I want to do this view .. I have a model call Product Options and I need to bring on the view the name or photo path for different tables
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; }
}
}
This are the Product Model:
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 Model
public class OptionsGroup
{
public int OptionsGroupId { get; set; }
[Display(Name = "Group Name")]
public string OptionsGroupName { get; set; }
public virtual ICollection<Option> Options { get; set; }
}
Options Model
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; }
}