问题
When saving changes, the follow Exception occurs: "Assembly could not be found for EntityName:#xx.xx.xx.xx.Entities"
First 3 lines of Stack:
at Breeze.ContextProvider.ContextProvider.LookupEntityType(String entityTypeName)
at Breeze.ContextProvider.SaveWorkState.<.ctor>b__8(IGrouping`2 g)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
JS:
function remove(entity) {
entity.entityAspect.setDeleted();
return this.manager
.saveChanges()
.then(ok, ko);
}
What can be causing this issue?
回答1:
That exception happens if the Breeze ContextProvider cannot find a server-side class for the entity type you are trying to save.
When manager.saveChanges
is called on the client, the JSON for each entity includes an entityAspect
object with an entityTypeName
property that is the fully-qualified class name of the entity. This tells the server how to materialize the entity.
In your case, there is no class on the server matching the entityTypeName
that your client is sending.
来源:https://stackoverflow.com/questions/31954460/save-changes-with-breeze-assembly-could-not-be-found-for-entitynamexx-xx-xx-xx