Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
❔ can't access anonymous object properties by name - C#
C
C#
•
3y ago
•
12 replies
PatrickG
❔ can't access anonymous object properties by name
in this
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/types/anonymous-types
the first example shows them instanciating new object v with amount and message properties
then they just type v
.amount to access it
but in my code i do this and pass a list of generated anonymous objects to an other class and then i cant access the properties by name anymore
help
Anonymous Types
Anonymous types in C
# encapsulate a set of read
-only properties in an object without having to explicitly define a type
. The compiler generates a name
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Can't access object attributes using X.PagedList
C
C# / help
3y ago
❔ "Invalid object name '...' "
C
C# / help
3y ago