public void Setup() { FakeEmployeesRepository fakeEmployeesRepository = new FakeEmployeesRepository(); _createService = new CreateEmployeeService(fakeEmployeesRepository); _showService = new ShowEmployeeService(fakeEmployeesRepository); }
public async Task <ActionResult <Employee> > Create( [FromServices] CreateEmployeeService service, [FromBody] Employee model) { if (ModelState.IsValid) { return(await service.execute(model)); } else { return(BadRequest(ModelState)); } }