Browse Source

Synchronization code

pull/40/head
sunkaixuan 1 year ago
parent
commit
5396b085c8
  1. 4
      Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs

4
Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs

@ -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;

Loading…
Cancel
Save