public async Task <IActionResult> AddEmployee([FromBody] CreateEmployeeRequestDto dto) { // TODO: convert dtoModel to Employee model by using Mapping var employeeId = await employeeService.CreateAsync( new CreateEmployeeRequest { FirstName = dto.FirstName, LastName = dto.LastName, BirthDate = dto.BirthDate, Salary = dto.Salary, Address = new Address { City = dto.Address.City, CountryCode = dto.Address.CountryCode, }, }); return(Ok()); }
public IResult CreateEmployee(CreateEmployeeRequestDto dto) { // Business Logic here EmployeeCreateDomainState request = ...Mapped from dto var rowsAffected = _repo.Execute(item);