static void Main(string[] args) { using var logStream = new StreamWriter("ef-log.txt"); var optionsBuilder = new DbContextOptionsBuilder <project0Context>(); optionsBuilder.UseSqlServer(GetConnectionString()); optionsBuilder.LogTo(logStream.WriteLine, LogLevel.Information); _dbContext = optionsBuilder.Options; StoreAppRepository storeAppRepository = new StoreAppRepository(_dbContext); CustomerConsole customer = new CustomerConsole(_dbContext); AdminConsole admin = new AdminConsole(_dbContext); Console.WriteLine("Welcome to Discount BestBuy"); Console.WriteLine("Where we sell the same stuff, at the same prices!!!"); Console.WriteLine(); Console.WriteLine("Enter 'A' for Admin or 'C' For Customer:"); string input = Console.ReadLine().ToLower(); while (input != "a" && input != "c") { Console.WriteLine("Enter 'A' for Admin or 'C' For Customer:"); input = Console.ReadLine().ToLower(); } if (input == "a") { admin.AdminUI(); } else { customer.CustomerUI(); } }
public ProductController(StoreAppRepository storeRepo) { _storeRepo = storeRepo; }
public InventoryController(StoreAppRepository storeRepo) { _storeRepo = storeRepo; }
public AdminConsole(DbContextOptions <project0Context> _dbContext) { storeRepo = new StoreAppRepository(_dbContext); }
public LocationController(StoreAppRepository storeRepo) { _storeRepo = storeRepo; }
public CustomerController(StoreAppRepository storeRepo, ILogger <CustomerController> logger) { _storeRepo = storeRepo; _logger = logger; }
public OrderController(StoreAppRepository storeRepo) { _storeRepo = storeRepo; }