public async Task HandleAsync(OutcomeDeleted payload) { using (ReadModelContext db = readModelContextFactory.Create()) { OutcomeEntity entity = await db.Outcomes.FindAsync(payload.AggregateKey.AsGuidKey().Guid); if (entity != null) { db.Outcomes.Remove(entity); await db.SaveChangesAsync(); } } }
Task IEventHandler <OutcomeDeleted> .HandleAsync(OutcomeDeleted payload) { OnOutcomeDeletedEvent(); return(Task.CompletedTask); }
Task IEventHandler <OutcomeDeleted> .HandleAsync(OutcomeDeleted payload) => UpdateModel(payload, model => Models.Remove(model));
Task IEventHandler <OutcomeDeleted> .HandleAsync(OutcomeDeleted payload) => RaiseEvent(payload);
Task IEventHandler <OutcomeDeleted> .HandleAsync(OutcomeDeleted payload) { return(UpdateState(() => IsDeleted = true)); }
Task IEventHandler <OutcomeDeleted> .HandleAsync(OutcomeDeleted payload) { _ = LoadPageAsync(); return(Task.CompletedTask); }