Skip to content

Commit

Permalink
代码生成器中支持识别TenantId
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 22, 2023
1 parent 28a86c0 commit 6c57069
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions XCode/Code/EntityBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ protected virtual void BuildCctor()
WriteLine("Meta.Modules.Add<IPModule>();");
if (ns.Contains("TraceId"))
WriteLine("Meta.Modules.Add<TraceModule>();");
if (ns.Contains("TenantId"))
WriteLine("Meta.Modules.Add<TenantModule>();");

// 唯一索引不是主键,又刚好是Master,使用单对象缓存从键
var di = Table.Indexes.FirstOrDefault(e => e.Unique && e.Columns.Length == 1 && Table.GetColumn(e.Columns[0]).Master);
Expand Down
2 changes: 1 addition & 1 deletion XCode/Membership/ITenantSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class TenantSourceHelper
}

/// <summary>租户过滤器。添加修改时自动设置租户标识</summary>
public class TenantFilter : EntityModule
public class TenantModule : EntityModule
{
/// <summary>初始化。检查是否匹配</summary>
/// <param name="entityType"></param>
Expand Down

0 comments on commit 6c57069

Please sign in to comment.