title: ADO.net Entity Model Framework Compiled Query issue
body: <p>I have the following code through which I am trying to create a CompiledQuery using LINQ.</p>
  
  <pre><code>public static Func&lt;DataContext, int, object&gt;
          GetTeamMembersByTeamId = CompiledQuery.Compile&lt;MazikReviewEntities, int, object&gt;(
              (context, teamId) =&gt; from tp in context.TeamPlayers
                                      join t in context.Teams on tp.TeamId equals t.ID
                                      join emp in context.Employees on tp.EmployeeId equals emp.ID
                                      where tp.TeamId == teamId &amp;&amp; emp.IsActive == true
                                      orderby emp.JoiningDate
                                      select new ProjTeamMemberDetails
                                      {
                                          EmployeeName = emp.FirstName + " " + emp.LastName,
                                          Email = emp.Email,
                                          Designation = context.Designations.FirstOrDefault(s =&gt; s.ID == emp.DesignationId).Name,
                                          NIC = emp.NIC,
                                          JoiningDate = emp.JoiningDate,
                                          EmployeeID = emp.ID
                 });
  
  }
  </code></pre>
  
  <p>In the line CompiledQuery.Compile I am getting an error for my datacontext which states that,</p>
  
  <blockquote>
    <p>"The type 'MazikGlobalReviewModel.MazikReviewEntities' cannot be used as type parameter 'TArg0' in the generic type or method 'System.Data.Linq.CompiledQuery.Compile(System.Linq.Expressions.Expression>)'. There is no implicit reference conversion from 'MazikGlobalReviewModel.MazikReviewEntities' to 'System.Data.Linq.DataContext'."</p>
  </blockquote>
  
  <p>What is this error and how to solve this?</p>