I'm working on templates for our aspx and codebehind pages.
Most tables we use contain a field Vch[tablename]Name, and as default I generate a column for this field in the datagrid.
The problem is that some tables do not contain a name field, and in this case the column should not be generated.
What I want to do is check if the related table contains a name field.
How can I get the fields from a related Entity?
This is what I do so far:
<% foreach(EntityFieldDefinition field in Entity.Fields) {
if(field.MappedField.IsForeignKey) {%>
//code to generate
<%}}%>