Exemple #1
0
        private static void OnFridgeAdded(object sender, NATS.Client.MsgHandlerEventArgs evt)
        {
            var eventMessage = MessageHelper.FromData <FridgeAddedEvent>(evt.Message.Data);
            var fridge       = eventMessage.Fridge;

            using (var context = new FreezrContext(dbOptions.Options))
            {
                context.Fridges.Add(fridge);
                context.SaveChanges();
            }

            EventCounter.Inc();
        }
 private void OnConfigUpdated(object sender, NATS.Client.MsgHandlerEventArgs args)
 {
     _runtimeConfigHolder.Reload().Wait();
 }