读代码学到新知识
1.AttributeUsage的应用(用于指定一个Attribute的应用范围)
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class DependencyAttribute : Attribute
{
..
}
2. 为方法参数设置默认值的写法
public class Man
{
public string Name;
public int Age;
public Man(string name = "123", int age = 1)
{ this.Name = name; this.Age = age; }
}