A complex type 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 the 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>
An entity, such as Employee
, can then refer to this complex type in our EDM as shown:
<EntityType Name="Employee"> <Key> <PropertyRef Name="EmployeeID" /> </Key> <Property Name="EmployeeID" Type="Int32" Nullable="false" /> <Property Name="FirstName...