nopcommerce - Got an error when adding product property in plugin's model -
I want to use the most visited went category product plugin public stores in the category of Home page
I have a new plugin name: Nop.Plugin.MostViewProduct.Product.Product
I model is added to the folder and write that code:
namespace Nop.Plugin. MostViewProduct.Product model {
public partial class most ViewProductModel: BaseNopModel {[NopResourceDisplayName ( "MostViewProduct.ProductId")] [AllowHtml] public int ProductId {get; Set; } [NopResourceDisplayName ("MostViewProduct.ProductCount")] [AllowHtml] public int ProductCount {get; Set; } Public Virtual Product Product {Received; Set; }} } And I get an error when I add a virtual product product {get; Set;} and error is Nop.Plugin.MostviewProduct.Product is a 'namespace' but used like a type. I already include the name space which is using Nop.Core.Domain.Catalog;
Why is it causing an error?
Thank you in advance.
A conflict Nop.Plugin.MostViewProduct.Product namespace and Nop.Core.Domain.Catalog.Product Between types To solve this, clearly defined that should how to use your property:
public virtual Nop.Core.Domain.Catalog.Product Product {get; Set; }
Comments
Post a Comment