public void Remove(CommandUdalostRemove cmd) { var client = new HttpClient(); client.BaseAddress = new Uri(_BaseUrl); client.PostAsJsonAsync("Remove", cmd); }
public async Task Remove(CommandUdalostRemove cmd) { var remove = db.Udalosti.Find(cmd.UdalostId); db.Udalosti.Remove(remove); var ev = new EventUdalostRemoved() { Generation = remove.Generation + 1, EventId = Guid.NewGuid(), UzivatelId = cmd.UdalostId, }; await _handler.PublishEvent(ev, MessageType.UdalostRemoved, ev.EventId, null, ev.Generation, ev.UdalostId); await db.SaveChangesAsync(); }
public async Task Remove(CommandUdalostRemove cmd) { await _repository.Remove(cmd); }