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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:33:01+00:00 2026-05-26T11:33:01+00:00

The following function works great if I enter one string as a parameter, but

  • 0

The following function works great if I enter one string as a parameter, but I would like to supply it a list of strings, i.e. instead of supplying it the name of one project, e.g. “AccountTracker”, I can supply it multiple project names, i.e. “AccountTracker”, “GameX”, “HR1”. How can I convert my LINQ query to do so?

There is the following relationship Employee(1–)EmployeeProjects(–1)Project

[WebGet]
public IQueryable<Employee> GetEmployeesByProjects(string project)
{
   var employees = from ep in CurrentDataSource.EmployeeProjects
          .Include("Project")
          .Include("Employee")
       where ep.Project.ProjectName == project
       select ep.Employee;
   return employees;
}
  • 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-05-26T11:33:02+00:00Added an answer on May 26, 2026 at 11:33 am

    send the projects as string list and you can use Contains method as below

    [WebGet]
    public IQueryable<Employee> GetEmployeesByProjects(List<string> projects)
    {
       var employees = from ep in CurrentDataSource.EmployeeProjects
              .Include("Project")
              .Include("Employee")
           where projects.Contains(ep.Project.ProjectName)
           select ep.Employee;
       return employees;
    }
    

    or you can send one string with projects as "AccountTracker,GameX,HR1"

    [WebGet]
    public IQueryable<Employee> GetEmployeesByProjects(string listofprojects)
    {
       string[] projects= listofprojects.Split(',');
       var employees = from ep in CurrentDataSource.EmployeeProjects
              .Include("Project")
              .Include("Employee")
           where projects.Contains(ep.Project.ProjectName)
           select ep.Employee;
       return employees;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following function works great, but it only zips the 1 folder. I need
Given the following code,the hover function works correctly, but when clicked, loses the clicked_no_event_box
I have the following function which works great, i used JSONP to overcome cross-domain,
The following code works great in IE, but not in FF or Safari. I
I have the following function in my iPhone project which works great...unless the query
The following function proposed by Doug Crockford: JavaScript: The Good Parts. works great. var
I have 3 checkboxes with the following jQuery and it works great. $(document).ready(function() {
I have the following code which works great:- $('.ajax a').click(function() { getpageajax(this.href); return false;
I have the following function which works very well within a $(document).ready(function(){ $('.threadWrapper >
How does the following grep function works (what does !/0o1Iil]/ do? ) @chars =

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.