Here is sample code
public class Foo
{
public string Data { get; set; } = "Example";
}
how can I get the default value "Example" of property Data
from typeof(Foo)
? we don't instance the class, don't change class.
I tried to find a solution from this post: C# Get property value without creating instance? but no luck.
Thanks.
Aucun commentaire:
Enregistrer un commentaire