public void EqualsMethods() { Assert.IsTrue(!Test1.Equals(Test2), "#E01"); Assert.IsTrue(!Test3.Equals(Test1), "#E02"); Assert.IsTrue(!Test2.Equals(new SqlString("TEST")), "#E03"); Assert.IsTrue(Test2.Equals(Test3), "#E04"); // Static Equals()-method Assert.IsTrue(SqlString.Equals(Test2, Test3).Value, "#E05"); Assert.IsTrue(!SqlString.Equals(Test1, Test2).Value, "#E06"); }
public void EqualsMethods() { Assert.False(_test1.Equals(_test2)); Assert.False(_test3.Equals(_test1)); Assert.False(_test2.Equals(new SqlString("TEST"))); Assert.True(_test2.Equals(_test3)); // Static Equals()-method Assert.True(SqlString.Equals(_test2, _test3).Value); Assert.False(SqlString.Equals(_test1, _test2).Value); }
public void Equal_Test() { var query1 = new SqlString("Text"); var query2 = new SqlString("Text"); Assert.IsTrue(query1.Equals(query2)); }
private static string SqlStringEquals(SqlString string1, SqlString string2) { // SqlString.Equals uses database semantics for evaluating nulls. string returnValue = SqlString.Equals(string1, string2).ToString(); return(returnValue); }
private static string StringEquals(SqlString string1, SqlString string2) { // String.Equals uses CLR type semantics for evaluating nulls. string returnValue = string1.Equals(string2).ToString(); return(returnValue); }
public virtual IDbCommand PrepareBatchCommand(CommandType type, SqlString sql, SqlType[] parameterTypes) { /* NH: * The code inside this block was added for a strange behaviour * discovered using Firebird (some times for us is external issue). * The problem is that batchCommandSql as a value, batchCommand is not null * BUT batchCommand.CommandText is null (I don't know who clear it) */ bool forceCommandRecreate = batchCommand == null || string.IsNullOrEmpty(batchCommand.CommandText); /****************************************/ if (sql.Equals(batchCommandSql) && ArrayHelper.ArrayEquals(parameterTypes, batchCommandParameterTypes) && !forceCommandRecreate) { if (log.IsDebugEnabled) { log.Debug("reusing command " + batchCommand.CommandText); } } else { batchCommand = PrepareCommand(type, sql, parameterTypes); // calls ExecuteBatch() batchCommandSql = sql; batchCommandParameterTypes = parameterTypes; } return(batchCommand); }
public bool Equals(string x, string y) { SqlString a = new SqlString(x, LCID, SqlCompareOptions.IgnoreWidth | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreCase); SqlString b = new SqlString(y, LCID, SqlCompareOptions.IgnoreWidth | SqlCompareOptions.IgnoreKanaType | SqlCompareOptions.IgnoreCase); return(a.Equals(b)); }
private SqlBoolean ToBoolean(SqlString value) { if (value == null) { throw new InvalidCastException(); } if (value.Equals(SqlBoolean.TrueString, true)) { return(SqlBoolean.True); } if (value.Equals(SqlBoolean.FalseString, true)) { return(SqlBoolean.False); } throw new InvalidCastException(); }
public override bool Equals(object other) { QueryKey that = ( QueryKey )other; if (!sqlQueryString.Equals(that.sqlQueryString)) { return(false); } if (firstRow != that.firstRow || maxRows != that.maxRows) { return(false); } if (types == null) { if (that.types != null) { return(false); } } else { if (that.types == null) { return(false); } if (types.Length != that.types.Length) { return(false); } for (int i = 0; i < types.Length; i++) { if (!types[i].Equals(that.types[i])) { return(false); } if (!object.Equals(values[i], that.values[i])) { return(false); } } } if (!DictionariesAreEqual(namedParameters, that.namedParameters)) { return(false); } return(true); }
public override bool Equals(object obj) { var other = obj as SqlToken; if (ReferenceEquals(other, null)) { return(false); } return(_tokenType.Equals(other._tokenType) && _sqlIndex.Equals(other._sqlIndex) && _length.Equals(other._length) && _sql.Equals(other._sql)); }
/// <summary> /// /// </summary> /// <param name="sql"></param> /// <returns></returns> public IDbCommand PrepareBatchCommand(SqlString sql) { if (!sql.Equals(batchCommandSql)) { batchCommand = PrepareCommand(sql); // calls ExecuteBatch() batchCommandSql = sql; } else { if (log.IsDebugEnabled) { log.Debug("reusing command " + batchCommand.CommandText); } } return(batchCommand); }
public virtual DbCommand PrepareBatchCommand(CommandType type, SqlString sql, SqlType[] parameterTypes) { if (sql.Equals(_batchCommandSql) && ArrayHelper.ArrayEquals(parameterTypes, _batchCommandParameterTypes)) { if (Log.IsDebugEnabled()) { Log.Debug("reusing command {0}", _batchCommand.CommandText); } } else { _batchCommand = PrepareCommand(type, sql, parameterTypes); // calls ExecuteBatch() _batchCommandSql = sql; _batchCommandParameterTypes = parameterTypes; } return(_batchCommand); }
public virtual async Task <DbCommand> PrepareBatchCommandAsync(CommandType type, SqlString sql, SqlType[] parameterTypes, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (sql.Equals(_batchCommandSql) && ArrayHelper.ArrayEquals(parameterTypes, _batchCommandParameterTypes)) { if (Log.IsDebugEnabled) { Log.Debug("reusing command " + _batchCommand.CommandText); } } else { _batchCommand = await(PrepareCommandAsync(type, sql, parameterTypes, cancellationToken)).ConfigureAwait(false); // calls ExecuteBatch() _batchCommandSql = sql; _batchCommandParameterTypes = parameterTypes; } return(_batchCommand); }
public override bool Equals(object other) { QueryKey that = (QueryKey)other; if (!sqlQueryString.Equals(that.sqlQueryString)) { return(false); } if (firstRow != that.firstRow || maxRows != that.maxRows) { return(false); } if (!Equals(customTransformer, that.customTransformer)) { return(false); } if (types == null) { if (that.types != null) { return(false); } } else { if (that.types == null) { return(false); } if (types.Length != that.types.Length) { return(false); } for (int i = 0; i < types.Length; i++) { if (!types[i].Equals(that.types[i])) { return(false); } if (!Equals(values[i], that.values[i])) { return(false); } } } if (!CollectionHelper.SetEquals(filters, that.filters)) { return(false); } if (!CollectionHelper.DictionaryEquals(namedParameters, that.namedParameters)) { return(false); } if (!CollectionHelper.CollectionEquals <int>(multiQueriesFirstRows, that.multiQueriesFirstRows)) { return(false); } if (!CollectionHelper.CollectionEquals <int>(multiQueriesMaxRows, that.multiQueriesMaxRows)) { return(false); } return(true); }
public override bool Equals(object other) { QueryKey that = (QueryKey)other; if (!_sqlQueryString.Equals(that._sqlQueryString)) { return(false); } if (_firstRow != that._firstRow || _maxRows != that._maxRows) { return(false); } if (!Equals(_customTransformer, that._customTransformer)) { return(false); } if (_types == null) { if (that._types != null) { return(false); } } else { if (that._types == null) { return(false); } if (_types.Length != that._types.Length) { return(false); } for (int i = 0; i < _types.Length; i++) { if (!_types[i].Equals(that._types[i])) { return(false); } if (!Equals(_values[i], that._values[i])) { return(false); } } } if (!CollectionHelper.SetEquals(_filters, that._filters)) { return(false); } if (!CollectionHelper.DictionaryEquals(_namedParameters, that._namedParameters)) { return(false); } if (!CollectionHelper.SequenceEquals <int>(_multiQueriesFirstRows, that._multiQueriesFirstRows)) { return(false); } if (!CollectionHelper.SequenceEquals <int>(_multiQueriesMaxRows, that._multiQueriesMaxRows)) { return(false); } return(true); }
public void String_Equals() { const string s = "Test string in UTF-16 LE"; var sqlString1 = new SqlString(s); var sqlString2 = new SqlString(s); Assert.IsTrue(sqlString1.Equals(sqlString2)); }
public bool Equals(QueryKey other) { if (other == null || !_sqlQueryString.Equals(other._sqlQueryString)) { return(false); } if (_firstRow != other._firstRow || _maxRows != other._maxRows) { return(false); } if (!Equals(_customTransformer, other._customTransformer)) { return(false); } if (_types == null) { if (other._types != null) { return(false); } } else { if (other._types == null) { return(false); } if (_types.Length != other._types.Length) { return(false); } for (int i = 0; i < _types.Length; i++) { if (!_types[i].Equals(other._types[i])) { return(false); } if (!Equals(_values[i], other._values[i])) { return(false); } } } // BagEquals is less efficient than a SetEquals or DictionaryEquals, but serializing dictionaries causes // issues on deserialization if GetHashCode or Equals are called in its deserialization callback. And // building sets or dictionaries on the fly will in most cases be worst than BagEquals, unless re-coding // its short-circuits. if (!CollectionHelper.BagEquals(_filters, other._filters)) { return(false); } if (!CollectionHelper.BagEquals(_namedParameters, other._namedParameters, NamedParameterComparer.Instance)) { return(false); } if (!CollectionHelper.SequenceEquals(_multiQueriesFirstRows, other._multiQueriesFirstRows)) { return(false); } if (!CollectionHelper.SequenceEquals(_multiQueriesMaxRows, other._multiQueriesMaxRows)) { return(false); } if (_tenantIdentifier != other._tenantIdentifier) { return(false); } return(true); }
static Dictionary <MethodInfo, SoodaLinqMethod> Initialize() { Dictionary <MethodInfo, SoodaLinqMethod> method2id = new Dictionary <MethodInfo, SoodaLinqMethod>(); Expression <Func <object, bool> > predicate = o => true; Expression <Func <object, int> > selector = o => 0; Expression <Func <object, decimal> > selectorM = o => 0; Expression <Func <object, double> > selectorD = o => 0; Expression <Func <object, long> > selectorL = o => 0; Expression <Func <object, int?> > selectorN = o => 0; Expression <Func <object, decimal?> > selectorNM = o => 0; Expression <Func <object, double?> > selectorND = o => 0; Expression <Func <object, long?> > selectorNL = o => 0; method2id.Add(MethodOf(() => Queryable.Where(null, predicate)), SoodaLinqMethod.Queryable_Where); method2id.Add(MethodOf(() => Queryable.OrderBy(null, selector)), SoodaLinqMethod.Queryable_OrderBy); method2id.Add(MethodOf(() => Queryable.OrderByDescending(null, selector)), SoodaLinqMethod.Queryable_OrderByDescending); method2id.Add(MethodOf(() => Queryable.ThenBy(null, selector)), SoodaLinqMethod.Queryable_ThenBy); method2id.Add(MethodOf(() => Queryable.ThenByDescending(null, selector)), SoodaLinqMethod.Queryable_ThenByDescending); method2id.Add(MethodOf(() => Queryable.Skip <object>(null, 0)), SoodaLinqMethod.Queryable_Skip); method2id.Add(MethodOf(() => Queryable.Take <object>(null, 0)), SoodaLinqMethod.Queryable_Take); method2id.Add(MethodOf(() => Queryable.Select(null, selector)), SoodaLinqMethod.Queryable_Select); method2id.Add(MethodOf(() => Queryable.Select(null, (object o, int i) => i)), SoodaLinqMethod.Queryable_SelectIndexed); method2id.Add(MethodOf(() => Queryable.GroupBy(null, selector)), SoodaLinqMethod.Queryable_GroupBy); method2id.Add(MethodOf(() => Queryable.Reverse <object>(null)), SoodaLinqMethod.Queryable_Reverse); method2id.Add(MethodOf(() => Queryable.Distinct <object>(null)), SoodaLinqMethod.Queryable_Distinct); method2id.Add(MethodOf(() => Queryable.OfType <object>(null)), SoodaLinqMethod.Queryable_OfType); method2id.Add(MethodOf(() => Queryable.Except <object>(null, null)), SoodaLinqMethod.Queryable_Except); method2id.Add(MethodOf(() => Queryable.Intersect <object>(null, null)), SoodaLinqMethod.Queryable_Intersect); method2id.Add(MethodOf(() => Queryable.Union <object>(null, null)), SoodaLinqMethod.Queryable_Union); method2id.Add(MethodOf(() => Queryable.All(null, predicate)), SoodaLinqMethod.Enumerable_All); method2id.Add(MethodOf(() => Queryable.Any <object>(null)), SoodaLinqMethod.Enumerable_Any); method2id.Add(MethodOf(() => Queryable.Any(null, predicate)), SoodaLinqMethod.Enumerable_AnyFiltered); method2id.Add(MethodOf(() => Queryable.Contains <object>(null, null)), SoodaLinqMethod.Enumerable_Contains); method2id.Add(MethodOf(() => Queryable.Count <object>(null)), SoodaLinqMethod.Enumerable_Count); method2id.Add(MethodOf(() => Queryable.Count(null, predicate)), SoodaLinqMethod.Enumerable_CountFiltered); method2id.Add(MethodOf(() => Queryable.First <object>(null)), SoodaLinqMethod.Queryable_First); method2id.Add(MethodOf(() => Queryable.First(null, predicate)), SoodaLinqMethod.Queryable_FirstFiltered); method2id.Add(MethodOf(() => Queryable.FirstOrDefault <object>(null)), SoodaLinqMethod.Queryable_FirstOrDefault); method2id.Add(MethodOf(() => Queryable.FirstOrDefault(null, predicate)), SoodaLinqMethod.Queryable_FirstOrDefaultFiltered); method2id.Add(MethodOf(() => Queryable.Last <object>(null)), SoodaLinqMethod.Queryable_Last); method2id.Add(MethodOf(() => Queryable.Last(null, predicate)), SoodaLinqMethod.Queryable_LastFiltered); method2id.Add(MethodOf(() => Queryable.LastOrDefault <object>(null)), SoodaLinqMethod.Queryable_LastOrDefault); method2id.Add(MethodOf(() => Queryable.LastOrDefault(null, predicate)), SoodaLinqMethod.Queryable_LastOrDefaultFiltered); method2id.Add(MethodOf(() => Queryable.Single <object>(null)), SoodaLinqMethod.Queryable_Single); method2id.Add(MethodOf(() => Queryable.Single(null, predicate)), SoodaLinqMethod.Queryable_SingleFiltered); method2id.Add(MethodOf(() => Queryable.SingleOrDefault <object>(null)), SoodaLinqMethod.Queryable_SingleOrDefault); method2id.Add(MethodOf(() => Queryable.SingleOrDefault(null, predicate)), SoodaLinqMethod.Queryable_SingleOrDefaultFiltered); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <decimal>)null)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <double>)null)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <int>)null)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <long>)null)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <decimal?>)null)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <double?>)null)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <int?>)null)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average((IQueryable <long?>)null)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Max <int>(null)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Queryable.Min <int>(null)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <decimal>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <double>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <int>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <long>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <decimal?>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <double?>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <int?>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum((IQueryable <long?>)null)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Average(null, selectorM)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average(null, selectorD)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average(null, selector)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average(null, selectorL)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Queryable.Average(null, selectorNM)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average(null, selectorND)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average(null, selectorN)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Average(null, selectorNL)), SoodaLinqMethod.Queryable_AverageNullable); method2id.Add(MethodOf(() => Queryable.Max(null, selector)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Queryable.Min(null, selector)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorM)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorD)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selector)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorL)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorNM)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorND)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorN)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Queryable.Sum(null, selectorNL)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.All(null, (object o) => true)), SoodaLinqMethod.Enumerable_All); method2id.Add(MethodOf(() => Enumerable.Any <object>(null)), SoodaLinqMethod.Enumerable_Any); method2id.Add(MethodOf(() => Enumerable.Any(null, (object o) => true)), SoodaLinqMethod.Enumerable_AnyFiltered); method2id.Add(MethodOf(() => Enumerable.Contains <object>(null, null)), SoodaLinqMethod.Enumerable_Contains); method2id.Add(MethodOf(() => Enumerable.Count <object>(null)), SoodaLinqMethod.Enumerable_Count); method2id.Add(MethodOf(() => Enumerable.Count(null, (object o) => true)), SoodaLinqMethod.Enumerable_CountFiltered); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => 0M)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => 0D)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => 0)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => 0L)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => (decimal?)0)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => (double?)0)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => (int?)0)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Average(null, (object o) => (long?)0)), SoodaLinqMethod.Enumerable_Average); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => 0M)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => 0D)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => 0)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => 0L)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => (decimal?)0)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => (double?)0)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => (int?)0)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => (long?)0)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Max(null, (object o) => string.Empty)), SoodaLinqMethod.Enumerable_Max); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => 0M)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => 0D)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => 0)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => 0L)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => (decimal?)0)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => (double?)0)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => (int?)0)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => (long?)0)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Min(null, (object o) => string.Empty)), SoodaLinqMethod.Enumerable_Min); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => 0M)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => 0D)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => 0)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => 0L)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => (decimal?)0)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => (double?)0)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => (int?)0)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => Enumerable.Sum(null, (object o) => (long?)0)), SoodaLinqMethod.Enumerable_Sum); method2id.Add(MethodOf(() => ((ICollection <object>)null).Contains(null)), SoodaLinqMethod.ICollection_Contains); method2id.Add(MethodOf(() => ((List <object>)null).Contains(null)), SoodaLinqMethod.ICollection_Contains); method2id.Add(MethodOf(() => ((System.Collections.ArrayList)null).Contains(null)), SoodaLinqMethod.ICollection_Contains); method2id.Add(MethodOf(() => ((System.Collections.IList)null).Contains(null)), SoodaLinqMethod.ICollection_Contains); method2id.Add(MethodOf(() => ((Sooda.ObjectMapper.SoodaObjectCollectionWrapperGeneric <object>)null).Contains(null)), SoodaLinqMethod.ICollection_Contains); method2id.Add(MethodOf(() => string.Empty.GetType()), SoodaLinqMethod.Object_GetType); method2id.Add(MethodOf(() => ((object)null).Equals(null)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => false.Equals(false)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => 0M.Equals(0M)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => 0D.Equals(0D)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => 0.Equals(0)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => 0L.Equals(0L)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => string.Empty.Equals(string.Empty)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => DateTime.Now.Equals(DateTime.Now)), SoodaLinqMethod.Object_InstanceEquals); method2id.Add(MethodOf(() => object.Equals(null, null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => string.Equals(null, null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => DateTime.Equals(DateTime.Now, DateTime.Now)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlBoolean.Equals(SqlBoolean.Null, SqlBoolean.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlDateTime.Equals(SqlDateTime.Null, SqlDateTime.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlDecimal.Equals(SqlDecimal.Null, SqlDecimal.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlDouble.Equals(SqlDouble.Null, SqlDouble.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlGuid.Equals(SqlGuid.Null, SqlGuid.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlInt32.Equals(SqlInt32.Null, SqlInt32.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlInt64.Equals(SqlInt64.Null, SqlInt64.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlSingle.Equals(SqlSingle.Null, SqlSingle.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => SqlString.Equals(SqlString.Null, SqlString.Null)), SoodaLinqMethod.Object_StaticEquals); method2id.Add(MethodOf(() => string.Concat(string.Empty, string.Empty)), SoodaLinqMethod.String_Concat); method2id.Add(MethodOf(() => LinqUtils.Like(string.Empty, string.Empty)), SoodaLinqMethod.String_Like); method2id.Add(MethodOf(() => string.Empty.Remove(0)), SoodaLinqMethod.String_Remove); method2id.Add(MethodOf(() => string.Empty.Substring(0, 0)), SoodaLinqMethod.String_Substring); method2id.Add(MethodOf(() => string.Empty.Replace(string.Empty, string.Empty)), SoodaLinqMethod.String_Replace); method2id.Add(MethodOf(() => string.Empty.ToLower()), SoodaLinqMethod.String_ToLower); method2id.Add(MethodOf(() => string.Empty.ToUpper()), SoodaLinqMethod.String_ToUpper); method2id.Add(MethodOf(() => string.Empty.StartsWith(string.Empty)), SoodaLinqMethod.String_StartsWith); method2id.Add(MethodOf(() => string.Empty.EndsWith(string.Empty)), SoodaLinqMethod.String_EndsWith); method2id.Add(MethodOf(() => string.Empty.Contains(string.Empty)), SoodaLinqMethod.String_Contains); method2id.Add(MethodOf(() => string.IsNullOrEmpty(null)), SoodaLinqMethod.String_IsNullOrEmpty); method2id.Add(MethodOf(() => 0.ToString()), SoodaLinqMethod.Int_ToString); method2id.Add(MethodOf(() => 0L.ToString()), SoodaLinqMethod.Long_ToString); method2id.Add(MethodOf(() => 0D.ToString()), SoodaLinqMethod.Double_ToString); method2id.Add(MethodOf(() => 0M.ToString()), SoodaLinqMethod.Decimal_ToString); method2id.Add(MethodOf(() => false.ToString()), SoodaLinqMethod.Bool_ToString); method2id.Add(MethodOf(() => Math.Abs(0M)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs(0D)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs((short)0)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs(0)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs(0L)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs((sbyte)0)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Abs(0F)), SoodaLinqMethod.Math_Abs); method2id.Add(MethodOf(() => Math.Acos(0)), SoodaLinqMethod.Math_Acos); method2id.Add(MethodOf(() => Math.Asin(0)), SoodaLinqMethod.Math_Asin); method2id.Add(MethodOf(() => Math.Atan(0)), SoodaLinqMethod.Math_Atan); method2id.Add(MethodOf(() => Math.Cos(0)), SoodaLinqMethod.Math_Cos); method2id.Add(MethodOf(() => Math.Exp(0)), SoodaLinqMethod.Math_Exp); method2id.Add(MethodOf(() => Math.Floor(0M)), SoodaLinqMethod.Math_Floor); method2id.Add(MethodOf(() => Math.Floor(0D)), SoodaLinqMethod.Math_Floor); method2id.Add(MethodOf(() => Math.Pow(1, 1)), SoodaLinqMethod.Math_Pow); method2id.Add(MethodOf(() => Math.Round(0M, 0)), SoodaLinqMethod.Math_Round); method2id.Add(MethodOf(() => Math.Round(0D, 0)), SoodaLinqMethod.Math_Round); method2id.Add(MethodOf(() => Math.Sign(0M)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign(0D)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign((short)0)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign(0)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign(0L)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign((sbyte)0)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sign(0F)), SoodaLinqMethod.Math_Sign); method2id.Add(MethodOf(() => Math.Sin(0)), SoodaLinqMethod.Math_Sin); method2id.Add(MethodOf(() => Math.Sqrt(0)), SoodaLinqMethod.Math_Sqrt); method2id.Add(MethodOf(() => Math.Tan(0)), SoodaLinqMethod.Math_Tan); method2id.Add(MethodOf(() => ((SoodaObject)null).GetPrimaryKeyValue()), SoodaLinqMethod.SoodaObject_GetPrimaryKeyValue); method2id.Add(MethodOf(() => ((SoodaObject)null).GetLabel(false)), SoodaLinqMethod.SoodaObject_GetLabel); // doesn't compile: method2id.Add(MethodOf(() => ((SoodaObject) null)[string.Empty]), SoodaLinqMethod.SoodaObject_GetItem); method2id.Add(typeof(SoodaObject).GetMethod("get_Item"), SoodaLinqMethod.SoodaObject_GetItem); _method2id = method2id; return(method2id); }