public static GroupResourceAggregateRoot Register(IWorkContext context, CreateGroupResourceCommand command, DepartmentAggregateRoot department)
 {
     return(new GroupResourceAggregateRoot(command.AggregateId).Create(context, command, department));
 }
        public GroupResourceAggregateRoot Create(IWorkContext context, CreateGroupResourceCommand command, DepartmentAggregateRoot department)
        {
            this.ApplyEvent(new CreateGroupResouceEvnet
            {
                AggregateId = this.AggregateId,
                CreateDate  = context.WorkTime,
                Creator     = context.GetWorkerName(),
                Version     = this.Version,

                GroupId      = command.GroupId,
                ResourceId   = command.ResourceId,
                DepartmentId = department.AggregateId,
            });

            return(this);
        }
        public GroupAggregateRoot Create(IWorkContext context, CreateGroupCommand command, DepartmentAggregateRoot department)
        {
            this.ApplyEvent(new CreateGroupEvnet
            {
                AggregateId = this.AggregateId,
                CreateDate  = context.WorkTime,
                Creator     = context.GetWorkerName(),
                Version     = this.Version,

                DepartmentId = department.AggregateId,
                Name         = command.Name,
                Descn        = command.Descn,
            });

            return(this);
        }