A complex type is actually a structures property. It can contain zero or more properties. To create a complex type, right-click on the design view mode of your EDM and create a new entity. Then, specify the properties you require. Here is how our complex type Address looks in the designer view:
And here is how the complex type Address
is represented in the EDM:
<ComplexType Name="Address"> <Property Name="Street" Type="String" /> <Property Name="City" Type="String" /> <Property Name="PinCode" Type="String" /> <Property Name="Country" Type="String" /> <Property Name="Phone" Type="String" /> </ComplexType>
Other entities, such as Employee, can then refer to this complex type in our EDM as shown below:
<EntityType Name="Employee"> EDMcomplex type, implementing<Key> <PropertyRef Name="EmployeeID" /> </Key> <Property Name="EmployeeID" Type="Int32" Nullable="false" /> <Property Name=...