public static NotificationDefResult ToDto(NotificationDefinitionAggregate notif)
 {
     return(new NotificationDefResult
     {
         Name = notif.Name,
         OperationParameters = notif.OperationParameters.Select(_ => ParameterResult.ToDto(_)).ToList(),
         PeopleAssignments = notif.PeopleAssignments.Select(_ => PeopleAssignmentDefinitionResult.ToDto(_)).ToList(),
         PresentationElements = notif.PresentationElements.Select(_ => PresentationElementDefinitionResult.ToDto(_)).ToList(),
         PresentationParameters = notif.PresentationParameters.Select(_ => PresentationParameterResult.ToDto(_)).ToList(),
         Priority = notif.Priority,
         Rendering = notif.Rendering
     });
 }
 public static HumanTaskDefResult ToDto(HumanTaskDefinitionAggregate humanTaskDef)
 {
     return(new HumanTaskDefResult
     {
         ActualOwnerRequired = humanTaskDef.ActualOwnerRequired,
         Id = humanTaskDef.AggregateId,
         UpdateDateTime = humanTaskDef.UpdateDateTime,
         CreateDateTime = humanTaskDef.CreateDateTime,
         Name = humanTaskDef.Name,
         NbInstances = humanTaskDef.NbInstances,
         Priority = humanTaskDef.Priority,
         Version = humanTaskDef.Version,
         SearchBy = humanTaskDef.SearchBy,
         Outcome = humanTaskDef.Outcome,
         Rendering = string.IsNullOrWhiteSpace(humanTaskDef.Rendering) ? new JObject()
         {
             { "type", "container" },
             { "children", new JArray() }
         } : JObject.Parse(humanTaskDef.Rendering),
         OperationParameters = humanTaskDef.OperationParameters.Select(_ => ParameterResult.ToDto(_)).ToList(),
         PeopleAssignments = humanTaskDef.PeopleAssignments.Select(_ => PeopleAssignmentDefinitionResult.ToDto(_)).ToList(),
         PresentationElements = humanTaskDef.PresentationElements.Select(_ => PresentationElementDefinitionResult.ToDto(_)).ToList(),
         DeadLines = humanTaskDef.DeadLines.Select(_ => HumanTaskDefinitionDeadLineResult.ToDto(_)).ToList(),
         PresentationParameters = humanTaskDef.PresentationParameters.Select(_ => PresentationParameterResult.ToDto(_)).ToList()
     });
 }
 public static NotificationDefResult ToDto(NotificationDefinitionAggregate notificationDef)
 {
     return(new NotificationDefResult
     {
         CreateDateTime = notificationDef.CreateDateTime,
         Id = notificationDef.AggregateId,
         Name = notificationDef.Name,
         NbInstances = notificationDef.NbInstances,
         Priority = notificationDef.Priority,
         UpdateDateTime = notificationDef.UpdateDateTime,
         Version = notificationDef.Version,
         OperationParameters = notificationDef.OperationParameters.Select(_ => ParameterResult.ToDto(_)).ToList(),
         PeopleAssignments = notificationDef.PeopleAssignments.Select(_ => PeopleAssignmentDefinitionResult.ToDto(_)).ToList(),
         PresentationElements = notificationDef.PresentationElements.Select(_ => PresentationElementDefinitionResult.ToDto(_)).ToList(),
         PresentationParameters = notificationDef.PresentationParameters.Select(_ => PresentationParameterResult.ToDto(_)).ToList()
     });
 }