Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7194711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:25:42+00:00 2026-05-28T20:25:42+00:00

I have an extension method as follows: public static bool SatisfiesSomeCondition(this Post post, SomeObj

  • 0

I have an extension method as follows:

public static bool SatisfiesSomeCondition(this Post post, SomeObj someObj)
{
   return post.SomeObjId == someObj.SomeObjId;
}

And i’m trying to use it like this:

var query = ctx.Posts.Where(p => p.SatisfiesSomeCondition(someObj)).ToList();

But i get the error:

LINQ to Entities does not recognize the method ‘Boolean SatisfiesSomeCondition(xx.xx.xx.Post, xx.xx.xx.SomeObj)’ method, and this method cannot be translated into a store expression.

If i change the query to:

var query = ctx.Posts.Where(p => p.SomeObjId == someObj.SomeObjId).ToList();

Which is identical to the method.

It works fine, and executes the expected T-SQL.

Why doesn’t my first query work? It’s a static method, can’t it figure out how to create the expression tree? (e.g a WHERE filter). Surely i don’t have to materialize the query first? (which means the records i don’t want come back over the wire, and i’m doing paging/ordering here, so that’s not an option).

Of course, i can just go with what works (e.g the above), but the method SatisfiesSomeCondition is an existing method used across the domain and i want to re-use that functionality, not duplicate it.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:25:43+00:00Added an answer on May 28, 2026 at 8:25 pm

    The LINQ to Entities engine has no way of knowing what your static method does.
    LINQ queries can only be translated from expression trees.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an extension method as follows: public static class PageExtensions { public static
I have an extension method which I can use from the .cs codebehind of
Is there a way to have extension method on the method? Example for this
I am having an issue using BinaryFormatter.Serialize. I have this generic extension method to
I have a pieces of code: The method is as follows: public IEnumerable<c> Test(){
According to this post , F# supports extension methods on object instances and static
I have an extension method on the HttpApplicationState object for getting my IoC container
I currently have an extension Method which converts an IEnumerable of type Tab into
What is necessary to have an extension method honored when it exists in an
I have a simple extension method on the int type so I can do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.