diff --git a/XmlSchemaClassGenerator/CodeUtilities.cs b/XmlSchemaClassGenerator/CodeUtilities.cs index 88b85b7b..d7a050f7 100644 --- a/XmlSchemaClassGenerator/CodeUtilities.cs +++ b/XmlSchemaClassGenerator/CodeUtilities.cs @@ -111,7 +111,8 @@ public static Type GetEffectiveType(this XmlSchemaDatatype type, GeneratorConfig XmlTypeCode.Time => typeof(DateTime), XmlTypeCode.Idref => typeof(string), XmlTypeCode.Integer or XmlTypeCode.NegativeInteger or XmlTypeCode.NonNegativeInteger or XmlTypeCode.NonPositiveInteger or XmlTypeCode.PositiveInteger => GetIntegerDerivedType(type, configuration, restrictions), - _ => type.ValueType, + XmlTypeCode.Decimal when restrictions.OfType().SingleOrDefault() is { IsSupported: true, Value: 0 } => GetIntegerDerivedType(type, configuration, restrictions), + _ => type.ValueType, }; if (schemaType.IsDerivedFrom(GuidQualifiedName))