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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:43:41+00:00 2026-05-29T05:43:41+00:00

I am joining a table to an in memory list and wanting to create

  • 0

I am joining a table to an in memory list and wanting to create an anonymous type from the results. I have joined the 2 data sources together ok, but I’m not sure of the syntax required to use a property from the in memory list in the anonymous type.

Here’s my code

        public DataKeys(IEnumerable<Element> elements)
    {
        var defsource = new DefinitionSource();
        var items = from def in defsource.Definitions
                    where elements.Select(el=> el.Value).Contains(def.Name)                        
                    select new { def.Key };
        ...

    }

(Obviously “elements” is an in-memory list of element and “DefinitionSource” is a wrapper around a table.) This works fine, but as you can see there is no property from the in-memory list of elements. I’ve tried this

      var items = from def in defsource.Definitions
                  where elements.Select(el=> el.Value).Contains(def.Name)  
                  from el in elements
                  where el.Value.Equals(def.Name)
                  select new { el.NodeType, def.Key };

but at run time it gens a “{“Local sequence cannot be used in LINQ to SQL implementations of query operators except the Contains operator.”}”

So what is the syntax I need to do this?

Many thx IA

Simon

  • 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-29T05:43:42+00:00Added an answer on May 29, 2026 at 5:43 am

    This might help:

    var def=defsource.Definitions
                        .Where(a=>elements.Select(el=>el.Value).Contains(a.Name))
                        .ToList();
    var items = from d in def
              from el in elements
                .Where(a=>a.Value==d.Name)
                      select new { el.NodeType, d.Key };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that does what i want joining table but i need
I have two models, user and group. I also have a joining table groups_users.
I have a join which deletes rows that match another table but the joining
I have 3 tables: problems, categories, and a joining table for problem_categories I am
Let's say we have two tables: 'Car' and 'Part', with a joining table in
I have a normal joining table with two columns that are keys to other
I have two models: store and category with a joining table called categories.stores .
I have a table table_a with a column containing data as follows: .aaa01932 .asd02343
If I have a joining table with two columns, TeamA and TeamB, how can
For example I have a tag lookup table joining tags to 3 different types

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.