Created
July 17, 2023 12:37
-
-
Save MichalGrzegorzak/e7def289708f82a641d9cd47944f9505 to your computer and use it in GitHub Desktop.
Reflection, cast prop to List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable items = (IEnumerable)propertyInfo.GetValue(customerObject, null); | |
object first = items.Cast<object>().FirstOrDefault(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment