public IFieldSetterSelector <TClass> FV <TValue>(string field, TValue value, bool ignoreFormat = false) { var fieldValue = SqlBuilderHelper.CreateStringValueFromGenericValue(value, ignoreFormat); FieldsList.Add(new Field(field, fieldValue, false)); return(this); }
public IFieldSetterSelector <TClass> FP(string field, string param) { param = SqlBuilderHelper.CheckParamNameAndUseFieldNameIfEmpty(field, param); FieldsList.Add(new Field(field, param, true)); return(this); }
public IWhereFieldSelector <TClass> WV <TValue>(string field, TValue value, OP whereOperator = OP.EQ, bool ignoreFormat = false) { var sendValue = SqlBuilderHelper.CreateStringValueFromGenericValue(value, ignoreFormat); Wheres.Add(CreateWhereFieldStringForValue(field, whereOperator, sendValue)); return(this); }
public IWhereFieldSelector <TClass> WV <T, TValue>( Expression <Func <TClass, T> > field, TValue value, OP whereOperator = OP.EQ, bool ignoreFormat = false) { return(WV(SqlBuilderHelper.GetNameFromExpression(field), value, whereOperator, ignoreFormat)); }
public IWhereFieldSelector <TClass> WP(string field, string paramName = null, OP whereOperator = OP.EQ) { paramName = SqlBuilderHelper.CheckParamNameAndUseFieldNameIfEmpty(field, paramName); Wheres.Add(CreateWhereFieldStringForParameter(field, paramName, whereOperator)); return(this); }
public ISelectFieldSelector <TClass> F(string field, string alias = null, string tablealias = null) { var tableAlias = SqlBuilderHelper.GetAliasForType <TClass>(tablealias); AddTableAlias(tableAlias); if (string.IsNullOrEmpty(alias)) { FieldsList.Add($"{tableAlias}.{field}"); } else { FieldsList.Add($"{tableAlias}.{field} as {alias}"); } return(this); }
protected virtual string CreateWhereFieldStringForValue(string field, OP whereOperator, params string[] value) { if (whereOperator == OP.NULL_OR_DI) { return(string.Format( "({0} IS NULL OR {0} {1} {2})", field, SqlBuilderHelper.GetStringForOperator(whereOperator), value)); } if (whereOperator == OP.NOT_IN && value.Length == 0) { return("/* NOT IN () */ 1 = 1"); } if (whereOperator == OP.IN && value.Length == 0) { return("/* IN () */ 1 = 0"); } return ($"{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {(value != null ? GetStringValueByOperator(whereOperator, value) : GetNullStringValueByOperator(whereOperator))}"); }
protected override string CreateWhereFieldStringForParameter(string field, string paramName, OP whereOperator) { return($"{GetAliasForType()}.{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {DbConfigConfig.WithParameters(paramName)}"); }
public IFieldSetterSelector <TClass> FV <T, TValue>(Expression <Func <TClass, T> > field, TValue value, bool ignoreFormat = false) { return(FV(SqlBuilderHelper.GetNameFromExpression(field), value, ignoreFormat)); }
public IFieldSetterSelector <TClass> FP <T>(Expression <Func <TClass, T> > field, string param = null) { return(FP(SqlBuilderHelper.GetNameFromExpression(field), param)); }
private string GetAliasForType() { return(Prefix ?? SqlBuilderHelper.GetAliasForType <TClass>()); }
public ISelectFieldSelector <TClass> F <T>(Expression <Func <TClass, T> > field, string alias = null, string tablealias = null) { return(F(SqlBuilderHelper.GetNameFromExpression(field), alias, tablealias)); }
private string GetParameterPrefix() { return(SqlBuilderHelper.GetParameterPrefixIfNull(DbConfigConfig?.GetParameterPrefix())); }
protected virtual string CreateWhereFieldStringForParameter(string field, string paramName, OP whereOperator) { return($"{field} {SqlBuilderHelper.GetStringForOperator(whereOperator)} {DbConfig.WithParameters(paramName)}"); }
public IWhereFieldSelector <TClass> WP <T>(Expression <Func <TClass, T> > field, string[] paramNames, OP whereOperator = OP.IN) { return(WP <T>(SqlBuilderHelper.GetNameFromExpression(field), paramNames, whereOperator)); }