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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:15:49+00:00 2026-06-15T14:15:49+00:00

I have some simple classes that looks like this: Class Favorites Guid UserId Guid

  • 0

I have some simple classes that looks like this:

Class Favorites
Guid UserId
Guid ObjectId

Class Objects
Guid Id
String Name

With Entity Framework I want to select all the Objects which has been marked as a favorite by a user.

So I tried something like this

context.Objects.Where(
   x => x.Id == 
   context.Favorite.Where(f => f.UserId == UserId)
   .Select(f => f.ObjectId).Any()
);

But I don’t get it. I also tried with intersect, but what I understand it most be the same type. One User can have many Favorite objects

  • 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-15T14:15:50+00:00Added an answer on June 15, 2026 at 2:15 pm

    you could use join clause:

    context.Favorite
      .Where(f => f.UserId == UserId)
      .Join(context.Objects, t => t.ObjectId, u => u.Id, (t, u) => t);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model that looks something like this: public class SampleModel { public
I created a very simple event publisher and it looks like this. public class
I have some simple constraints involving multiplication of reals in z3 that are producing
Let's say I have some simple Javascript like: <script> var hello = function(){ alert(Hello
I have implemented a simple little DSL that generates classes from input files, by
If have a union that currently foresees some simple data types: union Value {
I have some global variables (classes) that as I understand have created before main()
I have my GWT project, and another project that just has simple Domain Objects,
The issue is fairly simple, I have some constants in a C++ namespace that
i want to create some simple wrapper classes for an existing class library. 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.