diff --git a/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj b/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj
index ec8ec8ae..05c930d4 100644
--- a/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj
+++ b/samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj
@@ -4,7 +4,7 @@
- net6.0
+ net7.0
Liuliu.Demo.Web
38c51dba-31f4-4c29-a3b3-49164e38d32f
Linux
diff --git a/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs
new file mode 100644
index 00000000..3cf9310f
--- /dev/null
+++ b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.Designer.cs
@@ -0,0 +1,1620 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using OSharp.Entity;
+
+#nullable disable
+
+namespace Liuliu.Demo.Web.Migrations
+{
+ [DbContext(typeof(DefaultDbContext))]
+ [Migration("20231006102753_Comment")]
+ partial class Comment
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("OSharp.Authorization.EntityInfos.EntityInfo", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("AuditEnabled")
+ .HasColumnType("bit")
+ .HasComment("是否数据审计");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("实体名称");
+
+ b.Property("PropertyJson")
+ .IsRequired()
+ .HasMaxLength(5000)
+ .HasColumnType("nvarchar(max)")
+ .HasComment("实体属性信息Json字符串");
+
+ b.Property("TypeName")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("实体类型名称");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TypeName")
+ .IsUnique()
+ .HasDatabaseName("ClassFullNameIndex");
+
+ b.ToTable("Auth_EntityInfo", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Authorization.Functions.Function", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("AccessType")
+ .HasColumnType("int")
+ .HasComment("访问类型");
+
+ b.Property("Action")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("功能");
+
+ b.Property("Area")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("区域");
+
+ b.Property("AuditEntityEnabled")
+ .HasColumnType("bit")
+ .HasComment("是否数据审计");
+
+ b.Property("AuditOperationEnabled")
+ .HasColumnType("bit")
+ .HasComment("是否操作审计");
+
+ b.Property("CacheExpirationSeconds")
+ .HasColumnType("int")
+ .HasComment("数据缓存秒数");
+
+ b.Property("Controller")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("控制器");
+
+ b.Property("IsAccessTypeChanged")
+ .HasColumnType("bit")
+ .HasComment("访问类型是否更改");
+
+ b.Property("IsAjax")
+ .HasColumnType("bit")
+ .HasComment("是否Ajax功能");
+
+ b.Property("IsCacheSliding")
+ .HasColumnType("bit")
+ .HasComment("是否相对过期时间");
+
+ b.Property("IsController")
+ .HasColumnType("bit")
+ .HasComment("是否控制器");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("IsSlaveDatabase")
+ .HasColumnType("bit")
+ .HasComment("是否从库");
+
+ b.Property("Name")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("名称");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Area", "Controller", "Action")
+ .IsUnique()
+ .HasDatabaseName("AreaControllerActionIndex")
+ .HasFilter("[Area] IS NOT NULL AND [Controller] IS NOT NULL AND [Action] IS NOT NULL");
+
+ b.ToTable("Auth_Function", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Core.Systems.KeyValue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("Display")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)")
+ .HasComment("显示名称");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("Key")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("nvarchar(512)")
+ .HasComment("数据键名");
+
+ b.Property("Order")
+ .HasColumnType("int")
+ .HasComment("Order");
+
+ b.Property("Remark")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("显示名称");
+
+ b.Property("ValueJson")
+ .HasColumnType("text")
+ .HasComment("数据值JSON");
+
+ b.Property("ValueType")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("数据值类型名");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Key")
+ .IsUnique()
+ .HasDatabaseName("KeyIndex");
+
+ b.ToTable("Systems_KeyValue", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("EntityId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("数据编号");
+
+ b.Property("FilterGroupJson")
+ .HasMaxLength(5000)
+ .HasColumnType("nvarchar(max)")
+ .HasComment("过滤条件组Json字符串");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("Operation")
+ .HasColumnType("int")
+ .HasComment("数据权限操作");
+
+ b.Property("RoleId")
+ .HasColumnType("int")
+ .HasComment("角色编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("EntityId", "RoleId", "Operation")
+ .IsUnique()
+ .HasDatabaseName("EntityRoleIndex");
+
+ b.ToTable("Auth_EntityRole", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("EntityId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("数据编号");
+
+ b.Property("FilterGroupJson")
+ .HasMaxLength(5000)
+ .HasColumnType("nvarchar(max)")
+ .HasComment("过滤条件组Json字符串");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex("EntityId", "UserId")
+ .HasDatabaseName("EntityUserIndex");
+
+ b.ToTable("Auth_EntityUser", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("模块代码");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("模块名称");
+
+ b.Property("OrderCode")
+ .HasColumnType("float")
+ .HasComment("排序码");
+
+ b.Property("ParentId")
+ .HasColumnType("int")
+ .HasComment("父模块编号");
+
+ b.Property("Remark")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("模块描述");
+
+ b.Property("TreePathString")
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)")
+ .HasComment("父节点树形路径");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("Auth_Module", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleFunction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("FunctionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("功能编号");
+
+ b.Property("ModuleId")
+ .HasColumnType("int")
+ .HasComment("模块编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FunctionId");
+
+ b.HasIndex("ModuleId", "FunctionId")
+ .IsUnique()
+ .HasDatabaseName("ModuleFunctionIndex");
+
+ b.ToTable("Auth_ModuleFunction", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("ModuleId")
+ .HasColumnType("int")
+ .HasComment("模块编号");
+
+ b.Property("RoleId")
+ .HasColumnType("int")
+ .HasComment("角色编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("ModuleId", "RoleId")
+ .IsUnique()
+ .HasDatabaseName("ModuleRoleIndex");
+
+ b.ToTable("Auth_ModuleRole", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("Disabled")
+ .HasColumnType("bit")
+ .HasComment("Disabled");
+
+ b.Property("ModuleId")
+ .HasColumnType("int")
+ .HasComment("模块编号");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex("ModuleId", "UserId")
+ .IsUnique()
+ .HasDatabaseName("ModuleUserIndex");
+
+ b.ToTable("Auth_ModuleUser", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.LoginLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("Ip")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("登录IP");
+
+ b.Property("LogoutTime")
+ .HasColumnType("datetime2")
+ .HasComment("退出时间");
+
+ b.Property("UserAgent")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("用户代理头");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Identity_LoginLog", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Organization", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("名称");
+
+ b.Property("ParentId")
+ .HasColumnType("int")
+ .HasComment("父组织机构编号");
+
+ b.Property("Remark")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("描述");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("Identity_Organization", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("版本标识");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2")
+ .HasComment("DeletedTime");
+
+ b.Property("IsAdmin")
+ .HasColumnType("bit")
+ .HasComment("是否管理员角色");
+
+ b.Property("IsDefault")
+ .HasColumnType("bit")
+ .HasComment("是否默认角色");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("IsSystem")
+ .HasColumnType("bit")
+ .HasComment("是否系统角色");
+
+ b.Property("MessageId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("角色名称");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("标准化角色名称");
+
+ b.Property("Remark")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("角色描述");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MessageId");
+
+ b.HasIndex("NormalizedName", "DeletedTime")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex")
+ .HasFilter("[DeletedTime] IS NOT NULL");
+
+ b.ToTable("Identity_Role", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.RoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("声明类型");
+
+ b.Property("ClaimValue")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("声明值");
+
+ b.Property("RoleId")
+ .HasColumnType("int")
+ .HasComment("角色编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("Identity_RoleClaim", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int")
+ .HasComment("登录失败次数");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("版本标识");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2")
+ .HasComment("DeletedTime");
+
+ b.Property("Email")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("电子邮箱");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit")
+ .HasComment("电子邮箱确认");
+
+ b.Property("HeadImg")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("用户头像");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("IsSystem")
+ .HasColumnType("bit")
+ .HasComment("是否系统用户");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit")
+ .HasComment("是否登录锁");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset")
+ .HasComment("锁定时间");
+
+ b.Property("MessageId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("NickName")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("用户昵称");
+
+ b.Property("NormalizeEmail")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("标准化的电子邮箱");
+
+ b.Property("NormalizedUserName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("标准化的用户名");
+
+ b.Property("PasswordHash")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("密码哈希值");
+
+ b.Property("PhoneNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("手机号码");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit")
+ .HasComment("手机号码确定");
+
+ b.Property("Remark")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("备注");
+
+ b.Property("SecurityStamp")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("安全标识");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit")
+ .HasComment("双因子身份验证");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("用户名");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MessageId");
+
+ b.HasIndex("NormalizeEmail", "DeletedTime")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName", "DeletedTime")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex")
+ .HasFilter("[DeletedTime] IS NOT NULL");
+
+ b.ToTable("Identity_User", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("声明类型");
+
+ b.Property("ClaimValue")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("声明值");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Identity_UserClaim", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserDetail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("RegisterIp")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("注册IP");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId")
+ .IsUnique();
+
+ b.ToTable("Identity_UserDetail", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserLogin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("Avatar")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("第三方用户头像");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("LoginProvider")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("登录的登录提供程序");
+
+ b.Property("ProviderDisplayName")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("第三方用户昵称");
+
+ b.Property("ProviderKey")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("第三方用户的唯一标识");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex("LoginProvider", "ProviderKey")
+ .IsUnique()
+ .HasDatabaseName("UserLoginIndex")
+ .HasFilter("[LoginProvider] IS NOT NULL AND [ProviderKey] IS NOT NULL");
+
+ b.ToTable("Identity_UserLogin", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2")
+ .HasComment("DeletedTime");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("RoleId")
+ .HasColumnType("int")
+ .HasComment("角色编号");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.HasIndex("UserId", "RoleId", "DeletedTime")
+ .IsUnique()
+ .HasDatabaseName("UserRoleIndex")
+ .HasFilter("[DeletedTime] IS NOT NULL");
+
+ b.ToTable("Identity_UserRole", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserToken", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("LoginProvider")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("登录提供者");
+
+ b.Property("Name")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("令牌名称");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("用户编号");
+
+ b.Property("Value")
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)")
+ .HasComment("令牌值");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId", "LoginProvider", "Name")
+ .IsUnique()
+ .HasDatabaseName("UserTokenIndex")
+ .HasFilter("[LoginProvider] IS NOT NULL AND [Name] IS NOT NULL");
+
+ b.ToTable("Identity_UserToken", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2")
+ .HasComment("生效时间");
+
+ b.Property("CanReply")
+ .HasColumnType("bit")
+ .HasComment("是否允许回复");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("内容");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2")
+ .HasComment("删除时间");
+
+ b.Property("EndDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("IsSended")
+ .HasColumnType("bit")
+ .HasComment("是否发送");
+
+ b.Property("MessageType")
+ .HasColumnType("int")
+ .HasComment("消息类型");
+
+ b.Property("NewReplyCount")
+ .HasColumnType("int")
+ .HasComment("新回复数");
+
+ b.Property("SenderId")
+ .HasColumnType("int")
+ .HasComment("发送人编号");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("标题");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SenderId");
+
+ b.ToTable("Infos_Message", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReceive", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("MessageId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("接收的主消息编号");
+
+ b.Property("NewReplyCount")
+ .HasColumnType("int")
+ .HasComment("新回复数,接收者使用");
+
+ b.Property("ReadDate")
+ .HasColumnType("datetime2")
+ .HasComment("接收时间");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment("消息接收人编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MessageId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Infos_MessageReceive", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("BelongMessageId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("回复所属主消息,用于避免递归查询");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("消息内容");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("创建时间");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2")
+ .HasComment("删除时间");
+
+ b.Property("IsLocked")
+ .HasColumnType("bit")
+ .HasComment("是否锁定");
+
+ b.Property("IsRead")
+ .HasColumnType("bit")
+ .HasComment("是否已读");
+
+ b.Property("ParentMessageId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("回复的主消息,当回复主消息时有效");
+
+ b.Property("ParentReplyId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("回复的回复消息,当回复回复消息时有效");
+
+ b.Property("UserId")
+ .HasColumnType("int")
+ .HasComment(" 消息回复人编号");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BelongMessageId");
+
+ b.HasIndex("ParentMessageId");
+
+ b.HasIndex("ParentReplyId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Infos_MessageReply", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("EntityKey")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("类型名称");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("实体名称");
+
+ b.Property("OperateType")
+ .HasColumnType("int")
+ .HasComment("OperateType");
+
+ b.Property("OperationId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("OperationId");
+
+ b.Property("TypeName")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("类型名称");
+
+ b.HasKey("Id");
+
+ b.HasIndex("OperationId");
+
+ b.ToTable("Systems_AuditEntity", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditOperation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("Browser")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("浏览器");
+
+ b.Property("CreatedTime")
+ .HasColumnType("datetime2")
+ .HasComment("CreatedTime");
+
+ b.Property("Elapsed")
+ .HasColumnType("int")
+ .HasComment("Elapsed");
+
+ b.Property("FunctionName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("执行的功能名");
+
+ b.Property("Ip")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("当前访问IP");
+
+ b.Property("Message")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("消息");
+
+ b.Property("NickName")
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)")
+ .HasComment("当前用户昵称");
+
+ b.Property("OperationSystem")
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)")
+ .HasComment("操作系统");
+
+ b.Property("ResultType")
+ .HasColumnType("int")
+ .HasComment("ResultType");
+
+ b.Property("UserAgent")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("UserAgent");
+
+ b.Property("UserId")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)")
+ .HasComment("当前用户标识");
+
+ b.Property("UserName")
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)")
+ .HasComment("当前用户名");
+
+ b.HasKey("Id");
+
+ b.ToTable("Systems_AuditOperation", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditProperty", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("编号");
+
+ b.Property("AuditEntityId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("AuditEntityId");
+
+ b.Property("DataType")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("数据类型");
+
+ b.Property("DisplayName")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("名称");
+
+ b.Property("FieldName")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)")
+ .HasComment("字段");
+
+ b.Property("NewValue")
+ .HasMaxLength(5000)
+ .HasColumnType("nvarchar(max)")
+ .HasComment("新值");
+
+ b.Property("OriginalValue")
+ .HasMaxLength(5000)
+ .HasColumnType("nvarchar(max)")
+ .HasComment("旧值");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditEntityId");
+
+ b.ToTable("Systems_AuditProperty", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasComment("编号");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Acl")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("访问控制列表");
+
+ b.Property("Data")
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)")
+ .HasComment("菜单数据");
+
+ b.Property("Icon")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("图标");
+
+ b.Property("IsEnabled")
+ .HasColumnType("bit")
+ .HasComment("是否启用");
+
+ b.Property("IsSystem")
+ .HasColumnType("bit")
+ .HasComment("是否系统");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("名称");
+
+ b.Property("OrderCode")
+ .HasColumnType("float")
+ .HasComment("节点内排序");
+
+ b.Property("ParentId")
+ .HasColumnType("int")
+ .HasComment("父菜单编号");
+
+ b.Property("Target")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasComment("链接目标");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)")
+ .HasComment("显示");
+
+ b.Property("TreePathString")
+ .HasMaxLength(3000)
+ .HasColumnType("nvarchar(3000)")
+ .HasComment("父节点树形路径");
+
+ b.Property("Url")
+ .HasMaxLength(2000)
+ .HasColumnType("nvarchar(2000)")
+ .HasComment("链接");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId");
+
+ b.ToTable("Systems_Menu", (string)null);
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityRole", b =>
+ {
+ b.HasOne("OSharp.Authorization.EntityInfos.EntityInfo", "EntityInfo")
+ .WithMany()
+ .HasForeignKey("EntityId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role")
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("EntityInfo");
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.EntityUser", b =>
+ {
+ b.HasOne("OSharp.Authorization.EntityInfos.EntityInfo", "EntityInfo")
+ .WithMany()
+ .HasForeignKey("EntityId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("EntityInfo");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b =>
+ {
+ b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId");
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleFunction", b =>
+ {
+ b.HasOne("OSharp.Authorization.Functions.Function", "Function")
+ .WithMany()
+ .HasForeignKey("FunctionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module")
+ .WithMany()
+ .HasForeignKey("ModuleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Function");
+
+ b.Navigation("Module");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleRole", b =>
+ {
+ b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module")
+ .WithMany()
+ .HasForeignKey("ModuleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role")
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Module");
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.ModuleUser", b =>
+ {
+ b.HasOne("OSharp.Hosting.Authorization.Entities.Module", "Module")
+ .WithMany()
+ .HasForeignKey("ModuleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Module");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.LoginLog", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Organization", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.Organization", null)
+ .WithMany()
+ .HasForeignKey("ParentId");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b =>
+ {
+ b.HasOne("OSharp.Hosting.Infos.Entities.Message", null)
+ .WithMany("PublicRoles")
+ .HasForeignKey("MessageId");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.RoleClaim", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role")
+ .WithMany("RoleClaims")
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b =>
+ {
+ b.HasOne("OSharp.Hosting.Infos.Entities.Message", null)
+ .WithMany("Recipients")
+ .HasForeignKey("MessageId");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserClaim", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany("UserClaims")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserDetail", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithOne("UserDetail")
+ .HasForeignKey("OSharp.Hosting.Identity.Entities.UserDetail", "UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserLogin", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany("UserLogins")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserRole", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.Role", "Role")
+ .WithMany("UserRoles")
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany("UserRoles")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Role");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.UserToken", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany("UserTokens")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b =>
+ {
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "Sender")
+ .WithMany()
+ .HasForeignKey("SenderId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Sender");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReceive", b =>
+ {
+ b.HasOne("OSharp.Hosting.Infos.Entities.Message", "Message")
+ .WithMany("Receives")
+ .HasForeignKey("MessageId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("Message");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b =>
+ {
+ b.HasOne("OSharp.Hosting.Infos.Entities.Message", "BelongMessage")
+ .WithMany()
+ .HasForeignKey("BelongMessageId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Infos.Entities.Message", "ParentMessage")
+ .WithMany("Replies")
+ .HasForeignKey("ParentMessageId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Infos.Entities.MessageReply", "ParentReply")
+ .WithMany("Replies")
+ .HasForeignKey("ParentReplyId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("OSharp.Hosting.Identity.Entities.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("BelongMessage");
+
+ b.Navigation("ParentMessage");
+
+ b.Navigation("ParentReply");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b =>
+ {
+ b.HasOne("OSharp.Hosting.Systems.Entities.AuditOperation", "Operation")
+ .WithMany("AuditEntities")
+ .HasForeignKey("OperationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Operation");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditProperty", b =>
+ {
+ b.HasOne("OSharp.Hosting.Systems.Entities.AuditEntity", "AuditEntity")
+ .WithMany("Properties")
+ .HasForeignKey("AuditEntityId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("AuditEntity");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b =>
+ {
+ b.HasOne("OSharp.Hosting.Systems.Entities.Menu", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId");
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Authorization.Entities.Module", b =>
+ {
+ b.Navigation("Children");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.Role", b =>
+ {
+ b.Navigation("RoleClaims");
+
+ b.Navigation("UserRoles");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Identity.Entities.User", b =>
+ {
+ b.Navigation("UserClaims");
+
+ b.Navigation("UserDetail");
+
+ b.Navigation("UserLogins");
+
+ b.Navigation("UserRoles");
+
+ b.Navigation("UserTokens");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.Message", b =>
+ {
+ b.Navigation("PublicRoles");
+
+ b.Navigation("Receives");
+
+ b.Navigation("Recipients");
+
+ b.Navigation("Replies");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Infos.Entities.MessageReply", b =>
+ {
+ b.Navigation("Replies");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditEntity", b =>
+ {
+ b.Navigation("Properties");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.AuditOperation", b =>
+ {
+ b.Navigation("AuditEntities");
+ });
+
+ modelBuilder.Entity("OSharp.Hosting.Systems.Entities.Menu", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs
new file mode 100644
index 00000000..c4d276f0
--- /dev/null
+++ b/samples/web/Liuliu.Demo.WebApi/Migrations/20231006102753_Comment.cs
@@ -0,0 +1,4045 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Liuliu.Demo.Web.Migrations
+{
+ ///
+ public partial class Comment : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "Url",
+ table: "Systems_Menu",
+ type: "nvarchar(2000)",
+ maxLength: 2000,
+ nullable: true,
+ comment: "链接",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(2000)",
+ oldMaxLength: 2000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "TreePathString",
+ table: "Systems_Menu",
+ type: "nvarchar(3000)",
+ maxLength: 3000,
+ nullable: true,
+ comment: "父节点树形路径",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(3000)",
+ oldMaxLength: 3000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Text",
+ table: "Systems_Menu",
+ type: "nvarchar(500)",
+ maxLength: 500,
+ nullable: false,
+ comment: "显示",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(500)",
+ oldMaxLength: 500);
+
+ migrationBuilder.AlterColumn(
+ name: "Target",
+ table: "Systems_Menu",
+ type: "nvarchar(50)",
+ maxLength: 50,
+ nullable: true,
+ comment: "链接目标",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(50)",
+ oldMaxLength: 50,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "ParentId",
+ table: "Systems_Menu",
+ type: "int",
+ nullable: true,
+ comment: "父菜单编号",
+ oldClrType: typeof(int),
+ oldType: "int",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "OrderCode",
+ table: "Systems_Menu",
+ type: "float",
+ nullable: false,
+ comment: "节点内排序",
+ oldClrType: typeof(double),
+ oldType: "float");
+
+ migrationBuilder.AlterColumn(
+ name: "Name",
+ table: "Systems_Menu",
+ type: "nvarchar(500)",
+ maxLength: 500,
+ nullable: false,
+ comment: "名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(500)",
+ oldMaxLength: 500);
+
+ migrationBuilder.AlterColumn(
+ name: "IsSystem",
+ table: "Systems_Menu",
+ type: "bit",
+ nullable: false,
+ comment: "是否系统",
+ oldClrType: typeof(bool),
+ oldType: "bit");
+
+ migrationBuilder.AlterColumn(
+ name: "IsEnabled",
+ table: "Systems_Menu",
+ type: "bit",
+ nullable: false,
+ comment: "是否启用",
+ oldClrType: typeof(bool),
+ oldType: "bit");
+
+ migrationBuilder.AlterColumn(
+ name: "Icon",
+ table: "Systems_Menu",
+ type: "nvarchar(50)",
+ maxLength: 50,
+ nullable: true,
+ comment: "图标",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(50)",
+ oldMaxLength: 50,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Data",
+ table: "Systems_Menu",
+ type: "nvarchar(2000)",
+ maxLength: 2000,
+ nullable: true,
+ comment: "菜单数据",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(2000)",
+ oldMaxLength: 2000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Acl",
+ table: "Systems_Menu",
+ type: "nvarchar(500)",
+ maxLength: 500,
+ nullable: true,
+ comment: "访问控制列表",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(500)",
+ oldMaxLength: 500,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Id",
+ table: "Systems_Menu",
+ type: "int",
+ nullable: false,
+ comment: "编号",
+ oldClrType: typeof(int),
+ oldType: "int")
+ .Annotation("SqlServer:Identity", "1, 1")
+ .OldAnnotation("SqlServer:Identity", "1, 1");
+
+ migrationBuilder.AlterColumn(
+ name: "ValueType",
+ table: "Systems_KeyValue",
+ type: "nvarchar(1000)",
+ maxLength: 1000,
+ nullable: true,
+ comment: "数据值类型名",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(1000)",
+ oldMaxLength: 1000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "ValueJson",
+ table: "Systems_KeyValue",
+ type: "text",
+ nullable: true,
+ comment: "数据值JSON",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Remark",
+ table: "Systems_KeyValue",
+ type: "nvarchar(1000)",
+ maxLength: 1000,
+ nullable: true,
+ comment: "显示名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(1000)",
+ oldMaxLength: 1000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Order",
+ table: "Systems_KeyValue",
+ type: "int",
+ nullable: false,
+ comment: "Order",
+ oldClrType: typeof(int),
+ oldType: "int");
+
+ migrationBuilder.AlterColumn(
+ name: "Key",
+ table: "Systems_KeyValue",
+ type: "nvarchar(512)",
+ maxLength: 512,
+ nullable: false,
+ comment: "数据键名",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(512)",
+ oldMaxLength: 512);
+
+ migrationBuilder.AlterColumn(
+ name: "IsLocked",
+ table: "Systems_KeyValue",
+ type: "bit",
+ nullable: false,
+ comment: "是否锁定",
+ oldClrType: typeof(bool),
+ oldType: "bit");
+
+ migrationBuilder.AlterColumn(
+ name: "Display",
+ table: "Systems_KeyValue",
+ type: "nvarchar(100)",
+ maxLength: 100,
+ nullable: true,
+ comment: "显示名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(100)",
+ oldMaxLength: 100,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Id",
+ table: "Systems_KeyValue",
+ type: "uniqueidentifier",
+ nullable: false,
+ comment: "编号",
+ oldClrType: typeof(Guid),
+ oldType: "uniqueidentifier");
+
+ migrationBuilder.AlterColumn(
+ name: "OriginalValue",
+ table: "Systems_AuditProperty",
+ type: "nvarchar(max)",
+ maxLength: 5000,
+ nullable: true,
+ comment: "旧值",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(max)",
+ oldMaxLength: 5000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "NewValue",
+ table: "Systems_AuditProperty",
+ type: "nvarchar(max)",
+ maxLength: 5000,
+ nullable: true,
+ comment: "新值",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(max)",
+ oldMaxLength: 5000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "FieldName",
+ table: "Systems_AuditProperty",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: true,
+ comment: "字段",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "DisplayName",
+ table: "Systems_AuditProperty",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: true,
+ comment: "名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "DataType",
+ table: "Systems_AuditProperty",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: true,
+ comment: "数据类型",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "AuditEntityId",
+ table: "Systems_AuditProperty",
+ type: "uniqueidentifier",
+ nullable: false,
+ comment: "AuditEntityId",
+ oldClrType: typeof(Guid),
+ oldType: "uniqueidentifier");
+
+ migrationBuilder.AlterColumn(
+ name: "Id",
+ table: "Systems_AuditProperty",
+ type: "uniqueidentifier",
+ nullable: false,
+ comment: "编号",
+ oldClrType: typeof(Guid),
+ oldType: "uniqueidentifier");
+
+ migrationBuilder.AlterColumn(
+ name: "UserName",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(300)",
+ maxLength: 300,
+ nullable: true,
+ comment: "当前用户名",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(300)",
+ oldMaxLength: 300,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "UserId",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(100)",
+ maxLength: 100,
+ nullable: true,
+ comment: "当前用户标识",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(100)",
+ oldMaxLength: 100,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "UserAgent",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(500)",
+ maxLength: 500,
+ nullable: true,
+ comment: "UserAgent",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(500)",
+ oldMaxLength: 500,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "ResultType",
+ table: "Systems_AuditOperation",
+ type: "int",
+ nullable: false,
+ comment: "ResultType",
+ oldClrType: typeof(int),
+ oldType: "int");
+
+ migrationBuilder.AlterColumn(
+ name: "OperationSystem",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(300)",
+ maxLength: 300,
+ nullable: true,
+ comment: "操作系统",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(300)",
+ oldMaxLength: 300,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "NickName",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(300)",
+ maxLength: 300,
+ nullable: true,
+ comment: "当前用户昵称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(300)",
+ oldMaxLength: 300,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Message",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(1000)",
+ maxLength: 1000,
+ nullable: true,
+ comment: "消息",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(1000)",
+ oldMaxLength: 1000,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Ip",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(50)",
+ maxLength: 50,
+ nullable: true,
+ comment: "当前访问IP",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(50)",
+ oldMaxLength: 50,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "FunctionName",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: false,
+ comment: "执行的功能名",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200);
+
+ migrationBuilder.AlterColumn(
+ name: "Elapsed",
+ table: "Systems_AuditOperation",
+ type: "int",
+ nullable: false,
+ comment: "Elapsed",
+ oldClrType: typeof(int),
+ oldType: "int");
+
+ migrationBuilder.AlterColumn(
+ name: "CreatedTime",
+ table: "Systems_AuditOperation",
+ type: "datetime2",
+ nullable: false,
+ comment: "CreatedTime",
+ oldClrType: typeof(DateTime),
+ oldType: "datetime2");
+
+ migrationBuilder.AlterColumn(
+ name: "Browser",
+ table: "Systems_AuditOperation",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: true,
+ comment: "浏览器",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Id",
+ table: "Systems_AuditOperation",
+ type: "uniqueidentifier",
+ nullable: false,
+ comment: "编号",
+ oldClrType: typeof(Guid),
+ oldType: "uniqueidentifier");
+
+ migrationBuilder.AlterColumn(
+ name: "TypeName",
+ table: "Systems_AuditEntity",
+ type: "nvarchar(500)",
+ maxLength: 500,
+ nullable: false,
+ comment: "类型名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(500)",
+ oldMaxLength: 500);
+
+ migrationBuilder.AlterColumn(
+ name: "OperationId",
+ table: "Systems_AuditEntity",
+ type: "uniqueidentifier",
+ nullable: false,
+ comment: "OperationId",
+ oldClrType: typeof(Guid),
+ oldType: "uniqueidentifier");
+
+ migrationBuilder.AlterColumn(
+ name: "OperateType",
+ table: "Systems_AuditEntity",
+ type: "int",
+ nullable: false,
+ comment: "OperateType",
+ oldClrType: typeof(int),
+ oldType: "int");
+
+ migrationBuilder.AlterColumn(
+ name: "Name",
+ table: "Systems_AuditEntity",
+ type: "nvarchar(200)",
+ maxLength: 200,
+ nullable: false,
+ comment: "实体名称",
+ oldClrType: typeof(string),
+ oldType: "nvarchar(200)",
+ oldMaxLength: 200);
+
+ migrationBuilder.AlterColumn