title: Using nullable field in where clause Linq
body: <p>I have a table <code>Salary</code> where I have a nullable foreign key <code>programmerId</code> and I don't know how to write my query. </p>
  
  <p>I get this error </p>
  
  <blockquote>
    <p>'Domain.Abstract.Repository.IProgrammerRepository' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'Cbc.Domain.Abstract.Repository.IProgrammerRepository' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>if(entity.programmerId != null)
  { 
      var programmer= repositoryContainer
                      .ProgrammerRepository
                      .Where(entity.programmerId !=null &amp;&amp; id == entity.programmerId)
                      .FirstOrDefault();
  }
  </code></pre>
  
  <p>Any help?</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>public partial class Salary : IEntity&lt;long&gt;
  { 
       public long Id { get; set; }
       public int Мonth { get; set; }
       public int Year { get; set; }
       public long? ProgrammerId {get; set} 
       public virtual Programmer {get;Set}
  }
  
  public partial class Programmer: IEntity&lt;long&gt; 
  {
        public long Id { get; set; } 
  }
  </code></pre>
  
  <p>I need to select the programmer where <code>id == salary.ProgrammerId</code> </p>