Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

325 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="NorthwindEFModel.Store" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl"
Provider="SampleEntityFrameworkProvider" ProviderManifestToken="2008">
<EntityContainer Name="dbo">
<EntitySet Name="Employees" EntityType="NorthwindEFModel.Store.Employees" />
<EntitySet Name="Regions" EntityType="NorthwindEFModel.Store.Regions" />
<EntitySet Name="Customers" EntityType="NorthwindEFModel.Store.Customers"/>
<EntitySet Name="Categories" EntityType="NorthwindEFModel.Store.Categories" />
<EntitySet Name="OrderDetails" EntityType="NorthwindEFModel.Store.OrderDetails" />
<EntitySet Name="Suppliers" EntityType="NorthwindEFModel.Store.Suppliers" />
<EntitySet Name="Territories" EntityType="NorthwindEFModel.Store.Territories" />
<EntitySet Name="EmployeesTerritories" EntityType="NorthwindEFModel.Store.EmployeeTerritories" />
<EntitySet Name="PreviousEmployees" EntityType="NorthwindEFModel.Store.PreviousEmployees">
<DefiningQuery>
SELECT [EmployeeID],[LastName],[FirstName],[Title],[TitleOfCourtesy],[BirthDate],[HireDate],[Address],[City],[Region],[PostalCode]
,[Country],[HomePhone],[Extension],[Photo],[Notes],[PhotoPath],[Location]
FROM [dbo].[PreviousEmployees]
</DefiningQuery>
</EntitySet>
<!-- TPH -->
<EntitySet Name="Products" EntityType="NorthwindEFModel.Store.Products" />
<!-- TPT -->
<EntitySet Name="Orders" EntityType="NorthwindEFModel.Store.Orders" />
<EntitySet Name="InternationalOrders" EntityType="NorthwindEFModel.Store.InternationalOrders" />
</EntityContainer>
<EntityType Name="Employees">
<Key>
<PropertyRef Name="EmployeeID" />
</Key>
<Property Name="EmployeeID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="LastName" Type="nvarchar" Nullable="false" MaxLength="20" />
<Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
<Property Name="Title" Type="nvarchar" MaxLength="30" />
<Property Name="TitleOfCourtesy" Type="nvarchar" MaxLength="25" />
<Property Name="BirthDate" Type="datetime" />
<Property Name="HireDate" Type="datetime" />
<Property Name="Address" Type="nvarchar" MaxLength="60" />
<Property Name="City" Type="nvarchar" MaxLength="15" />
<Property Name="Region" Type="nvarchar" MaxLength="15" />
<Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="Country" Type="nvarchar" MaxLength="15" />
<Property Name="HomePhone" Type="nvarchar" MaxLength="24" />
<Property Name="Extension" Type="nvarchar" MaxLength="4" />
<Property Name="Photo" Type="image" />
<Property Name="Notes" Type="ntext" />
<Property Name="PhotoPath" Type="nvarchar" MaxLength="255" />
<Property Name="Location" Type="geography" />
</EntityType>
<EntityType Name="PreviousEmployees">
<Key>
<PropertyRef Name="EmployeeID" />
</Key>
<Property Name="EmployeeID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="LastName" Type="nvarchar" Nullable="false" MaxLength="20" />
<Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
<Property Name="Title" Type="nvarchar" MaxLength="30" />
<Property Name="TitleOfCourtesy" Type="nvarchar" MaxLength="25" />
<Property Name="BirthDate" Type="datetime" />
<Property Name="HireDate" Type="datetime" />
<Property Name="Address" Type="nvarchar" MaxLength="60" />
<Property Name="City" Type="nvarchar" MaxLength="15" />
<Property Name="Region" Type="nvarchar" MaxLength="15" />
<Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="Country" Type="nvarchar" MaxLength="15" />
<Property Name="HomePhone" Type="nvarchar" MaxLength="24" />
<Property Name="Extension" Type="nvarchar" MaxLength="4" />
<Property Name="Photo" Type="image" />
<Property Name="Notes" Type="ntext" />
<Property Name="PhotoPath" Type="nvarchar" MaxLength="255" />
<Property Name="Location" Type="geography" />
</EntityType>
<EntityType Name="EmployeeTerritories">
<Key>
<PropertyRef Name="EmployeeID" />
<PropertyRef Name="TerritoryID" />
</Key>
<Property Name="EmployeeID" Type="int" Nullable="false" />
<Property Name="TerritoryID" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="Territories">
<Key>
<PropertyRef Name="TerritoryID" />
</Key>
<Property Name="TerritoryID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="TerritoryDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
<Property Name="RegionID" Type="int" Nullable="false" />
</EntityType>
<EntityType Name="Regions">
<Key>
<PropertyRef Name="RegionID" />
</Key>
<Property Name="RegionID" Type="int" Nullable="false" />
<Property Name="RegionDescription" Type="nvarchar" Nullable="false" MaxLength="50" />
</EntityType>
<!-- Order Details Table -->
<EntityType Name="OrderDetails">
<Key>
<PropertyRef Name="OrderID" />
<PropertyRef Name="ProductID" />
</Key>
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="ProductID" Type="int" Nullable="false" />
<Property Name="UnitPrice" Type="money" Nullable="false" />
<Property Name="Quantity" Type="smallint" Nullable="false" />
<Property Name="Discount" Type="real" Nullable="false" />
</EntityType>
<!-- Customers Table -->
<EntityType Name="Customers">
<Key>
<PropertyRef Name="CustomerID" />
</Key>
<Property Name="CustomerID" Type="nchar" Nullable="false" MaxLength="5" />
<Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
<Property Name="ContactName" Type="nvarchar" MaxLength="30" />
<Property Name="ContactTitle" Type="nvarchar" MaxLength="30" />
<Property Name="Address" Type="nvarchar" MaxLength="60" />
<Property Name="City" Type="nvarchar" MaxLength="15" />
<Property Name="Region" Type="nvarchar" MaxLength="15" />
<Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="Country" Type="nvarchar" MaxLength="15" />
<Property Name="Phone" Type="nvarchar" MaxLength="24" />
<Property Name="Fax" Type="nvarchar" MaxLength="24" />
<Property Name="Location" Type="geography" />
</EntityType>
<!-- Products Table -->
<EntityType Name="Products">
<Key>
<PropertyRef Name="ProductID" />
</Key>
<Property Name="ProductID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="ProductName" Type="nvarchar" Nullable="false" MaxLength="40" />
<Property Name="SupplierID" Type="int" />
<Property Name="CategoryID" Type="int" />
<Property Name="QuantityPerUnit" Type="nvarchar" MaxLength="20" />
<Property Name="UnitPrice" Type="money" />
<Property Name="UnitsInStock" Type="smallint" />
<Property Name="UnitsOnOrder" Type="smallint" />
<Property Name="ReorderLevel" Type="smallint" />
<Property Name="Discontinued" Type="bit" Nullable="false" />
<Property Name="DiscontinuedDate" Type="datetime" />
</EntityType>
<!-- International Orders Table -->
<EntityType Name="InternationalOrders" >
<Key>
<PropertyRef Name="OrderID" />
</Key>
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="CustomsDescription" Type="nvarchar" Nullable="false" MaxLength="100" />
<Property Name="ExciseTax" Type="money" Nullable="false" />
</EntityType>
<!-- Orders Table -->
<EntityType Name="Orders">
<Key>
<PropertyRef Name="OrderID" />
</Key>
<Property Name="OrderID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="CustomerID" Type="nchar" MaxLength="5" />
<Property Name="EmployeeID" Type="int" />
<Property Name="OrderDate" Type="datetime" />
<Property Name="RequiredDate" Type="datetime" />
<Property Name="ShippedDate" Type="datetime" />
<Property Name="Freight" Type="money" />
<Property Name="ShipName" Type="nvarchar" MaxLength="40" />
<Property Name="ShipAddress" Type="nvarchar" MaxLength="60" />
<Property Name="ShipCity" Type="nvarchar" MaxLength="15" />
<Property Name="ShipRegion" Type="nvarchar" MaxLength="15" />
<Property Name="ShipPostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="ShipCountry" Type="nvarchar" MaxLength="15" />
<Property Name="ShipLocation" Type="geography" />
<Property Name="ContainerSize" Type="geometry" />
<Property Name="ShippingStatus" Type="int" />
</EntityType>
<!-- Categories Table -->
<EntityType Name="Categories">
<Key>
<PropertyRef Name="CategoryID" />
</Key>
<Property Name="CategoryID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="CategoryName" Type="nvarchar" Nullable="false" MaxLength="15" />
<Property Name="Description" Type="nvarchar(max)" />
<Property Name="Picture" Type="varbinary(max)" />
</EntityType>
<!-- Suppliers Table -->
<EntityType Name="Suppliers">
<Key>
<PropertyRef Name="SupplierID" />
</Key>
<Property Name="SupplierID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
<Property Name="ContactName" Type="nvarchar" MaxLength="30" />
<Property Name="ContactTitle" Type="nvarchar" MaxLength="30" />
<Property Name="Address" Type="nvarchar" MaxLength="60" />
<Property Name="City" Type="nvarchar" MaxLength="15" />
<Property Name="Region" Type="nvarchar" MaxLength="15" />
<Property Name="PostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="Country" Type="nvarchar" MaxLength="15" />
<Property Name="Phone" Type="nvarchar" MaxLength="24" />
<Property Name="Fax" Type="nvarchar" MaxLength="24" />
<Property Name="HomePage" Type="ntext" />
<Property Name="Location" Type="geography" />
</EntityType>
<!-- Functions -->
<Function Name="EmployeesDelete" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="EmployeeID" Type="int" Mode="In" />
</Function>
<Function Name="EmployeesGet" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
<Function Name="EmployeesInsert" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="LastName" Type="nvarchar" Mode="In" />
<Parameter Name="FirstName" Type="nvarchar" Mode="In" />
<Parameter Name="Title" Type="nvarchar" Mode="In" />
<Parameter Name="TitleOfCourtesy" Type="nvarchar" Mode="In" />
<Parameter Name="BirthDate" Type="datetime" Mode="In" />
<Parameter Name="HireDate" Type="datetime" Mode="In" />
<Parameter Name="Address" Type="nvarchar" Mode="In" />
<Parameter Name="City" Type="nvarchar" Mode="In" />
<Parameter Name="Region" Type="nvarchar" Mode="In" />
<Parameter Name="PostalCode" Type="nvarchar" Mode="In" />
<Parameter Name="Country" Type="nvarchar" Mode="In" />
<Parameter Name="HomePhone" Type="nvarchar" Mode="In" />
<Parameter Name="Extension" Type="nvarchar" Mode="In" />
<Parameter Name="Photo" Type="image" Mode="In" />
<Parameter Name="Notes" Type="ntext" Mode="In" />
<Parameter Name="PhotoPath" Type="nvarchar" Mode="In" />
<Parameter Name="Location" Type="geography" Mode="In" />
</Function>
<Function Name="EmployeesUpdate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="EmployeeID" Type="int" Mode="In" />
<Parameter Name="LastName" Type="nvarchar" Mode="In" />
<Parameter Name="FirstName" Type="nvarchar" Mode="In" />
<Parameter Name="Title" Type="nvarchar" Mode="In" />
<Parameter Name="TitleOfCourtesy" Type="nvarchar" Mode="In" />
<Parameter Name="BirthDate" Type="datetime" Mode="In" />
<Parameter Name="HireDate" Type="datetime" Mode="In" />
<Parameter Name="Address" Type="nvarchar" Mode="In" />
<Parameter Name="City" Type="nvarchar" Mode="In" />
<Parameter Name="Region" Type="nvarchar" Mode="In" />
<Parameter Name="PostalCode" Type="nvarchar" Mode="In" />
<Parameter Name="Country" Type="nvarchar" Mode="In" />
<Parameter Name="HomePhone" Type="nvarchar" Mode="In" />
<Parameter Name="Extension" Type="nvarchar" Mode="In" />
<Parameter Name="Photo" Type="image" Mode="In" />
<Parameter Name="Notes" Type="ntext" Mode="In" />
<Parameter Name="PhotoPath" Type="nvarchar" Mode="In" />
<Parameter Name="Location" Type="geography" Mode="In" />
</Function>
<!-- This null function is used in situations where we don't want to provide update functionality, but are required to provide a function -->
<Function Name="NullFunction" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
<!-- TVFs-->
<Function Name="fx_CustomerLocationForCountry" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="country" Type="nvarchar" Mode="In" />
<ReturnType>
<CollectionType>
<RowType>
<Property Name="Location" Type="geography" />
</RowType>
</CollectionType>
</ReturnType>
</Function>
<Function Name="fx_OrdersForShippingStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="shippingStatus" Type="int" Mode="In" />
<ReturnType>
<CollectionType>
<RowType>
<Property Name="OrderID" Type="int" Nullable="false" />
<Property Name="CustomerID" Type="nchar" MaxLength="5" />
<Property Name="EmployeeID" Type="int" />
<Property Name="OrderDate" Type="datetime" />
<Property Name="RequiredDate" Type="datetime" />
<Property Name="ShippedDate" Type="datetime" />
<Property Name="Freight" Type="money" />
<Property Name="ShipName" Type="nvarchar" MaxLength="40" />
<Property Name="ShipAddress" Type="nvarchar" MaxLength="60" />
<Property Name="ShipCity" Type="nvarchar" MaxLength="15" />
<Property Name="ShipRegion" Type="nvarchar" MaxLength="15" />
<Property Name="ShipPostalCode" Type="nvarchar" MaxLength="10" />
<Property Name="ShipCountry" Type="nvarchar" MaxLength="15" />
<Property Name="ShipLocation" Type="geography" />
<Property Name="ContainerSize" Type="geometry" />
<Property Name="ShippingStatus" Type="int" />
</RowType>
</CollectionType>
</ReturnType>
</Function>
<Function Name="fx_SuppliersWithinRange" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="miles" Type="int" Mode="In" />
<Parameter Name="location" Type="geography" Mode="In" />
<ReturnType>
<CollectionType>
<RowType>
<Property Name="SupplierID" Type="int" Nullable="false" />
<Property Name="CompanyName" Type="nvarchar" Nullable="false" MaxLength="40" />
<Property Name="Location" Type="geography" />
</RowType>
</CollectionType>
</ReturnType>
</Function>
<!-- Stored Procedure that returns multiple results sets-->
<Function Name="Customer With Recent Orders" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
<Parameter Name="CustomerID" Type="nchar" Mode="In" />
</Function>
</Schema>