public async Task <EpsViewModel> Detalle(Guid id) { var result = new EpsViewModel(); try { var _item = await _context.Eps .FirstOrDefaultAsync(x => x.Id == id); result.Item = EpsDto.ProyectarDto(_item); result.HabilitarEditar = true; result.HabilitarBorrar = true; } catch (Exception e) { } return(result); }
public async Task <EpsListViewModel> ListarTodos() { var result = new EpsListViewModel(); try { var _items = await _context.Eps .OrderBy(x => x.RegistradoAt) .ToListAsync(); var viewModelDto = _items .Select(EpsDto.ProyectarDto()) .ToList(); result.Items = viewModelDto; result.HabilitarCrear = true; } catch (Exception e) { } return(result); }