Esempio n. 1
0
 public async Task <CateoryDTO> GetOneAsync(int id)
 {
     using (ICateoryService rdevSvc = new CateoryService())
     {
         return(await Task.Run(() =>
         {
             return ObjectExtend.Mapper <CateoryDTO, CateoryEntity>(rdevSvc.GetOneAsync(id).Result);
         }));
     }
 }
Esempio n. 2
0
 public async Task <int> RealDeleteAsync(int id)
 {
     using (ICateoryService rdevSvc = new CateoryService())
     {
         return(await Task.Run(() =>
         {
             return rdevSvc.RealDeleteAsync(id);
         }));
     }
 }
Esempio n. 3
0
 public async Task <List <CateoryDTO> > GetAllAsync()
 {
     using (ICateoryService rdevSvc = new CateoryService())
     {
         return(await Task.Run(() =>
         {
             return rdevSvc.GetAll().ToList().ConvertAll(x => ObjectExtend.Mapper <CateoryDTO, CateoryEntity>(x));
         }));
     }
 }
Esempio n. 4
0
 public async Task <int> AddAsync(CateoryDTO dto)
 {
     using (ICateoryService rdevSvc = new CateoryService())
     {
         var model = ObjectExtend.Mapper <CateoryEntity, CateoryDTO>(dto);
         return(await Task.Run(() =>
         {
             return rdevSvc.AddAsync(model);
         }));
     }
 }