Skip to content

Commit ca8d542

Browse files
author
Michael Ganss
committed
Use type names from interfaces for properties in implementing classes
1 parent d76ad43 commit ca8d542

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+45124
-19
lines changed

XmlSchemaClassGenerator.Tests/XmlTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ private Assembly Compile(string name, string pattern, Generator generatorPrototy
9191
const string IS24ImmoTransferPattern = @"xsd\is24immotransfer\is24immotransfer.xsd";
9292
const string WadlPattern = @"xsd\wadl\wadl.xsd";
9393
const string ClientPattern = @"xsd\client\client.xsd";
94+
const string IataPattern = @"xsd\iata\????[^_][^_]?[^-]*.xsd";
9495

9596
[Fact, TestPriority(1)]
9697
[UseCulture("en-US")]
@@ -110,6 +111,16 @@ public void CanDeserializeSampleXml()
110111
TestSamples("Wadl", WadlPattern);
111112
Compile("IS24ImmoTransfer", IS24ImmoTransferPattern);
112113
TestSamples("IS24ImmoTransfer", IS24ImmoTransferPattern);
114+
Compile("Iata", IataPattern, new Generator
115+
{
116+
EntityFramework = true,
117+
DataAnnotationMode = DataAnnotationMode.All,
118+
NamespaceProvider = new Dictionary<NamespaceKey, string> { { new NamespaceKey(""), "XmlSchema" }, { new NamespaceKey("http://www.iata.org/IATA/EDIST/2017.2"), "Iata" } }
119+
.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "Wadl" }.NamespaceProvider.GenerateNamespace),
120+
MemberVisitor = (member, model) => { },
121+
GenerateInterfaces = true
122+
});
123+
TestSamples("Iata", IataPattern);
113124
}
114125

115126
private void TestSamples(string name, string pattern)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iata.org/IATA/EDIST/2017.2" targetNamespace="http://www.iata.org/IATA/EDIST/2017.2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.000" id="IATA2017.2">
3+
<xsd:include schemaLocation="edist_commontypes.xsd"/>
4+
<!--
5+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6+
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
7+
8+
A C K N O W L E D G E M E N T R E S P O N S E B U S I N E S S O B J E C T
9+
10+
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
11+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12+
-->
13+
<xsd:element name="Acknowledgement">
14+
<xsd:annotation>
15+
<xsd:documentation source="DESCRIPTION" xml:lang="en">The Acknowledgement document is a simple notification from party to party acknowledging the receipt of another transaction such as an inventory release or an updated order
16+
17+
It may also provide information indicating the status of the document.
18+
19+
This document is used consistently as an optional response to a notification transaction.</xsd:documentation>
20+
</xsd:annotation>
21+
<xsd:complexType>
22+
<xsd:sequence>
23+
<xsd:element ref="Document"/>
24+
<xsd:element name="StatusCode" type="CodesetValueSimpleType" minOccurs="0">
25+
<xsd:annotation>
26+
<xsd:documentation>Status Code. Example: OK</xsd:documentation>
27+
</xsd:annotation>
28+
</xsd:element>
29+
<xsd:element name="StatusMessage" type="ShortDescSimpleType" minOccurs="0">
30+
<xsd:annotation>
31+
<xsd:documentation>Status Message.</xsd:documentation>
32+
</xsd:annotation>
33+
</xsd:element>
34+
</xsd:sequence>
35+
<xsd:attributeGroup ref="IATA_PayloadStdAttributes"/>
36+
</xsd:complexType>
37+
</xsd:element>
38+
</xsd:schema>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iata.org/IATA/EDIST/2017.2" targetNamespace="http://www.iata.org/IATA/EDIST/2017.2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="4.001" id="IATA2017.2">
3+
<xsd:include schemaLocation="edist_commontypes.xsd"/>
4+
<xsd:include schemaLocation="aidm_commontypes.xsd"/>
5+
<!--
6+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7+
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
8+
A I R D O C U M E N T D I S P L A Y R E Q U E S T B U S I N E S S O B J E C T
9+
= / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / = / =
10+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
11+
-->
12+
<xsd:element name="AirDocDisplayRQ">
13+
<xsd:annotation>
14+
<xsd:documentation source="DESCRIPTION" xml:lang="en">The AirDocDisplay transaction set requests an Airline to return flight (ET) and/or ancillary (EMD) document details.</xsd:documentation>
15+
</xsd:annotation>
16+
<xsd:complexType>
17+
<xsd:sequence>
18+
<xsd:element ref="PointOfSale" minOccurs="0"/>
19+
<xsd:element ref="Document"/>
20+
<xsd:element ref="Party"/>
21+
<xsd:element name="Query">
22+
<xsd:annotation>
23+
<xsd:documentation>Air Document Display Request Query.</xsd:documentation>
24+
</xsd:annotation>
25+
<xsd:complexType>
26+
<xsd:sequence>
27+
<xsd:element name="DisplayCriteria" minOccurs="0">
28+
<xsd:annotation>
29+
<xsd:documentation>Used to specify they types of documents to display when requested by other than the ticket/document number.</xsd:documentation>
30+
</xsd:annotation>
31+
<xsd:complexType>
32+
<xsd:attribute name="ET_OnlyInd" type="xsd:boolean" use="optional">
33+
<xsd:annotation>
34+
<xsd:documentation>If true, only display electronic tickets.</xsd:documentation>
35+
</xsd:annotation>
36+
</xsd:attribute>
37+
<xsd:attribute name="EMD_OnlyInd" type="xsd:boolean" use="optional">
38+
<xsd:annotation>
39+
<xsd:documentation>When true, only display EMDs.</xsd:documentation>
40+
</xsd:annotation>
41+
</xsd:attribute>
42+
</xsd:complexType>
43+
</xsd:element>
44+
<xsd:element name="Flight" minOccurs="0">
45+
<xsd:annotation>
46+
<xsd:documentation>Flight information for which a ticket/document is requested.</xsd:documentation>
47+
</xsd:annotation>
48+
<xsd:complexType>
49+
<xsd:sequence>
50+
<xsd:element ref="AirlineID"/>
51+
<xsd:element ref="FlightNumber"/>
52+
<xsd:element ref="DepartureDate"/>
53+
<xsd:element ref="DepartureCode"/>
54+
<xsd:element ref="ArrivalCode"/>
55+
</xsd:sequence>
56+
</xsd:complexType>
57+
</xsd:element>
58+
<xsd:element name="TicketDocument" type="TicketDocumentType" minOccurs="0" maxOccurs="unbounded">
59+
<xsd:annotation>
60+
<xsd:documentation>The ticket/document number to be displayed.</xsd:documentation>
61+
</xsd:annotation>
62+
</xsd:element>
63+
<xsd:element name="OrderID" type="CouponOrderKeyType" minOccurs="0">
64+
<xsd:annotation>
65+
<xsd:documentation>The order id for which a ticket/document is requested.</xsd:documentation>
66+
</xsd:annotation>
67+
</xsd:element>
68+
<xsd:element name="FQTV" type="TravelerFQTV_Type" minOccurs="0">
69+
<xsd:annotation>
70+
<xsd:documentation>The frequent flier information for which a ticket/document is requested.</xsd:documentation>
71+
</xsd:annotation>
72+
</xsd:element>
73+
<xsd:element name="FOID" type="TravelerFOID_Type" minOccurs="0">
74+
<xsd:annotation>
75+
<xsd:documentation>Passenger check in information for which a ticket/document is requested.</xsd:documentation>
76+
</xsd:annotation>
77+
</xsd:element>
78+
<xsd:element ref="BookingReferences" minOccurs="0"/>
79+
<xsd:element name="DataLists" minOccurs="0">
80+
<xsd:complexType>
81+
<xsd:annotation>
82+
<xsd:documentation source="description" xml:lang="en">Common NDC Data List choices.</xsd:documentation>
83+
</xsd:annotation>
84+
<xsd:sequence>
85+
<xsd:element name="PassengerList" minOccurs="0">
86+
<xsd:annotation>
87+
<xsd:documentation>Passenger data list definition.</xsd:documentation>
88+
</xsd:annotation>
89+
<xsd:complexType>
90+
<xsd:sequence>
91+
<xsd:element name="Passenger" type="PassengerType" maxOccurs="unbounded">
92+
<xsd:annotation>
93+
<xsd:documentation>Any person except members of the crew carried or to be carried with the consent of the carrier, on board of any transport vehicle such as aircraft, train, bus, ship.</xsd:documentation>
94+
</xsd:annotation>
95+
</xsd:element>
96+
</xsd:sequence>
97+
</xsd:complexType>
98+
</xsd:element>
99+
<xsd:element name="ContactList" minOccurs="0">
100+
<xsd:annotation>
101+
<xsd:documentation>Contact data list definition.</xsd:documentation>
102+
</xsd:annotation>
103+
<xsd:complexType>
104+
<xsd:sequence>
105+
<xsd:element name="ContactInformation" type="ContactInformationType" maxOccurs="unbounded">
106+
<xsd:annotation>
107+
<xsd:documentation>The electronic or geographic address which a party has provided as the contact channel. For example, contact email, contact postal address, contact phone number.</xsd:documentation>
108+
</xsd:annotation>
109+
</xsd:element>
110+
</xsd:sequence>
111+
</xsd:complexType>
112+
</xsd:element>
113+
</xsd:sequence>
114+
</xsd:complexType>
115+
</xsd:element>
116+
</xsd:sequence>
117+
</xsd:complexType>
118+
</xsd:element>
119+
</xsd:sequence>
120+
<xsd:attributeGroup ref="IATA_PayloadStdAttributes"/>
121+
</xsd:complexType>
122+
</xsd:element>
123+
</xsd:schema>

0 commit comments

Comments
 (0)