diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryMethodInfo.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryMethodInfo.cs index 7f78256c4..67f3d5fbe 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryMethodInfo.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryMethodInfo.cs @@ -88,6 +88,12 @@ namespace SqlSugar this.QueryableObj = method.Invoke(QueryableObj, new object[] { expShortName, expressionString }); return this; } + public QueryMethodInfo Where(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expressionString) + { + var method = QueryableObj.GetType().GetMyMethod("Where", 2, typeof(Dictionary), typeof(FormattableString)); + this.QueryableObj = method.Invoke(QueryableObj, new object[] { keyIsShortName_ValueIsType_Dictionary, expressionString }); + return this; + } public QueryMethodInfo Where(List conditionalModels) { var method = QueryableObj.GetType().GetMyMethod("Where", 1, typeof(List)); @@ -158,6 +164,13 @@ namespace SqlSugar this.QueryableObj = method.Invoke(QueryableObj, new object[] { expShortName, expSelect, resultType }); return this; } + public QueryMethodInfo Select(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expSelect, Type resultType) + { + var method = QueryableObj.GetType().GetMyMethod("Select", 3, typeof(Dictionary), typeof(FormattableString), typeof(Type)); + method = method.MakeGenericMethod(resultType); + this.QueryableObj = method.Invoke(QueryableObj, new object[] { keyIsShortName_ValueIsType_Dictionary, expSelect, resultType }); + return this; + } public QueryMethodInfo Select(string selectorSql) { var method = QueryableObj.GetType().GetMyMethod("Select", 1, typeof(string)) diff --git a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index f62764b8e..bd56c7c67 100644 --- a/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -926,6 +926,12 @@ namespace SqlSugar } return this; } + public ISugarQueryable Where(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expressionString) + { + var exp = DynamicCoreHelper.GetWhere(keyIsShortName_ValueIsType_Dictionary, expressionString); + _Where(exp); + return this; + } public virtual ISugarQueryable Where(string expShortName, FormattableString expressionString) { var exp = DynamicCoreHelper.GetWhere(expShortName, expressionString); @@ -1348,6 +1354,11 @@ namespace SqlSugar } return _Select(expression); } + public ISugarQueryable Select(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expSelect, Type resultType) + { + var exp = DynamicCoreHelper.GetMember(keyIsShortName_ValueIsType_Dictionary, resultType, expSelect); + return _Select(exp); + } public ISugarQueryable Select(string expShortName, FormattableString expSelect, Type resultType) { var exp = DynamicCoreHelper.GetMember(typeof(TResult), resultType, expShortName, expSelect); diff --git a/Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs b/Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs index 55665aea4..e44b5a6a3 100644 --- a/Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs +++ b/Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs @@ -86,6 +86,7 @@ namespace SqlSugar ISugarQueryable TranLock(DbLockType? LockType = DbLockType.Wait); ISugarQueryable Where(Expression> expression); ISugarQueryable Where(string expShortName, FormattableString expressionString); + ISugarQueryable Where(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expressionString); ISugarQueryable Where(string whereString, object parameters = null); ISugarQueryable Where(IFuncModel funcModel); ISugarQueryable Where(List conditionalModels); @@ -152,6 +153,7 @@ namespace SqlSugar bool Any(); Task AnyAsync(); ISugarQueryable Select(string expShortName, FormattableString expSelect, Type resultType); + ISugarQueryable Select(Dictionary keyIsShortName_ValueIsType_Dictionary, FormattableString expSelect, Type resultType); ISugarQueryable Select(string expShortName, FormattableString expSelect,Type EntityType, Type resultType); ISugarQueryable Select(string expShortName, FormattableString expSelect, Type resultType); ISugarQueryable Select(Expression expression);