Exemple #1
0
 protected void OnDinnerLocationSet(DinnerLocationSetEvent domainEvent)
 {
     location = new Location
     {
         Address   = domainEvent.Address,
         Country   = domainEvent.Country,
         Latitude  = domainEvent.Latitude,
         Longitude = domainEvent.Longitude
     };
 }
Exemple #2
0
        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();
        }