mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-18 16:59:03 +08:00
Update unit of work
This commit is contained in:
@@ -83,8 +83,8 @@ namespace SqlSugar
|
||||
public RepositoryType GetMyRepository<RepositoryType>() where RepositoryType:new()
|
||||
{
|
||||
var result = (ISugarRepository)new RepositoryType();
|
||||
var type = typeof(RepositoryType).GetGenericArguments()[0];
|
||||
TenantAttribute tenantAttribute = type.GetCustomAttribute<TenantAttribute>();
|
||||
var type = typeof(RepositoryType).GetGenericArguments().FirstOrDefault();
|
||||
TenantAttribute tenantAttribute = type?.GetCustomAttribute<TenantAttribute>();
|
||||
if (tenantAttribute == null)
|
||||
{
|
||||
result.Context = this.Db;
|
||||
|
||||
Reference in New Issue
Block a user