Example #1
0
 /// <summary>
 /// For internal use only.
 /// </summary>
 /// <param name="cacheQueryOptions"></param>
 /// <param name="entityManagerParameterExpr"></param>
 private CacheQueryExpressionVisitor(EntityQuery query, CacheQueryOptions cacheQueryOptions)
     : base()
 {
     _query                      = query;
     _cacheQueryOptions          = cacheQueryOptions;
     _entityManagerParameterExpr = Expression.Parameter(typeof(EntityManager));
 }
Example #2
0
 public static bool NotEquals(String s1, String s2, CacheQueryOptions cqo)
 {
     if (cqo.UseSql92CompliantStringComparison)
     {
         s1 = (s1 ?? "").TrimEnd();
         s2 = (s2 ?? "").TrimEnd();
     }
     return(!String.Equals(s1, s2, cqo.StringComparison));
 }
Example #3
0
        /// <summary>
        /// See <see cref="Object.Equals(Object)"/>.
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public override bool Equals(Object o)
        {
            if (o == null)
            {
                return(false);
            }
            CacheQueryOptions cqo = o as CacheQueryOptions;

            if (cqo == null)
            {
                return(false);
            }
            return(cqo.StringComparison == this.StringComparison &&
                   cqo.UseSql92CompliantStringComparison == this.UseSql92CompliantStringComparison &&
                   cqo.GuidOrdering == this.GuidOrdering);
        }
Example #4
0
 public static int IndexOf(String s1, String s2, CacheQueryOptions cqo)
 {
     return(s1.IndexOf(s2, cqo.StringComparison));
 }
Example #5
0
 public static bool Contains(String s1, String s2, CacheQueryOptions cqo)
 {
     return(s1.IndexOf(s2, cqo.StringComparison) >= 0);
 }
Example #6
0
 public static bool EndsWith(String s1, String s2, CacheQueryOptions cqo)
 {
     return(s1.EndsWith(s2, cqo.StringComparison));
 }
Example #7
0
        public static Expression <Func <EntityManager, IEnumerable> > Visit(EntityQuery query, CacheQueryOptions cacheQueryOptions)
        {
            var visitor = new CacheQueryExpressionVisitor(query, cacheQueryOptions);

            return(visitor.VisitRoot(query.Expression));
        }
Example #8
0
 static CacheQueryOptions()
 {
     // same as DefaultSqlServerCompatibility.
     // __default = new CacheQueryOptions(StringComparison.OrdinalIgnoreCase, true, GuidOrdering.SqlServer);
     __default = new CacheQueryOptions(StringComparison.CurrentCultureIgnoreCase, true, GuidOrdering.SqlServer);
 }