<?xml version="1.0" encoding="utf-8"?>
<ServiceApplication
  Name="LightSwitchServiceApplication" xmlns="http://schemas.microsoft.com/LightSwitch/2010/xaml/model">
  <ServiceApplication.Attributes>
    <Partial />
  </ServiceApplication.Attributes>
  <EntityType
    Name="Supplier">
    <EntityType.Methods>
      <EntityMethod
        Name="Delete">
        <EntityMethod.Attributes>
          <Generated />
        </EntityMethod.Attributes>
      </EntityMethod>
    </EntityType.Methods>
    <EntityType.Properties>
      <KeyProperty
        Name="SupplierID"
        IsReadOnly="True"
        PropertyType=":Int32">
        <KeyProperty.Attributes>
          <Hidden />
          <Required />
          <NotSearchable />
        </KeyProperty.Attributes>
      </KeyProperty>
      <EntityProperty
        Name="CompanyName"
        PropertyType=":String">
        <EntityProperty.Attributes>
          <Required />
          <MaxLength
            Value="40" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="ContactName"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="30" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="ContactTitle"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="30" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Address"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="60" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="City"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="15" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Region"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="15" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="PostalCode"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="10" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Country"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="15" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Phone"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="24" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Fax"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="24" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="HomePage"
        PropertyType=":String?" />
      <NavigationProperty
        Name="Products"
        Association="FK_Products_Suppliers"
        FromEnd="Suppliers"
        ToEnd="Products" />
    </EntityType.Properties>
  </EntityType>
  <Association
    Name="FK_Products_Suppliers">
    <AssociationEnd
      Name="Products"
      Multiplicity="Many"
      EntityType="Product" />
    <AssociationEnd
      Name="Suppliers"
      EntityType="Supplier">
      <AssociationEnd.Attributes>
        <DeleteRule />
      </AssociationEnd.Attributes>
    </AssociationEnd>
  </Association>
  <EntityContainer
    Name="NorthwindData">
    <EntityContainer.Attributes>
      <Partial />
    </EntityContainer.Attributes>
    <EntitySet
      Name="Suppliers"
      CanDelete="True"
      CanInsert="True"
      CanUpdate="True"
      EntityType="Supplier" />
    <AssociationSet
      Name="FK_Products_Suppliers"
      Association="FK_Products_Suppliers">
      <AssociationSetEnd
        Name="Products"
        EntitySet="Products" />
      <AssociationSetEnd
        Name="Suppliers"
        EntitySet="Suppliers" />
    </AssociationSet>
    <QueryOperation
      Name="Suppliers_Single"
      ReturnType="Supplier">
      <QueryOperation.Attributes>
        <Generated />
        <Description
          Value="Returns the entity whose identity is specified by the parameter(s)." />
      </QueryOperation.Attributes>
      <QueryOperation.FilterExpression>
        <QueryFilterExpressionTree>
          <BinaryExpression
            NodeType="Equal">
            <BinaryExpression.Left>
              <ChainExpression>
                <MemberExpression
                  Member="SupplierID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="SupplierID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Suppliers" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="SupplierID"
        ParameterType=":Int32?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'SupplierID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
    <QueryOperation
      Name="Suppliers_SingleOrDefault"
      ReturnType="Supplier">
      <QueryOperation.Attributes>
        <Generated />
        <Description
          Value="Returns the entity whose identity is specified by the parameter(s) or null if no such entity exists." />
      </QueryOperation.Attributes>
      <QueryOperation.FilterExpression>
        <QueryFilterExpressionTree>
          <BinaryExpression
            NodeType="Equal">
            <BinaryExpression.Left>
              <ChainExpression>
                <MemberExpression
                  Member="SupplierID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="SupplierID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Suppliers" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="SupplierID"
        ParameterType=":Int32?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'SupplierID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
  </EntityContainer>
  <DataService
    Name="NorthwindDataDataService">
    <DataService.Attributes>
      <Partial />
    </DataService.Attributes>
    <EntitySetMapping
      EntitySet="Suppliers">
      <EntitySetMapping.Attributes>
        <CsdlEntitySet
          EntityTypeName="Supplier"
          EntityTypeNamespace="LightSwitchApplication"
          Name="Suppliers"
          EntityType="Supplier" />
        <CsdlProperty
          Name="SupplierID"
          StoreGeneratedPattern="Identity"
          Property="Supplier/Properties[SupplierID]" />
        <CsdlProperty
          Name="CompanyName"
          Property="Supplier/Properties[CompanyName]" />
        <CsdlProperty
          Name="ContactName"
          Property="Supplier/Properties[ContactName]" />
        <CsdlProperty
          Name="ContactTitle"
          Property="Supplier/Properties[ContactTitle]" />
        <CsdlProperty
          Name="Address"
          Property="Supplier/Properties[Address]" />
        <CsdlProperty
          Name="City"
          Property="Supplier/Properties[City]" />
        <CsdlProperty
          Name="Region"
          Property="Supplier/Properties[Region]" />
        <CsdlProperty
          Name="PostalCode"
          Property="Supplier/Properties[PostalCode]" />
        <CsdlProperty
          Name="Country"
          Property="Supplier/Properties[Country]" />
        <CsdlProperty
          Name="Phone"
          Property="Supplier/Properties[Phone]" />
        <CsdlProperty
          Name="Fax"
          Property="Supplier/Properties[Fax]" />
        <CsdlProperty
          Name="HomePage"
          Property="Supplier/Properties[HomePage]" />
        <CsdlProperty
          Name="Products"
          Property="Supplier/Properties[Products]" />
      </EntitySetMapping.Attributes>
    </EntitySetMapping>
    <AssociationSetMapping
      AssociationSet="FK_Products_Suppliers">
      <AssociationSetMapping.Attributes>
        <CsdlAssociation
          Name="FK_Products_Suppliers"
          Association="FK_Products_Suppliers" />
        <CsdlAssociationSetEnd
          End="NorthwindData/Members[FK_Products_Suppliers]/Members[Suppliers]">
          <CsdlAssociationSetEnd.Attributes>
            <CsdlPropertyRef
              Name="SupplierID" />
          </CsdlAssociationSetEnd.Attributes>
        </CsdlAssociationSetEnd>
        <CsdlAssociationSetEnd
          End="NorthwindData/Members[FK_Products_Suppliers]/Members[Products]">
          <CsdlAssociationSetEnd.Attributes>
            <CsdlPropertyRef
              Name="SupplierID" />
          </CsdlAssociationSetEnd.Attributes>
        </CsdlAssociationSetEnd>
      </AssociationSetMapping.Attributes>
    </AssociationSetMapping>
  </DataService>
</ServiceApplication>