public void Remove(Query query) { //TODO:好像Remove(Query query)并不能保证事务操作,因为没添加到UnitOfWork里面 //先提交事务 unitOfWork.Commit(); DataSession = DataSessionFactory.GetDataSession <T, TEntityKey>(); DataSession.Remove(query); }
public Repository(IUnitOfWork unitOfWork) { this.UnitOfWork = unitOfWork; DataSession = DataSessionFactory.GetDataSession <T, TEntityKey>(); }