﻿<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
    <Schema Namespace="QueryModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
        <EntityType Name="Queries">
          <Key>
            <PropertyRef Name="QueryID" />
          </Key>
          <Property Name="QueryID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="QueryReference" Type="varchar" MaxLength="53" StoreGeneratedPattern="Computed" />
          <Property Name="QueryTypeID" Type="smallint" Nullable="false" />
          <Property Name="QueryStatusID" Type="smallint" Nullable="false" />
          <Property Name="QuerySourceID" Type="smallint" Nullable="false" />
          <Property Name="EntityID" Type="smallint" Nullable="false" />
          <Property Name="ItemID" Type="bigint" Nullable="false" />
          <Property Name="AssignedToUserRoleID" Type="smallint" Nullable="false" />
          <Property Name="AssignedToUserID" Type="bigint" />
          <Property Name="AssignedToUserDate" Type="datetime" />
          <Property Name="CompletedByID" Type="bigint" />
          <Property Name="CompletedDate" Type="datetime" />
          <Property Name="Description" Type="varchar" MaxLength="2000" Nullable="false" />
          <Property Name="ResponseEmailAddresses" Type="varchar" MaxLength="500" />
          <Property Name="ResponseContactNumbers" Type="varchar" MaxLength="500" />
          <Property Name="LatestComment" Type="varchar" MaxLength="500" Nullable="false" />
          <Property Name="CreatedByID" Type="bigint" Nullable="false" />
          <Property Name="CreatedDate" Type="datetime" Nullable="false" />
          <Property Name="UpdatedByID" Type="bigint" Nullable="false" />
          <Property Name="UpdatedDate" Type="datetime" Nullable="false" />
        </EntityType>
        <EntityType Name="QuerySources">
          <Key>
            <PropertyRef Name="QuerySourceID" />
          </Key>
          <Property Name="QuerySourceID" Type="smallint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="Description" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <EntityType Name="QueryStatus">
          <Key>
            <PropertyRef Name="QueryStatusID" />
          </Key>
          <Property Name="QueryStatusID" Type="smallint" Nullable="false" />
          <Property Name="Description" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <EntityType Name="QueryTypes">
          <Key>
            <PropertyRef Name="QueryTypeID" />
          </Key>
          <Property Name="QueryTypeID" Type="smallint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="Description" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="DefaultAssignedToUserRoleID" Type="smallint" Nullable="false" />
          <Property Name="DefaultEscalatedToUserRoleID" Type="smallint" Nullable="false" />
          <Property Name="MessageTemplateID" Type="int" Nullable="false" />
          <Property Name="CustomPostScript" Type="varchar(max)" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <!--Errors Found During Generation:
warning 6002: The table/view 'EPWP.Crm.Vw_Queries' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.-->
        <EntityType Name="Vw_Queries">
          <Key>
            <PropertyRef Name="QueryID" />
            
            
            
            
            
            
            
            
            
            
            
            
            
          </Key>
          <Property Name="QueryID" Type="bigint" Nullable="false" />
          <Property Name="QueryReference" Type="varchar" MaxLength="53" />
          <Property Name="QueryTypeID" Type="smallint" Nullable="false" />
          <Property Name="QueryType" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="QueryStatusID" Type="smallint" Nullable="false" />
          <Property Name="QueryStatus" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="QuerySourceID" Type="smallint" Nullable="false" />
          <Property Name="QuerySource" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="EntityID" Type="smallint" Nullable="false" />
          <Property Name="ItemID" Type="bigint" Nullable="false" />
          <Property Name="AssignedToUserRoleID" Type="smallint" Nullable="false" />
          <Property Name="AssignedToUserID" Type="bigint" />
          <Property Name="AssignedToUserDate" Type="datetime" />
          <Property Name="CompletedByID" Type="bigint" />
          <Property Name="CompletedDate" Type="datetime" />
          <Property Name="Description" Type="varchar" MaxLength="2000" Nullable="false" />
          <Property Name="ResponseEmailAddresses" Type="varchar" MaxLength="500" />
          <Property Name="ResponseContactNumbers" Type="varchar" MaxLength="500" />
          <Property Name="LatestComment" Type="varchar" MaxLength="500" Nullable="false" />
          <Property Name="CreatedByID" Type="bigint" Nullable="false" />
          <Property Name="CreatedDate" Type="datetime" Nullable="false" />
        </EntityType>
        <Association Name="FK_Queries_QuerySources">
          <End Role="QuerySources" Type="Self.QuerySources" Multiplicity="1" />
          <End Role="Queries" Type="Self.Queries" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QuerySources">
              <PropertyRef Name="QuerySourceID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QuerySourceID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Queries_QueryStatus">
          <End Role="QueryStatus" Type="Self.QueryStatus" Multiplicity="1" />
          <End Role="Queries" Type="Self.Queries" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QueryStatus">
              <PropertyRef Name="QueryStatusID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QueryStatusID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Queries_QueryTypes">
          <End Role="QueryTypes" Type="Self.QueryTypes" Multiplicity="1" />
          <End Role="Queries" Type="Self.Queries" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QueryTypes">
              <PropertyRef Name="QueryTypeID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QueryTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Function Name="Pr_QueryCreate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="QueryTypeID" Type="smallint" Mode="In" />
          <Parameter Name="QuerySourceID" Type="smallint" Mode="In" />
          <Parameter Name="EntityID" Type="int" Mode="In" />
          <Parameter Name="ItemID" Type="bigint" Mode="In" />
          <Parameter Name="AssignedToUserRoleID" Type="smallint" Mode="In" />
          <Parameter Name="AssignedToUserID" Type="bigint" Mode="In" />
          <Parameter Name="AssignedToUserDate" Type="datetime" Mode="In" />
          <Parameter Name="Description" Type="varchar" Mode="In" />
          <Parameter Name="ResponseEmailAddresses" Type="varchar" Mode="In" />
          <Parameter Name="ResponseContactNumbers" Type="varchar" Mode="In" />
          <Parameter Name="QueryByUserName" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_QueryDelete" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="QueryID" Type="bigint" Mode="In" />
          <Parameter Name="QueryByUserName" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_QuerySearch" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="EntityID" Type="bigint" Mode="In" />
          <Parameter Name="ItemID" Type="bigint" Mode="In" />
          <Parameter Name="QueryStatusID" Type="varchar" Mode="In" />
          <Parameter Name="AssignedToUserRoleID" Type="varchar" Mode="In" />
          <Parameter Name="AssignedToUserID" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_QueryUpdate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="QueryID" Type="bigint" Mode="In" />
          <Parameter Name="QueryTypeID" Type="smallint" Mode="In" />
          <Parameter Name="QuerySourceID" Type="smallint" Mode="In" />
          <Parameter Name="AssignedToUserRoleID" Type="smallint" Mode="In" />
          <Parameter Name="AssignedToUserID" Type="bigint" Mode="In" />
          <Parameter Name="AssignedToUserDate" Type="datetime" Mode="In" />
          <Parameter Name="Description" Type="varchar" Mode="In" />
          <Parameter Name="ResponseEmailAddresses" Type="varchar" Mode="In" />
          <Parameter Name="ResponseContactNumbers" Type="varchar" Mode="In" />
          <Parameter Name="QueryByUserName" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_QueryUpdateStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="QueryID" Type="bigint" Mode="In" />
          <Parameter Name="QueryStatusID" Type="smallint" Mode="In" />
          <Parameter Name="QueryByUserName" Type="varchar" Mode="In" />
        </Function>
        <EntityContainer Name="QueryModelStoreContainer">
          <EntitySet Name="Queries" EntityType="Self.Queries" Schema="Crm" store:Type="Tables" />
          <EntitySet Name="QuerySources" EntityType="Self.QuerySources" Schema="Crm" store:Type="Tables" />
          <EntitySet Name="QueryStatus" EntityType="Self.QueryStatus" Schema="Crm" store:Type="Tables" />
          <EntitySet Name="QueryTypes" EntityType="Self.QueryTypes" Schema="Crm" store:Type="Tables" />
          <EntitySet Name="Vw_Queries" EntityType="Self.Vw_Queries" store:Type="Views" store:Schema="Crm">
            <DefiningQuery>SELECT 
    [Vw_Queries].[QueryID] AS [QueryID], 
    [Vw_Queries].[QueryReference] AS [QueryReference], 
    [Vw_Queries].[QueryTypeID] AS [QueryTypeID], 
    [Vw_Queries].[QueryType] AS [QueryType], 
    [Vw_Queries].[QueryStatusID] AS [QueryStatusID], 
    [Vw_Queries].[QueryStatus] AS [QueryStatus], 
    [Vw_Queries].[QuerySourceID] AS [QuerySourceID], 
    [Vw_Queries].[QuerySource] AS [QuerySource], 
    [Vw_Queries].[EntityID] AS [EntityID], 
    [Vw_Queries].[ItemID] AS [ItemID], 
    [Vw_Queries].[AssignedToUserRoleID] AS [AssignedToUserRoleID], 
    [Vw_Queries].[AssignedToUserID] AS [AssignedToUserID], 
    [Vw_Queries].[AssignedToUserDate] AS [AssignedToUserDate], 
    [Vw_Queries].[CompletedByID] AS [CompletedByID], 
    [Vw_Queries].[CompletedDate] AS [CompletedDate], 
    [Vw_Queries].[Description] AS [Description], 
    [Vw_Queries].[ResponseEmailAddresses] AS [ResponseEmailAddresses], 
    [Vw_Queries].[ResponseContactNumbers] AS [ResponseContactNumbers], 
    [Vw_Queries].[LatestComment] AS [LatestComment], 
    [Vw_Queries].[CreatedByID] AS [CreatedByID], 
    [Vw_Queries].[CreatedDate] AS [CreatedDate]
    FROM [Crm].[Vw_Queries] AS [Vw_Queries]</DefiningQuery>
          </EntitySet>
          <AssociationSet Name="FK_Queries_QuerySources" Association="Self.FK_Queries_QuerySources">
            <End Role="QuerySources" EntitySet="QuerySources" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
          <AssociationSet Name="FK_Queries_QueryStatus" Association="Self.FK_Queries_QueryStatus">
            <End Role="QueryStatus" EntitySet="QueryStatus" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
          <AssociationSet Name="FK_Queries_QueryTypes" Association="Self.FK_Queries_QueryTypes">
            <End Role="QueryTypes" EntitySet="QueryTypes" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
        </EntityContainer>
      </Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Model" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityContainer Name="QueriesContext" annotation:LazyLoadingEnabled="true">
          <EntitySet Name="Queries" EntityType="Model.Query" />
          <EntitySet Name="QuerySources" EntityType="Model.QuerySource" />
          <EntitySet Name="QueryStatus" EntityType="Model.QueryStatus" />
          <EntitySet Name="QueryTypes" EntityType="Model.QueryType" />
          <AssociationSet Name="FK_Queries_QuerySources" Association="Model.FK_Queries_QuerySources">
            <End Role="QuerySources" EntitySet="QuerySources" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
          <AssociationSet Name="FK_Queries_QueryStatus" Association="Model.FK_Queries_QueryStatus">
            <End Role="QueryStatus" EntitySet="QueryStatus" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
          <AssociationSet Name="FK_Queries_QueryTypes" Association="Model.FK_Queries_QueryTypes">
            <End Role="QueryTypes" EntitySet="QueryTypes" />
            <End Role="Queries" EntitySet="Queries" />
          </AssociationSet>
          <FunctionImport Name="Pr_QueryCreate" ReturnType="Collection(Int64)">
            <Parameter Name="QueryTypeID" Mode="In" Type="Int16" />
            <Parameter Name="QuerySourceID" Mode="In" Type="Int16" />
            <Parameter Name="EntityID" Mode="In" Type="Int32" />
            <Parameter Name="ItemID" Mode="In" Type="Int64" />
            <Parameter Name="AssignedToUserRoleID" Mode="In" Type="Int16" />
            <Parameter Name="AssignedToUserID" Mode="In" Type="Int64" />
            <Parameter Name="AssignedToUserDate" Mode="In" Type="DateTime" />
            <Parameter Name="Description" Mode="In" Type="String" />
            <Parameter Name="ResponseEmailAddresses" Mode="In" Type="String" />
            <Parameter Name="ResponseContactNumbers" Mode="In" Type="String" />
            <Parameter Name="QueryByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_QueryDelete" ReturnType="Collection(Boolean)">
            <Parameter Name="QueryID" Mode="In" Type="Int64" />
            <Parameter Name="QueryByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_QueryUpdate" ReturnType="Collection(Boolean)">
            <Parameter Name="QueryID" Mode="In" Type="Int64" />
            <Parameter Name="QueryTypeID" Mode="In" Type="Int16" />
            <Parameter Name="QuerySourceID" Mode="In" Type="Int16" />
            <Parameter Name="AssignedToUserRoleID" Mode="In" Type="Int16" />
            <Parameter Name="AssignedToUserID" Mode="In" Type="Int64" />
            <Parameter Name="AssignedToUserDate" Mode="In" Type="DateTime" />
            <Parameter Name="Description" Mode="In" Type="String" />
            <Parameter Name="ResponseEmailAddresses" Mode="In" Type="String" />
            <Parameter Name="ResponseContactNumbers" Mode="In" Type="String" />
            <Parameter Name="QueryByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_QueryUpdateStatus" ReturnType="Collection(Boolean)">
            <Parameter Name="QueryID" Mode="In" Type="Int64" />
            <Parameter Name="QueryStatusID" Mode="In" Type="Int16" />
            <Parameter Name="QueryByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <EntitySet Name="Vw_Queries" EntityType="Model.Vw_Queries" />
          <FunctionImport Name="Pr_QuerySearch" EntitySet="Vw_Queries" ReturnType="Collection(Model.Vw_Queries)">
            <Parameter Name="EntityID" Mode="In" Type="Int64" />
            <Parameter Name="ItemID" Mode="In" Type="Int64" />
            <Parameter Name="QueryStatusID" Mode="In" Type="String" />
            <Parameter Name="AssignedToUserRoleID" Mode="In" Type="String" />
            <Parameter Name="AssignedToUserID" Mode="In" Type="String" />
          </FunctionImport>
        </EntityContainer>
        <EntityType Name="Query">
          <Key>
            <PropertyRef Name="QueryID" />
          </Key>
          <Property Name="QueryID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="QueryReference" Type="String" MaxLength="53" Unicode="false" FixedLength="false" annotation:StoreGeneratedPattern="Computed" />
          <Property Name="QueryTypeID" Type="Int16" Nullable="false" />
          <Property Name="QueryStatusID" Type="Int16" Nullable="false" />
          <Property Name="QuerySourceID" Type="Int16" Nullable="false" />
          <Property Name="EntityID" Type="Int16" Nullable="false" />
          <Property Name="ItemID" Type="Int64" Nullable="false" />
          <Property Name="AssignedToUserRoleID" Type="Int16" Nullable="false" />
          <Property Name="AssignedToUserID" Type="Int64" />
          <Property Name="AssignedToUserDate" Type="DateTime" Precision="3" />
          <Property Name="CompletedByID" Type="Int64" />
          <Property Name="CompletedDate" Type="DateTime" Precision="3" />
          <Property Name="Description" Type="String" Nullable="false" MaxLength="2000" Unicode="false" FixedLength="false" />
          <Property Name="ResponseEmailAddresses" Type="String" MaxLength="500" Unicode="false" FixedLength="false" />
          <Property Name="ResponseContactNumbers" Type="String" MaxLength="500" Unicode="false" FixedLength="false" />
          <Property Name="LatestComment" Type="String" Nullable="false" MaxLength="500" Unicode="false" FixedLength="false" />
          <Property Name="CreatedByID" Type="Int64" Nullable="false" />
          <Property Name="CreatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <Property Name="UpdatedByID" Type="Int64" Nullable="false" />
          <Property Name="UpdatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <NavigationProperty Name="QuerySource" Relationship="Model.FK_Queries_QuerySources" FromRole="Queries" ToRole="QuerySources" />
          <NavigationProperty Name="QueryStatus" Relationship="Model.FK_Queries_QueryStatus" FromRole="Queries" ToRole="QueryStatus" />
          <NavigationProperty Name="QueryType" Relationship="Model.FK_Queries_QueryTypes" FromRole="Queries" ToRole="QueryTypes" />
        </EntityType>
        <EntityType Name="QuerySource">
          <Key>
            <PropertyRef Name="QuerySourceID" />
          </Key>
          <Property Name="QuerySourceID" Type="Int16" Nullable="false" />
          <Property Name="Description" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="Queries" Relationship="Model.FK_Queries_QuerySources" FromRole="QuerySources" ToRole="Queries" />
        </EntityType>
        <EntityType Name="QueryStatus">
          <Key>
            <PropertyRef Name="QueryStatusID" />
          </Key>
          <Property Name="QueryStatusID" Type="Int16" Nullable="false" />
          <Property Name="Description" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="Queries" Relationship="Model.FK_Queries_QueryStatus" FromRole="QueryStatus" ToRole="Queries" />
        </EntityType>
        <EntityType Name="QueryType">
          <Key>
            <PropertyRef Name="QueryTypeID" />
          </Key>
          <Property Name="QueryTypeID" Type="Int16" Nullable="false" />
          <Property Name="Description" Type="String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="DefaultAssignedToUserRoleID" Type="Int16" Nullable="false" />
          <Property Name="DefaultEscalatedToUserRoleID" Type="Int16" Nullable="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="Queries" Relationship="Model.FK_Queries_QueryTypes" FromRole="QueryTypes" ToRole="Queries" />
          <Property Name="MessageTemplateID" Type="Int32" Nullable="false" />
          <Property Name="CustomPostScript" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
        </EntityType>
        <Association Name="FK_Queries_QuerySources">
          <End Role="QuerySources" Type="Model.QuerySource" Multiplicity="1" />
          <End Role="Queries" Type="Model.Query" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QuerySources">
              <PropertyRef Name="QuerySourceID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QuerySourceID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Queries_QueryStatus">
          <End Role="QueryStatus" Type="Model.QueryStatus" Multiplicity="1" />
          <End Role="Queries" Type="Model.Query" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QueryStatus">
              <PropertyRef Name="QueryStatusID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QueryStatusID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Queries_QueryTypes">
          <End Role="QueryTypes" Type="Model.QueryType" Multiplicity="1" />
          <End Role="Queries" Type="Model.Query" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="QueryTypes">
              <PropertyRef Name="QueryTypeID" />
            </Principal>
            <Dependent Role="Queries">
              <PropertyRef Name="QueryTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="Vw_Queries">
          <Key>
            <PropertyRef Name="QueryID" />
          </Key>
          <Property Type="Int64" Name="QueryID" Nullable="false" />
          <Property Type="String" Name="QueryReference" MaxLength="53" FixedLength="false" Unicode="false" />
          <Property Type="Int16" Name="QueryTypeID" Nullable="false" />
          <Property Type="String" Name="QueryType" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="Int16" Name="QueryStatusID" Nullable="false" />
          <Property Type="String" Name="QueryStatus" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="Int16" Name="QuerySourceID" Nullable="false" />
          <Property Type="String" Name="QuerySource" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="Int16" Name="EntityID" Nullable="false" />
          <Property Type="Int64" Name="ItemID" Nullable="false" />
          <Property Type="Int16" Name="AssignedToUserRoleID" Nullable="false" />
          <Property Type="Int64" Name="AssignedToUserID" />
          <Property Type="DateTime" Name="AssignedToUserDate" Precision="3" />
          <Property Type="Int64" Name="CompletedByID" />
          <Property Type="DateTime" Name="CompletedDate" Precision="3" />
          <Property Type="String" Name="Description" Nullable="false" MaxLength="2000" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="ResponseEmailAddresses" MaxLength="500" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="ResponseContactNumbers" MaxLength="500" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="LatestComment" Nullable="false" MaxLength="500" FixedLength="false" Unicode="false" />
          <Property Type="Int64" Name="CreatedByID" Nullable="false" />
          <Property Type="DateTime" Name="CreatedDate" Nullable="false" Precision="3" />
        </EntityType>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
        <EntityContainerMapping StorageEntityContainer="QueryModelStoreContainer" CdmEntityContainer="QueriesContext">
          <EntitySetMapping Name="Queries"><EntityTypeMapping TypeName="Model.Query"><MappingFragment StoreEntitySet="Queries">
            <ScalarProperty Name="QueryID" ColumnName="QueryID" />
            <ScalarProperty Name="QueryReference" ColumnName="QueryReference" />
            <ScalarProperty Name="QueryTypeID" ColumnName="QueryTypeID" />
            <ScalarProperty Name="QueryStatusID" ColumnName="QueryStatusID" />
            <ScalarProperty Name="QuerySourceID" ColumnName="QuerySourceID" />
            <ScalarProperty Name="EntityID" ColumnName="EntityID" />
            <ScalarProperty Name="ItemID" ColumnName="ItemID" />
            <ScalarProperty Name="AssignedToUserRoleID" ColumnName="AssignedToUserRoleID" />
            <ScalarProperty Name="AssignedToUserID" ColumnName="AssignedToUserID" />
            <ScalarProperty Name="AssignedToUserDate" ColumnName="AssignedToUserDate" />
            <ScalarProperty Name="CompletedByID" ColumnName="CompletedByID" />
            <ScalarProperty Name="CompletedDate" ColumnName="CompletedDate" />
            <ScalarProperty Name="Description" ColumnName="Description" />
            <ScalarProperty Name="ResponseEmailAddresses" ColumnName="ResponseEmailAddresses" />
            <ScalarProperty Name="ResponseContactNumbers" ColumnName="ResponseContactNumbers" />
            <ScalarProperty Name="LatestComment" ColumnName="LatestComment" />
            <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
            <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
            <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
            <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="QuerySources"><EntityTypeMapping TypeName="Model.QuerySource"><MappingFragment StoreEntitySet="QuerySources">
            <ScalarProperty Name="QuerySourceID" ColumnName="QuerySourceID" />
            <ScalarProperty Name="Description" ColumnName="Description" />
            <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="QueryStatus"><EntityTypeMapping TypeName="Model.QueryStatus"><MappingFragment StoreEntitySet="QueryStatus">
            <ScalarProperty Name="QueryStatusID" ColumnName="QueryStatusID" />
            <ScalarProperty Name="Description" ColumnName="Description" />
            <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="QueryTypes"><EntityTypeMapping TypeName="Model.QueryType"><MappingFragment StoreEntitySet="QueryTypes">
            <ScalarProperty Name="CustomPostScript" ColumnName="CustomPostScript" />
                <ScalarProperty Name="MessageTemplateID" ColumnName="MessageTemplateID" />
                <ScalarProperty Name="QueryTypeID" ColumnName="QueryTypeID" />
            <ScalarProperty Name="Description" ColumnName="Description" />
            <ScalarProperty Name="DefaultAssignedToUserRoleID" ColumnName="DefaultAssignedToUserRoleID" />
            <ScalarProperty Name="DefaultEscalatedToUserRoleID" ColumnName="DefaultEscalatedToUserRoleID" />
            <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_QueryCreate" FunctionName="QueryModel.Store.Pr_QueryCreate" />
          <FunctionImportMapping FunctionImportName="Pr_QueryDelete" FunctionName="QueryModel.Store.Pr_QueryDelete" />
          <FunctionImportMapping FunctionImportName="Pr_QueryUpdate" FunctionName="QueryModel.Store.Pr_QueryUpdate" />
          <FunctionImportMapping FunctionImportName="Pr_QueryUpdateStatus" FunctionName="QueryModel.Store.Pr_QueryUpdateStatus" />
          <EntitySetMapping Name="Vw_Queries">
            <EntityTypeMapping TypeName="Model.Vw_Queries">
              <MappingFragment StoreEntitySet="Vw_Queries">
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="LatestComment" ColumnName="LatestComment" />
                <ScalarProperty Name="ResponseContactNumbers" ColumnName="ResponseContactNumbers" />
                <ScalarProperty Name="ResponseEmailAddresses" ColumnName="ResponseEmailAddresses" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="CompletedDate" ColumnName="CompletedDate" />
                <ScalarProperty Name="CompletedByID" ColumnName="CompletedByID" />
                <ScalarProperty Name="AssignedToUserDate" ColumnName="AssignedToUserDate" />
                <ScalarProperty Name="AssignedToUserID" ColumnName="AssignedToUserID" />
                <ScalarProperty Name="AssignedToUserRoleID" ColumnName="AssignedToUserRoleID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="QuerySource" ColumnName="QuerySource" />
                <ScalarProperty Name="QuerySourceID" ColumnName="QuerySourceID" />
                <ScalarProperty Name="QueryStatus" ColumnName="QueryStatus" />
                <ScalarProperty Name="QueryStatusID" ColumnName="QueryStatusID" />
                <ScalarProperty Name="QueryType" ColumnName="QueryType" />
                <ScalarProperty Name="QueryTypeID" ColumnName="QueryTypeID" />
                <ScalarProperty Name="QueryReference" ColumnName="QueryReference" />
                <ScalarProperty Name="QueryID" ColumnName="QueryID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_QuerySearch" FunctionName="QueryModel.Store.Pr_QuerySearch" />
        </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
    <Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </Connection>
    <Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
        <DesignerProperty Name="EnablePluralization" Value="True" />
        <DesignerProperty Name="IncludeForeignKeysInModel" Value="True" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
        <DesignerProperty Name="UseLegacyProvider" Value="False" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="QueryModel">
        <EntityTypeShape EntityType="Model.Query" Width="1.5" PointX="3" PointY="2.375" Height="5.4417122395833326" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.QuerySource" Width="1.5" PointX="0.75" PointY="4.25" Height="1.7879850260416674" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.QueryStatus" Width="1.5" PointX="0.75" PointY="0.75" Height="1.7879850260416665" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.QueryType" Width="1.5" PointX="0.75" PointY="7.25" Height="2.1725878906250005" IsExpanded="true" />
        <AssociationConnector Association="Model.FK_Queries_QuerySources" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="5.1439925130208337" />
          <ConnectorPoint PointX="3" PointY="5.1439925130208337" />
        </AssociationConnector>
        <AssociationConnector Association="Model.FK_Queries_QueryStatus" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="1.5624995" />
          <ConnectorPoint PointX="3.75" PointY="1.5624995" />
          <ConnectorPoint PointX="3.75" PointY="2.375" />
        </AssociationConnector>
        <AssociationConnector Association="Model.FK_Queries_QueryTypes" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="7.5333561197916659" />
          <ConnectorPoint PointX="3" PointY="7.5333561197916659" />
        </AssociationConnector>
        <EntityTypeShape EntityType="Model.Vw_Queries" Width="1.5" PointX="5.375" PointY="0.75" Height="5.057109375" />
      </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>