public OrderService(IDemoExchangeDbContextFactory <OrderContext> orderContextFactory, ISubscriber subscriber, IAccountServiceRpcClient accountService) { this.orderContextFactory = orderContextFactory; this.subscriber = subscriber; this.accountService = accountService; }
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(); }
public OrderServiceController(IDemoExchangeDbContextFactory <OrderContext> orderContextFactory, IOrderService service) { this.orderContextFactory = orderContextFactory; this.service = service; }
public AccountService(IDemoExchangeDbContextFactory <AccountContext> accountContextFactory) { this.accountContextFactory = accountContextFactory; }