为什么我们把"this"放在参数前面?

sah*_*arg 4 c#

例如:

public static Domain.Recruitment.Recruitment Map(this Data.Recruitment dv) 
{
 //some code
  return new Domain.Recruitment.Recruitment{} 
}
Run Code Online (Sandbox Code Playgroud)

Mic*_*urr 15

它将该方法标记为"扩展方法",可以像对象上的实例方法一样调用,并允许您"在不创建新的派生类型的情况下向现有类型添加'方法,重新编译或以其他方式修改原始类型":