﻿<?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="Model.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2005" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
        <EntityContainer Name="ModelStoreContainer">
          <EntitySet Name="Vw_DelegationDetails" EntityType="Model.Store.Vw_DelegationDetails" store:Type="Views" store:Schema="Delegation" store:Name="Vw_DelegationDetails">
            <DefiningQuery>SELECT 
      [Vw_DelegationDetails].[DelegationDetailID] AS [DelegationDetailID], 
      [Vw_DelegationDetails].[WorkflowInstanceID] AS [WorkflowInstanceID], 
      [Vw_DelegationDetails].[RequestedByID] AS [RequestedByID], 
      [Vw_DelegationDetails].[RequestedBy] AS [RequestedBy], 
      [Vw_DelegationDetails].[DelegationDetailStatusID] AS [DelegationDetailStatusID], 
      [Vw_DelegationDetails].[StartDate] AS [StartDate], 
      [Vw_DelegationDetails].[EndDate] AS [EndDate], 
      [Vw_DelegationDetails].[AutoAssignOnStart] AS [AutoAssignOnStart], 
      [Vw_DelegationDetails].[CreatedByID] AS [CreatedByID], 
      [Vw_DelegationDetails].[CreatedDate] AS [CreatedDate], 
      [Vw_DelegationDetails].[UpdatedByID] AS [UpdatedByID], 
      [Vw_DelegationDetails].[UpdatedDate] AS [UpdatedDate], 
      [Vw_DelegationDetails].[EntityID] AS [EntityID], 
      [Vw_DelegationDetails].[ItemID] AS [ItemID], 
      [Vw_DelegationDetails].[ReferenceNumber] AS [ReferenceNumber], 
      [Vw_DelegationDetails].[OriginalApproverUserID] AS [OriginalApproverUserID], 
      [Vw_DelegationDetails].[SkipApprovalStep] AS [SkipApprovalStep], 
      [Vw_DelegationDetails].[WorkflowID] AS [WorkflowID], 
      [Vw_DelegationDetails].[SelectedApproverID] AS [SelectedApproverID], 
      [Vw_DelegationDetails].[SelectedApprover] AS [SelectedApprover]
      FROM [Delegation].[Vw_DelegationDetails] AS [Vw_DelegationDetails]</DefiningQuery>
          </EntitySet>
        </EntityContainer>
        <!--Errors Found During Generation:
      warning 6002: The table/view 'Legitimate.Delegation.Vw_DelegationDetails' 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_DelegationDetails">
          <Key>
            <PropertyRef Name="DelegationDetailID" />
            <PropertyRef Name="RequestedByID" />
            <PropertyRef Name="RequestedBy" />
            <PropertyRef Name="DelegationDetailStatusID" />
            <PropertyRef Name="AutoAssignOnStart" />
            <PropertyRef Name="CreatedByID" />
            <PropertyRef Name="CreatedDate" />
            <PropertyRef Name="UpdatedByID" />
            <PropertyRef Name="UpdatedDate" />
            <PropertyRef Name="EntityID" />
            <PropertyRef Name="ItemID" />
            <PropertyRef Name="ReferenceNumber" />
            <PropertyRef Name="SkipApprovalStep" />
            <PropertyRef Name="WorkflowID" />
            <PropertyRef Name="SelectedApprover" />
          </Key>
          <Property Name="DelegationDetailID" Type="bigint" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="RequestedByID" Type="varchar" Nullable="false" MaxLength="20" />
          <Property Name="RequestedBy" Type="varchar" Nullable="false" MaxLength="1000" />
          <Property Name="DelegationDetailStatusID" Type="smallint" Nullable="false" />
          <Property Name="StartDate" Type="datetime" />
          <Property Name="EndDate" Type="datetime" />
          <Property Name="AutoAssignOnStart" Type="bit" 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" />
          <Property Name="EntityID" Type="int" Nullable="false" />
          <Property Name="ItemID" Type="bigint" Nullable="false" />
          <Property Name="ReferenceNumber" Type="varchar" Nullable="false" MaxLength="10" />
          <Property Name="OriginalApproverUserID" Type="bigint" />
          <Property Name="SkipApprovalStep" Type="bit" Nullable="false" />
          <Property Name="WorkflowID" Type="bigint" Nullable="false" />
          <Property Name="SelectedApproverID" Type="bigint" />
          <Property Name="SelectedApprover" Type="varchar" Nullable="false" MaxLength="101" />
        </EntityType>
        <Function Name="Pr_DelegationDetailStatusCalculate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Delegation">
          <Parameter Name="WorkflowInstanceID" Type="bigint" Mode="In" />
        </Function>
        <Function Name="Pr_DelegationDetailStatusUpdate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Delegation">
          <Parameter Name="UpdatedByID" Type="bigint" Mode="In" />
          <Parameter Name="Comments" Type="varchar" Mode="In" />
          <Parameter Name="DelegationDetailID" Type="bigint" Mode="In" />
          <Parameter Name="DelegationDetailStatusID" Type="smallint" Mode="In" />
          <Parameter Name="IsTransactionRequired" Type="bit" Mode="In" />
        </Function>
      </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="AfxAdminDelegationContext" annotation:LazyLoadingEnabled="false">
          <EntitySet Name="Vw_DelegationDetails" EntityType="Model.Vw_DelegationDetails" />
          <FunctionImport Name="Pr_DelegationDetailStatusCalculate">
            <Parameter Name="WorkflowInstanceID" Mode="In" Type="Int64" />
          </FunctionImport>
          <FunctionImport Name="Pr_DelegationDetailStatusUpdate">
            <Parameter Name="UpdatedByID" Mode="In" Type="Int64" />
            <Parameter Name="Comments" Mode="In" Type="String" />
            <Parameter Name="DelegationDetailID" Mode="In" Type="Int64" />
            <Parameter Name="DelegationDetailStatusID" Mode="In" Type="Int16" />
            <Parameter Name="IsTransactionRequired" Mode="In" Type="Boolean" />
          </FunctionImport>
        </EntityContainer>
        <EntityType Name="Vw_DelegationDetails">
          <Key>
            <PropertyRef Name="DelegationDetailID" />
            <PropertyRef Name="RequestedByID" />
            <PropertyRef Name="RequestedBy" />
            <PropertyRef Name="DelegationDetailStatusID" />
            <PropertyRef Name="AutoAssignOnStart" />
            <PropertyRef Name="CreatedByID" />
            <PropertyRef Name="CreatedDate" />
            <PropertyRef Name="UpdatedByID" />
            <PropertyRef Name="UpdatedDate" />
            <PropertyRef Name="EntityID" />
            <PropertyRef Name="ItemID" />
            <PropertyRef Name="ReferenceNumber" />
            <PropertyRef Name="SkipApprovalStep" />
            <PropertyRef Name="WorkflowID" />
            <PropertyRef Name="SelectedApprover" />
          </Key>
          <Property Name="DelegationDetailID" Type="Int64" Nullable="false" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="RequestedByID" Type="String" Nullable="false" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="RequestedBy" Type="String" Nullable="false" MaxLength="1000" Unicode="false" FixedLength="false" />
          <Property Name="DelegationDetailStatusID" Type="Int16" Nullable="false" />
          <Property Name="StartDate" Type="DateTime" Precision="3" />
          <Property Name="EndDate" Type="DateTime" Precision="3" />
          <Property Name="AutoAssignOnStart" Type="Boolean" Nullable="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" />
          <Property Name="EntityID" Type="Int32" Nullable="false" />
          <Property Name="ItemID" Type="Int64" Nullable="false" />
          <Property Name="ReferenceNumber" Type="String" Nullable="false" MaxLength="10" Unicode="false" FixedLength="false" />
          <Property Name="OriginalApproverUserID" Type="Int64" />
          <Property Name="SkipApprovalStep" Type="Boolean" Nullable="false" />
          <Property Name="WorkflowID" Type="Int64" Nullable="false" />
          <Property Name="SelectedApproverID" Type="Int64" />
          <Property Name="SelectedApprover" Type="String" Nullable="false" MaxLength="101" Unicode="false" FixedLength="false" />
        </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="ModelStoreContainer" CdmEntityContainer="AfxAdminDelegationContext">
          <EntitySetMapping Name="Vw_DelegationDetails">
            <EntityTypeMapping TypeName="Model.Vw_DelegationDetails">
              <MappingFragment StoreEntitySet="Vw_DelegationDetails">
                <ScalarProperty Name="DelegationDetailID" ColumnName="DelegationDetailID" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="RequestedByID" ColumnName="RequestedByID" />
                <ScalarProperty Name="RequestedBy" ColumnName="RequestedBy" />
                <ScalarProperty Name="DelegationDetailStatusID" ColumnName="DelegationDetailStatusID" />
                <ScalarProperty Name="StartDate" ColumnName="StartDate" />
                <ScalarProperty Name="EndDate" ColumnName="EndDate" />
                <ScalarProperty Name="AutoAssignOnStart" ColumnName="AutoAssignOnStart" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="ReferenceNumber" ColumnName="ReferenceNumber" />
                <ScalarProperty Name="OriginalApproverUserID" ColumnName="OriginalApproverUserID" />
                <ScalarProperty Name="SkipApprovalStep" ColumnName="SkipApprovalStep" />
                <ScalarProperty Name="WorkflowID" ColumnName="WorkflowID" />
                <ScalarProperty Name="SelectedApproverID" ColumnName="SelectedApproverID" />
                <ScalarProperty Name="SelectedApprover" ColumnName="SelectedApprover" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_DelegationDetailStatusCalculate" FunctionName="Model.Store.Pr_DelegationDetailStatusCalculate" />
          <FunctionImportMapping FunctionImportName="Pr_DelegationDetailStatusUpdate" FunctionName="Model.Store.Pr_DelegationDetailStatusUpdate" />
        </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" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams></Diagrams>
  </Designer>
</edmx:Edmx>