Is any way to dump objects to console / logfile build with ClaySharp in C#?
Clay is a dynamic C# type that will enable you to sculpt objects of any shape just as easily as in JavaScript or other dynamic languages. Project Link
Ex object build with Clay:
// Build a Clay object
dynamic New = new ClayFactory();
dynamic directory = New.Array(
New.Person(
FirstName: "Louis",
LastName: "Dejardin",
Aliases: new[] { "Lou" }
),
New.Person(
FirstName: "Bertrand",
LastName: "Le Roy"
).Aliases("bleroy", "boudin"),
New.Person(
FirstName: "Renaud",
LastName: "Paquay"
).Aliases("Your Scruminess", "Chef")
).Name("Some Orchard folks");
I think this might take adding a feature to Clay, as the details we are after live under a private field called
_behaviour
(a collection) inside thePropBehaviour
's private field_props
collection for properties, and also inside theArrayBehaviour
's private field_data
for Arrays.Perhaps a new
ClayBehavior
(or more likely an extension toPropBehaviour
) similar toArrayBehaviour
'sGetEnumerator
magic that lists all the properties...Update: Try this:
Sample output of the above: