C#中this用法
查看mvc的源代码,看到这种写法
- C# code
public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, object routeValues, AjaxOptions ajaxOptions) { return RouteLink(ajaxHelper, linkText, null /* routeName */, new RouteValueDictionary(routeValues), ajaxOptions, new Dictionary<string, object>()); }
我想知道参数中的this为什么那么写?
谢谢!!!
[解决办法]
这是扩展方法。
你可以查阅MSDN,输入扩展方法,或者Extend Method。
[解决办法]
http://msdn.microsoft.com/zh-cn/library/bb383977.aspx