【问题标题】:ReturnType "invalid child element" of Function element in EDMXEDMX 中 Function 元素的 ReturnType “无效子元素”
【发布时间】:2021-01-19 16:14:24
【问题描述】:
<Schema Namespace="OurModel.Store" 
    ... 
    xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">

  <Function Name="fn_Test" Schema="dbo" IsComposable="true">
    <ReturnType>
      <CollectionType>
        <RowType>
          <Property Name="A" Type="varchar" MaxLength="10" />
          <Property Name="B" Type="varchar" MaxLength="60" />
        </RowType>
      </CollectionType>
    </ReturnType>
    <Parameter Name="X" Mode="In" Type="varchar" MaxLength="10" />
    <Parameter Name="Y" Mode="In" Type="int" />
  </Function>

错误:

错误 5:命名空间 'http://schemas.microsoft.com/ado/2009/02/edm/ssdl' 中的元素 'Function' 具有无效的子元素 'ReturnType ' 在命名空间“http://schemas.microsoft.com/ado/2009/02/edm/ssdl”中。预期的可能元素列表:命名空间“http://schemas.microsoft.com/ado/2009/02/edm/ssdl”中的“文档、命令文本、参数”以及命名空间“##other”中的任何元素。

MSDN documents ReturnType as a child element of Function.

我们的模型使用 EDMX 2.0。 ReturnType 是 EDMX 3.0 功能吗?

【问题讨论】:

  • 您好,您解决了吗?因为将我的项目移动到我的新电脑后我得到了同样的错误

标签: c# entity-framework edmx ssdl


【解决方案1】:

我已经解决了这个问题。

我删除了 XML 编辑器中所有有错误的行。然后我使用“打开方式”菜单中的“实体数据模型设计器”打开 EDMX 文件。最后一步我通过右键单击设计器从数据库中更新了模型。

【讨论】:

    猜你喜欢
    • 2011-07-15
    • 2016-10-23
    • 2021-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多