Skip to content

Instantly share code, notes, and snippets.

@enisn
Created May 7, 2020 20:32
Show Gist options
  • Save enisn/9f95511ab3670228709fcf81dd445f98 to your computer and use it in GitHub Desktop.
Save enisn/9f95511ab3670228709fcf81dd445f98 to your computer and use it in GitHub Desktop.
Challenge #2 - Solutiont - 2
var type = user.GetType(); // find type at runtime.
var property = type.GetProperty("Email"); // Get property info with string name.
var value = property.GetValue(user); // Gets Email property value of object which placed at 'user' variable.
Console.WriteLine(value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment