I am working on an ASP.NET MVC RC2 app using Entity Framework.
This is my Entity diagram.

In my repository I get the entity like this:
public Product GetProduct(int id) { return (from c in _entities.ProductSet.Include('User') where c.Id == id select c).FirstOrDefault(); }
My view:
<%@ Page Title='' Language='C#' MasterPageFile='~/Views/Shared/Site.Master' Inherits='System.Web.Mvc.ViewPage<SampleApp.Models.Product>' %>
Edit product
<h2>Edit product</h2> <%= Html.ValidationSummary('Edit was unsuccessful. Please correct the errors and try again.') %> <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <p> <label for='Id'>Id:</label> <%= Model.Id %> </p> <p> <label for='Title'>Title:</label> <%= Html.TextBox('Title', Model.Title) %> <%= Html.ValidationMessage('Title', '*') %> </p> <p> <label for='Body'>Body:</label> <%= Html.TextBox('Body', Model.Body) %> <%= Html.ValidationMessage('Body', '*') %> </p> <p> <input type='submit' value='Save' /> </p> </fieldset> <% } %> <div> <%=Html.ActionLink('Back to List', 'Index') %> </div>
Problem and my question is: When the ‘Product’ entity is returned from the view on post, the linked entity ‘User’ is null. Why is that and is there any way to get around this?

Because the productToEdit is a new product object populated from the form fields and if you don’t have fields for the user how would you populate the User entity
For a ‘workaround’, first get the product from the db, edit this with the edited fields in the productToEdit and save to db