In https://github.com/OpenAPITools/openapi-generator/blob/78f3b19b58df699ef883b89a7a44531407377719/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java#L530C80-L530C85 the anyOf should be oneOf in the subcondition (model.anyOf != null && model.oneOf.size() > 0), i.e. it should read (model.**oneOf** != null && model.oneOf.size() > 0).