Svish Svish - 1 year ago 229
C# Question

Does C# have extension properties?

Does C# have extension properties?

For example, can I add an extension property to

which would return
ShortDatePattern + " " + LongTimePattern

Answer Source

No they do not exist in C# 3.0 and will not be added in 4.0. It's on the list of feature wants for C# so it may be added at a future date.

At this point the best you can do is GetXXX style extension methods.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download