public virtual async Task Run(CashbackDbContext dbContext, EventType type, ICommand command, CommandResult result) { if (Method != null) { await Method(dbContext, type, command, result); } }
public Empty_DbContextFixture() { var builder1 = new DbContextOptionsBuilder <CashbackDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .EnableSensitiveDataLogging() .ConfigureWarnings(warnings => warnings .Throw(CoreEventId.IncludeIgnoredWarning) .Throw(RelationalEventId.QueryClientEvaluationWarning)); DbContext = new CashbackDbContext(builder1.Options); CommandsHandler = new CashbackCommandsHandler(DbContext); CashbackStartup.Configure(null); }
public async Task HandleEvent(CashbackDbContext context, Util.ICommand command, CommandResult result) { var ev = command.GetEvent(); if (ev == EventType.None) { return; } var lstListeners = GetListeners(ev); foreach (var listener in lstListeners) { await listener.Run(context, ev, command, result); } }
public CashbackQueriesHandler(CashbackDbContext dbContext) { DbContext = dbContext; }