public static TripDto AsDto(this TripDocument document) => new TripDto { Id = document.Id, Destination = document.Destination, Date = document.TimeStamp.AsDateTime(), DifficultyLevel = document.DifficultyLevel };
public static TripDto AsDto(this TripDocument document) => new TripDto { Id = document.Id, Destination = document.Destination, Date = document.TimeStamp.AsDateTime(), DifficultyLevel = document.DifficultyLevel, Participants = document.Participants?.Select(p => new ParticipantDto { UserId = p.UserId }) };
public static Core.Entities.Trip AsEntity(this TripDocument document) => new Core.Entities.Trip(document.Id, document.Destination, document.TimeStamp.AsDateTime(), document.DifficultyLevel, document.Participants?.Select(p => new Participant(p.UserId)), document.Version);
public static Core.Entities.Trip AsEntity(this TripDocument document) => new Core.Entities.Trip(document.Id, document.Destination, document.TimeStamp.AsDateTime(), document.DifficultyLevel, document.Version);