Hint to MVC view generator for primary key on POCOs
- by myotherme
When generating a strongly-typed Index view for my model I always get the following:
<%= Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %>
I am using a POCO class for use with our ORM. As I understand it when using LINQ to SQL the view code will know which field is the primary key.
Is there a way that I can an attribute to the property (or class) that will let the View Generator know that the ID property if the primary key?