Ejemplo n.º 1
0
 public async Task <List <CategoryDto> > GetAllCategories(int top)
 {
     using (IDAL.ICategoryService categorySvc = new DAL.CategoryService())
     {
         return(await categorySvc.GetAll(m => true).Take(top).Select(m => new CategoryDto()
         {
             UserId = m.UserId,
             CategoryName = m.CategoryName,
             CategoryId = m.Id
         }).ToListAsync());
     }
 }
Ejemplo n.º 2
0
 public List <CategoryDto> GetAllCategoriesSync()
 {
     using (IDAL.ICategoryService categorySvc = new DAL.CategoryService())
     {
         return(categorySvc.GetAll(m => true).Select(m => new CategoryDto()
         {
             UserId = m.UserId,
             CategoryName = m.CategoryName,
             CategoryId = m.Id
         }).ToList());
     }
 }