DbInfo.Init(typeof(RoleMapper).Assembly); var dbContext = DbFactory.GetContext; new PostgreSQLTableGenerator(dbContext).CreateTables(TableCreateMode.CreateNew); dbContext.Insert(new Role() { ID = SnowflakeFactory.NewId, RoleName = "管理层", RoleLevel = 1 }); dbContext.Insert(new Role() { ID = SnowflakeFactory.NewId, RoleName = "设备层", RoleLevel = 2 }); dbContext.Insert(new Role() { ID = SnowflakeFactory.NewId, RoleName = "使用层", RoleLevel = 3 });