Beispiel #1
0
        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));
        }
Beispiel #2
0
        public IEnumerable <DataRow> Search(FormulaSearchSpecification specification)
        {
            Guard.AgainstNull(specification, nameof(specification));

            return(_databaseGateway.GetRowsUsing(_queryFactory.Search(specification)));
        }