Bu görünümü görmek istiyorum .. Modelli bir ürün var Ürün Seçenekleri ve görünümüne farklı tablolar için ad veya fotoğraf yolu getirmem gerekiyorBunu nasıl yapabilirim ... Çoklu modeller modeller bakış MVC 5
public class Product
{
public int Id { get; set; }
[Display(Name = "Product Name")]
public string Name { get; set; }
[Display(Name = "Category")]
public int CategoryId { get; set; }
[Column(TypeName = "Money")]
public decimal Price { get; set; }
[Display(Name = "Image")]
public string PhotoPath { get; set; }
[Display(Name = "Discount")]
public int DiscountId { get; set; }
[Display(Name = "Enable")]
public bool status { get; set; }
public virtual ICollection<ProductOption> ProductOptions { get; set; }
}
OptionsGroup Modeli
:public class ProductOption
{
public int id { get; set; }
[Display(Name = "Product")]
public int ProductId { get; set; }
[Display(Name = "Group")]
public int GroupId { get; set; }
[Display(Name = "Option")]
public int OptionId { get; set; }
[Display(Name = "Price")]
public decimal priceIncrement { get; set; }
}
}
Bu
Ürün Modeli vardırSeçenekler Modeli Anladığım kadarıyla
public class Option
{
public int OptionId { get; set; }
[Display(Name="Option Name ")]
public string OptionName { get; set; }
[Display(Name = "Group Name ")]
public int OptionsGroupId { get; set; }
public virtual OptionsGroup OptionsGroup { get; set; }
}