Mike

My feedback

  1. 865 votes
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)

      We’ll send you updates on this idea

      Mike commented  · 

      You may be able to workaround this by flipping around your query for Linq to Entities, then flipping it back with Linq to Objects. Using the example above:

      var q = context.Products.Where(p => p.UnitPrice > 20 & p.Category.StartsWith("a")).Include(p => p.Category);

      var r = q.ToList().Select(p => p.Category).Distinct();

      Note: This would not work if you are expecting Categories that don't have products in your results.

      Mike supported this idea  · 
    • 101 votes
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)

        We’ll send you updates on this idea

        Mike supported this idea  · 

      Feedback and Knowledge Base