public override Customer ToDomain(CustomerDto customerDto) { return(Customer.CustomerBuilder.Customer() .WithId(string.IsNullOrWhiteSpace(customerDto.Id) ? Guid.Empty : new Guid(customerDto.Id)) .WithLastname(customerDto.LastName) .WithFirstname(customerDto.FirstName) .WithAddress(_addressMapper.ToDomain(customerDto.Address)) .WithEmail(_emailMapper.ToDomain(customerDto.Email)) .WithPhoneNumber(_phoneNumberMapper.ToDomain(customerDto.PhoneNumber)) .Build()); }
public override Customer ToDomain(CustomerDto customerDto) { return(Customer.CustomerBuilder.Customer() .WithId(Guid.Empty) .WithLastname(customerDto.LastName) .WithFirstname(customerDto.FirstName) .WithAddress(_addressMapper.ToDomain(customerDto.Address)) .WithEmail(_emailMapper.ToDomain(customerDto.Email)) .WithPhoneNumber(_phoneNumberMapper.ToDomain(customerDto.PhoneNumber)) .Build()); }