using System;
namespace TestMethod
{
class Program
{
static void Main(string[] args)
{
ObsoleteClass.test();
Console.ReadKey();
}
}
[Obsolete("Don't use OldMethod, use NewMethod instead", false)]
public class ObsoleteClass
{
public static void test()
{
Console.WriteLine("ObsoleteClass.test");
}
}
}
using System;
namespace BoerCloud.Core.Util
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class RecordAttribute : Attribute
{
private string _recordType;
private string _author;
private DateTime _date;
private string _apiType;
private string _desc;
public RecordAttribute(string recordType,string author,string date,string apiType,string desc)
{
this._recordType = recordType;
this._author = author;
this._date = Convert.ToDateTime(date);
this._apiType = apiType;
this._desc = desc;
}
public string RecordType { get { return _recordType; } }
public string Author { get { return _author; } }
public DateTime Date { get { return _date; } }
public string ApiType { get { return _apiType; } }
public string Desc {
get { return _desc; }
set { _desc = value; }
}
}
}
[Record("create", "ChenQP", "2016-08-09", "OpenApi", "RegisterSite")]
扩展阅读