@@ -1720,8 +1720,12 @@ private object GetNotValue(object o)
1720
1720
1721
1721
private bool IsColumnAccess ( MethodCallExpression m )
1722
1722
{
1723
- if ( m . Object != null && m . Object as MethodCallExpression != null )
1724
- return IsColumnAccess ( m . Object as MethodCallExpression ) ;
1723
+ if ( m . Object == null )
1724
+ return false ;
1725
+
1726
+ var methCallExp = m . Object as MethodCallExpression ;
1727
+ if ( methCallExp != null )
1728
+ return IsColumnAccess ( methCallExp ) ;
1725
1729
1726
1730
var exp = m . Object as MemberExpression ;
1727
1731
return IsParameterAccess ( exp )
@@ -1930,14 +1934,11 @@ public IList<string> GetAllFields()
1930
1934
return modelDef . FieldDefinitions . ConvertAll ( r => r . Name ) ;
1931
1935
}
1932
1936
1933
- private bool IsStaticArrayMethod ( MethodCallExpression m )
1937
+ private static bool IsStaticArrayMethod ( MethodCallExpression m )
1934
1938
{
1935
- if ( m . Object == null && m . Method . Name == "Contains" )
1936
- {
1937
- return m . Arguments . Count == 2 ;
1938
- }
1939
-
1940
- return false ;
1939
+ return ( m . Object == null
1940
+ && m . Method . Name == "Contains"
1941
+ && m . Arguments . Count == 2 ) ;
1941
1942
}
1942
1943
1943
1944
protected virtual object VisitStaticArrayMethodCall ( MethodCallExpression m )
@@ -1959,17 +1960,13 @@ protected virtual object VisitStaticArrayMethodCall(MethodCallExpression m)
1959
1960
}
1960
1961
}
1961
1962
1962
- private bool IsEnumerableMethod ( MethodCallExpression m )
1963
+ private static bool IsEnumerableMethod ( MethodCallExpression m )
1963
1964
{
1964
- if ( m . Object != null
1965
+ return ( m . Object != null
1965
1966
&& m . Object . Type . IsOrHasGenericInterfaceTypeOf ( typeof ( IEnumerable < > ) )
1966
1967
&& m . Object . Type != typeof ( string )
1967
- && m . Method . Name == "Contains" )
1968
- {
1969
- return m . Arguments . Count == 1 ;
1970
- }
1971
-
1972
- return false ;
1968
+ && m . Method . Name == "Contains"
1969
+ && m . Arguments . Count == 1 ) ;
1973
1970
}
1974
1971
1975
1972
protected virtual object VisitEnumerableMethodCall ( MethodCallExpression m )
@@ -2000,14 +1997,10 @@ private object ToInPartialString(Expression memberExpr, object quotedColName)
2000
1997
return new PartialSqlString ( statement ) ;
2001
1998
}
2002
1999
2003
- private bool IsStaticStringMethod ( MethodCallExpression m )
2000
+ private static bool IsStaticStringMethod ( MethodCallExpression m )
2004
2001
{
2005
- if ( m . Object == null && m . Method . Name == "Concat" )
2006
- {
2007
- return true ;
2008
- }
2009
-
2010
- return false ;
2002
+ return ( m . Object == null
2003
+ && m . Method . Name == "Concat" ) ;
2011
2004
}
2012
2005
2013
2006
protected virtual object VisitStaticStringMethodCall ( MethodCallExpression m )
@@ -2051,7 +2044,6 @@ protected virtual object VisitSqlMethodCall(MethodCallExpression m)
2051
2044
case "In" :
2052
2045
statement = ConvertInExpressionToSql ( m , quotedColName ) ;
2053
2046
break ;
2054
-
2055
2047
case "Desc" :
2056
2048
statement = string . Format ( "{0} DESC" , quotedColName ) ;
2057
2049
break ;
0 commit comments