首先是ef的多数据库操作实现事务的方法 public int AddDifferenceDB(userinfo1 user1, userinfo user) { ; using (var test2DB = new test2Entities1()) { using (var test1DB = new test1Entities1()) { using (TransactionScope trans = new TransactionScope()) { try { test2DB.Set<u