gpt4 book ai didi

stored-procedures - EF5 存储过程问题

转载 作者:行者123 更新时间:2023-12-04 18:31:51 25 4
gpt4 key购买 nike

我有一个为 Insert 方法使用存储过程的实体。插入操作工作正常,但我目前无法删除记录。我收到此错误:

System.Data.Entity.Infrastructure.DbUpdateException: System.Data.Entity.Infrastructure.DbUpdateException: Cannot find the DeleteFunctionMapping for EntityType 'LoanDetail' in the mapping file. ---> System.Data.UpdateException: Cannot find the DeleteFunctionMapping for EntityType 'LoanDetail' in the mapping file.

我在 Julie Lerman 的书中读到,不再需要为所有方法指定过程。这是版本 4.x 的功能,现在又收紧了吗?

最佳答案

看来这至少在 Beta 版中是个问题。请查看以下 MSDN 线程:

http://social.msdn.microsoft.com/Forums/en-US/silverlightwcf/thread/9a59afab-a760-4e28-abad-cef34b3a712e/

其中还引用了这篇文章:

http://www.code-magazine.com/article.aspx?quickid=0911121&page=3

简而言之,在 EF5 中进行 SP 映射时必须牢记 2 个基本注意事项:

  1. 您不能映射包含 ComplexType 的函数实体
  2. 如果您有更新映射,但没有删除删除,您将得到一个 UpdateException,如您所描述的那样。

是的,看来至少就 Beta 而言,这是一个重新收紧的约束。

关于stored-procedures - EF5 存储过程问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12289937/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com