public static void Update(this TestRunSessionRequest request, TestRunSession session)
 {
     if (request.ProductLine.Id.HasValue)
     {
         session.ProductLineId = request.ProductLine.Id.Value;
     }
     session.AzureTestBuildId     = request.AzureTestBuildId;
     session.AzureTestBuildNumber = request.AzureTestBuildNumber;
     session.SuiteName            = request.SuiteName;
     session.StartTime            = request.StartTime;
     session.FinishTime           = request.FinishTime;
     session.State = request.State;
     session.ExtraData.UpdateFrom(request.ExtraData);
 }
 public static TestRunSessionRequest ToRequest(this TestRunSession session)
 {
     return(new TestRunSessionRequest()
     {
         ProductLine = session.ProductLine != null
             ? session.ProductLine.ToDto()
             : new Common.Models.ProductLine()
         {
             Id = session.ProductLineId
         },
         AzureTestBuildId = session.AzureTestBuildId,
         AzureTestBuildNumber = session.AzureTestBuildNumber,
         SuiteName = session.SuiteName,
         StartTime = session.StartTime,
         FinishTime = session.FinishTime,
         State = session.State,
         ProductBuild = session.ProductBuildInfo?.ToDto(),
         TestRuns = session.TestRuns?.Select(ToRequest).ToList(),
         ExtraData = session.ExtraData.ToDto()
     });
 }
 public static TestRunSessionResponse ToResponse(this TestRunSession session)
 {
     return(new TestRunSessionResponse()
     {
         Id = session.Id,
         ProductLine = session.ProductLine != null
             ? session.ProductLine.ToDto()
             : new Common.Models.ProductLine()
         {
             Id = session.ProductLineId
         },
         ProductBuild = session.ProductBuildInfo?.ToDto(),
         AzureTestBuildId = session.AzureTestBuildId,
         AzureTestBuildNumber = session.AzureTestBuildNumber,
         SuiteName = session.SuiteName,
         StartTime = session.StartTime,
         FinishTime = session.FinishTime,
         State = session.State,
         ExtraData = session.ExtraData.ToDto()
     });
 }