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

  • SEARCH
  • Home
  • 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 8077927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:37:48+00:00 2026-06-05T15:37:48+00:00

I am trying to write a dynamic lambda or query but it occurs an

  • 0

I am trying to write a dynamic lambda or query but it occurs an error..

for lambda; I created a function

    public IEnumerable<musteriler>  GetCustomers<musteriler>(Expression<Func<musteriler, bool>> where)
   {
    IEnumerable<musteriler> _musteriler = market.musteriler.Where(where).Select(m => m);

     return _musteriler;

    }

and I call like that

  IEnumerable<musteriler> _musteriler  = helper.GetCustomers<musteriler>(m => m.MAktif == true);

I get two errors in Where(where) which are

    The best overloaded method match for System.Data.Objects.ObjectQuery<AkilliMarket.musteriler>.Where(string, params System.Data.Objects.ObjectParameter[])' has some invalid arguments

and

   Argument 1: cannot convert from 'System.Linq.Expressions.Expression<System.Func<musteriler,bool>>' to 'string'

after I tried a string query like

 IEnumerable<musteriler> _musteriler=  market.musteriler.Where("MAktif = true").Select(m => m) as IEnumerable<musteriler>;

yes it works but I cant use _musteriler.. for example when I write _musteriler.Count(); I get this error

  'MAktif' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near simple identifier, line 6, column 1.

MAktif is a column name of my musteriler table in db. and I tried another columns but result is same..

Where are my mistakes for both?

  • 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-06-05T15:37:50+00:00Added an answer on June 5, 2026 at 3:37 pm

    The problem is IQueryable<T>.Where is an extension method and ObjectQuery.Where is picked as “best overloaded method match” before extension methods are considered.

    Try:

    public IEnumerable<AkilliMarket.musteriler> GetCustomers<AkilliMarket.musteriler>(Expression<Func<AkilliMarket.musteriler, bool>> predicate)
    {
       return market.musteriler.AsQueryable().Where(predicate);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a Dynamic Query which uses a CTE. But I
I'm trying to write a dynamic Linq 2 Sql query using Expressions trees but
I am trying write a function that generates simulated data but if the simulated
I am trying to create a dynamic lambda expression (parsed from text), that does
I am trying to write a partially dynamic HQL query without resorting to the
Im trying to write a function that creates set of dynamic sublists each containing
hi i am trying to write a regular expression inside an xslt but i
I'm trying to write an abstraction to load dynamic libraries on Windows and Linux.
Trying to write out syslog entries containing strings but they don't register. // person.name
Trying to write a function to see how often an object exists and give

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.