1

私のアプリケーションは、最初に EF3.5 で開発を開始し、Model/EDMX を EF5 にアップグレードしました。2 つの結果セットを返すストアド プロシージャを使用しようとしています。これらの結果はどちらもクエリの結果であり、列の順序が正確なテーブルはありません。

Microsoft の記事の 2 番目の部分に従いましたが、コンパイルされます。ただし、実行時にエラーがスローされます

エラー 3027: 次の EntitySet/AssociationSet にマッピングが指定されていません - NotViewedReports、ViewedReports

どうすればこれを機能させることができますか?どんな助けでも大歓迎です

このストアド プロシージャのマッピング全体を次に示します。

<EntityType Name="NotViewedReport">
          <Key>
            <PropertyRef Name="RecordID" />
          </Key>
          <Property Name="RecordID" Type="String" Nullable="false" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportId" Type="Int32" Nullable="true" />
          <Property Name="ReportDesc" Type="String" Nullable="true" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportLink" Type="String" Nullable="true" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="DistributionDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="ReportTypeId" Type="Int32" Nullable="true" />
          <Property Name="IsLocked" Type="Boolean" Nullable="true" />
          <Property Name="EffectiveStartDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="EffectiveEndDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="Investor_ID" Type="Int32" Nullable="true" />
          <Property Name="Investor_Name" Type="String" Nullable="true" MaxLength="100" FixedLength="false" Unicode="true" />
        </EntityType>
        <EntityType Name="ViewedReport">
          <Key>
            <PropertyRef Name="RecordID" />
          </Key>
          <Property Name="RecordID" Type="String" Nullable="false" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportId" Type="Int32" Nullable="true" />
          <Property Name="ReportDesc" Type="String" Nullable="true" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportLink" Type="String" Nullable="true" MaxLength="240" FixedLength="false" Unicode="true" />
          <Property Name="ReportDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="DistributionDate" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="Mr_Ms" Type="String" Nullable="true" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Name="Last_Name" Type="String" Nullable="true" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Name="First_MI" Type="String" Nullable="true" MaxLength="50" FixedLength="false" Unicode="true" />
          <Property Name="Company" Type="String" Nullable="true" MaxLength="255" FixedLength="false" Unicode="true" />
          <Property Name="LoginTime" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="Contact_ID" Type="Int32" Nullable="true" />
          <Property Name="LastViewed" Type="DateTime" Nullable="true" Precision="3" />
          <Property Name="Investor_Name" Type="String" Nullable="true" MaxLength="100" FixedLength="false" Unicode="true" />
        </EntityType>
    </Schema>
    </edmx:ConceptualModels>

......
<FunctionImport Name="GetBatchViewStatus">
            <Parameter Name="batchFrom" Mode="In" Type="Int32" />
            <Parameter Name="batchTo" Mode="In" Type="Int32" />
            <ReturnType EntitySet="NotViewedReports" Type="Collection(IRISModel.NotViewedReport)" />
            <ReturnType EntitySet="ViewedReports" Type="Collection(IRISModel.ViewedReport)" />
          </FunctionImport>
        </EntityContainer>

.....
<FunctionImportMapping FunctionImportName="GetBatchViewStatus" FunctionName="IRISModel.Store.GetBatchViewStatus" >
              <ResultMapping>
                <EntityTypeMapping TypeName ="IRISModel.NotViewedReport">
                  <ScalarProperty Name="RecordID" ColumnName="RecordID" />
                  <ScalarProperty Name="ReportId" ColumnName="ReportId" />
                  <ScalarProperty Name="ReportDesc" ColumnName="ReportDesc" />
                  <ScalarProperty Name="ReportLink" ColumnName="ReportLink" />
                  <ScalarProperty Name="ReportDate" ColumnName="ReportDate" />
                  <ScalarProperty Name="DistributionDate" ColumnName="DistributionDate" />
                  <ScalarProperty Name="ReportTypeId" ColumnName="ReportTypeId" />
                  <ScalarProperty Name="IsLocked" ColumnName="IsLocked" />
                  <ScalarProperty Name="EffectiveStartDate" ColumnName="EffectiveStartDate" />
                  <ScalarProperty Name="EffectiveEndDate" ColumnName="EffectiveEndDate" />
                  <ScalarProperty Name="Investor_ID" ColumnName="Investor ID" />
                  <ScalarProperty Name="Investor_Name" ColumnName="Investor Name" />
                </EntityTypeMapping>
              </ResultMapping>
              <ResultMapping>
                <EntityTypeMapping TypeName="IRISModel.ViewedReport">
                  <ScalarProperty Name="RecordID" ColumnName="RecordID" />
                  <ScalarProperty Name="ReportId" ColumnName="ReportId" />
                  <ScalarProperty Name="ReportDesc" ColumnName="ReportDesc" />
                  <ScalarProperty Name="ReportLink" ColumnName="ReportLink" />
                  <ScalarProperty Name="ReportDate" ColumnName="ReportDate" />
                  <ScalarProperty Name="DistributionDate" ColumnName="DistributionDate" />
                  <ScalarProperty Name="Mr_Ms" ColumnName="Mr/Ms" />
                  <ScalarProperty Name="Last_Name" ColumnName="Last Name" />
                  <ScalarProperty Name="First_MI" ColumnName="[First/MI]" />
                  <ScalarProperty Name="Company" ColumnName="Company" />
                  <ScalarProperty Name="LoginTime" ColumnName="LoginTime" />
                  <ScalarProperty Name="Contact_ID" ColumnName="Contact ID" />
                  <ScalarProperty Name="LastViewed" ColumnName="LastViewed" />
                  <ScalarProperty Name="Investor_Name" ColumnName="Investor Name" />
                </EntityTypeMapping>
            </ResultMapping>
          </FunctionImportMapping>            
          </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
4

0 に答える 0