Hi I have included nested class within a class to use it in a view but it doesnt show up the properties of that nested class below is the class, I want to use sku in the view : View:
@model Nop.Web.Models.Catalog.CategoryModel
<div class="product-item">
<h2 class="product-title">
@Model.Name
</h2>
<div class="description">
**@Model.ProductVariantModels.Select(x => x.Sku)//doesnt works** // partial class productvariant
</div>
<div class="add-info">
@Model.Name <br/> @Model.FullDescription //values from class CategoryModel
</div>
</div>
Model:
public class CategoryModel : BaseEntityModel
{
public CategoryModel()
{
ProductVariantModels = new List<ProductVariantModel>();
}
public string Name { get; set; }
public string FullDescription { get; set; }
public string MetaKeywords { get; set; }
public string MetaDescription { get; set; }
public string MetaTitle { get; set; }
public IList<ProductVariantModel> ProductVariantModels { get; set; }
public class ProductVariantModel : BaseNopEntityModel
{
public string Name { get; set; }
public bool ShowSku { get; set; }
public string Sku { get; set; }
public string Description { get; set; }
}
}