using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Nop.Core.Data;
using Nop.Core.Domain.Catalog;
using Nop.Services.Catalog;
using Nop.Web.Factories;
using Nop.Web.Framework.Components;
using Nop.Web.Models.Catalog;

namespace Nop.Web.Components
{
    public class MostViewdProductB2CViewComponent : NopViewComponent
    {
        private readonly ICatalogModelB2CFactory _catalogModelB2CFactory;
        private readonly IProductServiceB2C _IProductServiceB2C;
        private readonly IRepository<MostViewedProduct> _reposmostviewedproduct;
        private readonly IProductModelFactory _productModelFactory;
        private readonly IProductService _productservice;



        public MostViewdProductB2CViewComponent(ICatalogModelB2CFactory catalogModelB2CFactory, IProductServiceB2C IProductServiceB2C, IRepository<MostViewedProduct> reposmostviewedproduct, IProductModelFactory productModelFactory, IProductService productservice)
        {
            _catalogModelB2CFactory = catalogModelB2CFactory;
            _IProductServiceB2C = IProductServiceB2C;
            _reposmostviewedproduct = reposmostviewedproduct;
            _productModelFactory = productModelFactory;
            _productservice = productservice;
        }

        public IViewComponentResult Invoke()
        {

            var model = _catalogModelB2CFactory.PrepareProducts(new CatalogPagingFilteringModel());
            return View(model);
        }
    }
}
