internal static void Initialize(HandlePriceDetailsDbContext context)
        {
            // Check if our database is created if not then create it
            context.Database.EnsureCreated();

            if (!context.Products.Any())
            {
                context.Products.AddRange(ConvertService.CsvToProductList("price_detail.csv"));

                context.SaveChanges();
            }
        }
Exemple #2
0
 public ProductRepo(HandlePriceDetailsDbContext handlePriceDetailsDbContext)
 {
     _handlePriceDetailsDbContext = handlePriceDetailsDbContext;
 }