/// <summary> /// SqlScalar /// </summary> /// <param name="configExecutor"></param> /// <param name="parameters">sql的参数</param> /// <param name="cachePolicy">缓存策略</param> /// <returns></returns> public static object ScalarUseDict(this ISqlConfigExecutor configExecutor, IDictionary <string, object> parameters, SqlL2QueryCachePolicy cachePolicy = null) { return(configExecutor.Scalar(EFHelper.Services.SqlParamConverter.DictionaryToDBParams(configExecutor.DB, parameters), ToPolicies(cachePolicy))); }
/// <summary> /// SqlScalar /// </summary> /// <param name="configExecutor"></param> /// <param name="paramsModel">sql的参数模型对象</param> /// <param name="ignoreProptsForParamModel">sql的参数模型对象中需要忽略的属性名</param> /// <param name="cachePolicy">缓存策略</param> /// <returns></returns> public static object ScalarUseModel(this ISqlConfigExecutor configExecutor, object paramsModel, IEnumerable <string> ignoreProptsForParamModel, SqlL2QueryCachePolicy cachePolicy = null) { return(configExecutor.Scalar(EFHelper.Services.SqlParamConverter.ObjectToDBParams(configExecutor.DB, paramsModel, ignoreProptsForParamModel), ToPolicies(cachePolicy))); }
/// <summary> /// SqlQuery /// </summary> /// <typeparam name="T">数据类型</typeparam> /// <param name="configExecutor"></param> /// <param name="parameters">sql的参数</param> /// <param name="ignoreProptsForRtnType">数据类型需要忽略的属性名</param> /// <param name="cachePolicy">缓存策略</param> /// <returns></returns> public static IReadOnlyList <T> QueryUseDict <T>(this ISqlConfigExecutor configExecutor, IDictionary <string, object> parameters, IEnumerable <string> ignoreProptsForRtnType = null, SqlL2QueryCachePolicy cachePolicy = null) where T : new() { return(configExecutor.Query <T>(EFHelper.Services.SqlParamConverter.DictionaryToDBParams(configExecutor.DB, parameters), ignoreProptsForRtnType, ToPolicies(cachePolicy))); }
/// <summary> /// SqlQuery /// </summary> /// <typeparam name="T">数据类型</typeparam> /// <param name="configExecutor"></param> /// <param name="paramsModel">sql的参数模型对象</param> /// <param name="ignoreProptsForParamModel">sql的参数模型对象中需要忽略的属性名</param> /// <param name="ignoreProptsForRtnType">数据类型需要忽略的属性名</param> /// <param name="cachePolicy">缓存策略</param> /// <returns></returns> public static IReadOnlyList <T> QueryUseModel <T>(this ISqlConfigExecutor configExecutor, object paramsModel, IEnumerable <string> ignoreProptsForParamModel, IEnumerable <string> ignoreProptsForRtnType, SqlL2QueryCachePolicy cachePolicy = null) where T : new() { return(configExecutor.Query <T>( EFHelper.Services.SqlParamConverter.ObjectToDBParams(configExecutor.DB, paramsModel, ignoreProptsForParamModel), ignoreProptsForRtnType, ToPolicies(cachePolicy))); }