예제 #1
0
        public async Task Handle(EmployeeAssignedToLocationEvent message)
        {
            var location = await _locationRepository.GetByID(message.NewLocationID);

            location.Employees.Add(message.EmployeeID);
            await _locationRepository.Save(location);

            var employee = await _employeeRepository.GetByID(message.EmployeeID);

            employee.LocationID = message.NewLocationID;
            await _employeeRepository.Save(employee);
        }
예제 #2
0
        public void Handle(EmployeeAssignedToLocationEvent message)
        {
            var location = _locationRepo.GetByID(message.NewLocationID);

            location.Employees.Add(message.EmployeeID);
            _locationRepo.Save(location);

            //Find the employee which was assigned to this Location
            var employee = _employeeRepo.GetByID(message.EmployeeID);

            employee.LocationID = message.NewLocationID;
            _employeeRepo.Save(employee);
        }
예제 #3
0
        public Task Handle(EmployeeAssignedToLocationEvent message)
        {
            var location = _locationRepository.GetByID(message._locationId);

            location.Employees.Add(message._employeeId);
            _locationRepository.Save(location);

            //Find the employee which was assigned to this Location
            var employee = _employeeRepository.GetByID(message._employeeId);

            employee.LocationID = message._locationId;
            _employeeRepository.Save(employee);
            return(Task.CompletedTask);
        }
예제 #4
0
파일: Location.cs 프로젝트: wladioh/cqrs-es
 private void Apply(EmployeeAssignedToLocationEvent e)
 {
     _employees.Add(e.EmployeeId);
 }