// GET: Store/Products/MountainBikes
        //public ActionResult MountainBikes()
        //{
        //    if (!ControllerContext.RouteData.DataTokens.ContainsKey("area"))
        //        ControllerContext.RouteData.DataTokens.Add("area", "Store");

        //    ProductsViewModel model = new ProductsViewModel()
        //    {
        //        ViewTitle = "Mountain Bikes",
        //        Subcategory = 1
        //    };

        //    return View("Bikes", model);
        //}

        public async Task <ActionResult> Display(int id)
        {
            RepositoryProducts repo = new RepositoryProducts();

            ProductModel model = await Task.Run(() => repo.GetModelById(id));

            return(View(model));
        }
        public async Task <FileContentResult> Thumbnail(int id)
        {
            RepositoryProducts repo = new RepositoryProducts();

            ProductPhoto productPhoto = await Task.Run(() => repo.GetPhoto(id));

            if (productPhoto == null)
            {
                return(null);
            }

            int fileExtPos = productPhoto.LargePhotoFileName.LastIndexOf(".");

            if (fileExtPos <= 0)
            {
                return(null);
            }

            string contentType = string.Format("image/{0}", productPhoto.LargePhotoFileName.Substring(fileExtPos + 1, productPhoto.LargePhotoFileName.Length - fileExtPos - 1));

            return(File(productPhoto.ThumbNailPhoto, contentType));
        }