public Email(MainEmail mainEmail, GuestNumber guestNumber, IEnumerable <Guest> guestList, AdditionalInfo additionalInfo, NeedHotel needHotel, NeedDrive needDrive) { MainEmail = mainEmail; GuestNumber = guestNumber; GuestList = guestList; AdditionalInfo = additionalInfo; NeedHotel = needHotel; NeedDrive = needDrive; Validate(); }
public static Email MapFromDto(EmailDTO dto) { var mainEmail = new MainEmail { Value = dto.MainEmail }; var guestNumber = new GuestNumber { Value = dto.GuestNumber }; var guestList = dto.GuestList.Select(GuestDTO.MapFromDto).ToList(); var additionalInfo = new AdditionalInfo { Value = dto.AdditionalInfo }; var needHotel = new NeedHotel { Value = dto.NeedHotel }; var needDrive = new NeedDrive { Value = dto.NeedDrive }; return(new Email(mainEmail, guestNumber, guestList, additionalInfo, needHotel, needDrive)); }