public IEnumerable <Employee> GetEmployees(Pagination pagination) { PracticeAPI.BLL.Models.Pagination pagination1 = _mapper.Map <BLL.Models.Pagination>(pagination); IEnumerable <PracticeAPI.BLL.Models.Employee> employees = _employeeRepository.GetEmployees(pagination1); IEnumerable <Employee> employees1 = _mapper.Map <IEnumerable <Employee> >(employees); return(employees1); }
public ActionResult ListEmployees() { List <EmployeeViewModel> employees = new List <EmployeeViewModel>(); foreach (var employee in _employeeLogic.GetEmployees()) { employees.Add(_mapper.Map <EmployeeViewModel>(employee)); } return(View(employees)); }
public IActionResult Get(string q) { if (q == null || q.Length < 2) { return(BadRequest("Querystring must be at least 2 characters long.")); } var employees = _employeeLogic.GetEmployees(q); return(Ok(new { query = q, matches = employees })); }
public void GetAllEmployees() { //Arrange MockService(); //Act var result = employeeLogic.GetEmployees(null); //Assert Assert.NotNull(result); Assert.True(result.Result.IsSuccess); Assert.Contains(result.Result.Message, "Success"); Assert.True(((List <Employee>)result.Result.Result).Count > 0); }
public IActionResult Get(int?identity = null) { Inicializer(); var employees = employeeLogic.GetEmployees(identity); if (employees.Result != null && employees.Result.IsSuccess.Equals(true)) { return(Ok(JsonConvert.SerializeObject(employees.Result.Result, Formatting.Indented))); } else { responseClient.BadRequest(errorMessage); return(BadRequest(JsonConvert.SerializeObject(responseClient, Formatting.Indented))); } }
public IActionResult GetEmployees() { var employees = _employeeLogic.GetEmployees(); return(Ok(employees)); }