예제 #1
0
 public async Task CreateCategory(string name, Guid userId)
 {
     using (IDAL.IBlogCategory categorySvc = new DAL.BlogCategoryService())
     {
         await categorySvc.CreateAsync(new Models.BlogCategory()
         {
             CategoryName = name,
             UserId       = userId
         });
     }
 }
예제 #2
0
 public async Task <List <BlogCategoryDto> > GetAllCategories(Guid userId)
 {
     using (IDAL.IBlogCategory categorySvc = new DAL.BlogCategoryService())
     {
         return(await categorySvc.GetAllAsync().Where(m => m.UserId == userId).Select(m => new BlogCategoryDto()
         {
             Id = m.Id,
             CategoryName = m.CategoryName
         }).ToListAsync());
     }
 }