title: EF-CF-Set 'ignored' property from another table value
body: <p>I am using Entity Framework Code-First approach. Below is my sample Model.</p>
  
  <pre><code>    public class LocalizableEntity
      {
      public int Id{get;set;}
  
      // this property is 'Ignore'd. Need to set this.
      public string Name{get;set;}
  
      // this is the collection of 'Name's in all supported cultures.
      public virtual ICollection&lt;LocalizationText&gt; LocalNames{get;set;}
      }
  </code></pre>
  
  <p>Using fluent API, the 'Name' property will be ignored, like <code>Ignore(t=&gt;t.Name)</code>. My idea is to set the Name property from LocalNames collection by querying with a given culture ID. The LocalizationText type will look like below.</p>
  
  <pre><code>public class LocalizationText
  {
  public int Id{get;set;}
  public string Text{get;set;}
  public string Culture{get;set;}
  }
  </code></pre>
  
  <p>I want to implement methods to SELECT the items in SINGLE, ALL and BY PREDICATE in my repository(please consider <code>LocalizableEntities</code> and <code>LocalizationText</code> are the DbSets), but with populating the Name property in one query.</p>
  
  <h2>GET SINGLE ITEM method</h2>
  
  <pre><code>public LocalizableEntity GetById(int id)
  {
  var result=LocalizableEntities.Find(id); // selects the item
  
  //the culture will be passed in by other way. Hard-coding here
  result.Name=LocalizableEntities.LocalNames.Single(t=&gt;t.Culture=="en-us");
  return result;
  }
  </code></pre>
  
  <p>But the above implementation will take two DB calls. I want to make this into one query/expression. I also need to do this when selecting in batch also, assigning value for <code>Name</code> over sequence. </p>
  
  <p>Is this possible with single query? If yes, can anyone please guide me?
  Thanks :)</p>