Exemplo n.º 1
0
 public StockDomainModel(Stock stock, int sharesOwned)
 {
     Ticker = stock.Symbol;
     Name = stock.Name;
     Exchange = stock.Exchange;
     SharesOwned = sharesOwned;
     UpdateStockInformation();
 }
Exemplo n.º 2
0
 private static void CheckIfTickerExists(Stock stock, ApplicationDbContext context)
 {
     try
         {
             YahooAPICalls.GetCurrentStockPrice(stock.Symbol);
         }
         catch (Exception ex)
         {
             context.Remove(stock);
         }
 }
Exemplo n.º 3
0
 public static List<Stock> SeedStockData(List<SeedStock> seedStocks)
 {
     Stock[] dataStocks = new Stock[seedStocks.Count()];
     Parallel.For(0, seedStocks.Count(), i =>
     {
         dataStocks[i] = (new Stock {
             Symbol = seedStocks[i].Symbol,
             Name = seedStocks[i].Name,
             Exchange = seedStocks[i].Exchange
         });
     });
     return dataStocks.ToList();
 }