Skip to content

Commit

Permalink
Add decimal FractionDigitsRestrictionModel.Value is 0 as integer
Browse files Browse the repository at this point in the history
  • Loading branch information
kronic committed Aug 8, 2023
1 parent 85289d5 commit 58dd175
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XmlSchemaClassGenerator/CodeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FractionDigitsRestrictionModel>().SingleOrDefault() is { IsSupported: true, Value: 0 } => GetIntegerDerivedType(type, configuration, restrictions),
_ => type.ValueType,
};

if (schemaType.IsDerivedFrom(GuidQualifiedName))
Expand Down

0 comments on commit 58dd175

Please sign in to comment.