예제 #1
0
 public OrderService(IDemoExchangeDbContextFactory <OrderContext> orderContextFactory,
                     ISubscriber subscriber, IAccountServiceRpcClient accountService)
 {
     this.orderContextFactory = orderContextFactory;
     this.subscriber          = subscriber;
     this.accountService      = accountService;
 }
예제 #2
0
        public void TestPerfAddOrder(List <IOrderModel> buyOrders, List <IOrderModel> sellOrders,
                                     IDemoExchangeDbContextFactory <OrderContext> orderContextFactory)
        {
            int i = 0;

            using OrderContext buy = orderContextFactory.Create();
            foreach (IOrderModel request in buyOrders)
            {
                OrderBL order = new OrderBL(request.AccountId, request.Action, request.Ticker, request.Type, request.Quantity, request.OrderPrice, request.TimeInForce);
                buy.Orders.Add((OrderEntity)order);
                BuyBook.TestPerfAddOrderNoSort(order);
                if ((i % 1000) == 0)
                {
                    buy.SaveChanges();
                }
            }
            buy.SaveChanges();
            BuyBook.TestPerfSort();

            i = 0;
            using OrderContext sell = orderContextFactory.Create();
            foreach (IOrderModel request in sellOrders)
            {
                OrderBL order = new OrderBL(request.AccountId, request.Action, request.Ticker, request.Type, request.Quantity, request.OrderPrice, request.TimeInForce);
                sell.Orders.Add((OrderEntity)order);
                SellBook.TestPerfAddOrderNoSort(order);
                if ((i % 1000) == 0)
                {
                    sell.SaveChanges();
                }
            }
            sell.SaveChanges();
            SellBook.TestPerfSort();
        }
예제 #3
0
 public OrderServiceController(IDemoExchangeDbContextFactory <OrderContext> orderContextFactory,
                               IOrderService service)
 {
     this.orderContextFactory = orderContextFactory;
     this.service             = service;
 }
예제 #4
0
 public AccountService(IDemoExchangeDbContextFactory <AccountContext> accountContextFactory)
 {
     this.accountContextFactory = accountContextFactory;
 }