2012-09-05 125 views
3

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

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版本的一个特性,它现在又被收紧了吗?

回答

1

这似乎是一个问题,至少在测试版中。请看看下面的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

总之,有2米,你必须做SP映射时牢记基本的注意事项在EF5中:

  1. 您不能映射包含复杂类型的函数实体
  2. 如果您有更新映射,但不是删除,您将得到一个UpdateException,如您所描述的。

所以,似乎至少就Beta而言,这是一个已经重新收紧的约束。