Browse Source

Sqlite Long Bug

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
17417c6292
  1. 4
      Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs
  2. 2
      Src/Asp.Net/SqliteTest/Config.cs
  3. BIN
      Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite
  4. 2
      Src/Asp.Net/SqliteTest/Models/DataTestInfo.cs
  5. 0
      Src/Asp.Net/SqliteTest/SqlSugar4xTest.sqlite
  6. 5
      Src/Asp.Net/SqliteTest/UnitTest/DataTest.cs
  7. BIN
      Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite

4
Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataRecordExtensions.cs

@ -264,6 +264,10 @@ namespace SqlSugar
{
return (T)Convert.ChangeType(dr.GetBoolean(i), type);
}
else if (type == UtilConstants.LongType)
{
return (T)Convert.ChangeType(dr.GetInt64(i), type);
}
else if (type == UtilConstants.GuidType)
{
string guidString = dr.GetString(i);

2
Src/Asp.Net/SqliteTest/Config.cs

@ -8,6 +8,6 @@ namespace OrmTest
{
public class Config
{
public static string ConnectionString = @"DataSource=D:\MyGit\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite";
public static string ConnectionString = @"DataSource=F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite";
}
}

BIN
Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite

Binary file not shown.

2
Src/Asp.Net/SqliteTest/Models/DataTestInfo.cs

@ -130,6 +130,8 @@ namespace OrmTest.Models
/// Nullable:True
/// </summary>
public double? Float2 {get;set;}
public long Long1 { get; set; }
public long? Long2 { get; set; }
}
}

0
Src/Asp.Net/SqliteTest/SqlSugar4xTest.sqlite

5
Src/Asp.Net/SqliteTest/UnitTest/DataTest.cs

@ -37,8 +37,10 @@ namespace OrmTest.UnitTest
Money2 = 8,
Varbinary1 = new byte[] { 4, 5 },
Varbinary2 = null,
String = "string"
String = "string",
Long1=100
};
var x = db.Queryable<DataTestInfo2>().Select(it => it.PK).ToList();
var id = db.Insertable<DataTestInfo>(insertObject).ExecuteReturnIdentity();
var data = db.Queryable<DataTestInfo>().InSingle(id);
if (
@ -48,6 +50,7 @@ namespace OrmTest.UnitTest
insertObject.Float2 != data.Float2 ||
insertObject.Int2 != data.Int2 ||
insertObject.Money1 != data.Money1 ||
insertObject.Long1!=data.Long1||
insertObject.Guid2!=data.Guid2||
string.Join(",", insertObject.Varbinary1) != string.Join(",", data.Varbinary1) ||
insertObject.String != data.String)

BIN
Src/Asp.NetCore2/SqlSeverTest/SqliteTest/DataBase/SqlSugar4xTest.sqlite

Binary file not shown.
Loading…
Cancel
Save