Ejemplo n.º 1
0
 public OrderService(CoinContext context, IMemoryCache cache,
                     ICoinContextService coinContextService)
 {
     _coinContext        = context;
     _cache              = cache;
     _coinContextService = coinContextService;
 }
Ejemplo n.º 2
0
        protected CoinContext GetContext()
        {
            var context = new CoinContext(GetOptions());

            context.Database.EnsureCreated();
            return(context);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var DbContextOptions = new CoinContext(GetOptions("Server=.\\SQLEXPRESS;Database=Crypto2;Trusted_Connection=True;"));

            using (var cc = DbContextOptions)
            {
                TestCreate(cc, "Bitcoin", "BTC", "Bitcoin", 6350, "CoinBase");
            }
        }
Ejemplo n.º 4
0
        public static void TestCreate(CoinContext cc, string CoinName, string CoinTicker, string CoinDescription, float CoinPrice,
                                      string ExchangeName)
        {
            var coin = new Coin()
            {
                CoinName = "Ethereum", CoinTicker = "ETH", CoinDescription = "Ethereum", CoinPrice = 202
            };
            var exchange = new Exchange()
            {
                ExchangeName = "MtGox"
            };
            var coinExchange = new CoinExchange()
            {
                Coin = coin, Exchange = exchange
            };

            cc.Coins.Add(coin);
            cc.Exchanges.Add(exchange);
            cc.CoinExchanges.Add(coinExchange);
            cc.SaveChanges();
        }
Ejemplo n.º 5
0
 public HomeController(CoinContext context)
 {
     _context = context;
 }
 public OrdersController(CoinContext coinContext)
 {
     _coinContext = coinContext;
 }
Ejemplo n.º 7
0
 public ExchangeSetting(CoinContext coinContext)
 {
     _coinContext = coinContext;
 }
Ejemplo n.º 8
0
 public ArbitrageService(ICoinContextService coinContextService, CoinContext coinContext)
 {
     _coinContextService = coinContextService;
     _coinContext        = coinContext;
 }
 public LogsController(CoinContext coinContext)
 {
     _coinContext = coinContext;
 }