コード例 #1
0
ファイル: Program.cs プロジェクト: DmitriyLos/Lab4_IGI
 public static void Main(string[] args)
 {
     using (STOContext db = new STOContext())
     {
         DbInitializer.Initialize(db);
     }
     CreateWebHostBuilder(args).Build().Run();
 }
コード例 #2
0
ファイル: TakeLast.cs プロジェクト: DmitriyLos/Lab4_IGI
        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);
        }
コード例 #3
0
 public CarsController(STOContext context)
 {
     _context = context;
 }
コード例 #4
0
 public CreateCache(STOContext context, IMemoryCache memoryCache)
 {
     cache = memoryCache;
 }
コード例 #5
0
 public AuthRepository(STOContext context)
 {
     this.context = context;
 }
コード例 #6
0
 public CarController(STOContext CarContext)
 {
     db = CarContext;
 }
コード例 #7
0
 public RepresentativeRepository(STOContext context)
 {
     this.context = context;
 }
コード例 #8
0
ファイル: AdminRepository.cs プロジェクト: newaccnure/STOApi
 public AdminRepository(STOContext context)
 {
     this.context = context;
 }
コード例 #9
0
 public OrganizerRepository(STOContext context)
 {
     this.context = context;
 }
コード例 #10
0
 public OrdersController(STOContext context)
 {
     _context = context;
 }
コード例 #11
0
 public OwnerController(STOContext OwnerContext)
 {
     db = OwnerContext;
 }
コード例 #12
0
 public OrderController(STOContext OrderContext)
 {
     db = OrderContext;
 }
コード例 #13
0
 public WorkerController(STOContext WorkerContext)
 {
     db = WorkerContext;
 }
コード例 #14
0
 public WorkersController(STOContext context)
 {
     _context = context;
 }