visual studio - Hiding VB.NET extension methods / modules -
i have library written in vb.net containing extension methods. vb.net has 2 characteristics in opinion @ odds concept of extension methods:
- extension methods must declared in module (extension methods)
- all module members @ namespace scope (type promotion)
this means extension methods either accessible @ namespace level, or not accessible @ all. doesn't make sense, because scope conceptually type extend, not namespace.
the fact method declared extension influences naming, because while global utility method might include type, getdictionaryvalueornull
, extension method can getvalueornull
because should clear declared dictionary
type. when extension methods global, can confusing: in (non-dictionary) class has getvalue
method. if type "getvalue", visual studio list both "getvalue" , "getvalueornull", making appear though current class supports both operations.
is there solution (other "write in c#")? can mark module non-global, or @ least force visual studio display extension methods when being looked extension methods?
suggestion @ visual studio user voice: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4228049-include-an-option-to-disable-the-promotion-of-scop
the obvious option move extension methods specific namespace, import when want them.
Comments
Post a Comment