|
|
@@ -12,6 +12,7 @@ using System.Collections;
|
|
|
using Business.EntityFrameworkCore;
|
|
|
using System.Linq.Expressions;
|
|
|
using Z.EntityFramework.Plus;
|
|
|
+using System.Data.SqlClient;
|
|
|
|
|
|
namespace Bussiness.EntityFrameworkCore.SqlRepositories
|
|
|
{
|
|
|
@@ -85,5 +86,20 @@ namespace Bussiness.EntityFrameworkCore.SqlRepositories
|
|
|
return new Tuple<List<T>, int>(entities, total);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public DataSet SelectDataBaseBySql(string sql, string tableName)
|
|
|
+ {
|
|
|
+ DataSet ds = new DataSet();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string connectionString = _dbContextProvider.GetDbContextAsync().Result.Database.GetDbConnection().ConnectionString;
|
|
|
+ SqlDataAdapter da = new SqlDataAdapter(sql, connectionString);
|
|
|
+ da.Fill(ds, tableName);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ }
|
|
|
+ return ds;
|
|
|
+ }
|
|
|
}
|
|
|
}
|