Skip to content
New issue

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

是否可以让UseTransactionAttribute 可使用在 类上,让类里面所有方法都默认使用事务 #105

Open
XiaoHeitu opened this issue Sep 3, 2019 · 3 comments
Assignees

Comments

@XiaoHeitu
Copy link
Collaborator

SmartSql version

4.1.25

Database provider and version

Steps to reproduce

Expected result

namespace SmartSql.DyRepository.Annotations
{
[AttributeUsage(AttributeTargets.Method||AttributeTargets.Class, AllowMultiple = false)]
public class UseTransactionAttribute : Attribute
{
public IsolationLevel Level { get; set; } = IsolationLevel.Unspecified;
}
}

Actual result

namespace SmartSql.DyRepository.Annotations
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class UseTransactionAttribute : Attribute
{
public IsolationLevel Level { get; set; } = IsolationLevel.Unspecified;
}
}

Stack trace

@Ahoo-Wang
Copy link
Member

UseTransactionAttribute 作用域是 动态仓储接口 , 请使用 SmartSql.AOP 提供的事务注解。
https://github.com/dotnetcore/SmartSql/blob/master/src/SmartSql.AOP/TransactionAttribute.cs

@Ahoo-Wang Ahoo-Wang reopened this Sep 4, 2019
@Ahoo-Wang
Copy link
Member

SmartSql.AOP.TransactionAttribute.cs 类注解的作用域,你可以尝试写写,然后提供PR。

XiaoHeitu pushed a commit to XiaoHeitu/SmartSql that referenced this issue Sep 11, 2019
@XiaoHeitu
Copy link
Collaborator Author

好的。已提交PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants