Ejemplo n.º 1
0
 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));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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));
            }
        }
Ejemplo n.º 5
0
 public Task <PagedResultDto <EmployeeDto> > GetAll(GetEmployeeInputDto input)
 {
     return(_employeeAppService.GetAll(input));
 }
Ejemplo n.º 6
0
        public async Task <IActionResult> Get()
        {
            var result = _employeeAppService.GetAll();

            return(await Response(result));
        }
 public Task <ObjectResult> GetAll()
 {
     return(_employeeAppService.GetAll().TaskResult());
 }
Ejemplo n.º 8
0
        public async Task <IActionResult> GetAll()
        {
            var data = await _employeeAppService.GetAll();

            return(Ok(data));
        }
Ejemplo n.º 9
0
        // GET: Cliente
        public ActionResult Index()
        {
            var EmployeeViewModel = Mapper.Map <IEnumerable <Employee>, IEnumerable <EmployeeViewModel> >(_employeeApp.GetAll());

            return(View(EmployeeViewModel));
        }
Ejemplo n.º 10
0
 public IActionResult Get()
 {
     return(Response(_employeeAppService.GetAll()));
 }