From 59ba3007c9e5f8d7605345cc30d01188a98c4f72 Mon Sep 17 00:00:00 2001 From: Michael Ganss Date: Fri, 31 May 2024 17:10:10 +0200 Subject: [PATCH] Make RangeAttribute type match property type (fixes #513) --- XmlSchemaClassGenerator/TypeModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index d2e9526..de2d2cc 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -1351,7 +1351,7 @@ public IEnumerable GetRestrictionAttributes() { var rangeAttribute = new CodeAttributeDeclaration( CodeUtilities.CreateTypeReference(Attributes.Range, Configuration), - new(new CodeTypeOfExpression(minInclusive.Type)), + new(new CodeTypeOfExpression(GetReferenceFor(Namespace))), new(new CodePrimitiveExpression(minInclusive.Value)), new(new CodePrimitiveExpression(maxInclusive.Value)));