I have created following models in ASP.NET MVC. Now I have to send products data by API or JSON format.
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public virtual IList<ProductAttribute> ProductAttributes { get; set; }
}
public class ProductAttribute
{
public int Id { get; set; }
public int ProductId { get; set; } //foreign key
public string Key { get; set; }
public string Value { get; set; }
}
Currently data comes in this way after converting into JSON.

But I want to convert it into Pivot view, something like this.
How can I do this by using Entity Framework or LINQ ? Thanks
