Example #1
0
 public GetPrice(int productId, int productPriceId, decimal originalPrice, ShoppingContext shoppingContext)
 {
     ProductId = productId;
     ProductPriceId = productPriceId;
     OriginalPrice = originalPrice;
     FinalPrice = originalPrice;
     ShoppingContext = shoppingContext;
 }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (context != null)
         {
             context.Dispose();
             context = null;
         }
     }
 }
Example #3
0
        public async void Details_ExistedId_ReturnViewResultOrders(int a)
        {
            var option  = new DbContextOptionsBuilder <ShoppingContext>().UseInMemoryDatabase(databaseName: "testDB4").Options;
            var context = new ShoppingContext(option);

            SampleData.Initialize(context);

            var supermarketService = new Mock <SupermarketsService>(context);
            var customerstService  = new Mock <CustomersService>(context);
            var mock       = new Mock <OrdersService>(context, supermarketService.Object, customerstService.Object);
            var controller = new OrdersController(mock.Object);
            var resultView = await controller.Details(a);

            var viewResult = Assert.IsType <ViewResult>(resultView);
            var model      = Assert.IsAssignableFrom <Order>(viewResult.Model);

            Assert.Equal(a, model.Id);
        }
Example #4
0
        public void AddNewOrder()
        {
            using (var db = new ShoppingContext())
            {
                var   service = new Repository.Repository(db);
                Order or      = new Order();
                or.Items = new List <ItemOrder>();
                ItemOrder item     = new ItemOrder();
                var       products = service.GetProducts();
                item.Prduct = products.ToList()[0];
                item.Count  = 2;
                or.Items.Add(item);
                or.Date = DateTime.Now;
                int i = service.AddOrder(1, or);

                Assert.IsTrue(i > 0);
            }
        }
Example #5
0
        public void AddProduct()
        {
            using (var db = new ShoppingContext())
            {
                var product = new Product
                {
                    Name        = "Ravioles",
                    Code        = "123456",
                    Description = "Ravioles",
                    Price       = 200
                };
                var service = new Repository.Repository(db);
                product.CategorityId = service.GetCategory(1, "Pastas").Id;
                int i = service.AddProduct(product);

                Assert.IsTrue(i > 0);
            }
        }
Example #6
0
        public void UpdateCategory()
        {
            Category category;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                category = service.GetCategory(1, "Pastas");
            }
            using (var db = new ShoppingContext())
            {
                category.Name = "Carnes";
                var service = new Repository.Repository(db);
                int i       = service.UpdateCategority(category);

                Assert.IsTrue(i > 0);
            }
        }
Example #7
0
        public void UpdateWaiter()
        {
            Waiter product;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                product = service.GetUser("psilva");
            }
            using (var db = new ShoppingContext())
            {
                product.Password = "******";
                var service = new Repository.Repository(db);
                int i       = service.UpdateUser(product);

                Assert.IsTrue(i > 0);
            }
        }
Example #8
0
        public void UpdateLetter()
        {
            LetterMenu letter;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                letter = service.GetLetterMenu("Principal");
            }
            using (var db = new ShoppingContext())
            {
                letter.Name = "Vinos";
                var service = new Repository.Repository(db);
                int i       = service.UpdateLetter(letter);

                Assert.IsTrue(i > 0);
            }
        }
Example #9
0
        public void UpdateProduct()
        {
            Product product;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                product = service.GetProduct(1);
            }
            using (var db = new ShoppingContext())
            {
                product.Name = "Ravioles";
                var service = new Repository.Repository(db);
                int i       = service.UpdateProduct(product);

                Assert.IsTrue(i > 0);
            }
        }
Example #10
0
        static void Main(string[] args)
        {
            const string _connectionString = "Server = DESKTOP-28DHLU6; Database = test; User Id = arafat; Password = 123; ";
            var          context           = new ShoppingContext(_connectionString);
            var          Customer          = new Customer()
            {
                Name         = "A",
                Email        = "*****@*****.**",
                Mobile       = "01625420852",
                RegisterDate = DateTime.Now,
                UserName     = "******",
                Password     = "******",
                PasswordNew  = "1234"
            };

            context.Customers.Add(Customer);

            context.SaveChanges();
        }
Example #11
0
        static void DeleteCustomersViaTrx()

        {
            using (var db = new ShoppingContext())

                using (var transaction = db.Database.BeginTransaction())

                {
                    var customers = db.Customers.Include(b => b.Orders).ToList();
                    foreach (var customer in customers)
                    {
                        db.Entry(customer).State = Microsoft.EntityFrameworkCore.EntityState.Deleted;

                        int recordsDeleted = db.SaveChanges();

                        Console.WriteLine("Number of records deleted:" + recordsDeleted);
                    }

                    transaction.Commit();
                }
        }
Example #12
0
 private void LoadCurrentList()
 {
     CurrentList = new ObservableCollection <BindableProduct>();
     using (var db = new ShoppingContext())
     {
         _currentShoppingList = db.ShoppingLists.Where(x => x.UserId == _currentUser.UserId).OrderByDescending(x => x.CreationDate).FirstOrDefault();
         if (_currentShoppingList == null)
         {
             _currentShoppingList = new ShoppingList(_currentUser.UserId);
             db.ShoppingLists.Add(_currentShoppingList);
             db.SaveChanges();
             return;
         }
         var products = db.Products.Where(x => x.ShoppingListId == _currentShoppingList.ShoppingListId);
         CurrentList = new ObservableCollection <BindableProduct>();
         foreach (var product in products)
         {
             CurrentList.Add(new BindableProduct(product));
         }
     }
 }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ShoppingContext dbcontext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/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.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseSession();

            app.Use(async(context, next) =>
            {
                await next();
            });

            app.UseMyAuthMiddleware();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            dbcontext.Database.EnsureDeleted();
            dbcontext.Database.EnsureCreated();

            new DBSeeder(dbcontext);
        }
        private void LoadUsers()
        {
            using (var db = new ShoppingContext())
            {
                var tempUsersCollection = new ObservableCollection <User>();
                try
                {
                    var query = from u in db.Users select u;

                    foreach (var user in query)
                    {
                        tempUsersCollection.Add(user);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Failed to load db. Delete db! =)");
                    db.Database.Delete();
                }
                UsersList = tempUsersCollection;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (var db = new ShoppingContext())
                {
                    var shoppingPlaces = db.shoppingPlaces.ToArray().Select(x => new ListItem()
                    {
                        Text  = x.Name,
                        Value = x.ShoppingPlaceID.ToString()
                    }).ToArray();
                    ddlShoppingPlaces.Items.AddRange(shoppingPlaces);

                    var shoppingOccasions = db.ShoppingOccasions.ToArray().Select(x => new ListItem()
                    {
                        Text  = x.Date.ToShortDateString(),
                        Value = x.ShoppingOccasionID.ToString()
                    }).ToArray();
                    ddlShoppingOccasions.Items.AddRange(shoppingOccasions);
                }
            }
        }
Example #16
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ShoppingContext dbcontext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            //use extenstions to register middleware
            app.UseMiddlewareExtensions();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            //create database and table
            dbcontext.Database.EnsureDeleted();
            dbcontext.Database.EnsureCreated();

            //insert data into database
            new DBSeeder(dbcontext);
        }
Example #17
0
        public void RemuveWaiter()
        {
            Waiter product;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                product = service.GetUser("psilva");
            }
            if (product != null)
            {
                using (var db = new ShoppingContext())
                {
                    var service = new Repository.Repository(db);
                    int i       = service.RemoveUser(product);

                    Assert.IsTrue(i > 0);
                }
            }
            else
            {
                Assert.Fail("Product id: " + 1 + " not exist");
            }
        }
Example #18
0
        public void RemuveProduct()
        {
            Product product;

            using (var db = new ShoppingContext())
            {
                var service = new Repository.Repository(db);
                product = service.GetProduct(1);
            }
            if (product != null)
            {
                using (var db = new ShoppingContext())
                {
                    var service = new Repository.Repository(db);
                    int i       = service.RemuveProduct(product);

                    Assert.IsTrue(i > 0);
                }
            }
            else
            {
                Assert.Fail("Product id: " + 1 + " not exist");
            }
        }
        public User AuthenticateUser(string Username, string Password, ShoppingContext dbcontext)
        {
            //shermaine

            User dbUser = dbcontext.Users
                          .Where(x => x.Username == Username).FirstOrDefault();

            if (dbUser == null || dbUser.Password == null)
            {
                return(null);
            }


            Debug.WriteLine("Database pw: {0}", dbUser.Password);
            Debug.WriteLine("Entered pw:{0} ", Password);


            if (dbUser != null && dbUser.Password == Password)
            {
                return(dbUser);
            }

            return(null);
        }
 public OrdersController(ShoppingContext context)
 {
     _context = context;
 }
Example #21
0
 public ProductController(ILogger <ProductController> logger, ShoppingContext context)
 {
     _logger  = logger;
     _context = context;
 }
Example #22
0
 public HomeController(ShoppingContext shoppingContext)
 {
 }
Example #23
0
 public OrderRepository(ShoppingContext context) : base(context)
 {
 }
Example #24
0
 public static void Initialize(ShoppingContext context)
 {
     if (context.Products.Any())
     {
         return;   // DB has been seeded
     }
     context.Products.AddRange(
         new Product
     {
         Name  = "Butter",
         Price = 30.0
     },
         new Product
     {
         Name  = "Banana",
         Price = 20.50
     },
         new Product
     {
         Name  = "Cola",
         Price = 9.30
     }
         );
     context.SaveChanges();
     context.SuperMarkets.AddRange(
         new SuperMarket
     {
         Name    = "Wellmart",
         Address = "Lviv",
     },
         new SuperMarket
     {
         Name    = "Billa",
         Address = "Odessa",
     }
         );
     context.SaveChanges();
     context.Orders.AddRange(
         new Order
     {
         UserId        = "53a919d8-a58f-4cdb-946f-0570c1ac0c6d",
         SuperMarketId = 1,
         OrderDate     = DateTime.Now,
     },
         new Order
     {
         UserId        = "53a919d8-a58f-4cdb-946f-0570c1ac0c6d",
         SuperMarketId = 1,
         OrderDate     = DateTime.Now,
     }
         );
     context.SaveChanges();
     context.OrderDetails.AddRange(
         new OrderDetail
     {
         OrderId   = 1,
         ProductId = 1,
         Quantity  = 2
     },
         new OrderDetail
     {
         OrderId   = 2,
         ProductId = 2,
         Quantity  = 1
     }
         );
     context.SaveChanges();
 }
Example #25
0
 public EfProductsRepository(ShoppingContext context)
 {
     this.context = context;
 }
Example #26
0
 public CustomersController(ShoppingContext context)
 {
     this.context = context;
 }
 /// <summary>
 /// Associates a given instance of a DbContext to the current request.
 /// </summary>
 /// <param name="request">The request to will the DbContext instance will be associated.</param>
 /// <param name="context">The DbContext instance to associate with the request.</param>
 public static void SetContext(
     this HttpRequestMessage request,
     ShoppingContext context)
 {
     request.Properties[DB_Context] = context;
 }
Example #28
0
 public CustomerService(ShoppingContext shoppingContext)
 {
     _shoppingContext = shoppingContext;
 }
Example #29
0
        public SeedData()
        {
            ShoppingContext shopDb = new ShoppingContext();

            shopDb.Categories.Add(new Category {
                CategoryName = "Battleship", Description = "This is a "
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Battlecruiser", Description = "This is a Battlecruiser"
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Cruiser", Description = "This is a Cruiser"
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Frigate", Description = "This is a Frigate"
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Destroyer", Description = "This is a Destroyer"
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Corvette", Description = "This is a Corvette"
            });
            shopDb.Categories.Add(new Category {
                CategoryName = "Submercible", Description = "This is a Corvette"
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Battleship"), PublicName = "HMS Dreadnought", BasePrice = 50M, BulkPrice = 40M, BulkQnt = 10, ImageUrl = "/", PrivateDescription = "", Description = "Dreadnought was significantly larger than the two ships of the Lord Nelson class, which were under construction at the same time. She had an overall length of 527 feet (160.6 m), a beam of 82 feet 1 inch (25.0 m), and a draught of 29 feet 7.5 inches (9.0 m) at deep load."
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Battleship"), PublicName = "USS Iowa", BasePrice = 150M, BulkPrice = 130M, BulkQnt = 10, ImageUrl = "/", PrivateDescription = "", Description = "USS Iowa (BB-61) is a retired battleship, the lead ship of her class, and the fourth in the United States Navy to be named after the state of Iowa. Owing to the cancellation of the Montana-class battleships, Iowa is the last lead ship of any class of United States battleships and was the only ship of her class to have served in the Atlantic Ocean during World War II. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Battleship"), PublicName = "Yamato", BasePrice = 170M, BulkPrice = 150M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "Yamato (大和) was the lead ship of her class of battleships built for the Imperial Japanese Navy (IJN) shortly before World War II. She and her sister ship, Musashi, were the heaviest and most powerfully armed battleships ever constructed, displacing 72,800 tonnes at full load and armed with nine 46 cm (18.1 in) Type 94 main guns, which were the largest guns ever mounted on a warship. "
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "BattleCruiser"), PublicName = "HMS Hood", BasePrice = 110M, BulkPrice = 100M, BulkQnt = 8, ImageUrl = "/", PrivateDescription = "", Description = "HMS Hood (pennant number 51) was the last battlecruiser built for the Royal Navy. Commissioned in 1920, she was named after the 18th-century Admiral Samuel Hood. One of four Admiral-class battlecruisers ordered in mid-1916, Hood had design limitations, though her design was revised after the Battle of Jutland and improved while she was under construction. For this reason, she was the only ship of her class to be completed. Despite the appearance of new and more modern ship designs over time, Hood remained the largest and most powerful warship in the world for 20 years after her commissioning."
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "BattleCruiser"), PublicName = "HMS Invincible", BasePrice = 100M, BulkPrice = 90M, BulkQnt = 8, ImageUrl = "/", PrivateDescription = "", Description = "HMS Invincible was the lead ship of her class of three battlecruisers built for the Royal Navy during the first decade of the twentieth century and the first battlecruiser to be built by any country in the world. During the First World War she participated in the Battle of Heligoland Bight in a minor role as she was the oldest and slowest of the British battlecruisers present."
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Cruiser"), PublicName = "Varyag", BasePrice = 50M, BulkPrice = 40M, BulkQnt = 10, ImageUrl = "/", PrivateDescription = "", Description = "Laid down in 1979 at 61 Kommunara Shipbuilding Plant (Shipyard 445) in Nikolayev as Chervona Ukraina ('Red Ukraine'), the vessel was launched in July 1983, and commissioned 16 October 1989. The warship joined the Pacific Fleet in 1990 and was listed as having only a caretaker crew up to 2002.The cruiser re-entered service with the Pacific Fleet in early 2008 after an overhaul. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Cruiser"), PublicName = "USS Port Royal", BasePrice = 50M, BulkPrice = 40M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "USS Port Royal (CG-73) is a United States Navy Ticonderoga-class guided missile cruiser, the 27th and final in the class. She is the second U.S. warship to bear the name of two naval battles of Port Royal Sound, South Carolina, of the American Revolutionary War and the American Civil War. At the time of her naming, the Navy designated her as 'First ship named' by way of a plaque in the Engineering Control Center, but this was in error as there was a previous ship to bear the name. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Frigate"), PublicName = "HMCS Halifax", BasePrice = 30M, BulkPrice = 28M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "HMCS Halifax (FFH 330) is a Halifax-class frigate that has served in the Royal Canadian Navy and Canadian Forces since 1992. Halifax is the lead ship in her class which is the name for the Canadian Patrol Frigate Project. She is the second vessel to carry the designation HMCS Halifax. She carries the hull classification symbol FFH 330. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Frigate"), PublicName = "HMS Richmond", BasePrice = 30M, BulkPrice = 27M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "HMS Richmond is a Type 23 frigate of the Royal Navy. She was launched on 6 April 1993 by Lady Hill-Norton, wife of the late Admiral of the Fleet the Lord Hill-Norton, and was the last warship to be built by Swan Hunter Shipbuilders. She sailed from the builders on the River Tyne in November 1994. She is named for the Dukedom of Richmond. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Frigate"), PublicName = "Admiral Gorshkov", BasePrice = 30M, BulkPrice = 27M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "The Admiral Gorshkov-class frigates, also known as Project 22350, are a class of frigate of the Russian Navy. They were designed by the Severnoye Design Bureau, Saint Petersburg, the lead ship being named after Sergey Gorshkov.[11]"
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Frigate"), PublicName = "Baden-Württemberg", BasePrice = 30M, BulkPrice = 27M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "The F125 Baden-Württemberg-class frigates are a series of frigates of the German Navy, which were designed and constructed by ARGE F125, a joint-venture of Thyssen-Krupp and Lürssen. The Baden-Württemberg class have the highest displacement of any class of frigate worldwide. They are to replace the Bremen class."
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Destroyer"), PublicName = "USS Winston S. Churchill", BasePrice = 20M, BulkPrice = 17M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "USS Winston S. Churchill (DDG-81) is an Arleigh Burke-class destroyer of the United States Navy. She is named after Sir Winston Churchill, the renowned former Prime Minister of the United Kingdom. This ship is the 31st destroyer of her class. Winston S. Churchill was the 18th ship of this class to be built at Bath Iron Works in Bath, Maine, and construction began on 7 May 1998. She was launched and christened on 17 April 1999. On 10 March 2001, she was commissioned during a ceremony at Town Point Park in Norfolk, Virginia. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Destroyer"), PublicName = "Destructor", BasePrice = 30M, BulkPrice = 27M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "Destructor was a 19th-century Spanish warship. She was a fast ocean-going torpedo gunboat and a precursor of the destroyer type of vessel.[2] Destructor was the first warship classified as a 'destroyer' at the time of her commissioning.[3][4] Her designer was a Spanish Navy officer, Fernando Villaamil, commissioned by the Minister of the Navy, Vice-Admiral Manuel Pezuela. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Destroyer"), PublicName = "HMS Havock", BasePrice = 20M, BulkPrice = 15M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "HMS Havock was a Havock-class torpedo boat destroyer of the British Royal Navy built by the Yarrow shipyard. She was one of the very first destroyers ordered by the Royal Navy, and the first to be delivered. "
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Corvette"), PublicName = "HMCS Regina", BasePrice = 11M, BulkPrice = 7M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "HMCS Regina was a Royal Canadian Navy revised Flower-class corvette which took part in convoy escort duties during the Second World War. She fought primarily in the Battle of the Atlantic. She was named for Regina, Saskatchewan. "
            });
            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Corvette"), PublicName = "Braunschweig class", BasePrice = 10M, BulkPrice = 7M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "The K130 Braunschweig class (sometimes Korvette 130) is Germany's newest class of ocean-going corvettes. Five ships have replaced the Gepard-class fast attack craft of the German Navy. "
            });

            shopDb.Products.Add(new Product {
                Category = shopDb.Categories.SingleOrDefault(g => g.CategoryName == "Submercible"), PublicName = "USS Virginia ", BasePrice = 6M, BulkPrice = 5M, BulkQnt = 5, ImageUrl = "/", PrivateDescription = "", Description = "The Virginia class, also known as the SSN-774 class, is a class of nuclear-powered fast attack submarines (hull classification symbol SSN) in service with the United States Navy. The Virginia-class attack submarine is the U.S. Navy’s newest undersea warfare platform and incorporates the latest in stealth, intelligence gathering and weapons systems technology."
            });
        }
Example #30
0
 public Supermarkets(ShoppingContext context)
 {
     _context = context;
 }
 public ProductsService(ShoppingContext dbContext)
 {
     _dbContext = dbContext;
 }
 public ProductRepository(ShoppingContext _context) : base(_context)
 {
 }