We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
需要安装FreeSql.DbContext
dotnet add package FreeSql dotnet add package FreeSql.DbContext dotnet add package FreeSql.Provider.MySqlConnector
var repoA = orm.GetRepository<A>(); var repoB = orm.GetRepository<B>(); var a = new A(); repoA.Insert(a); var b = new B { id = a.Id }; repoB.Insert(b);
reposA.Insert(a);,如果 A 有自增,会自动填充 a.id 插入后的值。
后面就可以直接使用 a.id 来添加 b了。
The text was updated successfully, but these errors were encountered:
using (var uow = orm.CreateUnitOfWork()) { var repoA = orm.GetRepository<A>(); var repoB = orm.GetRepository<B>(); var a = new A(); repoA.Insert(a); var b = new B { id = a.Id }; repoB.Insert(b); uow.Commit(); }
Sorry, something went wrong.
No branches or pull requests
需要安装FreeSql.DbContext
无事务的做法
reposA.Insert(a);,如果 A 有自增,会自动填充 a.id 插入后的值。
后面就可以直接使用 a.id 来添加 b了。
The text was updated successfully, but these errors were encountered: