Allow Extesion Properties
I would like to be able to write extension Properties, not only extension methods.
4 comments
-
Silvio Jeschofnik
commented
Yes, this would be great and very very useful.
-
Thaina commented
Propose syntax
public static int SomeProperty[this SomeClass obj] { get {} set{} }
public static int SomeIndexer[this SomeClass obj,int i] { get {} set{} }Yes, this can be used to make "Naming indexer"
-
Anonymous
commented
It is would be really amazing feature. I hope, VS team will give in the up coming .Net framework.
-
Carsten
commented
Absolutely. I've suggested this lately to the VsNext team, and the response was very positive.
As always has such stuff been, it's just syntactical sugar, like properties all in all are. Still:
var c1 = (new[] { "foo", "bar" }).Count;
but
var c2 = someIEnumberable.ToList().Count();
Even coders need some eye candy ;-) Thus, thumbs up thrice!