VB.NET: impossible to use Extension method on System.Object instance

后端 未结 6 1045
南方客
南方客 2020-12-03 09:49

Can I make an Extension method for all the subclasses of System.Object (everything)?

Example:


Public Function MyExtens         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 10:14

    If you do too many extensions on object intellisence might become less useful, but it's perfectly valid.

    Here's an example of an extension method on object for object information:

    http://www.developer.com/net/csharp/article.php/3718806/NET-Tip-Using-Extension-Methods.htm

提交回复
热议问题