문제

I have an assembly data project in my solution that is being consumed by a different project. The data project contains three different edmx entries.

I'm calling a function import in one, but inside the edmx.cs I'm receiving an error on the calling line:

return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction

((IObjectContextAdapter)this).ObjectContext

is returning the type of a different context entirely! Thus it cannot find the function I'm calling.

Has anyone seen this behavior before? I don't know why it would be in one context and yet return the other type when the ObjextContext is checked.

도움이 되었습니까?

해결책

A foolish mistake on my part. My connection string in the consuming project was pointing to the wrong csdl. The code compiles fine, you can update from the model perfectly, but it will break at runtime when the consuming project's config is used. Even though you can trace into the edmx.cs file for your data project, it will cast to the other model on the execution line.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top