I have a strongly-typed view that receives a Design model for its rendering. My Design class (Entity) has a many-to-one relationship to a Designer (i.e. 1 Designer can have 1 or more Designs).
When trying to use the following code, I get an NullReferenceException for the Design.Designer relationship. Obviously I'm doing something wrong, but being fairly inexperienced with the Entity Framework I need guidance on what it actually is.
<% foreach (var Design in Model)
{ %>
<figure>
<a href="View/<%= Design.ID %>" rel="Next" title="View this design">
<img id="design-<%= Design.ID %>"
src="/Templates/<%= Design.ID %>/preview.png"
height="200"
width="200"
alt="<%= Design.Title %> by <%= Design.Designer.DisplayName %>"
title="<%= Design.Title %> by <%= Design.Designer.DisplayName %>" />
</a>
</figure>
<%} %>
Any suggestions and pointers appreciated.