A
Andy
Hi,
I'm trying to figure out a linq to sql command that will execute
something similar to this sql:
select *
from products
where IsBundle = 0
AND (
productDescription like '%the%' OR
productDescription like '%january%' OR
productDescription like '%bobcat%'
)
I'm trying to do this:
var query = from products in db.Products select products;
if ( noBundles ) {
query = query.Where( p => p.IsBundle == false );
}
if ( descTokens.Count > 0 ) {
query = query.Where( p => descTokens.Any( s =>
p.Description.Contains( s ) ) );
}
But I'm getting the error Local sequence cannot be used in L2S
implementation except the Contains() operator.
Any ideas?
I'm trying to figure out a linq to sql command that will execute
something similar to this sql:
select *
from products
where IsBundle = 0
AND (
productDescription like '%the%' OR
productDescription like '%january%' OR
productDescription like '%bobcat%'
)
I'm trying to do this:
var query = from products in db.Products select products;
if ( noBundles ) {
query = query.Where( p => p.IsBundle == false );
}
if ( descTokens.Count > 0 ) {
query = query.Where( p => descTokens.Any( s =>
p.Description.Contains( s ) ) );
}
But I'm getting the error Local sequence cannot be used in L2S
implementation except the Contains() operator.
Any ideas?