using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WIDESEAWCS_Core.Tenants { /// /// 标识 多租户 的业务表
/// 默认设置是多库
/// 公共表无需区分 直接使用主库 各自业务在各自库中
///
[AttributeUsage(AttributeTargets.Class)] public class MultiTenantAttribute : Attribute { public MultiTenantAttribute() { } public MultiTenantAttribute(TenantTypeEnum tenantType) { TenantType = tenantType; } public TenantTypeEnum TenantType { get; set; } = TenantTypeEnum.Db; } /// /// 租户隔离方案 /// public enum TenantTypeEnum { None = 0, /// /// Id隔离 /// [Description("Id隔离")] Id = 1, /// /// 库隔离 /// [Description("库隔离")] Db = 2, /// /// 表隔离 /// [Description("表隔离")] Tables = 3, } }