Extension method has any restriction in C #

I want to ask if extension methods add to data types in the same way as Microsoft methods, or do they have any restrictions.

This applies to experienced programmers who have found some limitations when using them.

+3
source share
3 answers

What limitations do you think? I am not particularly keen on how they were discovered, and in particular, if the extended type later receives a method with the same signature that will be silently called without warning around the extension method in general.

, , - , - .

, - , , , Microsoft , .

, - ?

+2

- , , , . .

+2

The main difference from the user's perspective is that they are also called with null references.

0
source

Source: https://habr.com/ru/post/1733840/


All Articles