public ActionResult Get( [FromQuery] FilterViewModel filter = null, [FromQuery] OrderByViewModel order = null, [FromQuery] PaginationViewModel pagination = null) { return(Ok(_employeeAppService.GetAll(filter, order, pagination))); }
public async Task <ActionResult> Index() { var employees = await _employeeAppService.GetAll(); var model = new IndexViewModel(employees.Items); return(View(model)); }
public void EmployeeAppService_GetAll() { var employees = new List <Employee> { GenerateEmployeeOk() }; _employeeRepository.Setup(e => e.GetAll()).Returns(employees); _employeeAppService = new EmployeeAppService(_employeeRepository.Object); var result = _employeeAppService.GetAll(); Assert.NotNull(result); Assert.NotNull(result.Return); Assert.False(result.MessageErrors.Any()); Assert.False(result.ValidationErrors.Any()); Assert.Equal(employees, (List <Employee>)result.Return); }
public IHttpActionResult GetAll() { try { var employeeDtos = _employeeAppService.GetAll(); var employeeModels = new List <EmployeeModel>(); foreach (var employeeDto in employeeDtos) { employeeModels.Add(Mapper.Map <EmployeeModel>(employeeDto)); } return(Ok(employeeModels)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public Task <PagedResultDto <EmployeeDto> > GetAll(GetEmployeeInputDto input) { return(_employeeAppService.GetAll(input)); }
public async Task <IActionResult> Get() { var result = _employeeAppService.GetAll(); return(await Response(result)); }
public Task <ObjectResult> GetAll() { return(_employeeAppService.GetAll().TaskResult()); }
public async Task <IActionResult> GetAll() { var data = await _employeeAppService.GetAll(); return(Ok(data)); }
// GET: Cliente public ActionResult Index() { var EmployeeViewModel = Mapper.Map <IEnumerable <Employee>, IEnumerable <EmployeeViewModel> >(_employeeApp.GetAll()); return(View(EmployeeViewModel)); }
public IActionResult Get() { return(Response(_employeeAppService.GetAll())); }