C#プロパティ(Attribute)

5276 ワード


  
    
1 [AttributeUsage(AttributeTargets.Class)]///
2 public class IsDbTable:System.Attribute///
3 {
4 public string tablename{ get ; set ;}
5 public IsDbTable( string tableName)
6 {
7 this .tablename = tableName;
8 }
9 private IsDbTable() { }
10 }
11 [AttributeUsage(AttributeTargets.Property)]
12 public class IsNotDbValue : System.Attribute
13 {
14 }
15
16 [AttributeUsage(AttributeTargets.Property)]
17 public class DbFiltering:System.Attribute
18 {
19 public string FilteringRules { get ; set ; }
20 public DbFiltering( string Filteringrules)
21 {
22 this .FilteringRules = Filteringrules;
23 }
24 }
System.Attribute.GetCustomAttribute(p, typeof(IsNotDbValue))///