Ejemplo n.º 1
0
        private Temp Create(EventTempCreated evt)
        {
            var model = new Temp()
            {
                Generation = evt.Generation,
                EventGuid  = evt.EventId,
                TempId     = evt.TempId,
                TempValue1 = evt.TempValue1,
                TempValue2 = evt.TempValue2
            };

            return(model);
        }
Ejemplo n.º 2
0
        public async Task Add(CommandTempCreate cmd)
        {
            var ev = new EventTempCreated()
            {
                EventId    = Guid.NewGuid(),
                Generation = 0,
                TempId     = Guid.NewGuid(),
            };
            var item = Create(ev);

            db.Temps.Add(item);
            await db.SaveChangesAsync();

            await _handler.PublishEvent(ev, MessageType.UzivatelCreated, ev.EventId, null, ev.Generation, item.TempId);
        }