Skip to content

Commit f3695e9

Browse files
committed
Bypass mapping 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 4b68e2b commit f3695e9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

OnTopic/Mapping/Reverse/ReverseTopicMappingService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ private async Task SetPropertyAsync(
275275
return;
276276
}
277277

278+
/*------------------------------------------------------------------------------------------------------------------------
279+
| Skip properties injected by the compiler for record types
280+
\-----------------------------------------------------------------------------------------------------------------------*/
281+
if (configuration.Property.Name is "EqualityContract") {
282+
return;
283+
}
284+
278285
/*------------------------------------------------------------------------------------------------------------------------
279286
| Handle mapping properties from referenced objects
280287
\-----------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)