mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Compatible .net core
This commit is contained in:
parent
fdcaa7ea3b
commit
8a70b411a9
@ -52,6 +52,12 @@ namespace OrmTest
|
||||
var db = GetInstance();
|
||||
List<Order> list = db.Queryable<Order>().ToList();
|
||||
|
||||
var x2=db.Ado.SqlQueryAsync<Order>("select * from [Order] ");
|
||||
x2.Wait();
|
||||
var x22 = db.Ado.GetScalarAsync("select * from [Order] ");
|
||||
x22.Wait();
|
||||
var x222 = db.Ado.ExecuteCommandAsync("select * from [Order] ");
|
||||
x222.Wait();
|
||||
Order item = db.Queryable<Order>().First(it => it.Id == 1);
|
||||
|
||||
DataTable dataTable = db.Queryable<Order>().Select(it => it.Id).ToDataTable();
|
||||
|
@ -313,7 +313,7 @@ namespace SqlSugar
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
SetConnectionEnd(sql);
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite)
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite&& SugarCompatible.IsFramework)
|
||||
sqlCommand.Dispose();
|
||||
return sqlDataReader;
|
||||
}
|
||||
@ -456,7 +456,7 @@ namespace SqlSugar
|
||||
sqlCommand.Parameters.Clear();
|
||||
ExecuteAfter(sql, parameters);
|
||||
SetConnectionEnd(sql);
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite)
|
||||
if (this.Context.CurrentConnectionConfig.DbType == DbType.Sqlite&&SugarCompatible.IsFramework)
|
||||
sqlCommand.Dispose();
|
||||
return sqlDataReader;
|
||||
}
|
||||
|
13
Src/Asp.Net/SqlSugar/OnlyNet/Compatible.cs
Normal file
13
Src/Asp.Net/SqlSugar/OnlyNet/Compatible.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class SugarCompatible
|
||||
{
|
||||
public const bool IsFramework = true;
|
||||
}
|
||||
}
|
@ -90,6 +90,7 @@
|
||||
<Compile Include="Abstract\DeleteProvider\DeleteableProvider.cs" />
|
||||
<Compile Include="Entities\StackTraceInfo.cs" />
|
||||
<Compile Include="Entities\SubInsertTree.cs" />
|
||||
<Compile Include="OnlyNet\Compatible.cs" />
|
||||
<Compile Include="OnlyNet\KdbndpInserttable.cs" />
|
||||
<Compile Include="Interface\ISubInsertable.cs" />
|
||||
<Compile Include="Abstract\InsertableProvider\SubInserable.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user