3 ms·
Extension methods only apply to instances and they must be declared explicitly. This syntax can be used anywhere as long as the types signatures of the functio
by radicalbyte 11y ago
Extension methods only apply to instances and they must be declared explicitly.
This syntax can be used anywhere as long as the types signatures of the functions are conducive to the chaining.
- danbruc 11y agoNot sure what you mean with applying only to instances, in which case couldn't you use an extension method? If you own the code making a function an extension method seems not a big deal. If you want to invoke a static function you don't own the code for then you could have a generic wrapper extension method which admittedly would probably look rather clumsy and nullify the desired gain in readability.
- mateuszf 11y agoBut you have to write them before using. It's not needed in case of the discussed feature.