Пример #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();
        }
Пример #2
0
 public FridgeRepository(FreezrContext freezrContext)
 {
     this.freezrContext = freezrContext;
 }