diff --git a/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Config.cs b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Config.cs index dd942aaab..6efc5cced 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Config.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Config.cs @@ -8,6 +8,6 @@ namespace OrmTest { public class Config { - public static string ConnectionString = "Database=SqlSugar4xTest;Data Source=127.0.0.1;User Id=root;Password=root;pooling=false;CharSet=utf8;port=3306"; + public static string ConnectionString = "Database=SqlSugar4xTest;Data Source=127.0.0.1;User Id=root;Password=haosql;pooling=false;CharSet=utf8;port=3306"; } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Demos/J_Encode.cs b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Demos/J_Encode.cs new file mode 100644 index 000000000..36c0d4a2b --- /dev/null +++ b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Demos/J_Encode.cs @@ -0,0 +1,37 @@ +using OrmTest.Demo; +using OrmTest.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest.Demo +{ + public class Encode : DemoBase + { + public static void Init() + { + var db = GetInstance(); + db.Utilities.RemoveCacheAll(); + + + var id=db.Insertable(new List() { + new StudentEncode(){Name="✨✨✨👉🏻2" }, + new StudentEncode(){ Name="✨✨✨👉🏻" } + } ).ExecuteReturnIdentity(); + + var entity = db.Queryable().OrderBy(it=>it.Id,SqlSugar.OrderByType.Desc).ToList(); + entity.First().Name = "✨update✨✨👉🏻"; + db.Updateable(entity.First()).ExecuteCommand(); + entity = db.Queryable().OrderBy(it => it.Id, SqlSugar.OrderByType.Desc).ToList(); + + } + } + [SqlSugar.SugarTable("student")] + public class StudentEncode { + public int Id { get; set; } + [SqlSugar.SugarColumn(IsTranscoding =true)] + public string Name { get; set; } + } +} diff --git a/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Program.cs b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Program.cs index d25102e4f..ed0f90dfe 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Program.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/MySqlTest/Program.cs @@ -39,6 +39,7 @@ namespace MySqlTest OrmTest.Demo.ComplexModel.Init(); OrmTest.Demo.CodeFirst.Init(); OrmTest.Demo.Queue.Init(); + OrmTest.Demo.Encode.Init(); } } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/Config.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/Config.cs index 43f3df924..e668961eb 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/Config.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSeverTest/Config.cs @@ -8,8 +8,8 @@ namespace OrmTest { public class Config { - public static string ConnectionString = "server=.;uid=sa;pwd=@jhl85661501;database=SqlSugar4XTest"; - public static string ConnectionString2 = "server=.;uid=sa;pwd=@jhl85661501;database=SQLSUGAR4XTEST"; - public static string ConnectionString3 = "server=.;uid=sa;pwd=@jhl85661501;database=sqlsugar4xtest"; + public static string ConnectionString = "server=.;uid=sa;pwd=haosql;database=SqlSugar4XTest"; + public static string ConnectionString2 = "server=.;uid=sa;pwd=haosql;database=SQLSUGAR4XTEST"; + public static string ConnectionString3 = "server=.;uid=sa;pwd=haosql;database=sqlsugar4xtest"; } } diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/Config.cs b/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/Config.cs index 3b2ce1f6e..53b80c81e 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/Config.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/Config.cs @@ -13,7 +13,7 @@ namespace OrmTest get { - return Environment.CurrentDirectory.Replace(@"\bin\Debug", ""); + return Environment.CurrentDirectory.Replace(@"\bin\Debug", "").Replace(@"\netcoreapp2.0",""); } } public static string ConnectionString = @"DataSource=" + GetCurrentProjectPath + @"\DataBase\SqlSugar4xTest.sqlite"; diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite b/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite index 24804c631..20a748355 100644 Binary files a/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite and b/Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite differ