title: Odata No NavigationLink factory was found
body: <p>I am currently working on a mvc4 web api odata service where I want to return a List of Users where Users have a list of Languages. When I want to get the Users I get the following error:</p>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>&lt;m:innererror&gt;
  &lt;m:message&gt;
  The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.
  &lt;/m:message&gt;
  &lt;m:type&gt;System.InvalidOperationException&lt;/m:type&gt;
  &lt;m:stacktrace/&gt;
  &lt;m:internalexception&gt;
  &lt;m:message&gt;
  No NavigationLink factory was found for the navigation property 'Languages' from entity type 'MvcWebRole1.Models.User' on entity set 'Users'. Try calling HasNavigationPropertyLink on the EntitySetConfiguration.
   Parameter name: navigationProperty
  &lt;/m:message&gt;
  &lt;m:type&gt;System.ArgumentException&lt;/m:type&gt;
  &lt;m:stacktrace&gt;
  at System.Web.Http.OData.Builder.EntitySetLinkBuilderAnnotation.BuildNavigationLink(EntityInstanceContext instanceContext, IEdmNavigationProperty navigationProperty, ODataMetadataLevel metadataLevel)
   at System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteNavigationLinks(EntityInstanceContext context, ODataWriter writer, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, IEnumerable`1 propertyBag, ODataWriter writer, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteObjectInline(Object graph, ODataWriter writer, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(Object graph, ODataWriter writer, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObjectInline(Object graph, ODataWriter writer, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(Object graph, ODataMessageWriter messageWriter, ODataSerializerContext writeContext)
   at System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.&lt;&gt;c__DisplayClassa.&lt;WriteToStreamAsync&gt;b__9()
   at System.Threading.Tasks.TaskHelpers.RunSynchronously(Action action, CancellationToken token)
  &lt;/m:stacktrace&gt;
  &lt;/m:internalexception&gt;
  &lt;/m:innererror&gt;
  </code></pre>
  
  <p><strong>My User looks like this:</strong></p>
  
  <pre><code>public class User
  {
      [Key]
      public int UserId { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string UserName { get; set; }
  
      public string Password { get; set; }
      public virtual ICollection&lt;Language&gt; Languages { get; set; }
  
      public User()
      {
          Languages = new List&lt;Language&gt;();
      }
  }
  </code></pre>
  
  <p><strong>and my UsersController for OData looks like this:</strong></p>
  
  <pre><code>public class UsersController : EntitySetController&lt;User, int&gt;
  {
      WorldChatContext db = new WorldChatContext();
  
      public override IQueryable&lt;User&gt; Get()
      {
          return db.Users.AsQueryable();
      }
  
      protected override User GetEntityByKey(int key)
      {
          return db.Users.FirstOrDefault(p =&gt; p.UserId == key);
      }
  
      public override HttpResponseMessage Post(User entity)
      {
          db.Users.Add(entity);
          db.SaveChanges();
          return base.Post(entity);
      }
  }
  </code></pre>
  
  <p>I am calling the following url which i setup in my routing: <code>http://127.0.0.1:81/odata/Users</code> it works if I comment navigation property in my User model.</p>
  
  <p>What am i doing wrong? I already tryed to put [Serializable, KnownType(typeof(Language))] on top of my user class but for some reason i cant use KnownType. How can i make my OData work with this navigation property?</p>