Skip to content

Instantly share code, notes, and snippets.

@MichalGrzegorzak
Created July 17, 2023 12:37
Show Gist options
  • Save MichalGrzegorzak/e7def289708f82a641d9cd47944f9505 to your computer and use it in GitHub Desktop.
Save MichalGrzegorzak/e7def289708f82a641d9cd47944f9505 to your computer and use it in GitHub Desktop.
Reflection, cast prop to List
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