In my MVC app I have one model which is of a certain 'category', another model.
When the index view is displayed both the name of this model and the category name are called 'Name', how do i change the displayed name of the category to something other than name?
[Table("Product")]
public partial class Product
{
public int ProductId { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Description { get; set; }
public int CategoryId { get; set; }
public decimal Price { get; set; }
public virtual Category Category { get; set; }
}
I have tried using [DisplayName ("New Name")]
above both CategoryId and Category and this doesn't seem to work, can anyone advise me?
Thanks