Esempio n. 1
0
 public async Task <List <NewsCategoryDto> > GetAllNewsCategory()
 {
     using (IDAL.INewsCategoryService Svc = new DAL.NewsCategoryService())
     {
         return(await Svc.GetAllAsync().Select(m => new Dto.NewsCategoryDto()
         {
             CategoryId = m.CategoryId,
             CategoryName = m.CategoryName
         }).ToListAsync());
     }
 }
Esempio n. 2
0
 public async Task AddNewsCategory(string CategoryId, string newsCategoryName)
 {
     using (IDAL.INewsCategoryService Svc = new DAL.NewsCategoryService())
     {
         await Svc.CreateAsync(new NewsCategory()
         {
             ModifyTime   = DateTime.Now,
             CategoryId   = CategoryId,
             CategoryName = newsCategoryName
         });
     }
 }