摘要: 扩展方法是静态方法,必须在静态类中使用。 例子: static class CustomExtendMethod { public static int Square(this int num) { return num * num; } } 在上面的例子中,Square方法是对int类型的一个扩展 阅读全文
posted @ 2022-10-10 15:39 0724job 阅读(28) 评论(0) 推荐(0)