protected void OnDinnerLocationSet(DinnerLocationSetEvent domainEvent) { location = new Location { Address = domainEvent.Address, Country = domainEvent.Country, Latitude = domainEvent.Latitude, Longitude = domainEvent.Longitude }; }
public void Handle(DinnerLocationSetEvent domainEvent) { var dinnerReadModel = GetDinnerReadModel(domainEvent); if (dinnerReadModel == null) { return; } dinnerReadModel.Address = domainEvent.Address; dinnerReadModel.Country = domainEvent.Country; dinnerReadModel.Latitude = domainEvent.Latitude; dinnerReadModel.Longitude = domainEvent.Longitude; db.SaveChanges(); }