Example #1
0
        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);
        }
Example #2
0
        public async Task <IEnumerable <ProjectCard> > GetProjectsByCategoryAsync(int categoryId)
        {
            Entities.ProjectCategory category = await FindCategoryAsync(x => x.Id == categoryId);

            return(ConvertToProjectCards(category.Projects));
        }