Skip to content

Commit

Permalink
base64Binary and hexBinary don't work for xs:list attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ganss committed Nov 30, 2018
1 parent 3bf7663 commit cb116e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions XmlSchemaClassGenerator/CodeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ public static Type GetEffectiveType(this XmlSchemaDatatype type, GeneratorConfig
// XmlSerializer doesn't support xsd:list for elements, only for attributes:
// https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/t84dzyst(v%3dvs.100)

// Also, de/serialization fails when the XML schema type is ambiguous (DateTime -> date, datetime, or time)
// Also, de/serialization fails when the XML schema type is ambiguous
// DateTime -> date, datetime, or time
// byte[] -> hexBinary or base64Binary

if (!attribute || resultType == typeof(DateTime))
if (!attribute || resultType == typeof(DateTime) || resultType == typeof(byte[]))
resultType = typeof(string);
}

Expand Down

0 comments on commit cb116e1

Please sign in to comment.