Exemple #1
0
 public Repository(TradingEngineContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("Null DbContext");
     }
     _context = context;
     _dbSet   = context.Set <T>();
 }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
 public CurrencyRepository(TradingEngineContext context)
 {
     _context = context;
 }
Exemple #4
0
 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;
 }
Exemple #7
0
 public UserRepository(TradingEngineContext context) : base(context)
 {
 }
Exemple #8
0
 protected void CreateDbContext()
 {
     _context = new TradingEngineContext();
     //context.Configuration.ValidateOnSaveEnabled = false;
 }
Exemple #9
0
 public CurrencyRepository(TradingEngineContext context) : base(context)
 {
 }
Exemple #10
0
 public AccountHistoryRepository(TradingEngineContext context) : base(context)
 {
 }
Exemple #11
0
 public WalletRepository(TradingEngineContext context) : base(context)
 {
 }