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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:15:09+00:00 2026-05-11T13:15:09+00:00

This used to work for me and then it failed. I want to return

  • 0

This used to work for me and then it failed. I want to return only those items that contain all the filters, not at least one filter as it is doing now. WHat is wrong here?

private IQueryable<IndexItem> FilteredIndex (IQueryable<IndexItem> index, IEnumerable<string> filters)      {          var filteredIndex= from f in filters.AsQueryable()                 where f.Length>0                from i in index                 where i.FilterNames.Contains(f)                select i;         return filteredIndex;    } 
  • 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. 2026-05-11T13:15:10+00:00Added an answer on May 11, 2026 at 1:15 pm

    How about something like:

    foreach(string s in filters) {     if(s.Length == 0) continue;     string tmp = s; // because of 'capture' problem     index = index.Where(i => i.FilterNames.Contains(tmp)); } return index; 

    This applies a succession of Where clauses, covering all the filters – essentially AND.

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

Sidebar

Related Questions

Does your work environment use Harvest SCM? I've used this now at two different
How is this tool used? Not the debugger, I mean Tools > Attach to
I have used this in my HTML: <q> Hai How r u </q> Which
I have heard this concept used frequently, but I don't have a really good
I've seen this format used for comma-delimited lists in some C++ code (although this
When should the keyword 'this' be used within C# class definitions? Is it standard
I'm interested in finding out why this is used on some Web sites for
In many past projects, I used this JPA / Hibernate approach to add auditing
When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root
What's the best way to remove a page frame automatically? I've used this type

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.