public Where <TDto, TProperty, TTable> AndWhere <TProperty>(string columnName) { var andWhere = new Where <TDto, TProperty, TTable>(TableImpl, Parameters, columnName); AndConditions.Add(andWhere); return(andWhere); }
public void WhereAndCondition(string WhereClauseContent, int?IntParameter) { if (IntParameter == null) { return; } AndConditions.Add(" " + WhereClauseContent + " "); }
public void WhereAndCondition(string WhereClauseContent, Guid?GuidParameter) { if (GuidParameter == Guid.Empty || GuidParameter == null) { return; } AndConditions.Add(" " + WhereClauseContent + " "); }
public void WhereAndCondition(string WhereClauseContent, string StringParameter) { if (string.IsNullOrEmpty(StringParameter)) { return; } AndConditions.Add(" " + WhereClauseContent + " "); }
public void WhereAndCondition(string WhereClauseContent, double?DoubleParameter) { if (DoubleParameter == null) { return; } AndConditions.Add(" " + WhereClauseContent + " "); }
public PredicateProgramDto ToDto() { return(new PredicateProgramDto { AndConditions = AndConditions != null?AndConditions.Select(ParameterPredicate.ToDto).ToList() : null, OrConditions = OrConditions != null?OrConditions.Select(ParameterPredicate.ToDto).ToList() : null, Condition = ParameterPredicate.ToDto(Condition), Program = Program.Name }); }
public Where <TDto, TProperty, TTable> AndWhere <TProperty>(Expression <Func <TDto, TProperty> > columnExpression, string colPrefix = null) { var columnName = SpryExpression.GetColumnName(columnExpression); if (!string.IsNullOrWhiteSpace(colPrefix)) { columnName = colPrefix + "." + columnName; } var andWhere = new Where <TDto, TProperty, TTable>(TableImpl, Parameters, columnName); AndConditions.Add(andWhere); return(andWhere); }
public string GetQuery() { if (!AndConditions.Any() && !OrConditions.Any()) { return(InitialQuery + " " + WhereClause); } var IsFirst = true; WhereClause = new StringBuilder(" where "); // Add And Conditions if (AndConditions.Any()) { foreach (var condition in AndConditions) { if (!IsFirst) { WhereClause.Append(" and "); } WhereClause.Append(" " + condition + " "); IsFirst = false; } } //Add Or Conditions if (OrConditions.Any()) { foreach (var condition in OrConditions) { if (!IsFirst) { WhereClause.Append(" or "); } WhereClause.Append(" " + condition + " "); IsFirst = false; } } return(InitialQuery + " " + WhereClause + " " + GroupByClause + " " + HavingClause); }
public void WhereAndCondition(string WhereClauseContent) { AndConditions.Add(" " + WhereClauseContent + " "); }