Beispiel #1
0
        public override string ToParametrizedString(SqlParameterCollection list)
        {
            if (Value is Array)
                return ToString();

            var parameter = list.AddOrGet(Value);
            return parameter.ToString();
        }
 public override string ToParametrizedString(SqlParameterCollection list)
 {
     var builder = new StringBuilder();
     if (Type == SqlLikeType.StartsWith || Type == SqlLikeType.Contains) {
         builder.Append("%");
     }
     builder.Append(Value);
     if (Type == SqlLikeType.EndsWith || Type == SqlLikeType.Contains) {
         builder.Append("%");
     }
     var parameter = list.AddOrGet(builder.ToString());
     return parameter.ToString();
     //var parameter = list.AddOrGet(Value);
     //var builder = new StringBuilder();
     //if (Type == SqlLikeType.StartsWith || Type == SqlLikeType.Contains) {
     //    builder.Append("'%' + ");
     //}
     //builder.Append(parameter);
     //if (Type == SqlLikeType.EndsWith || Type == SqlLikeType.Contains) {
     //    builder.Append(" + '%'");
     //}
     //return builder.ToString();
 }