@@ -1738,7 +1738,7 @@ public SQLiteConnectionString(string databasePath, SQLiteOpenFlags openFlags = S
17381738 }
17391739}
17401740
1741- [ AttributeUsage ( AttributeTargets . Class ) ]
1741+ [ AttributeUsage ( AttributeTargets . Class | AttributeTargets . Struct ) ]
17421742public class TableAttribute ( string name ) : Attribute {
17431743 public string Name { get ; set ; } = name ;
17441744
@@ -1749,47 +1749,46 @@ public class TableAttribute(string name) : Attribute {
17491749 public bool WithoutRowId { get ; set ; }
17501750}
17511751
1752- [ AttributeUsage ( AttributeTargets . Property ) ]
1752+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17531753public class ColumnAttribute ( string name ) : Attribute {
17541754 public string Name { get ; set ; } = name ;
17551755}
17561756
1757- [ AttributeUsage ( AttributeTargets . Property ) ]
1757+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17581758public class PrimaryKeyAttribute : Attribute {
17591759}
17601760
1761- [ AttributeUsage ( AttributeTargets . Property ) ]
1761+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17621762public class AutoIncrementAttribute : Attribute {
17631763}
17641764
1765- [ AttributeUsage ( AttributeTargets . Property , AllowMultiple = true ) ]
1765+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field , AllowMultiple = true ) ]
17661766public class IndexedAttribute : Attribute {
17671767 public string ? Name { get ; set ; }
17681768 public int Order { get ; set ; }
17691769 public virtual bool Unique { get ; set ; }
17701770
17711771 public IndexedAttribute ( ) {
17721772 }
1773-
17741773 public IndexedAttribute ( string name , int order ) {
17751774 Name = name ;
17761775 Order = order ;
17771776 }
17781777}
17791778
1780- [ AttributeUsage ( AttributeTargets . Property ) ]
1779+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17811780public class IgnoreAttribute : Attribute {
17821781}
17831782
1784- [ AttributeUsage ( AttributeTargets . Property ) ]
1783+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17851784public class UniqueAttribute : IndexedAttribute {
17861785 public override bool Unique {
17871786 get => true ;
17881787 set => throw new InvalidOperationException ( ) ;
17891788 }
17901789}
17911790
1792- [ AttributeUsage ( AttributeTargets . Property ) ]
1791+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
17931792public class MaxLengthAttribute ( int length ) : Attribute {
17941793 public int Value { get ; } = length ;
17951794}
@@ -1799,16 +1798,16 @@ public class MaxLengthAttribute(int length) : Attribute {
17991798/// "BINARY", "NOCASE", and "RTRIM" are supported.
18001799/// "BINARY" is the default.
18011800/// </summary>
1802- [ AttributeUsage ( AttributeTargets . Property ) ]
1801+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
18031802public class CollationAttribute ( string collation ) : Attribute {
18041803 public string Value { get ; } = collation ;
18051804}
18061805
1807- [ AttributeUsage ( AttributeTargets . Property ) ]
1806+ [ AttributeUsage ( AttributeTargets . Property | AttributeTargets . Field ) ]
18081807public class NotNullAttribute : Attribute {
18091808}
18101809
1811- [ AttributeUsage ( AttributeTargets . Enum ) ]
1810+ [ AttributeUsage ( AttributeTargets . Enum | AttributeTargets . Field ) ]
18121811public class StoreAsTextAttribute : Attribute {
18131812}
18141813
0 commit comments