public IQuery Search(FormulaSearchSpecification specification) { Guard.AgainstNull(specification, nameof(specification)); return(RawQuery.Create(string.Concat(SelectClause, @" where ( @Id is null or Id = @Id ) and ( @Name is null or @Name = '' or Name like '%' + @Name + '%' ) and ( @MaximumFormulaName is null or @MaximumFormulaName = '' or MaximumFormulaName like '%' + @MaximumFormulaName + '%' ) and ( @MinimumFormulaName is null or @MinimumFormulaName = '' or MinimumFormulaName like '%' + @MinimumFormulaName + '%' ) order by Name ")) .AddParameterValue(Columns.Id, specification.Id) .AddParameterValue(Columns.Name, specification.Name) .AddParameterValue(Columns.MaximumFormulaName, specification.MaximumFormulaName) .AddParameterValue(Columns.MinimumFormulaName, specification.MinimumFormulaName)); }
public IEnumerable <DataRow> Search(FormulaSearchSpecification specification) { Guard.AgainstNull(specification, nameof(specification)); return(_databaseGateway.GetRowsUsing(_queryFactory.Search(specification))); }