@@ -6,6 +6,7 @@ namespace Thinktecture.CodeAnalysis;
66 public bool HasJsonConverterAttribute { get ; }
77 public bool HasNewtonsoftJsonConverterAttribute { get ; }
88 public bool HasMessagePackFormatterAttribute { get ; }
9+ public bool HasProtoContractAttribute { get ; }
910 public ImmutableArray < DesiredFactory > DesiredFactories { get ; }
1011 public ValidationErrorState ValidationError { get ; }
1112 public string ? KeyMemberComparerAccessor { get ; }
@@ -16,6 +17,7 @@ private AttributeInfo(
1617 bool hasJsonConverterAttribute ,
1718 bool hasNewtonsoftJsonConverterAttribute ,
1819 bool hasMessagePackFormatterAttribute ,
20+ bool hasProtoContractAttribute ,
1921 ImmutableArray < DesiredFactory > desiredFactories ,
2022 ValidationErrorState validationError ,
2123 string ? keyMemberComparerAccessor ,
@@ -25,6 +27,7 @@ private AttributeInfo(
2527 HasJsonConverterAttribute = hasJsonConverterAttribute ;
2628 HasNewtonsoftJsonConverterAttribute = hasNewtonsoftJsonConverterAttribute ;
2729 HasMessagePackFormatterAttribute = hasMessagePackFormatterAttribute ;
30+ HasProtoContractAttribute = hasProtoContractAttribute ;
2831 DesiredFactories = desiredFactories ;
2932 ValidationError = validationError ;
3033 KeyMemberComparerAccessor = keyMemberComparerAccessor ;
@@ -37,6 +40,7 @@ private AttributeInfo(
3740 var hasJsonConverterAttribute = false ;
3841 var hasNewtonsoftJsonConverterAttribute = false ;
3942 var hasMessagePackFormatterAttribute = false ;
43+ var hasProtoContractAttribute = false ;
4044 var validationError = ValidationErrorState . Default ;
4145 var valueObjectFactories = ImmutableArray < DesiredFactory > . Empty ;
4246 string ? keyMemberComparerAccessor = null ;
@@ -64,6 +68,10 @@ private AttributeInfo(
6468 {
6569 hasMessagePackFormatterAttribute = true ;
6670 }
71+ else if ( attribute . AttributeClass . IsProtoContractAttribute ( ) )
72+ {
73+ hasProtoContractAttribute = true ;
74+ }
6775 else if ( attribute . AttributeClass . IsValueObjectFactoryAttribute ( ) )
6876 {
6977 var useForSerialization = attribute . FindUseForSerialization ( ) ;
@@ -102,6 +110,7 @@ private AttributeInfo(
102110 hasJsonConverterAttribute ,
103111 hasNewtonsoftJsonConverterAttribute ,
104112 hasMessagePackFormatterAttribute ,
113+ hasProtoContractAttribute ,
105114 valueObjectFactories ,
106115 validationError ,
107116 keyMemberComparerAccessor ,
@@ -120,6 +129,7 @@ public bool Equals(AttributeInfo other)
120129 && HasJsonConverterAttribute == other . HasJsonConverterAttribute
121130 && HasNewtonsoftJsonConverterAttribute == other . HasNewtonsoftJsonConverterAttribute
122131 && HasMessagePackFormatterAttribute == other . HasMessagePackFormatterAttribute
132+ && HasProtoContractAttribute == other . HasProtoContractAttribute
123133 && DesiredFactories . SequenceEqual ( other . DesiredFactories )
124134 && ValidationError . Equals ( other . ValidationError )
125135 && KeyMemberComparerAccessor == other . KeyMemberComparerAccessor
@@ -134,6 +144,7 @@ public override int GetHashCode()
134144 hashCode = ( hashCode * 397 ) ^ HasJsonConverterAttribute . GetHashCode ( ) ;
135145 hashCode = ( hashCode * 397 ) ^ HasNewtonsoftJsonConverterAttribute . GetHashCode ( ) ;
136146 hashCode = ( hashCode * 397 ) ^ HasMessagePackFormatterAttribute . GetHashCode ( ) ;
147+ hashCode = ( hashCode * 397 ) ^ HasProtoContractAttribute . GetHashCode ( ) ;
137148 hashCode = ( hashCode * 397 ) ^ DesiredFactories . ComputeHashCode ( ) ;
138149 hashCode = ( hashCode * 397 ) ^ ValidationError . GetHashCode ( ) ;
139150 hashCode = ( hashCode * 397 ) ^ ( KeyMemberComparerAccessor ? . GetHashCode ( ) ?? 0 ) ;
0 commit comments