Exemple #1
0
        public override object Clone()
        {
            var result = new CasePlanInstanceAggregate
            {
                CasePlanId       = CasePlanId,
                AggregateId      = AggregateId,
                CreateDateTime   = CreateDateTime,
                Version          = Version,
                Name             = Name,
                State            = State,
                UpdateDateTime   = UpdateDateTime,
                CaseOwner        = CaseOwner,
                Files            = new ConcurrentBag <CasePlanInstanceFileItem>(Files.Select(_ => (CasePlanInstanceFileItem)_.Clone()).ToList()),
                Roles            = Roles.Select(_ => (CasePlanInstanceRole)_.Clone()).ToList(),
                WorkerTasks      = new ConcurrentBag <CasePlanInstanceWorkerTask>(WorkerTasks.Select(_ => (CasePlanInstanceWorkerTask)_.Clone()).ToArray()),
                ExecutionContext = (CasePlanInstanceExecutionContext)ExecutionContext.Clone(),
                Children         = new ConcurrentBag <BaseCaseEltInstance>(Children.Select(_ => (BaseCaseEltInstance)_.Clone()))
            };

            result.ExecutionContext.CasePlanInstance = result;
            return(result);
        }
Exemple #2
0
        public override object Clone()
        {
            var result = new CasePlanInstanceAggregate
            {
                CasePlanId                = CasePlanId,
                CaseFileId                = CaseFileId,
                AggregateId               = AggregateId,
                CreateDateTime            = CreateDateTime,
                Version                   = Version,
                Name                      = Name,
                State                     = State,
                UpdateDateTime            = UpdateDateTime,
                NameIdentifier            = NameIdentifier,
                Files                     = Files.Select(_ => (CasePlanInstanceFileItem)_.Clone()).ToList(),
                Roles                     = Roles.Select(_ => (CasePlanInstanceRole)_.Clone()).ToList(),
                WorkerTasks               = WorkerTasks.Select(_ => (CasePlanInstanceWorkerTask)_.Clone()).ToList(),
                ExecutionContextVariables = ExecutionContextVariables.ToDictionary(c => c.Key, c => c.Value),
                Children                  = Children.Select(_ => (CaseEltInstance)_.Clone()).ToList()
            };

            return(result);
        }