Пример #1
0
        public ActionResult Index()
        {
            MyStoreContext _myStoreContext = new MyStoreContext();
            var            employeeDetails = (from emp in _myStoreContext.Employee
                                              join dept in _myStoreContext.Department
                                              on emp.DepartmentId equals dept.DepartmentId
                                              orderby dept.Name
                                              select new EmployeeDetailsViewModel
            {
                Name = emp.Name,
                Description = emp.Description,
                DepartmentName = dept.Name
            }).ToList();

            EmployeeDepartmentDetailsViewModel employeeDepartmentDetails = new EmployeeDepartmentDetailsViewModel
            {
                Employees = employeeDetails
            };


            return(View(employeeDepartmentDetails));
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              IApplicationLifetime lifetime, MyStoreContext myStoreContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
//                app.UseHsts();
            }

//            app.UseHttpsRedirection();
            app.UseAuthentication();
            app.UseMiddleware <ErrorHandlerMiddleware>();
            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseHealthChecks("/health");
            app.UseSwagger();
            app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyStore API v1"));
//            app.Use(async (ctx, next) =>
//            {
//                Console.WriteLine("BEFORE");
//                await next();
//            });
//            app.Run(async ctx =>
//            {
//                Console.WriteLine("RUN");
//                await Task.CompletedTask;
//            });

            app.UseMvc();
            myStoreContext.Database.EnsureCreated();

            lifetime.ApplicationStopped.Register(() => Container.Dispose());
        }
Пример #3
0
 public GenericRepository(MyStoreContext context)
 {
     _entities = context;
 }
Пример #4
0
 public LoginController(MyStoreContext context)
 {
     this._context      = context;
     this._secretString = "MySecretsmlkmfwlemfmeewjhevryqbouhtipuhaoifbreuafbuafieunquuenfu";
 }
Пример #5
0
 public UnitOfWork()
 {
     this._context = new MyStoreContext();
 }
Пример #6
0
 public ProductController(MyStoreContext context)
 {
     _context = context;
 }
Пример #7
0
 public PictureRepository(MyStoreContext context)
 {
     _context = context;
 }
Пример #8
0
 public MenuItemsController(MyStoreContext context)
 {
     _context = context;
 }
Пример #9
0
 public EfProductRepository(MyStoreContext context)
 {
     _context = context;
 }
Пример #10
0
 public CustomRoleStore(MyStoreContext context)
     : base(context)
 {
 }
Пример #11
0
 public CustomUserStore(MyStoreContext context)
     : base(context)
 {
 }
Пример #12
0
 public OrderController(MyStoreContext context)
 {
     _context = context;
 }
Пример #13
0
 public CustomerController(MyStoreContext context)
 {
     _context = context;
 }
Пример #14
0
 public CategoryRepository(MyStoreContext context)
 {
     _context = context;
 }
Пример #15
0
 public EfCategoryRepository(MyStoreContext mySotreContext)
 {
     _ctx = mySotreContext;
 }
 public ProductsController(MyStoreContext context)
 => _context = context;
Пример #17
0
 public EmployeesController(MyStoreContext context)
 {
     _context = context;
 }
Пример #18
0
 public EfProductRepository(MyStoreContext mySotreContext)
 {
     _ctx = mySotreContext;
 }
Пример #19
0
        private void ReInitRepo()
        {
            var context = new MyStoreContext();

            _repository = new ShoppingCartRepository(context);
        }
Пример #20
0
 public HomeController(MyStoreContext context)
 {
     _context = context;
 }
Пример #21
0
 public OrderRepository(MyStoreContext context)
 {
     _context = context;
 }
 public PurchasesController(MyStoreContext context) => _context = context;
Пример #23
0
 public ShoppingCartRepository(MyStoreContext context)
 {
     _context = context;
 }
Пример #24
0
 public TimeSheetsController(MyStoreContext context)
 {
     _context = context;
 }
Пример #25
0
 public UserRepository(MyStoreContext context)
 {
     _context     = context;
     _userManager = new UserManager <User, Guid>(new CustomUserStore(context));
 }
Пример #26
0
 public CheckoutController(MyStoreContext context) => _context = context;
Пример #27
0
 public MarkRepository(MyStoreContext context)
 {
     _context = context;
 }
Пример #28
0
 public EfOrderRepository(MyStoreContext myStoreContext)
 {
     _ctx = myStoreContext;
 }