Is there a performance hit for creating Extension methods that operate off the type 'object'?

前端 未结 4 838
我在风中等你
我在风中等你 2020-12-03 07:03

I have a set of extension methods that I regularly use for various UI tasks. I typically define them to run off of type object, even though inside of them I\'m

4条回答
  •  清歌不尽
    2020-12-03 07:38

    What overhead is associated with an extension method at runtime? (.NET) answers your question I think. Extension methods are just static methods, so they do not belong on the Object type. Intellisense only makes it seem so.

提交回复
热议问题