﻿<?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="LegitimateNATIONALModel.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="BusinessRuleBypassRequestDetails">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestDetailID" />
          </Key>
          <Property Name="BusinessRuleBypassRequestDetailID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="OfficeLocationID" Type="bigint" />
          <Property Name="DivisionTypeID" Type="smallint" />
          <Property Name="ProvinceID" Type="smallint" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="ReferenceNumber" Type="varchar" MaxLength="20" />
          <Property Name="RelatedReferenceNumber" Type="varchar" MaxLength="20" />
          <Property Name="BusinessRuleBypassRequestTypeID" Type="smallint" Nullable="false" />
          <Property Name="Reason" Type="varchar(max)" Nullable="false" />
          <Property Name="EntityID" Type="int" Nullable="false" />
          <Property Name="ItemID" Type="bigint" 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="BusinessRuleBypassRequestTypes">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
          </Key>
          <Property Name="BusinessRuleBypassRequestTypeID" Type="smallint" Nullable="false" />
          <Property Name="Title" Type="varchar" MaxLength="255" Nullable="false" />
          <Property Name="IsCancelled" Type="bit" Nullable="false" />
        </EntityType>
        <!--Errors Found During Generation:
warning 6002: The table/view 'LegitimateNATIONAL.App.Vw_BusinessRuleBypassRequestDetails' 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_BusinessRuleBypassRequestDetails">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestDetailID" />
            <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            <PropertyRef Name="BusinessRuleBypassRequestType" />
            <PropertyRef Name="Reason" />
            <PropertyRef Name="EntityID" />
            <PropertyRef Name="ItemID" />
            <PropertyRef Name="CreatedByID" />
            <PropertyRef Name="CreatedDate" />
            <PropertyRef Name="UpdatedByID" />
            <PropertyRef Name="UpdatedDate" />
          </Key>
          <Property Name="BusinessRuleBypassRequestDetailID" Type="bigint" Nullable="false" />
          <Property Name="OfficeLocationID" Type="bigint" />
          <Property Name="DivisionTypeID" Type="smallint" />
          <Property Name="ProvinceID" Type="smallint" />
          <Property Name="WorkflowInstanceID" Type="bigint" />
          <Property Name="ReferenceNumber" Type="varchar" MaxLength="20" />
          <Property Name="RelatedReferenceNumber" Type="varchar" MaxLength="20" />
          <Property Name="BusinessRuleBypassRequestTypeID" Type="smallint" Nullable="false" />
          <Property Name="BusinessRuleBypassRequestType" Type="varchar" MaxLength="255" Nullable="false" />
          <Property Name="Reason" Type="varchar(max)" Nullable="false" />
          <Property Name="EntityID" Type="int" Nullable="false" />
          <Property Name="ItemID" Type="bigint" 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>
        <Association Name="FK__BusinessR__Busin__7DA458C7">
          <End Role="BusinessRuleBypassRequestTypes" Type="Self.BusinessRuleBypassRequestTypes" Multiplicity="1" />
          <End Role="BusinessRuleBypassRequestDetails" Type="Self.BusinessRuleBypassRequestDetails" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="BusinessRuleBypassRequestTypes">
              <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            </Principal>
            <Dependent Role="BusinessRuleBypassRequestDetails">
              <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Function Name="Pr_BusinessRuleBypassRequestCreate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App">
          <Parameter Name="BusinessRuleBypassRequestTypeID" Type="smallint" Mode="In" />
          <Parameter Name="RelatedReferenceNumber" Type="varchar" Mode="In" />
          <Parameter Name="Reason" Type="varchar(max)" Mode="In" />
          <Parameter Name="RequestEntityID" Type="int" Mode="In" />
          <Parameter Name="RequestItemID" Type="bigint" Mode="In" />
          <Parameter Name="UserID" Type="bigint" Mode="In" />
        </Function>
        <Function Name="Pr_BusinessRuleBypassRequestPrecheck" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="App">
          <Parameter Name="BusinessRuleBypassRequestTypeID" Type="smallint" Mode="In" />
          <Parameter Name="ReferenceNumber" Type="varchar" Mode="In" />
          <Parameter Name="UserID" Type="bigint" Mode="In" />
        </Function>
        <EntityContainer Name="LegitimateNATIONALModelStoreContainer">
          <EntitySet Name="BusinessRuleBypassRequestDetails" EntityType="Self.BusinessRuleBypassRequestDetails" Schema="App" store:Type="Tables" />
          <EntitySet Name="BusinessRuleBypassRequestTypes" EntityType="Self.BusinessRuleBypassRequestTypes" Schema="Md" store:Type="Tables" />
          <EntitySet Name="Vw_BusinessRuleBypassRequestDetails" EntityType="Self.Vw_BusinessRuleBypassRequestDetails" store:Type="Views" store:Schema="App">
            <DefiningQuery>SELECT 
    [Vw_BusinessRuleBypassRequestDetails].[BusinessRuleBypassRequestDetailID] AS [BusinessRuleBypassRequestDetailID], 
    [Vw_BusinessRuleBypassRequestDetails].[OfficeLocationID] AS [OfficeLocationID], 
    [Vw_BusinessRuleBypassRequestDetails].[DivisionTypeID] AS [DivisionTypeID], 
    [Vw_BusinessRuleBypassRequestDetails].[ProvinceID] AS [ProvinceID], 
    [Vw_BusinessRuleBypassRequestDetails].[WorkflowInstanceID] AS [WorkflowInstanceID], 
    [Vw_BusinessRuleBypassRequestDetails].[ReferenceNumber] AS [ReferenceNumber], 
    [Vw_BusinessRuleBypassRequestDetails].[RelatedReferenceNumber] AS [RelatedReferenceNumber], 
    [Vw_BusinessRuleBypassRequestDetails].[BusinessRuleBypassRequestTypeID] AS [BusinessRuleBypassRequestTypeID], 
    [Vw_BusinessRuleBypassRequestDetails].[BusinessRuleBypassRequestType] AS [BusinessRuleBypassRequestType], 
    [Vw_BusinessRuleBypassRequestDetails].[Reason] AS [Reason], 
    [Vw_BusinessRuleBypassRequestDetails].[EntityID] AS [EntityID], 
    [Vw_BusinessRuleBypassRequestDetails].[ItemID] AS [ItemID], 
    [Vw_BusinessRuleBypassRequestDetails].[CreatedByID] AS [CreatedByID], 
    [Vw_BusinessRuleBypassRequestDetails].[CreatedDate] AS [CreatedDate], 
    [Vw_BusinessRuleBypassRequestDetails].[UpdatedByID] AS [UpdatedByID], 
    [Vw_BusinessRuleBypassRequestDetails].[UpdatedDate] AS [UpdatedDate]
    FROM [App].[Vw_BusinessRuleBypassRequestDetails] AS [Vw_BusinessRuleBypassRequestDetails]</DefiningQuery>
          </EntitySet>
          <AssociationSet Name="FK__BusinessR__Busin__7DA458C7" Association="Self.FK__BusinessR__Busin__7DA458C7">
            <End Role="BusinessRuleBypassRequestTypes" EntitySet="BusinessRuleBypassRequestTypes" />
            <End Role="BusinessRuleBypassRequestDetails" EntitySet="BusinessRuleBypassRequestDetails" />
          </AssociationSet>
        </EntityContainer>
      </Schema></edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Model" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
        <EntityContainer Name="BusinessRuleBypassContext" annotation:LazyLoadingEnabled="true">
          <FunctionImport Name="Pr_BusinessRuleBypassRequestPrecheck" ReturnType="Collection(Model.Pr_BusinessRuleBypassRequestPrecheck_Result)">
            <Parameter Name="BusinessRuleBypassRequestTypeID" Mode="In" Type="Int16" />
            <Parameter Name="ReferenceNumber" Mode="In" Type="String" />
            <Parameter Name="UserID" Mode="In" Type="Int64" />
          </FunctionImport>
          <EntitySet Name="Vw_BusinessRuleBypassRequestDetails" EntityType="Model.Vw_BusinessRuleBypassRequestDetails" />
          <EntitySet Name="BusinessRuleBypassRequestDetails" EntityType="Model.BusinessRuleBypassRequestDetail" />
          <EntitySet Name="BusinessRuleBypassRequestTypes" EntityType="Model.BusinessRuleBypassRequestType" />
          <AssociationSet Name="FK__BusinessR__Busin__7DA458C7" Association="Model.FK__BusinessR__Busin__7DA458C7">
            <End Role="BusinessRuleBypassRequestType" EntitySet="BusinessRuleBypassRequestTypes" />
            <End Role="BusinessRuleBypassRequestDetail" EntitySet="BusinessRuleBypassRequestDetails" />
          </AssociationSet>
          <FunctionImport Name="Pr_BusinessRuleBypassRequestCreate" EntitySet="Vw_BusinessRuleBypassRequestDetails" ReturnType="Collection(Model.Vw_BusinessRuleBypassRequestDetails)">
            <Parameter Name="BusinessRuleBypassRequestTypeID" Mode="In" Type="Int16" />
            <Parameter Name="RelatedReferenceNumber" Mode="In" Type="String" />
            <Parameter Name="Reason" Mode="In" Type="String" />
            <Parameter Name="RequestEntityID" Mode="In" Type="Int32" />
            <Parameter Name="RequestItemID" Mode="In" Type="Int64" />
            <Parameter Name="UserID" Mode="In" Type="Int64" />
          </FunctionImport>
        </EntityContainer>
        <ComplexType Name="Pr_BusinessRuleBypassRequestPrecheck_Result">
          <Property Type="Int64" Name="EntityID" Nullable="true" />
          <Property Type="Int64" Name="ItemID" Nullable="true" />
        </ComplexType>
        <EntityType Name="Vw_BusinessRuleBypassRequestDetails">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestDetailID" />
            <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            <PropertyRef Name="BusinessRuleBypassRequestType" />
            <PropertyRef Name="Reason" />
            <PropertyRef Name="EntityID" />
            <PropertyRef Name="ItemID" />
            <PropertyRef Name="CreatedByID" />
            <PropertyRef Name="CreatedDate" />
            <PropertyRef Name="UpdatedByID" />
            <PropertyRef Name="UpdatedDate" />
          </Key>
          <Property Name="BusinessRuleBypassRequestDetailID" Type="Int64" Nullable="false" />
          <Property Name="OfficeLocationID" Type="Int64" />
          <Property Name="DivisionTypeID" Type="Int16" />
          <Property Name="ProvinceID" Type="Int16" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="ReferenceNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="RelatedReferenceNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="BusinessRuleBypassRequestTypeID" Type="Int16" Nullable="false" />
          <Property Name="BusinessRuleBypassRequestType" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="Reason" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Name="EntityID" Type="Int32" Nullable="false" />
          <Property Name="ItemID" Type="Int64" 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" />
        </EntityType>
        <EntityType Name="BusinessRuleBypassRequestDetail">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestDetailID" />
          </Key>
          <Property Name="BusinessRuleBypassRequestDetailID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="OfficeLocationID" Type="Int64" />
          <Property Name="DivisionTypeID" Type="Int16" />
          <Property Name="ProvinceID" Type="Int16" />
          <Property Name="WorkflowInstanceID" Type="Int64" />
          <Property Name="ReferenceNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="RelatedReferenceNumber" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
          <Property Name="BusinessRuleBypassRequestTypeID" Type="Int16" Nullable="false" />
          <Property Name="Reason" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Name="EntityID" Type="Int32" Nullable="false" />
          <Property Name="ItemID" Type="Int64" 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" />
          <NavigationProperty Name="BusinessRuleBypassRequestType" Relationship="Model.FK__BusinessR__Busin__7DA458C7" FromRole="BusinessRuleBypassRequestDetail" ToRole="BusinessRuleBypassRequestType" />
        </EntityType>
        <EntityType Name="BusinessRuleBypassRequestType">
          <Key>
            <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
          </Key>
          <Property Name="BusinessRuleBypassRequestTypeID" Type="Int16" Nullable="false" />
          <Property Name="Title" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="IsCancelled" Type="Boolean" Nullable="false" />
          <NavigationProperty Name="BusinessRuleBypassRequestDetails" Relationship="Model.FK__BusinessR__Busin__7DA458C7" FromRole="BusinessRuleBypassRequestType" ToRole="BusinessRuleBypassRequestDetail" />
        </EntityType>
        <Association Name="FK__BusinessR__Busin__7DA458C7">
          <End Type="Model.BusinessRuleBypassRequestType" Role="BusinessRuleBypassRequestType" Multiplicity="1" />
          <End Type="Model.BusinessRuleBypassRequestDetail" Role="BusinessRuleBypassRequestDetail" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="BusinessRuleBypassRequestType">
              <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            </Principal>
            <Dependent Role="BusinessRuleBypassRequestDetail">
              <PropertyRef Name="BusinessRuleBypassRequestTypeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
      </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="LegitimateNATIONALModelStoreContainer" CdmEntityContainer="BusinessRuleBypassContext">
          <FunctionImportMapping FunctionImportName="Pr_BusinessRuleBypassRequestPrecheck" FunctionName="LegitimateNATIONALModel.Store.Pr_BusinessRuleBypassRequestPrecheck">
            <ResultMapping>
              <ComplexTypeMapping TypeName="Model.Pr_BusinessRuleBypassRequestPrecheck_Result">
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
              </ComplexTypeMapping>
            </ResultMapping>
          </FunctionImportMapping>
          <EntitySetMapping Name="Vw_BusinessRuleBypassRequestDetails">
            <EntityTypeMapping TypeName="Model.Vw_BusinessRuleBypassRequestDetails">
              <MappingFragment StoreEntitySet="Vw_BusinessRuleBypassRequestDetails">
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="Reason" ColumnName="Reason" />
                <ScalarProperty Name="BusinessRuleBypassRequestType" ColumnName="BusinessRuleBypassRequestType" />
                <ScalarProperty Name="BusinessRuleBypassRequestTypeID" ColumnName="BusinessRuleBypassRequestTypeID" />
                <ScalarProperty Name="RelatedReferenceNumber" ColumnName="RelatedReferenceNumber" />
                <ScalarProperty Name="ReferenceNumber" ColumnName="ReferenceNumber" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="ProvinceID" ColumnName="ProvinceID" />
                <ScalarProperty Name="DivisionTypeID" ColumnName="DivisionTypeID" />
                <ScalarProperty Name="OfficeLocationID" ColumnName="OfficeLocationID" />
                <ScalarProperty Name="BusinessRuleBypassRequestDetailID" ColumnName="BusinessRuleBypassRequestDetailID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="BusinessRuleBypassRequestDetails">
            <EntityTypeMapping TypeName="Model.BusinessRuleBypassRequestDetail">
              <MappingFragment StoreEntitySet="BusinessRuleBypassRequestDetails">
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="Reason" ColumnName="Reason" />
                <ScalarProperty Name="BusinessRuleBypassRequestTypeID" ColumnName="BusinessRuleBypassRequestTypeID" />
                <ScalarProperty Name="RelatedReferenceNumber" ColumnName="RelatedReferenceNumber" />
                <ScalarProperty Name="ReferenceNumber" ColumnName="ReferenceNumber" />
                <ScalarProperty Name="WorkflowInstanceID" ColumnName="WorkflowInstanceID" />
                <ScalarProperty Name="ProvinceID" ColumnName="ProvinceID" />
                <ScalarProperty Name="DivisionTypeID" ColumnName="DivisionTypeID" />
                <ScalarProperty Name="OfficeLocationID" ColumnName="OfficeLocationID" />
                <ScalarProperty Name="BusinessRuleBypassRequestDetailID" ColumnName="BusinessRuleBypassRequestDetailID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <EntitySetMapping Name="BusinessRuleBypassRequestTypes">
            <EntityTypeMapping TypeName="Model.BusinessRuleBypassRequestType">
              <MappingFragment StoreEntitySet="BusinessRuleBypassRequestTypes">
                <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
                <ScalarProperty Name="Title" ColumnName="Title" />
                <ScalarProperty Name="BusinessRuleBypassRequestTypeID" ColumnName="BusinessRuleBypassRequestTypeID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_BusinessRuleBypassRequestCreate" FunctionName="LegitimateNATIONALModel.Store.Pr_BusinessRuleBypassRequestCreate" />
        </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="UseLegacyProvider" Value="false" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams></Diagrams>
  </Designer>
</edmx:Edmx>