EntityFramework抛“未找到具有标识{0}的类型的对象映射”异常的可能解决方法

These are the things that could cause this error:

1. The code for the type "monaco.reservation.reservation" was actually hand written and you forgot to Attribute it correctly.

2. We were unable to find the clr type for "monaco.reservation.reservation" since it is in a different assembly. But in your specific case this should not occur since you are using the property on the context( context.reservation) which should tell us where the assembly is. But if for some reason this is the problem, you can do something like this : context.MetadataWorkspace.LoadFromAssembly( typeof(monaco.reservation.reservation).Assembly);

http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/7b1798fd-c315-498e-9781-3802564dff9b

posted @ 2011-10-14 11:33  不会游水的鱼  阅读(389)  评论(0)    收藏  举报