标签:io ar sp on cti ad line new as
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
public class Student
{
public string name;
public string age;
}
public static class ExtentionMethod
{
public static Student Add(this Student str)
{
Student stu=str;
stu.name="aa";
stu.age="11";
return stu;
}
}
class Program
{
static void Main(string[] args)
{
Student stu = new Student();
stu = stu.Add();
Console.WriteLine(stu.age);
}
}
}
标签:io ar sp on cti ad line new as
原文地址:http://www.cnblogs.com/lanhaipeng/p/4031957.html