VS Intellisense: can you hide extension methods?

前端 未结 3 1524
花落未央
花落未央 2021-01-11 12:49

By default Visual Studio displays all members and its extension methods for a type in intellisense.

Sometimes I would like to hide the extension methods to make it e

3条回答
  •  -上瘾入骨i
    2021-01-11 13:20

    Not that I'm aware of - but one thing you might want to do is get rid of the using directive for System.Linq. At that point the extension method won't be accessible, and I believe it won't be offered by Intellisense.

    Obviously that's no good if you want to use LINQ from one bit of code in a class, but not in another - but for classes which aren't using LINQ at all, it might help you.

提交回复
热议问题