private DeployStateSummary PopulateDeployStateSummary(SqlDeployState item, bool loadChildren)
 {
     var returnValue = new DeployStateSummary();
     PopulateDeployState(item, loadChildren, returnValue);
     return returnValue;
 }
 private void PopulateDeployState(SqlDeployState source, bool loadChildren, DeployStateSummary target)
 {
     target.Id = source.ID;
     target.DeployBatchRequestItemId = source.DeployBatchRequestItemID;
     target.DeploymentStartedDateTimeUtc = source.DeploymentStartedDateTimeUtc;
     target.Status = (EnumDeployStatus)source.EnumDeployStatusID;
     target.ErrorDetails = source.ErrorDetails;
     target.ProjectId = source.ProjectID;
     target.DeploymentCompleteDateTimeUtc = source.DeploymentCompleteDateTimeUtc;
     target.SubmittedDateTimeUtc = source.SubmittedDateTimeUtc;
     target.CreatedByUserName = source.CreatedByUserName;
     target.CreatedDateTimeUtc = source.CreatedDateTimeUtc;
     target.UpdatedByUserName = source.UpdatedByUserName;
     target.UpdatedDateTimeUtc = source.UpdatedDateTimeUtc;
     if(!string.IsNullOrEmpty(source.BranchJson))
     {
         target.Branch = JsonConvert.DeserializeObject<DeployProjectBranch>(source.BranchJson);
     }
     if(!string.IsNullOrEmpty(source.BuildJson))
     {
         target.Build = JsonConvert.DeserializeObject<DeployBuild>(source.BuildJson);
     }
     if(!string.IsNullOrEmpty(source.ComponentJson))
     {
         target.Component = JsonConvert.DeserializeObject<DeployComponent>(source.ComponentJson);
     }
     if(!string.IsNullOrEmpty(source.EnvironmentJson))
     {
         target.Environment = JsonConvert.DeserializeObject<DeployEnvironment>(source.EnvironmentJson);
     }
     if(!string.IsNullOrEmpty(source.MessageListJson) && target is DeployState)
     {
         var deployState = (DeployState)target;
         deployState.MessageList = JsonConvert.DeserializeObject<List<DeployStateMessage>>(source.MessageListJson);
     }
     if(loadChildren)
     {
         PopulateDeployStateChildren(target);
     }
 }
 private void PopulateDeployStateChildren(DeployStateSummary deployState)
 {
     deployState.MachineList = GetDeployStateMachineList(deployState.Id);
 }