コード例 #1
0
        private void Initialize(EmployeeInputDto employee, EntityDependency[] dependencies)
        {
            RegisterCommandRepositoryFactory <Employee>(() => new EmployeeCommandRepository());

            var managerDependency = (Manager)dependencies?.SingleOrDefault()?.Entity;

            RootEntity = new Employee
            {
                Id           = employee.EmployeeId,
                Name         = employee.Name,
                SupervisorId = (managerDependency != null) ? managerDependency.Id : employee.SupervisorId
            };

            Enqueue(new SaveEntityCommandOperation <Employee>(RootEntity, dependencies));
        }
コード例 #2
0
 public SaveEmployeeCommandAggregate(EmployeeInputDto employee, EntityDependency[] dependencies = null) : base(new DomainFramework.DataAccess.RepositoryContext(ManagerWithEmployeesConnectionClass.GetConnectionName()))
 {
     Initialize(employee, dependencies);
 }