internal static WorkflowInstanceVm FromModel(WorkflowInstance workflowInstance)
 {
     WorkflowInstanceVm vm = new WorkflowInstanceVm();
     List<WorkflowInstanceStepVm> steps = new List<WorkflowInstanceStepVm>();
     vm.Id = workflowInstance.Id;
     vm.OrganizationId = workflowInstance.OrganizationId;
     vm.WorkflowId = workflowInstance.WorkflowId;
     foreach (var step in workflowInstance.WorkflowInstanceSteps)
     {
         steps.Add(WorkflowInstanceStepVm.FromModel(step));
     }
     vm.WorkflowInstanceSteps = steps;
     vm.IsComplete = workflowInstance.IsComplete;
     return vm;
 }
 public WorkflowInstance ToModel()
 {
     List<WorkflowInstanceStep> steps = new List<WorkflowInstanceStep>();
     var wfi = new WorkflowInstance();
     wfi.Id = this.Id;
     wfi.OrganizationId = this.OrganizationId;
     foreach (var step in this.WorkflowInstanceSteps)
     {
         steps.Add(step.ToModel());
     }
     wfi.WorkflowInstanceSteps = steps;
     wfi.WorkflowId = this.WorkflowId;
     wfi.IsComplete = this.IsComplete;
     return wfi;
 }