C# fields to dictionary class code example
Example: convert dto to dictionary c#
someObject.GetType()
.GetProperties(BindingFlags.Instance | BindingFlags.Public)
.ToDictionary(prop => prop.Name, prop => prop.GetValue(someObject, null))