public IQueryable <ProductModel> GetAllProducts(
            [ValueProvider(typeof(HeaderValueProviderFactory <string>))] string sessionKey)
        {
            var context = new StoreContext();

            using (context)
            {
                var user = UsersController.GetUserBySessionKey(sessionKey);
                if (user == null)
                {
                    throw new ArgumentException("There is no user with such sessionKey!");
                }

                var newProductModel =
                    (from product in context.Products
                     select new ProductModel()
                {
                    ProductId = product.ProductId,
                    ProductsName = product.ProductName,
                }).ToList();

                return(newProductModel.AsQueryable());
            }
        }
        public IQueryable <CategoryModel> GetCategories(
            [ValueProvider(typeof(HeaderValueProviderFactory <string>))] string sessionKey)
        {
            var context = new StoreContext();

            using (context)
            {
                var user = UsersController.GetUserBySessionKey(sessionKey);
                if (user == null)
                {
                    throw new ArgumentException("There is no user with such sessionKey!");
                }

                var newCategoryModel =
                    (from category in context.Categories
                     select new CategoryModel()
                {
                    CategoryId = category.CategoryId,
                    CategoryName = category.CategoryName
                }).ToList();

                return(newCategoryModel.AsQueryable());
            }
        }