修改EF3.10支持执行sql的方法

This commit is contained in:
falcon 2019-12-13 13:25:25 +08:00
parent c8c2e43e7a
commit 36a829f872

View File

@ -21,8 +21,13 @@ namespace Falcon.ModelSP
/// <param name="db">数据上下文</param> /// <param name="db">数据上下文</param>
/// <param name="data">参数数据</param> /// <param name="data">参数数据</param>
public static int RunProcuder<TPrarmType>(this DbContext db,TPrarmType data) { public static int RunProcuder<TPrarmType>(this DbContext db,TPrarmType data) {
var parms = getParams(data); var parms = getParams(data).ToArray();
return db.Database.ExecuteSqlCommand(getProcuderName<TPrarmType>(),parms.ToArray()); var pName = getProcuderName<TPrarmType>();
#if NETSTANDARD2_1
return db.Database.ExecuteSqlRaw(pName,parms);
#else
return db.Database.ExecuteSqlCommand(pName,parms);
#endif
} }
/// <summary> /// <summary>
/// 执行有返回值的存储过程 /// 执行有返回值的存储过程