1064

(C#) How to get the default value of a property through reflection

So i have:public class Locking{ public Locking() { } public string LockingName { get; set; } public int LockingNr { get; set; } public DateTime LockingDate { get; set; }}than i have a functionpublic string GetFirstPropertyEqualDefaultValue(T entity, params string[] propertyNames) {...}The question is what to write instead of {...}, to obtain the first property that has its value equal with default? (Of course it's need the reflection)=============================let me explain more: I have smth like this:Type t;where t.Name equal for example "System.DateTime", now how can I write smth like this:default(t)this gives me an error, becaus I have to write:default(System.DateTime)and I don't know for the moment how to accomplish this, pls help me.
0