title: Unable to set field/property on entity
body: <p>I have been on a project with entity framework in DDD pattern. I don't use the default custom tool for the entity and I have a repository and some model classes.</p>
  <p>I have 3 tables in my entity framework:</p>
  <ol>
  <li>Category</li>
  <li>CategoryContent</li>
  <li>Content</li>
  </ol>
  <p>Category with <code>categoryContent</code> and content with <code>categoryContent</code> have 1 to many relationship. (I don't use many to many here because I have some properties in CategoryContent table)</p>
  <p>When I send a request for the list of <code>CategoryContent</code> and show content.Title of this list in MVC I have seen this error:</p>
  <p><code>Unable to set field/property CategoryContents on entity type System.Data.Entity.DynamicProxies.Content_731FEFC3E064D6098DC133918117C2359E2F308D2EB1E5D8D986538641AAB7CD.</code></p>
  <p>But when I traced, the program doesn't have any problems and returned data and show.</p>
  <p>I use the message system (request and response message in the service project).</p>
  <p>this code is a method for return list of <code>contentcategory</code>.</p>
  <pre><code> public IEnumerable&lt;CategoryContent&gt; GetContents(int categoryID)
      {
          Query query = new Query();
          OrderByClause order = new OrderByClause();
          order.PropertyName = &quot;ID&quot;;
          order.Desc = true;
          query.OrderByProperty = order;
          query.Add(new Criterion(&quot;CategoryID&quot;, categoryID, CriteriaOperator.Equal));
  
          return  categoryContentRepository.FindBy(query);
      }
  </code></pre>
  <p>categoryContentRepository is an object from CategoryContentRepository class in Repository project for management work with DB.</p>
  <p>in MVC Controllers:</p>
  <pre><code>public ActionResult Content(int id)
      {
          var contentService = ServiceFactory.CreatContentService();
          var response = contentService.GetContents(id).ToList();
  
          return PartialView(&quot;_Content&quot;, response);
      }
  </code></pre>
  <p>in view (_content.cshtml):</p>
  <pre><code>@model List&lt;Plus.Model.CategoryContent&gt;
  
  @foreach (var item in Model)
  {
      @Html.ActionLink(item.Content.Title, &quot;Amir&quot;)
  }
  </code></pre>
  <p>Model Classes:</p>
  <pre><code>public class Category: ValidationBase, IAggregateRoot
  {
      public int ID { get; set; }
  
      [NotNullOrEmpty()]
      public string Name { get; set; }
  
      [NotNullOrEmpty()]
      public int Ordering { get; set; }
  
      public int? ParentID { get; set; }
  public Guid ModifiedBy { get; set; }
  public DateTime ModifiedOn { get; set; }
  public string ModifiedReason { get; set; }
  public bool Deleted { get; set; }
  public bool Active { get; set; }
  
      
      public virtual Category Parent { get; set; }
      public virtual IList&lt;Category&gt; Childeren { get; set; }
      public virtual IList&lt;CategoryContent&gt; CategoryContents { get; set; }
  }
  
  public class CategoryContent : ModelBase, IAggregateRoot
  {
      public int ID { get; set; }
      public int ContentID { get; set; }
      public int CategoryID { get; set; }
  
      public virtual Content Content { get; set; }
      public virtual Category Category { get; set; }
  }
  
  public class Content: ModelBase, IAggregateRoot
  {
      public int ID { get; set; }
      public string Title { get; set; }
      public string Intro { get; set; }
      public int? ParentID { get; set; }
      public bool IsSeries { get; set; }
      public byte LikeVoteStatus { get; set; }
  
      public virtual IList&lt;SubContent&gt; SubContents { get; set; }
      public virtual Content Parent { get; set; }
      public virtual IList&lt;Content&gt; Childeren { get; set; }
      public virtual CategoryContent CategoryContents { get; set; }
  }
  </code></pre>