<?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="Customer">
    <EntityType.Methods>
      <EntityMethod
        Name="Delete">
        <EntityMethod.Attributes>
          <Generated />
        </EntityMethod.Attributes>
      </EntityMethod>
    </EntityType.Methods>
    <EntityType.Properties>
      <KeyProperty
        Name="CustomerID"
        PropertyType=":String">
        <KeyProperty.Attributes>
          <Required />
          <MaxLength
            IsFixedLength="True"
            Value="5" />
        </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>
      <NavigationProperty
        Name="Orders"
        Association="FK_Orders_Customers"
        FromEnd="Customers"
        ToEnd="Orders" />
    </EntityType.Properties>
  </EntityType>
  <Association
    Name="FK_Orders_Customers">
    <AssociationEnd
      Name="Customers"
      EntityType="Customer">
      <AssociationEnd.Attributes>
        <DeleteRule />
      </AssociationEnd.Attributes>
    </AssociationEnd>
    <AssociationEnd
      Name="Orders"
      Multiplicity="Many"
      EntityType="Order" />
  </Association>
  <EntityContainer
    Name="NorthwindData">
    <EntityContainer.Attributes>
      <Partial />
    </EntityContainer.Attributes>
    <EntitySet
      Name="Customers"
      CanDelete="True"
      CanInsert="True"
      CanUpdate="True"
      EntityType="Customer" />
    <AssociationSet
      Name="FK_Orders_Customers"
      Association="FK_Orders_Customers">
      <AssociationSetEnd
        Name="Customers"
        EntitySet="Customers" />
      <AssociationSetEnd
        Name="Orders"
        EntitySet="Orders" />
    </AssociationSet>
    <QueryOperation
      Name="Customers_Single"
      ReturnType="Customer">
      <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="CustomerID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="CustomerID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Customers" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="CustomerID"
        ParameterType=":String?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'CustomerID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
    <QueryOperation
      Name="Customers_SingleOrDefault"
      ReturnType="Customer">
      <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="CustomerID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="CustomerID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Customers" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="CustomerID"
        ParameterType=":String?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'CustomerID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
  </EntityContainer>
  <DataService
    Name="NorthwindDataDataService">
    <DataService.Attributes>
      <Partial />
    </DataService.Attributes>
    <EntitySetMapping
      EntitySet="Customers">
      <EntitySetMapping.Attributes>
        <CsdlEntitySet
          EntityTypeName="Customer"
          EntityTypeNamespace="LightSwitchApplication"
          Name="Customers"
          EntityType="Customer" />
        <CsdlProperty
          Name="CustomerID"
          Property="Customer/Properties[CustomerID]" />
        <CsdlProperty
          Name="CompanyName"
          Property="Customer/Properties[CompanyName]" />
        <CsdlProperty
          Name="ContactName"
          Property="Customer/Properties[ContactName]" />
        <CsdlProperty
          Name="ContactTitle"
          Property="Customer/Properties[ContactTitle]" />
        <CsdlProperty
          Name="Address"
          Property="Customer/Properties[Address]" />
        <CsdlProperty
          Name="City"
          Property="Customer/Properties[City]" />
        <CsdlProperty
          Name="Region"
          Property="Customer/Properties[Region]" />
        <CsdlProperty
          Name="PostalCode"
          Property="Customer/Properties[PostalCode]" />
        <CsdlProperty
          Name="Country"
          Property="Customer/Properties[Country]" />
        <CsdlProperty
          Name="Phone"
          Property="Customer/Properties[Phone]" />
        <CsdlProperty
          Name="Fax"
          Property="Customer/Properties[Fax]" />
        <CsdlProperty
          Name="Orders"
          Property="Customer/Properties[Orders]" />
      </EntitySetMapping.Attributes>
    </EntitySetMapping>
    <AssociationSetMapping
      AssociationSet="FK_Orders_Customers">
      <AssociationSetMapping.Attributes>
        <CsdlAssociation
          Name="FK_Orders_Customers"
          Association="FK_Orders_Customers" />
        <CsdlAssociationSetEnd
          End="NorthwindData/Members[FK_Orders_Customers]/Members[Customers]">
          <CsdlAssociationSetEnd.Attributes>
            <CsdlPropertyRef
              Name="CustomerID" />
          </CsdlAssociationSetEnd.Attributes>
        </CsdlAssociationSetEnd>
        <CsdlAssociationSetEnd
          End="NorthwindData/Members[FK_Orders_Customers]/Members[Orders]">
          <CsdlAssociationSetEnd.Attributes>
            <CsdlPropertyRef
              Name="CustomerID" />
          </CsdlAssociationSetEnd.Attributes>
        </CsdlAssociationSetEnd>
      </AssociationSetMapping.Attributes>
    </AssociationSetMapping>
  </DataService>
</ServiceApplication>