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