Closed siegrainwong closed 5 years ago
明白了 ,谢谢解答
不过我的Delete
里有五条语句,所以才想这样操作的。
现在声明了个虚方法加上Transaction
实现了。
@Seanwong933 下个小版本将支持
点赞~
Ref https://github.com/dotnetcore/SmartSql/releases/tag/v4.0.29
可以通过一下几种方式开启事物:
[UseTransaction]
long DoByAnnotationTransaction(AllPrimitive entity);
<Statement Id="DoByTransaction" Transaction="Unspecified">
// do-something-0
// do-something-1
// do-something-2
// do-something-3
</Statement>
var id = DbSession.ExecuteScalar<long>(new RequestContext
{
Scope = nameof(User),
SqlId = "Insert",
Transaction = IsolationLevel.Unspecified,
Request = new User
{
UserName= "SmartSql",
}
});
谢谢,用上了~
在虚方法上这个特性有效,在接口方法上无效: 请问是不支持接口吗?
有效示例:
无效示例: