robsCode
  • Home
  • About
  • Privacy Policy
Sign in Subscribe

Reflection

A collection of 1 post
C#

[C#] Get fields of a class object dynamically

I found a nice way to get all fields of a class object dynamically. My example is a simple class holding only parameters: Note that I used auto-properties (shorthand for declaration and a get/set method). public class MySimpleClass { public string StringVal1 { get; set; } public string StringVal2 { get; set; } public
Mar 17, 2015 1 min read
Page 1 of 1
robsCode © 2023
  • Sign up
Powered by Ghost