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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:21:46+00:00 2026-06-11T15:21:46+00:00

All, I am experimenting with Linq and Entity Framework (athough I am using nHydrate)

  • 0

All,

I am experimenting with Linq and Entity Framework (athough I am using nHydrate) in VB.NET. Lets say I have 3 tables as follows:

Diagram

So Table1 is the top level grandparent which has a number of records/entities.

I want to select all of Table3 records/entities that are related to a specific Table1 instance. I want to do this as part of some search functionality.

I want to take an instance of Table1 as my starting point, i.e.

Public Class MySearch

    Private _lookUnder As System.Data.Objects.DataClasses.EntityObject

    Public Sub Search() 
        ...
        CType(_lookUnder, Table1) ' ???? need to linq here ????
        ...
    End Sub
End Class

Can this be done completely with Linq? C# answers are welcome.

I’ve tried looking at this but didn’t help too much.

Thanks,

Andez

  • 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-11T15:21:47+00:00Added an answer on June 11, 2026 at 3:21 pm

    Ideally, you should have access to the context, making something like this possible (C#):

    var relatedTable3s = context.Table3s.Where(t3 => t3.Table2.Table1.id == _lookUnder.id);
    

    I suppose something like this might work, too:

    var relatedTable3s =
        from t2 in _lookUnder.Table2s.AsQueryable()
        from t3 in t2.Table3s
        select t3;
    

    … otherwise written as:

    var relatedTable3s = _lookUnder.Table2s.AsQueryable()
        .SelectMany(t2 => t2.Table3s);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been experimenting with using mvc-mini-profiler on a ASP.NET website. All of the request
I have been experimenting some problems with the fully distributed version. First of all
First of all, I'm using Rails 3.1.1 and Ruby 1.9.3-p0 . After experimenting for
I have been looking at making the switch from SQL TableAdapters to Linq using
I have been experimenting with making GUIs in java as opposed to just using
I have been experimenting with WPF and using a CustomControl have made my own
Here is the scenario: VS 2008 .NET 3.5 SP1 LINQ to SQL I have
I've been experimenting with LINQ to SQL recently and have a quick question. The
I'm currently building an application using entity framework. Normally I would use a stored
I have been experimenting with Dynamic LINQ as a solution to a scenario, whereby

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.