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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:39:22+00:00 2026-06-05T07:39:22+00:00

This should be a really simple problem to solve, but for some reason Entity

  • 0

This should be a really simple problem to solve, but for some reason Entity Framework makes it really hard for me. I just need to do a simple left join…

I have two tables. For example, a user table:

user_id | name | fk_group_id

And a group table

group_id | groupname

In raw SQL:

SELECT * FROM users AS u
LEFT JOIN groups AS g
ON u.fk_group_id = g.group_id
WHERE groupname = 'my group'

Super easy in SQL. But when i search for answers on how to do this is Entity Framework, then there’s one thing that immidiately goes through my mind… WTF…!?!?
Super large constructed, weird formatted “queries” are performed and i’m really confused what i need and what not…

So i’m hoping someone could help me with my specific problem. How would one rewrite the above SQL query in (LINQ?) Entity Framework.

Currently i have this:

var bla = (from m in myEnt.Users
          // My join attempt..
          join mp in myEnt.Groups on m equals mp.group_id into n
          where n.group_name == "something"
          select m);

Even if this was working, i really don’t see how this is suppose to make my life easier.. Oo

Anyway, i really hope someone can help me out 🙂

  • 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-05T07:39:23+00:00Added an answer on June 5, 2026 at 7:39 am

    Umm, you don’t have to explicitly do that with any ORM. That’s the catch here, that’s what mapping’s for.

    You can just go:

    var blah = myEnt.Users.Where(user => user.Group.Name == "something");
    

    Or in the alternate syntax

    from usr in myEnt.Users
    where usr.Group.Name == "something"
    select usr`
    

    If it’s many-to-one relationship after mapping to objects, then every User entity will have the navigation property to his Group, and every Group will have a User collection. Then you only have to filter the results appropriately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm facing a problem which should be really simple to solve, but I am
This should be really simple, but I have tried many solutions posted on the
This seems like it should be really simple, but I'm unable to figure this
This seems like it should be really easy but I couln't find an answer
This really shouldn't be hard, I just can't figure out how to do it.
I'm trying to do something that should be very simple, but it's causing this
This should be really simple. I am using SSMS 2008, trying to get a
I have a really simple problem, but I don't find a nice way how
This should really be allowed - I do not understand why it is not.
This should really be easy for an experienced android programmer. Unfortunately I don't know

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.