Reputation: 2061
Extension methods are a great way to extend the functionality of a type. Are there any ways similar to this which can be used to extend properties of a class without inheriting a new class.
Upvotes: 1
Views: 101
Reputation: 39946
No extension properties do not exist.
You can't do it via properties without inheriting a new class. There are only extension methods, not extension properties (it may be added at a future date). If you don't want to alter the original class you should inherit from the original class and then add your properties to the derived class.
Upvotes: 3