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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:09:28+00:00 2026-05-16T17:09:28+00:00

I have three tables that I would like to query: Streams, Entries, and FieldInstances.

  • 0

I have three tables that I would like to query: Streams, Entries, and FieldInstances.

I’m wanting to get a list of entries inside a stream. A Stream could be a blog or a page etc. and entry is the actual instance of the stream ie: “stream:Page entry:Welcome” or “stream:blog entry:News about somthing”.

The thing is, each entry has custom data field associated with it through FieldInstance. IE:

stream: Page
entry: Welcome
fieldInstance: Welcome Image Path

I’m trying to figure out the best way to get a list of all entries inside of one stream and also have the custom field instances that are associated with each entry.

I’ve been playing around with code like this:

var stream = genesisRepository.Streams.First(x => x.StreamUrl == streamUrl);
IQueryable<StreamEntry> entry = genesisRepository.StreamEntries.Where(x => x.StreamID == stream.StreamID);
IQueryable<FieldInstance> fieldInstances = genesisRepository.FieldInstances.Where(
            // doesn't work because entry is basically returning a collection of some kind.
            // and i can't figure out how to compare a single ID with a list/collection of IDs
            x => x.fiStreamEntryID == entry.Where(e => e.StreamID == stream.StreamID)
        );

This of course doesn’t work. Inititially I was thinking to get all entries in the stream and then all fieldInstances in the stream, then I’ll display the data using lambdas after I have everything… hopefully keeping sql queries dows to two or three. But I can’t figure out how to write the linqTOsql to execute in just two or three queries. I keep thinking that I need to execute queries in a loop to get the fieldInstances for each entry.

Is there a LinqTOsql query that will select all fieldInstances where the StreamEntryID(fk) is in the list of entries whose (fk)StreamID matches the Stream?

  • 1 1 Answer
  • 3 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-16T17:09:28+00:00Added an answer on May 16, 2026 at 5:09 pm

    Sorry, I don’t quite get what columns you are joining in the third statement, but:

    var stream = genesisRepository.Streams.First(x => x.StreamUrl == streamUrl);
    IQueryable<StreamEntry> entries = genesisRepository.StreamEntries.Where(x => x.StreamID == stream.StreamID);
    IQueryable<FieldInstance> fieldInstances = from entry in entries
        from instance in genesisRepository.FieldInstances
        where entry.entryId == instance.fiStreamEntryID
        select instance;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have three tables that we would like to query to find out the
i have three tables i would like to link in this one query. The
I have three tables: user, friend_recommendation, and movie. I would like to get the
Need help with a query that I wrote: I have three tables Company id
I have a MySQL query that: gets data from three tables linked by unique
I have a Microsoft SQL Server 2008 query that returns data from three tables
I have three tables I would like to join to pull off a MySQL
I've got three tables I would like to query for a single dataset. Here
My goal is to get a query written. I have three tables, A, B
I have three tables that look like these: PROD Prod_ID|Desc ------------ P1|Foo1 P2|Foo2 P3|Foo3

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.