﻿<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
    <Schema Namespace="AuditModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2008" 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="History">
          <Key>
            <PropertyRef Name="HistoryID" />
          </Key>
          <Property Name="HistoryID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="SourceID" Type="smallint" Nullable="false" />
          <Property Name="ActionID" Type="smallint" Nullable="false" />
          <Property Name="Description" Type="varchar(max)" />
          <Property Name="IsCritical" Type="bit" Nullable="false" />
          <Property Name="IsException" Type="bit" Nullable="false" />
          <Property Name="EntityID" Type="int" />
          <Property Name="ItemID" Type="bigint" />
          <Property Name="CreatedByID" Type="bigint" Nullable="false" />
          <Property Name="CreatedDate" Type="datetime" Nullable="false" />
        </EntityType>
        <!--Errors Found During Generation:
warning 6002: The table/view 'EPWP.Audit.Vw_Audits' 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_Audits">
          <Key>
            <PropertyRef Name="HistoryID" />
            
            
            
            
            
            
            
          </Key>
          <Property Name="HistoryID" Type="bigint" Nullable="false" />
          <Property Name="SourceID" Type="smallint" Nullable="false" />
          <Property Name="ActionID" Type="smallint" Nullable="false" />
          <Property Name="EntityID" Type="int" />
          <Property Name="ItemID" Type="bigint" />
          <Property Name="Source" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="Action" Type="varchar" MaxLength="50" Nullable="false" />
          <Property Name="Description" Type="varchar(max)" />
          <Property Name="IsCritical" Type="bit" Nullable="false" />
          <Property Name="IsException" Type="bit" Nullable="false" />
          <Property Name="AuditUser" Type="varchar" MaxLength="101" />
          <Property Name="AuditDate" Type="datetime" Nullable="false" />
        </EntityType>
        <Function Name="Pr_WriteEntryByID" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Audit">
          <Parameter Name="UserID" Type="bigint" Mode="In" />
          <Parameter Name="Source" Type="varchar" Mode="In" />
          <Parameter Name="Action" Type="varchar" Mode="In" />
          <Parameter Name="Description" Type="varchar(max)" Mode="In" />
          <Parameter Name="IsCritical" Type="bit" Mode="In" />
          <Parameter Name="IsException" Type="bit" Mode="In" />
          <Parameter Name="EntityID" Type="bigint" Mode="In" />
          <Parameter Name="ItemID" Type="bigint" Mode="In" />
        </Function>
        <EntityContainer Name="AuditModelStoreContainer">
          <EntitySet Name="History" EntityType="Self.History" Schema="Audit" store:Type="Tables" />
          <EntitySet Name="Vw_Audits" EntityType="Self.Vw_Audits" store:Type="Views" store:Schema="Audit">
            <DefiningQuery>SELECT 
[Vw_Audits].[HistoryID] AS [HistoryID], 
[Vw_Audits].[SourceID] AS [SourceID], 
[Vw_Audits].[ActionID] AS [ActionID], 
[Vw_Audits].[EntityID] AS [EntityID], 
[Vw_Audits].[ItemID] AS [ItemID], 
[Vw_Audits].[Source] AS [Source], 
[Vw_Audits].[Action] AS [Action], 
[Vw_Audits].[Description] AS [Description], 
[Vw_Audits].[IsCritical] AS [IsCritical], 
[Vw_Audits].[IsException] AS [IsException], 
[Vw_Audits].[AuditUser] AS [AuditUser], 
[Vw_Audits].[AuditDate] AS [AuditDate]
FROM [Audit].[Vw_Audits] AS [Vw_Audits]</DefiningQuery>
          </EntitySet>
        </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="AuditContext" annotation:LazyLoadingEnabled="true">
          <EntitySet Name="Vw_Audits" EntityType="Model.Vw_Audits" />
          <FunctionImport Name="Pr_WriteEntryByID">
            <Parameter Name="UserID" Mode="In" Type="Int64" />
            <Parameter Name="Source" Mode="In" Type="String" />
            <Parameter Name="Action" Mode="In" Type="String" />
            <Parameter Name="Description" Mode="In" Type="String" />
            <Parameter Name="IsCritical" Mode="In" Type="Boolean" />
            <Parameter Name="IsException" Mode="In" Type="Boolean" />
            <Parameter Name="EntityID" Mode="In" Type="Int64" />
            <Parameter Name="ItemID" Mode="In" Type="Int64" />
          </FunctionImport>
          <EntitySet Name="History" EntityType="Model.History" />
          </EntityContainer>
        <EntityType Name="Vw_Audits">
          <Key>
            <PropertyRef Name="HistoryID" />
          </Key>
          <Property Type="Int16" Name="SourceID" Nullable="false" />
          <Property Type="Int16" Name="ActionID" Nullable="false" />
          <Property Type="Int32" Name="EntityID" />
          <Property Type="Int64" Name="ItemID" />
          <Property Type="String" Name="Source" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="Action" Nullable="false" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="Description" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Type="Boolean" Name="IsCritical" Nullable="false" />
          <Property Type="Boolean" Name="IsException" Nullable="false" />
          <Property Type="Int64" Name="HistoryID" Nullable="false" />
          <Property Type="String" Name="AuditUser" MaxLength="101" FixedLength="false" Unicode="false" />
          <Property Type="DateTime" Name="AuditDate" Nullable="false" Precision="3" />
        </EntityType>
        <EntityType Name="History">
          <Key>
            <PropertyRef Name="HistoryID" />
          </Key>
          <Property Name="HistoryID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="SourceID" Type="Int16" Nullable="false" />
          <Property Name="ActionID" Type="Int16" Nullable="false" />
          <Property Name="Description" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
          <Property Name="IsCritical" Type="Boolean" Nullable="false" />
          <Property Name="IsException" Type="Boolean" Nullable="false" />
          <Property Name="EntityID" Type="Int32" />
          <Property Name="ItemID" Type="Int64" />
          <Property Name="CreatedByID" Type="Int64" Nullable="false" />
          <Property Name="CreatedDate" Type="DateTime" 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="AuditModelStoreContainer" CdmEntityContainer="AuditContext">
          <EntitySetMapping Name="Vw_Audits">
            <EntityTypeMapping TypeName="Model.Vw_Audits">
              <MappingFragment StoreEntitySet="Vw_Audits">
                <ScalarProperty Name="AuditDate" ColumnName="AuditDate" />
                <ScalarProperty Name="AuditUser" ColumnName="AuditUser" />
                <ScalarProperty Name="HistoryID" ColumnName="HistoryID" />
                <ScalarProperty Name="IsException" ColumnName="IsException" />
                <ScalarProperty Name="IsCritical" ColumnName="IsCritical" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="Action" ColumnName="Action" />
                <ScalarProperty Name="Source" ColumnName="Source" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="ActionID" ColumnName="ActionID" />
                <ScalarProperty Name="SourceID" ColumnName="SourceID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_WriteEntryByID" FunctionName="AuditModel.Store.Pr_WriteEntryByID" />
          <EntitySetMapping Name="History">
            <EntityTypeMapping TypeName="Model.History">
              <MappingFragment StoreEntitySet="History">
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="IsException" ColumnName="IsException" />
                <ScalarProperty Name="IsCritical" ColumnName="IsCritical" />
                <ScalarProperty Name="Description" ColumnName="Description" />
                <ScalarProperty Name="ActionID" ColumnName="ActionID" />
                <ScalarProperty Name="SourceID" ColumnName="SourceID" />
                <ScalarProperty Name="HistoryID" ColumnName="HistoryID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          </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="True" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="AuditModel">
        <EntityTypeShape EntityType="Model.Vw_Audits" Width="1.5" PointX="2.875" PointY="0.875" Height="3.3263964843749996" />
        <EntityTypeShape EntityType="Model.History" Width="1.5" PointX="5.375" PointY="0.75" />
        </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>