public async Task <int> CreateCategoryAsync(string name, int profileId) { Validate.NotNull(name, "Category name"); Validate.NotNull(profileId, "Profile id"); var category = new Entities.ProjectCategory { Name = name, UserId = profileId }; await uow.ProjectCategoryRepository.CreateAsync(category); return(category.Id); }
public async Task <IEnumerable <ProjectCard> > GetProjectsByCategoryAsync(int categoryId) { Entities.ProjectCategory category = await FindCategoryAsync(x => x.Id == categoryId); return(ConvertToProjectCards(category.Projects)); }