public void Run() { Result <EmployeeInfo> result = GetNewEmployeeInfo.Get(); if (result.ServiceResult == ServiceResult.Ok) { EmployeeInfo info = result.Data; Employee employee = new Employee(info.FirstName, info.LastName, info.Email); Employee manager = GetEmployeeManager.GetManagerFor(employee); manager.Employees.Add(employee); } }
public void Execute(AddNewEmployeeData commandData) { Result <EmployeeInfo> result = GetNewEmployeeInfo.Get(); if (result.ServiceResult == ServiceResult.Ok) { EmployeeInfo info = result.Data; Employee employee = new Employee(info.FirstName, info.LastName, info.Email); Employee manager = GetEmployeeManager.GetManagerFor(employee); manager.Employees.Add(employee); AppController.Raise(new EmployeeAddedEvent()); } }