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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:24:33+00:00 2026-05-23T16:24:33+00:00

I have a list in which i store objects with properties called Name, ID,

  • 0

I have a list in which i store objects with properties called Name, ID, Attendance. I want to get the index values of all the objects in the list according to a search by name. This is the easy part. Along with the search by name, i want to further narrow the index results to only those objects whose ID property is not in an exclusion list of ID’s to ignore. For ex:

Exclusion List:
123
456
981

Main List of Objects
Object 1 with Name Property = Hi, ID = 123, Attendance = Present
Object 2 with Name Property = Ho, ID = 323, Attendance = Present
Object 3 with Name Property = He, ID = 456, Attendance = Present

The above are just representations of the data structures. Exclusion list is integer list and so is ID property etc. The result of my search on the Main List should return me the INDEX integer of the found object’s location within the list. In this case Return should be an integer with value 1.

Thanks

  • 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-23T16:24:34+00:00Added an answer on May 23, 2026 at 4:24 pm

    It sounds like you want something like:

    var query = list.Select((value, index) => new { value, index })
                    .Where(pair => !exclusions.Contains(pair.value.ID))
                    .Select(pair => pair.index)
    

    That will give all the matching index values; if you only want one you can use First, FirstOrDefault etc. Note that to match by name as well, you just need to extend the Where call.

    If that isn’t what you want, please clarify your question.

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

Sidebar

Related Questions

I have a list of objects which I store in the session. This list
I have a List which contains a list of objects and I want to
I have a list which will store Number objects. The list will be populated
I have a record store which holds a list of shopping items i am
I have List objects which are shown like this: www.mysite.com/lists/123 Where 123 is the
I have a list which has repeating items and I want a list of
I have a list of custom objects which I have added to a ListBox
Imagine you have a list of items which is an array of objects (fields:
I have made a LinkedList to store State objects which is a class I
I have a linked list, which stores groups of settings for my application: typedef

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.