public static void Main(string[] args) { using (STOContext db = new STOContext()) { DbInitializer.Initialize(db); } CreateWebHostBuilder(args).Build().Run(); }
public static HomeViewModel GetHomeViewModel() { HomeViewModel homeViewModel = null; Thread.Sleep(2000); using (STOContext _context = new STOContext()) { List <Worker> workers = _context.Workers.OrderByDescending(p => p.WorkerID).Take(5).ToList(); List <Car> cars = _context.Cars.OrderByDescending(p => p.CarID).Take(5).ToList(); List <Order> orders = _context.Orders.OrderByDescending(p => p.OrderID).Take(5).ToList(); List <Owner> owners = _context.Owners.OrderByDescending(p => p.OwnerID).Take(5).ToList(); homeViewModel = new HomeViewModel { Owners = owners, Orders = orders, Cars = cars, Workers = workers }; } return(homeViewModel); }
public CarsController(STOContext context) { _context = context; }
public CreateCache(STOContext context, IMemoryCache memoryCache) { cache = memoryCache; }
public AuthRepository(STOContext context) { this.context = context; }
public CarController(STOContext CarContext) { db = CarContext; }
public RepresentativeRepository(STOContext context) { this.context = context; }
public AdminRepository(STOContext context) { this.context = context; }
public OrganizerRepository(STOContext context) { this.context = context; }
public OrdersController(STOContext context) { _context = context; }
public OwnerController(STOContext OwnerContext) { db = OwnerContext; }
public OrderController(STOContext OrderContext) { db = OrderContext; }
public WorkerController(STOContext WorkerContext) { db = WorkerContext; }
public WorkersController(STOContext context) { _context = context; }