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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:09:30+00:00 2026-06-17T09:09:30+00:00

would be grate if someone could help me to translate this into lambda expression

  • 0

would be grate if someone could help me to translate this into lambda expression or something like.

firstly introduction:
are two tables/objects:

OFFICE 
{officeID,
 NAME,
 another data}

WORKER
{ID,
 officeID,
 NAME}

There is n of offices and m of workers in each off it. (we don’t know exact numbers and we don’t need them)

I know WORKER NAME, I have to get all OFFICES where is at least one worker with such NAME.

So,
SQL will be somethin like this :

SELECT * FROM OFFICE WHERE officeID = (SELECT officeID FROM WORKER where NAME='myName');

(maybe could be another, I’m not sure)

Just, could someone help me get the same using types:OFFICES,WORKER, with lambda expression and IQueryable?

  • 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-17T09:09:30+00:00Added an answer on June 17, 2026 at 9:09 am

    Are you using Navigation Properties? If so, then you can take advantage of those and do either of the two queries below:

    context.Office.Where(o => o.Workers.Any(w => w.Name == "myName"));
    

    or

    context.Workers.Where(w => w.Name == "myName").Select(w => w.Office).Distinct();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would like someone to take a look at my script and tell me where
I have a table that looks something like this: CREATE TABLE student_results(id integer, name
Hello would appreciate any help having problems with this code. value=<?phpif($_GET['level']== Grade 2){ echo
I would like to ask a little attention to this challenge. My intention is
I would like to make a layout like the one displayed on the this
I would like to apply CellTemplateSelector to a CellEditingTemplate. Can they be combined? This
I have a set of directories called CODE (GRADE) and would like to rename
Would like to parse IPv4 address from exit-addresses . Format of the file: ExitNode
Would be possible to extend this kind of layout so that I can have
Would like a for loop in jquery so that: For every hover_link: show hidden

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.