public void Setup()
        {
            FakeEmployeesRepository fakeEmployeesRepository = new FakeEmployeesRepository();

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