public Repository(TradingEngineContext context) { if (context == null) { throw new ArgumentNullException("Null DbContext"); } _context = context; _dbSet = context.Set <T>(); }
public static async Task DispatchDomainEventsAsync(this IMediator mediator, TradingEngineContext tradingEngineContext) { IEnumerable <EntityEntry <Entity> > domainEntities = tradingEngineContext.ChangeTracker .Entries <Entity>() .Where(x => x.Entity.DomainEvents != null && x.Entity.DomainEvents.Any()).ToList(); List <INotification> domainEvents = domainEntities .SelectMany(x => x.Entity.DomainEvents) .ToList(); domainEntities.ToList() .ForEach(entity => entity.Entity.ClearDomainEvents()); foreach (INotification domainEvent in domainEvents) { await mediator.Publish(domainEvent); } }
public CurrencyRepository(TradingEngineContext context) { _context = context; }
public TradingEngineRepository(TradingEngineContext tradingEngineContext) { TradingEngineContext = tradingEngineContext; DbSet = tradingEngineContext.Set <TEntity>(); DbQuery = tradingEngineContext.Query <TEntity>(); }
public AccountRepository(TradingEngineContext tradingEngineEngineContext) : base(tradingEngineEngineContext) { }
public UserRepository(TradingEngineContext context) { _context = context; }
public UserRepository(TradingEngineContext context) : base(context) { }
protected void CreateDbContext() { _context = new TradingEngineContext(); //context.Configuration.ValidateOnSaveEnabled = false; }
public CurrencyRepository(TradingEngineContext context) : base(context) { }
public AccountHistoryRepository(TradingEngineContext context) : base(context) { }
public WalletRepository(TradingEngineContext context) : base(context) { }