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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:44:11+00:00 2026-05-11T23:44:11+00:00

I have a simple LINQ query on ADO.NET Entity Framework as follows var result

  • 0

I have a simple LINQ query on ADO.NET Entity Framework as follows

var result = 
  from itemA in TableA
  join itemB in TableB on itemA.ID = itemB.ID
  select ??????

I am trying to select everything from itemA and itemB without specifying all the TableA and TableB.

anything thoughts???

  • 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-11T23:44:11+00:00Added an answer on May 11, 2026 at 11:44 pm

    Is this what you need?

        var result = from itemA in TableA 
                     join itemB in TableB on itemA.ID equals itemB.ID
                     select new { itemA, itemB };
    

    Alternately, you could declare a result class that helps you build the result object without specifying all the fields:

        class ItemAB
        {
            public ItemAB(ItemA a, ItemB b)
            {
                FieldA1 = a.FieldA1;
                FieldA2 = a.FieldA2;
                FieldB1 = b.FieldB1;
                FieldB2 = b.FieldB2;
    
            }
            public int FieldA1 { get; private set; }
            public int FieldA2 { get; private set; }
            public int FieldB1 { get; private set; }
            public int FieldB2 { get; private set; }
        }
    
        var result = from itemA in TableA 
                     join itemB in TableB on itemA.ID equals itemB.ID
                     select new ItemAB(itemA, itemB);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you have a simple Linq query like: var result = from record in
I have a simple LINQ query running on top of Entity Framework (v1) and
I have a very simple linq query that gets data from two datatables (orderHeader
I have a very simple table and I can happily query it using LINQ
I have a ASP.Net page using ADO to query MS access database and as
I'm in the process of moving from ADO.NET to Linq. The application is a
I have a simple LINQ query that is going against a collection. Dim oList
I have a simple linq query that unionizes two tables that implement the same
I have an entity model and I've been looking to write a linq query
i have a simple SQL query, but im struggling to replicate in LINQ select

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.