© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
Runa

❔ Getting a value from an class in a list that is an attribute from another class

This code is an exmaple
class a{
.............
public List<b> listB { get; set; }
.............
}

public class b{
public int number { get; set; }
public string text { get; set; }
}
class a{
.............
public List<b> listB { get; set; }
.............
}

public class b{
public int number { get; set; }
public string text { get; set; }
}


I have an instance of
class a
class a
, and I want to get the string
text
text
from 1 of the objects in the list
List<b> listB
List<b> listB

how can I do that?

I'm new to OOP and making this project to get better
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ ✅ How to call a specific attribute from a getter class to another class
C#CC# / help
3y ago
accessing an instance of a class in another class
C#CC# / help
3y ago
❔ Getting documentation from another class and putting it in another one
C#CC# / help
3y ago