mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update 达梦
This commit is contained in:
parent
15573551bf
commit
58cb1428f1
45
Src/Asp.Net/DmTest/BugTest/BugTest1.cs
Normal file
45
Src/Asp.Net/DmTest/BugTest/BugTest1.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest.Test
|
||||||
|
{
|
||||||
|
public class BugTest1
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = Config.ConnectionString,
|
||||||
|
DbType = DbType.Dm,
|
||||||
|
IsAutoCloseConnection = true,
|
||||||
|
|
||||||
|
InitKeyType = InitKeyType.Attribute,
|
||||||
|
});
|
||||||
|
//调式代码 用来打印SQL
|
||||||
|
Db.Aop.OnLogExecuting = (sql, pars) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine(sql);
|
||||||
|
};
|
||||||
|
|
||||||
|
Db.CodeFirst.InitTables(typeof(testmmxxxmm121));
|
||||||
|
var id = Guid.NewGuid();
|
||||||
|
Db.Insertable(new testmmxxxmm121() { x = id }).ExecuteCommand();
|
||||||
|
var x= Db.Queryable<testmmxxxmm121>().Where(it => it.x.ToString().ToUpper() == id.ToString().ToUpper()).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class testmmxxxmm121
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey =true,IsIdentity =true)]
|
||||||
|
public int id { get; set; }
|
||||||
|
[SugarColumn(ColumnDataType ="varchar(36)")]
|
||||||
|
public Guid x { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -44,6 +44,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Config.cs" />
|
<Compile Include="Config.cs" />
|
||||||
|
<Compile Include="BugTest\BugTest1.cs" />
|
||||||
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
|
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
|
||||||
<Compile Include="Demo\Demo1_Queryable.cs" />
|
<Compile Include="Demo\Demo1_Queryable.cs" />
|
||||||
<Compile Include="Demo\Demo2_Updateable.cs" />
|
<Compile Include="Demo\Demo2_Updateable.cs" />
|
||||||
|
@ -117,6 +117,11 @@ namespace SqlSugar
|
|||||||
sqlParameter.Size = parameter.Size;
|
sqlParameter.Size = parameter.Size;
|
||||||
sqlParameter.Value = parameter.Value;
|
sqlParameter.Value = parameter.Value;
|
||||||
sqlParameter.DbType = parameter.DbType;
|
sqlParameter.DbType = parameter.DbType;
|
||||||
|
if (sqlParameter.DbType == System.Data.DbType.Guid)
|
||||||
|
{
|
||||||
|
sqlParameter.DbType = System.Data.DbType.String;
|
||||||
|
sqlParameter.Value = sqlParameter.Value.ToString();
|
||||||
|
}
|
||||||
if (parameter.Direction == 0)
|
if (parameter.Direction == 0)
|
||||||
{
|
{
|
||||||
parameter.Direction = ParameterDirection.Input;
|
parameter.Direction = ParameterDirection.Input;
|
||||||
|
Loading…
Reference in New Issue
Block a user