<?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="Contact">
    <EntityType.Methods>
      <EntityMethod
        Name="Delete">
        <EntityMethod.Attributes>
          <Generated />
        </EntityMethod.Attributes>
      </EntityMethod>
    </EntityType.Methods>
    <EntityType.Properties>
      <KeyProperty
        Name="ContactID"
        IsReadOnly="True"
        PropertyType=":Int32">
        <KeyProperty.Attributes>
          <Hidden />
          <Required />
          <NotSearchable />
        </KeyProperty.Attributes>
      </KeyProperty>
      <EntityProperty
        Name="ContactType"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="50" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <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="Extension"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="4" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Fax"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="24" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="HomePage"
        PropertyType=":String?" />
      <EntityProperty
        Name="PhotoPath"
        PropertyType=":String?">
        <EntityProperty.Attributes>
          <MaxLength
            Value="255" />
        </EntityProperty.Attributes>
      </EntityProperty>
      <EntityProperty
        Name="Photo"
        PropertyType=":Binary?">
        <EntityProperty.Attributes>
          <NotSearchable />
        </EntityProperty.Attributes>
      </EntityProperty>
    </EntityType.Properties>
  </EntityType>
  <EntityContainer
    Name="NorthwindData">
    <EntityContainer.Attributes>
      <Partial />
    </EntityContainer.Attributes>
    <EntitySet
      Name="Contacts"
      CanDelete="True"
      CanInsert="True"
      CanUpdate="True"
      EntityType="Contact" />
    <QueryOperation
      Name="Contacts_Single"
      ReturnType="Contact">
      <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="ContactID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="ContactID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Contacts" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="ContactID"
        ParameterType=":Int32?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'ContactID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
    <QueryOperation
      Name="Contacts_SingleOrDefault"
      ReturnType="Contact">
      <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="ContactID" />
              </ChainExpression>
            </BinaryExpression.Left>
            <BinaryExpression.Right>
              <ParameterExpression
                Parameter="ContactID" />
            </BinaryExpression.Right>
          </BinaryExpression>
        </QueryFilterExpressionTree>
      </QueryOperation.FilterExpression>
      <QueryOperation.Source>
        <QuerySourceExpressionTree>
          <MemberExpression
            Member="Contacts" />
        </QuerySourceExpressionTree>
      </QueryOperation.Source>
      <QueryOperationParameter
        Name="ContactID"
        ParameterType=":Int32?">
        <QueryOperationParameter.Attributes>
          <Description
            Value="The value of the 'ContactID' key property of the entity to retrieve." />
        </QueryOperationParameter.Attributes>
      </QueryOperationParameter>
    </QueryOperation>
  </EntityContainer>
  <DataService
    Name="NorthwindDataDataService">
    <DataService.Attributes>
      <Partial />
    </DataService.Attributes>
    <EntitySetMapping
      EntitySet="Contacts">
      <EntitySetMapping.Attributes>
        <CsdlEntitySet
          EntityTypeName="Contact"
          EntityTypeNamespace="LightSwitchApplication"
          Name="Contacts"
          EntityType="Contact" />
        <CsdlProperty
          Name="ContactID"
          StoreGeneratedPattern="Identity"
          Property="Contact/Properties[ContactID]" />
        <CsdlProperty
          Name="ContactType"
          Property="Contact/Properties[ContactType]" />
        <CsdlProperty
          Name="CompanyName"
          Property="Contact/Properties[CompanyName]" />
        <CsdlProperty
          Name="ContactName"
          Property="Contact/Properties[ContactName]" />
        <CsdlProperty
          Name="ContactTitle"
          Property="Contact/Properties[ContactTitle]" />
        <CsdlProperty
          Name="Address"
          Property="Contact/Properties[Address]" />
        <CsdlProperty
          Name="City"
          Property="Contact/Properties[City]" />
        <CsdlProperty
          Name="Region"
          Property="Contact/Properties[Region]" />
        <CsdlProperty
          Name="PostalCode"
          Property="Contact/Properties[PostalCode]" />
        <CsdlProperty
          Name="Country"
          Property="Contact/Properties[Country]" />
        <CsdlProperty
          Name="Phone"
          Property="Contact/Properties[Phone]" />
        <CsdlProperty
          Name="Extension"
          Property="Contact/Properties[Extension]" />
        <CsdlProperty
          Name="Fax"
          Property="Contact/Properties[Fax]" />
        <CsdlProperty
          Name="HomePage"
          Property="Contact/Properties[HomePage]" />
        <CsdlProperty
          Name="PhotoPath"
          Property="Contact/Properties[PhotoPath]" />
        <CsdlProperty
          Name="Photo"
          Property="Contact/Properties[Photo]" />
      </EntitySetMapping.Attributes>
    </EntitySetMapping>
  </DataService>
</ServiceApplication>