public async Task <IActionResult> AddPrichod(string prichod, Guid uzivatelId) { Random rnd = new Random(); var model = new CommandDochazkaCreate() { CteckaId = "", Datum = DateTimeOffset.Now, Prichod = Convert.ToBoolean(prichod), UzivatelId = uzivatelId, }; await client.AddAsync(model); return(RedirectToAction("Index")); }
public async Task Add(CommandDochazkaCreate cmd) { var ev = new EventDochazkaCreated() { EventId = Guid.NewGuid(), Generation = 0, DochazkaId = Guid.NewGuid(), CteckaId = cmd.CteckaId, Datum = cmd.Datum, EventCreated = DateTime.Now, Prichod = cmd.Prichod, UzivatelId = cmd.UzivatelId }; var item = Create(ev); db.Dochazka.Add(item); await db.SaveChangesAsync(); await _handler.PublishEvent(ev, MessageType.DochazkaCreated, ev.EventId, null, ev.Generation, item.DochazkaId); }
public async Task Add(CommandDochazkaCreate cmd) { await _repository.Add(cmd); }