Browse Source

Update PgSql

pull/12/MERGE
610262374@qq.com 6 years ago
parent
commit
83674d7f30
  1. 2
      Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/2_Update.cs
  2. 2
      Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/B_SharedConnection.cs
  3. 4
      Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/C_ExtSqlFun.cs
  4. 2
      Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/H_ExtEntity.cs
  5. 4
      Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Program.cs

2
Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/2_Update.cs

@ -60,7 +60,7 @@ namespace OrmTest.Demo
db.Updateable(updateObj).Where(true).ExecuteCommand();
//sql
db.Updateable(updateObj).Where("id=@x",new { x="1"}).ExecuteCommand();
db.Updateable(updateObj).Where("id=@x",new { x=1}).ExecuteCommand();
db.Updateable(updateObj).Where("id","=",1).ExecuteCommand();
var t12 = db.Updateable<School>().AS("Student").UpdateColumns(it => new School() { Name = "jack" }).Where(it => it.Id == 1).ExecuteCommandAsync();
t12.Wait();

2
Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/B_SharedConnection.cs

@ -76,7 +76,7 @@ namespace OrmTest.Demo
SqlSugarClient db = new SqlSugarClient(
new ConnectionConfig() {
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = false,
IsShardSameThread= true /*Shard Same Thread*/
});

4
Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/C_ExtSqlFun.cs

@ -18,14 +18,14 @@ namespace OrmTest.Demo
UniqueMethodName = "MyToString",
MethodValue = (expInfo, dbType, expContext) =>
{
return string.Format("CAST({0} AS VARCHAR(MAX))", expInfo.Args[0].MemberName);
return string.Format("CAST({0} AS VARCHAR)", expInfo.Args[0].MemberName);
}
});
var config = new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
ConfigureExternalServices = new ConfigureExternalServices()
{

2
Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Demos/H_ExtEntity.cs

@ -17,7 +17,7 @@ namespace OrmTest.Demo
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() {
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
DbType = DbType.PostgreSQL,
IsAutoCloseConnection = true,
ConfigureExternalServices=new ConfigureExternalServices() {
EntityService = (property, column) => {

4
Src/Asp.NetCore2/SqlSeverTest/PgSqlTest/Program.cs

@ -18,7 +18,7 @@ namespace OrmTest
{
// Demo.CodeFirst.Init();
// Demo.Aop.Init();
Demo.Aop.Init();
Demo.Query.Init();
Demo.Insert.Init();
Demo.Delete.Init();
@ -26,7 +26,7 @@ namespace OrmTest
Demo.MasterSlave.Init();
Demo.SharedConnection.Init();
Demo.ExtSqlFun.Init();
Demo.QueryableView.Init();
// Demo.QueryableView.Init();
Demo.AttributeDemo.Init();
Demo.Mapper.Init();
Demo.ExtEntity.Init();

Loading…
Cancel
Save