using extension methods on int

后端 未结 7 1324
难免孤独
难免孤独 2021-02-19 04:10

I\'m reading about extension methods, and monkeying around with them to see how they work, and I tried this:

namespace clunk {
    public static class oog {
             


        
7条回答
  •  情歌与酒
    2021-02-19 04:38

    Extension methods are exactly that—methods.
    You cannot make extension operators or properties.

    Had that been possible, it would result in very hard-to-read code.
    If you aren't familiar with the code base, it's almost impossible to figure out what if (7) means.

提交回复
热议问题