Error: System.ArgumentException: 'The type 'Nop.Plugin.Widgets.MRMegaMenuStandard.Services.MRMegaMenuStandardService' is not assignable to service 'Nop.Services.Catalog.ICategoryService'.'
View component:
[ViewComponent(Name = "MRMegaMenuStandard")]
public class MRMegaMenuStandardViewComponent : NopViewComponent
{
private readonly ICategoryService _categoryService;
private readonly IMRMegaMenuStandardService _mRMegaMenuStandardService;
private readonly IWorkContext _workContext;
public MRMegaMenuStandardViewComponent(IWorkContext workContext,
IMRMegaMenuStandardService mRMegaMenuStandardService,
ICategoryService categoryService)
{
_workContext = workContext;
_categoryService = categoryService;
}
public IViewComponentResult Invoke()
{
return Content("");
}
}
Service:
public interface IMRMegaMenuStandardService
{
/// <summary>
/// Logs the specified record.
/// </summary>
/// <param name="record">The record.</param>
}
public class MRMegaMenuStandardService : IMRMegaMenuStandardService
{
private readonly IRepository<ProductCategory> _productCategoryRepository;
/// <summary>
/// Default constructor
/// </summary>
/// <param name="productCategoryRepository"></param>
public MRMegaMenuStandardService(IRepository<ProductCategory> productCategoryRepository)
{
_productCategoryRepository = productCategoryRepository;
}
}