In visual studio, is there a way to "serialize" an object to object-literal c# notation like you can serialize an object to json? I have numerous data objects that I currently get from a database that I would like to convert to literal objects to that I can include them in unit tests without relying on a database.
For example, if I have an instance of MyClass in memory, which has string properties Prop1, Prop2,... PropN, I'd like to serialize it to a string that looks like this c#:
var myClass1 = new MyClass(){
Prop1 = "value 1",
Prop2 = "value 2",
...
PropN = "value n"
};