Example #1
0
        public static CaseWorkerTaskAggregate New(CaseInstanceWorkerTaskAddedEvent evt)
        {
            var result = new CaseWorkerTaskAggregate
            {
                CasePlanInstanceId        = evt.AggregateId,
                CasePlanInstanceElementId = evt.CasePlanInstanceElementId,
                CreateDateTime            = DateTime.UtcNow,
                UpdateDateTime            = DateTime.UtcNow,
                Version     = 0,
                AggregateId = BuildCaseWorkerTaskIdentifier(evt.AggregateId, evt.CasePlanInstanceElementId)
            };

            return(result);
        }
        public static CaseWorkerTaskAggregate New(CaseInstanceWorkerTaskAddedEvent evt)
        {
            var result = new CaseWorkerTaskAggregate
            {
                CasePlanInstanceId        = evt.AggregateId,
                CasePlanInstanceElementId = evt.CasePlanInstanceElementId,
                CreateDateTime            = DateTime.UtcNow,
                UpdateDateTime            = DateTime.UtcNow,
                Roles = evt.CaseOwnerRole == null ? new List <CaseWorkerTaskRole>() : new List <CaseWorkerTaskRole>
                {
                    new CaseWorkerTaskRole
                    {
                        Claims = evt.CaseOwnerRole.Claims,
                        RoleId = evt.CaseOwnerRole.Id
                    }
                },
                Version     = 0,
                AggregateId = BuildCaseWorkerTaskIdentifier(evt.AggregateId, evt.CasePlanInstanceElementId)
            };

            return(result);
        }