示例#1
0
 public static TripDto AsDto(this TripDocument document)
 => new TripDto
 {
     Id              = document.Id,
     Destination     = document.Destination,
     Date            = document.TimeStamp.AsDateTime(),
     DifficultyLevel = document.DifficultyLevel
 };
示例#2
0
 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
     })
 };
示例#3
0
 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);
示例#4
0
 public static Core.Entities.Trip AsEntity(this TripDocument document)
 => new Core.Entities.Trip(document.Id, document.Destination, document.TimeStamp.AsDateTime(),
                           document.DifficultyLevel, document.Version);