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 7707057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:15:52+00:00 2026-06-01T00:15:52+00:00

I want to dynamically query an object with System.Linq.Dynamic . var selectData = (from

  • 0

I want to dynamically query an object with System.Linq.Dynamic.

 var selectData = (from i in data 
                      select i).AsQueryable().Where("Name = @0","Bob1");//This works fine with a non-entity object

I know that we cannot project onto a mapped entity. I believe that is the reason this code fails

        foreach (var item in rawQuery.ObsDataResultList)
        {
            var propertyData = (from i in item
                                select i).AsQueryable().Where("PropertyName = @0", "blah");
        }//item is a Entity Complex Type

Error

Could not find an implementation of the query pattern for
source type ‘ClassLibrary1.Model.bhcs_ObsData_2_Result’. ‘Select’ not
found.

Given the fact that I need to specify the PropertyName at runtime, I don’t see any way to project with an anonymous type or a DTO.

I don’t need to retain any of the Entity functionality at this point, I just need the data. Copying the data onto something that is queryable is a valid solution. So, is it possible to query entity framework with dynamic LINQ?

And here is the entity class header (the thing I’m trying to query, aka the item object)

[EdmComplexTypeAttribute(NamespaceName="MyDbModel", Name="blah_myQuery_2_Result")]
[DataContractAttribute(IsReference=true)]
[Serializable()]
public partial class blah_myQuery_2_Result : ComplexObject
{
  • 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-01T00:15:53+00:00Added an answer on June 1, 2026 at 12:15 am

    First of all, let me clarify that System.Linq.Dynamic is not a full fledged Microsoft product. It is just a sample we release some time ago, and we don’t thoroughly test different LINQ implementations to work correctly with it. If you are looking for a fully supported text-based query language for EF ObjectContext API you should take a look at Entity SQL instead.

    Besides that, if you want to use System.Linq.Dynamic and you are ok with testing yourself that you don’t hit anything that will block your application from working, then I’ll try to see if I can help. I am going to need additional information since I am not sure I understand everything in your code snippets.

    First of all I would like to understand, in your first example what is “data” and where did it come from? In your second snippet, what is “rawQuery” and where did it come from? Besdies, what is rawQuery.DataResultList and what is rawQuery.ObsDataResultList?

    Also regarding your second snippet, it seems that you are trying to compose with query operators on top of an object that is not actually of a query type (although that doesn’t explain the error you are getting given that you are calling AsQueryable the compiler should have complained before that bhcs_ObsData_2_Result is not an IEnumerable nor a non-generic IEnumerable).

    In your propposed answer you are saying that you tried with ObjectResult and that seemed to help. Just be aware that ObjectResult is not a query object and therefore it won’t allow you to build queries that get send to the server. In other words, any query operators that you apply to ObjectResult will be evaluated in memory and if you don’t keep this in mind you may end up bringing all the data from that table into memory before you apply any filtering.

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

Sidebar

Related Questions

i have a table array dynamically generated from a data query and stored in
I have a huge query that is being made dynamically, but I want the
I want to dynamically get the name of the current stored procedure inside itself
I want to dynamically create object of HtmlDivElement in my jsf managed bean and
I want to dynamically query Google Maps through the Google Directions API. As an
How can I put a table name dynamically in a query? Suppose I have
I want to get the value of a parameter in a sqlalchemy query object
I want to get the count of the results of a dynamically-generated HQL query,
I'm trying to generate a query dynamically using textbox values from my Bookings form
I want to dynamically set the FilterValue1 property of a Content by Query to

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.