扩展方法和静态方法有什么区别?扩展方法和静态方法有什么区别?
我有两个类是这样的:
public static class AClass {
public static int AMethod(string ....)
{
}
}
和
public static class BClass {
public static int BMethod(this string ....)
{
}
}
我可以用这些像
AClass.AMethod('...');
或
'...'.BMethod();
哪个建议?
非常好(一如既往),里德。 +1 – Brian