You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Generate custom attributes for schema restrictions that aren't covered by standard DataAnnotations (see [below](#restriction-attributes))
21
22
* Use [`Collection<T>`](http://msdn.microsoft.com/en-us/library/ms132397.aspx) properties
22
23
(initialized in constructor and with private setter)
23
24
* Map xs:integer and derived types to the closest possible .NET type, if not possible - fall back to string. Can be overriden by explicitly defined type (int, long, or decimal)
@@ -247,35 +248,6 @@ var generator = new Generator
247
248
};
248
249
```
249
250
250
-
### Metadata attributes
251
-
252
-
When `EmitMetadataAttributes` is enabled, the generator emits custom attributes for XML schema restrictions that aren't covered by standard DataAnnotations. For example, `xs:fractionDigits` becomes `FractionDigitsAttribute`:
The attribute definition is automatically generated in the specified namespace. If not specified, the default namespace is `XmlSchemaClassGenerator.Metadata`.
278
-
279
251
### Mapping xsd files to C# namespaces
280
252
281
253
Using the optional `|` syntax of the `-n` command line option you can map individual xsd files to C# namespaces. If you have several input files using the same XML namespace you can still generate an individual C# namespace for the types defined within a single xsd file. For example, if you have two input files `a.xsd` and `b.xsd` both of which have the same `targetNamespace` of `http://example.com/namespace` you can generate the C# namespaces `Example.NamespaceA` and `Example.NamespaceB`:
@@ -507,6 +479,12 @@ are all integer types, then the narrowest integer type will be used that can fit
507
479
508
480
Note that semantic issues might arise with this approach. For example, `DateTime` values are serialized with both date and time information included. See discussion at [#397](https://github.com/mganss/XmlSchemaClassGenerator/issues/397).
509
481
482
+
### Restriction attributes
483
+
484
+
When `EmitMetadataAttributes` is enabled, the generator emits custom attributes for XML schema restrictions that aren't covered by standard DataAnnotations. For example, `xs:fractionDigits` becomes `FractionDigitsAttribute`.
485
+
486
+
The attribute definition is automatically generated in the namespace specified through `--metadataNamespace`. If not specified, the default namespace is `XmlSchemaClassGenerator.Metadata`.
0 commit comments