private static BookingDayDataModel From(BookingDay entity) { var dataModelId = entity.Id.Value; var dataModel = new BookingDayDataModel { Id = dataModelId, Bookings = From(entity.Bookings) }; return(dataModel); }
private static BookingDay From(BookingDayDataModel dataModel) { if (dataModel == null) { return(null); } var entityId = BookingDayId.With(dataModel.Id); var entity = new BookingDay(entityId, From(dataModel.Bookings)); return(entity); }