Skip to content

Commit 4b68e2b

Browse files
committed
Bypass validation of the EqualityContract property
On C# 9.0 `record` types, the `EqualityContract` property is generated by the compiler, but it is not intended to be mapped by `ReverseTopicMappingService`.
1 parent 5950ec1 commit 4b68e2b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

OnTopic/Mapping/Reverse/BindingModelValidator.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ static internal void ValidateProperty(
173173
return;
174174
}
175175

176+
/*------------------------------------------------------------------------------------------------------------------------
177+
| Skip properties injected by the compiler for record types
178+
\-----------------------------------------------------------------------------------------------------------------------*/
179+
if (configuration.Property.Name is "EqualityContract") {
180+
return;
181+
}
182+
176183
/*------------------------------------------------------------------------------------------------------------------------
177184
| Handle mapping properties from referenced objects
178185
\-----------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)