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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:10:06+00:00 2026-06-11T15:10:06+00:00

I have a List <customClass >. The custom class contains two members that, together,

  • 0

I have a List<customClass>.

The custom class contains two members that, together, form a pseudo composite key.

I want to be able to write to each instance of the custom class multiple times (“stepwise population” — a couple of members assigned values at one point, then a couple more members assigned values at a later point, etc.).

When saving data to this List<T>, I want to be able to locate the particular instance I am about to partially populate, if it has already been instantiated.

For example, let’s say the “pseudo composite key” is:

class.member1 == "a"
class.member2 == "42"

I want to search to see if there already is an instance of my custom class with those values and, if so, use it; otherwise, create a new instance of that class to add to the List<T>.

Is there a way to locate that particular instance of the custom class so that I can then assign members to as-yet unassigned members of that instance?

The reason I need to do this is that at the time of saving values (before they “go away”) some but probably not all of the values of many if not all of the custom class instances are known; the next time a save is made, other parts of those same class instances are known and must be added to existing class instances; etc.

  • 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-11T15:10:07+00:00Added an answer on June 11, 2026 at 3:10 pm
    try {   
        var obj = list.First(x => x.Property1 == "1" && x.Property2 == "a");
    } catch {
        // Not found
    }
    
    • 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 items of a custom class. That class contains an
I have a custom class set up as a key that has two properties,
So I have a custom class Foo that has a number of members: @interface
I have a project that is using a generic list of a custom class.
I have a custom class called CustomClass. It contains a variable called Name and
I have a list of RowData items (a custom class). A RowData item contains
I have an Array list of a custom class which is essentially has two
I have a List<> in my program, filled with my custom class. I want
I have a list of my custom class Customer and I want to sort
i have list of rows that user select and i want to delete them,

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.