protected async Task On(RuleDeleted @event, EnvelopeHeaders headers) { await EnsureRulesLoadedAsync(); inMemoryRules.GetOrAddNew(@event.AppId.Id).RemoveAll(x => x.Id == @event.RuleId); await Collection.DeleteManyAsync(x => x.Id == @event.RuleId); }
public void Handle(RuleDeleted @event) { using (var context = _contextFactory.Invoke()) { var rule = context.Find <RuleDetail>(@event.RuleId); if (rule != null) { context.Set <RuleDetail>().Remove(rule); context.SaveChanges(); } } }
protected void On(RuleDeleted @event) { IsDeleted = true; }
public void On(RuleDeleted @event, EnvelopeHeaders headers) { Rules.Remove(@event.RuleId); }