user1329695
user1329695

Reputation:

EF5 stored procedure issue

I have an entity which uses a stored procedure for the Insert method. The insert operation works fine, but I am currently unable to delete records. I get this error:

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.

I read in Julie Lerman's book that specifying procs for all methods is no longer required. Was this a feature of version 4.x, which has now been tightened again?

Upvotes: 3

Views: 1104

Answers (1)

Troy Alford
Troy Alford

Reputation: 27236

It would appear that this is an issue at least in Beta. Please check out the following MSDN thread:

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

Which also references this article:

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

In short, there are 2 basic caveats which you must keep in mind when doing SP mappings in EF5:

  1. You cannot map functions entities that contain ComplexTypes
  2. If you have Update mapped, but not Delete, you will get an UpdateException, such as you are describing.

So yes, it appears that at least as far as Beta is concerned, this is a constraint which has been re-tightened.

Upvotes: 0

Related Questions