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); })); } }
public async Task <int> RealDeleteAsync(int id) { using (ICateoryService rdevSvc = new CateoryService()) { return(await Task.Run(() => { return rdevSvc.RealDeleteAsync(id); })); } }
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)); })); } }
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); })); } }