我只是想编写以下扩展方法:扩展方法可以修改扩展类的值吗?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _4Testing
{
static class ExtensionMethods
{
public static void AssignMe(this int me, int value)
{
me = value;
}
}
}
但它不工作,我的意思是,我可以使用扩展方法来扩展从班改变值?我不想将void返回类型更改为int,只是更改扩展类的值。在此先感谢
酷布赖恩!现在让我回到我的IDE继续更改我的代码。 – 2010-09-20 13:13:31