public void Handle(CompanyUpdated @event) { using (var context = new ProjectionContext(ConnectionString.Get())) { var entity = context.Companies.Find(@event.AggregateId); if (entity == null) { throw new EntityNotFoundException(@event.AggregateId, "Societe"); } entity.Name = @event.Name; entity.Address = @event.Address; entity.ZipCode = @event.ZipCode; entity.City = @event.City; context.SaveChanges(); } }
public void When(CompanyUpdated companyUpdated) { }