Extensions Property
-
hi all i want to Extend a Property for a class is there some thing like Extension Methods for properties?
-
hi all i want to Extend a Property for a class is there some thing like Extension Methods for properties?
Extension methods only work at the class level. Depending on what you want to do, you may have a couple of options. You'll either have to inherit from the class and override the property or add another property and call the base class property from it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Extension methods only work at the class level. Depending on what you want to do, you may have a couple of options. You'll either have to inherit from the class and override the property or add another property and call the base class property from it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiaki know bun unfortunately i can`t derive from desired class because it force me to change all of the project . in addition i am looking for a better solution
-
i know bun unfortunately i can`t derive from desired class because it force me to change all of the project . in addition i am looking for a better solution
reza assar wrote:
i know bun unfortunately i can`t derive from desired class because it force me to change all of the project
Sounds like the requirements and specs changed after development started. You really have to plan ahread for these things.
reza assar wrote:
in addition i am looking for a better solution
You don't have one. Extension methods cannot be attached to a property of a type, only to the type itself.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak