Courses.Buisness.CategoryService.GetByID C# (CSharp) Method

GetByID() public method

Получение информации о категории по его идентификатору
public GetByID ( int id ) : CategoryViewModel
id int
return CategoryViewModel
        public CategoryViewModel GetByID(int id)
        {
            var category = categoryRepository.Get(id);
            return (category == null) ? null : Convert(category);
        }

Usage Example

Ejemplo n.º 1
0
 public void GetByIDTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModel _categoryViewModel = GetCategoryViewModel();
     _categoryService.Add(_categoryViewModel);
     Assert.IsNotNull(_categoryService.GetByID(1));
 }
All Usage Examples Of Courses.Buisness.CategoryService::GetByID