﻿<?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="CommentModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2005" 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="Comments">
          <Key>
            <PropertyRef Name="CommentID" />
          </Key>
          <Property Name="CommentID" Type="bigint" StoreGeneratedPattern="Identity" Nullable="false" />
          <Property Name="EntityID" Type="int" Nullable="false" />
          <Property Name="ItemID" Type="bigint" Nullable="false" />
          <Property Name="Comment" Type="varchar" MaxLength="2000" Nullable="false" />
          <Property Name="IsCancelled" 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" />
        </EntityType>
        <EntityType Name="Users">
          <Key>
            <PropertyRef Name="UserID" />
          </Key>
          <Property Name="UserID" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="UserStatusID" Type="smallint" Nullable="false" />
          <Property Name="EntityID" Type="int" />
          <Property Name="ItemID" Type="varchar" MaxLength="20" />
          <Property Name="LastName" Type="varchar" MaxLength="50" />
          <Property Name="FirstName" Type="varchar" MaxLength="50" />
          <Property Name="FullName" Type="varchar" MaxLength="101" StoreGeneratedPattern="Computed" Nullable="false" />
          <Property Name="KnownAs" Type="varchar" MaxLength="101" />
          <Property Name="Email" Type="varchar" MaxLength="255" Nullable="false" />
          <Property Name="NTAccount" Type="varchar" MaxLength="255" />
          <Property Name="Cell" Type="varchar" MaxLength="10" />
          <Property Name="IsPasswordExpired" Type="bit" />
          <Property Name="PasswordDate" Type="datetime" />
          <Property Name="PasswordHash" Type="varchar" MaxLength="255" />
          <Property Name="PasswordSalt" Type="varchar" MaxLength="20" />
          <Property Name="PasswordChallenge" Type="varchar" MaxLength="20" />
          <Property Name="PasswordQuestion" Type="varchar" MaxLength="255" />
          <Property Name="PasswordAnswerHash" Type="varchar" MaxLength="255" />
          <Property Name="PasswordAnswerSalt" Type="varchar" MaxLength="20" />
          <Property Name="PasswordAnswerChallenge" Type="varchar" MaxLength="20" />
          <Property Name="FingerprintTemplate" Type="varbinary(max)" />
          <Property Name="FingerprintRequestToken" Type="varchar" MaxLength="255" />
          <Property Name="FingerprintRequestExpiryDate" Type="datetime" />
          <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_Comments_Users_CreatedBy">
          <End Role="Users" Type="Self.Users" Multiplicity="1" />
          <End Role="Comments" Type="Self.Comments" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Users">
              <PropertyRef Name="UserID" />
            </Principal>
            <Dependent Role="Comments">
              <PropertyRef Name="CreatedByID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Comments_Users_UpdatedBy">
          <End Role="Users" Type="Self.Users" Multiplicity="1" />
          <End Role="Comments" Type="Self.Comments" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Users">
              <PropertyRef Name="UserID" />
            </Principal>
            <Dependent Role="Comments">
              <PropertyRef Name="UpdatedByID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Function Name="Pr_CommentCreate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="EntityID" Type="int" Mode="In" />
          <Parameter Name="ItemID" Type="bigint" Mode="In" />
          <Parameter Name="Comment" Type="varchar" Mode="In" />
          <Parameter Name="CommentByUserName" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_CommentDelete" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="CommentID" Type="bigint" Mode="In" />
          <Parameter Name="CommentByUserName" Type="varchar" Mode="In" />
        </Function>
        <Function Name="Pr_CommentUpdate" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="Crm">
          <Parameter Name="CommentID" Type="bigint" Mode="In" />
          <Parameter Name="Comment" Type="varchar" Mode="In" />
          <Parameter Name="CommentByUserName" Type="varchar" Mode="In" />
        </Function>
        <EntityContainer Name="CommentModelStoreContainer">
          <EntitySet Name="Comments" EntityType="Self.Comments" Schema="Crm" store:Type="Tables" />
          <EntitySet Name="Users" EntityType="Self.Users" Schema="Security" store:Type="Tables" />
          <AssociationSet Name="FK_Comments_Users_CreatedBy" Association="Self.FK_Comments_Users_CreatedBy">
            <End Role="Users" EntitySet="Users" />
            <End Role="Comments" EntitySet="Comments" />
          </AssociationSet>
          <AssociationSet Name="FK_Comments_Users_UpdatedBy" Association="Self.FK_Comments_Users_UpdatedBy">
            <End Role="Users" EntitySet="Users" />
            <End Role="Comments" EntitySet="Comments" />
          </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="CommentContext" annotation:LazyLoadingEnabled="true">
          <EntitySet Name="Comments" EntityType="Model.Comment" />
          <EntitySet Name="CommentsUsers" EntityType="Model.CommentsUser" />
          <AssociationSet Name="FK_Comments_Users_CreatedBy" Association="Model.FK_Comments_Users_CreatedBy">
            <End Role="User" EntitySet="CommentsUsers" />
            <End Role="Comment" EntitySet="Comments" />
          </AssociationSet>
          <AssociationSet Name="FK_Comments_Users_UpdatedBy" Association="Model.FK_Comments_Users_UpdatedBy">
            <End Role="User" EntitySet="CommentsUsers" />
            <End Role="Comment" EntitySet="Comments" />
          </AssociationSet>
          <FunctionImport Name="Pr_CommentUpdate" ReturnType="Collection(Boolean)">
            <Parameter Name="CommentID" Mode="In" Type="Int64" />
            <Parameter Name="Comment" Mode="In" Type="String" />
            <Parameter Name="CommentByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_CommentDelete" ReturnType="Collection(Boolean)">
            <Parameter Name="CommentID" Mode="In" Type="Int64" />
            <Parameter Name="CommentByUserName" Mode="In" Type="String" />
          </FunctionImport>
          <FunctionImport Name="Pr_CommentCreate" ReturnType="Collection(Int64)">
            <Parameter Name="EntityID" Mode="In" Type="Int32" />
            <Parameter Name="ItemID" Mode="In" Type="Int64" />
            <Parameter Name="Comment" Mode="In" Type="String" />
            <Parameter Name="CommentByUserName" Mode="In" Type="String" />
          </FunctionImport>
          </EntityContainer>
        <EntityType Name="Comment">
          <Key>
            <PropertyRef Name="CommentID" />
          </Key>
          <Property Name="CommentID" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="EntityID" Type="Int32" Nullable="false" />
          <Property Name="ItemID" Type="Int64" Nullable="false" />
          <Property Name="Comments" Type="String" Nullable="false" MaxLength="2000" 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" />
          <Property Type="Boolean" Name="IsCancelled" Nullable="false" />
          <NavigationProperty Name="UserCreatedBy" Relationship="Model.FK_Comments_Users_CreatedBy" FromRole="Comment" ToRole="User" />
          <NavigationProperty Name="UserUpdatedBy" Relationship="Model.FK_Comments_Users_UpdatedBy" FromRole="Comment" ToRole="User" />
          </EntityType>
        <EntityType Name="CommentsUser">
          <Key>
            <PropertyRef Name="UserID" />
          </Key>
          <Property Type="Int64" Name="UserID" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Type="Int16" Name="UserStatusID" Nullable="false" />
          <Property Type="String" Name="LastName" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="FirstName" MaxLength="50" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="FullName" Nullable="false" MaxLength="101" FixedLength="false" Unicode="false" annotation:StoreGeneratedPattern="Computed" />
          <Property Type="String" Name="Email" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Type="Int32" Name="EntityID" a:GetterAccess="Internal" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" a:SetterAccess="Internal" />
          <Property Type="String" Name="ItemID" MaxLength="20" FixedLength="false" Unicode="false" a:GetterAccess="Internal" xmlns:a="http://schemas.microsoft.com/ado/2006/04/codegeneration" a:SetterAccess="Internal" />
          <Property Type="String" Name="KnownAs" MaxLength="101" FixedLength="false" Unicode="false" />
          <Property Type="String" Name="Cell" MaxLength="10" FixedLength="false" Unicode="false" />
          <Property Name="CreatedByID" Type="Int64" Nullable="false" />
          <Property Name="UpdatedByID" Type="Int64" Nullable="false" />
          <Property Name="CreatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <Property Name="UpdatedDate" Type="DateTime" Nullable="false" Precision="3" />
          <Property Name="FingerprintRequestToken" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
          <Property Name="FingerprintRequestExpiryDate" Type="DateTime" Precision="3" />
        </EntityType>
        <Association Name="FK_Comments_Users_CreatedBy">
          <End Type="Model.CommentsUser" Role="User" Multiplicity="1" />
          <End Type="Model.Comment" Role="Comment" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="User">
              <PropertyRef Name="UserID" />
            </Principal>
            <Dependent Role="Comment">
              <PropertyRef Name="CreatedByID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Comments_Users_UpdatedBy">
          <End Type="Model.CommentsUser" Role="User" Multiplicity="1" />
          <End Type="Model.Comment" Role="Comment" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="User">
              <PropertyRef Name="UserID" />
            </Principal>
            <Dependent Role="Comment">
              <PropertyRef Name="UpdatedByID" />
            </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="CommentModelStoreContainer" CdmEntityContainer="CommentContext">
          <EntitySetMapping Name="Comments"><EntityTypeMapping TypeName="Model.Comment"><MappingFragment StoreEntitySet="Comments">
            <ScalarProperty Name="IsCancelled" ColumnName="IsCancelled" />
                <ScalarProperty Name="CommentID" ColumnName="CommentID" />
            <ScalarProperty Name="EntityID" ColumnName="EntityID" />
            <ScalarProperty Name="ItemID" ColumnName="ItemID" />
            <ScalarProperty Name="Comments" ColumnName="Comment" />
            <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="CommentsUsers">
            <EntityTypeMapping TypeName="Model.CommentsUser">
              <MappingFragment StoreEntitySet="Users">
                <ScalarProperty Name="FingerprintRequestExpiryDate" ColumnName="FingerprintRequestExpiryDate" />
                <ScalarProperty Name="FingerprintRequestToken" ColumnName="FingerprintRequestToken" />
                <ScalarProperty Name="UpdatedDate" ColumnName="UpdatedDate" />
                <ScalarProperty Name="CreatedDate" ColumnName="CreatedDate" />
                <ScalarProperty Name="UpdatedByID" ColumnName="UpdatedByID" />
                <ScalarProperty Name="CreatedByID" ColumnName="CreatedByID" />
                <ScalarProperty Name="Cell" ColumnName="Cell" />
                <ScalarProperty Name="KnownAs" ColumnName="KnownAs" />
                <ScalarProperty Name="ItemID" ColumnName="ItemID" />
                <ScalarProperty Name="EntityID" ColumnName="EntityID" />
                <ScalarProperty Name="Email" ColumnName="Email" />
                <ScalarProperty Name="FullName" ColumnName="FullName" />
                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
                <ScalarProperty Name="LastName" ColumnName="LastName" />
                <ScalarProperty Name="UserStatusID" ColumnName="UserStatusID" />
                <ScalarProperty Name="UserID" ColumnName="UserID" />
              </MappingFragment>
            </EntityTypeMapping>
          </EntitySetMapping>
          <FunctionImportMapping FunctionImportName="Pr_CommentUpdate" FunctionName="CommentModel.Store.Pr_CommentUpdate" />
          <FunctionImportMapping FunctionImportName="Pr_CommentDelete" FunctionName="CommentModel.Store.Pr_CommentDelete" />
          <FunctionImportMapping FunctionImportName="Pr_CommentCreate" FunctionName="CommentModel.Store.Pr_CommentCreate" />
        </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="CommentModel">
        <EntityTypeShape EntityType="Model.Comment" Width="1.5" PointX="0.75" PointY="0.75" Height="2.5571907552083335" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.CommentsUser" Width="2.625" PointX="3.75" PointY="0.5" Height="4.8648079427083326" />
        <AssociationConnector Association="Model.FK_Comments_Users_CreatedBy" >
          <ConnectorPoint PointX="3.75" PointY="2.8722506205240883" />
          <ConnectorPoint PointX="2.25" PointY="2.8722506205240883" />
        </AssociationConnector>
        <AssociationConnector Association="Model.FK_Comments_Users_UpdatedBy" >
          <ConnectorPoint PointX="3.75" PointY="1.7486253102620442" />
          <ConnectorPoint PointX="2.25" PointY="1.7486253102620442" />
        </AssociationConnector>
        </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>