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