Example #1
0
 public OrderProcessor(IAskRepository askRepository, ICommodityRepository commodityRepository)
 {
     this.AskRepository       = askRepository;
     this.CommodityRepository = commodityRepository;
     OpenAsksByBuyerCommdoity = new ConcurrentDictionary <int, ConcurrentDictionary <int, ConcurrentDictionary <long, ThreadSafeAsk> > >();
     OpenAsks      = new ConcurrentDictionary <long, ThreadSafeAsk>();
     AsksToProcess = new ConcurrentDictionary <long, ThreadSafeAsk>();
 }
 public HomeController(IAskRepository askRepository = null, ICommodityRepository commodityRepository = null)
 {
     if (askRepository == null)
     {
         AskRepository = new AskRepository();
     }
     if (commodityRepository == null)
     {
         CommodityRepository = new CommodityRepository();
     }
 }
        //private Cart cart;

        //Constructor depedency injection
        public ClientController(IProductRepository repository,
                                ICartRepository cartRepository,
                                UserManager <ApplicationUser> userManager,
                                IWebApiFetch webApiFetch,
                                IWalletRepository walletRepository,
                                IAskRepository askRepository)
        {
            _repository       = repository;
            _cartRepository   = cartRepository;
            _userManager      = userManager;
            _webApiFetch      = webApiFetch;
            _walletRepository = walletRepository;
            _askRepository    = askRepository;
        }
 public void Update(Ask ask, IAskRepository repository)
 {
     lock (sync)
     {
         this.Ask.AllowPartialFill     = ask.AllowPartialFill;
         this.Ask.ApplyCommissionToBuy = ask.ApplyCommissionToBuy;
         this.Ask.BuyQuantity          = ask.BuyQuantity;
         this.Ask.SellQuantity         = ask.SellQuantity;
         this.Ask.BuyRatio             = ask.BuyRatio;
         this.Ask.SellRatio            = ask.SellRatio;
         this.Ask.ValidToDate          = ask.ValidToDate;
         this.Ask.MinBuyQuantity       = ask.MinBuyQuantity;
         this.Ask.MinSellQuantity      = ask.MinSellQuantity;
         repository.UpdateAsk(this.Ask);
     }
 }
Example #5
0
 //Depedency injection
 public MainHub(UserManager <ApplicationUser> userManager,
                ICartRepository cartRepository,
                IOrderRepository orderRepository,
                IProductRepository productRepository,
                IWalletRepository walletRepository,
                IAskRepository askRepository,
                IOfferRepository offerRepository,
                ISellRepository sellRepository
                )
 {
     _userManager       = userManager;
     _cartRepository    = cartRepository;
     _orderRepository   = orderRepository;
     _productRepository = productRepository;
     _walletRepository  = walletRepository;
     _askRepository     = askRepository;
     _offerRepository   = offerRepository;
     _sellRepository    = sellRepository;
 }