我为添加/编辑成员打开了一个成员表单。它有自己的实体管理器,当单击“保存”按钮时,我关闭表单并返回到列表表单。
处理保存后,我调用一个名为CalculateOwing 的例程来计算成员余额。此方法位于单独的 .cs 文件中,因为可以从应用程序的许多区域调用它。
CalculateOwing 方法应该在单独的实体管理器中还是在与正在处理的成员记录相同的实体管理器中?
A response to this question can be seen at http://www.ideablade.com/forum/forum_posts.asp?TID=4686&title=need-advice-on-entity-manager
EDIT:
Including the response here.
"If you want the results of CalculateOwing to be part of the same database transaction, you need to call it before the Save completes and on the same EntityManager that the Save is using."