Reputation: 5524
I have a sqlserver table that has a timestamp column, I'm trying tou use it for filter a linq query like this:
byte[] filtroTimeStamp = SessionBag.Current.mesasTimeStamp;
var ubicAbiertas = from uA in db.TableA
select uA;
ubicAbiertas = ubicAbiertas.Where(
y => y.BitAbierta == true
& y.BitBloqueada == true
& y.TimeStampUltimoCambio == filtroTimeStamp);
When I try this way it shows an error: operator & can't be applied to operands of type bool and byte[]
How can I do to use Byte[] values as a filter of linq Query?
Upvotes: 1
Views: 333
Reputation: 16623
You have to use the && operator which performs a logical-AND:
ubicAbiertas = ubicAbiertas.Where(y => y.BitAbierta == true
&& y.BitBloqueada == true
&& y.TimeStampUltimoCambio == filtroTimeStamp);
Upvotes: 2
Reputation: 20674
That should be && (two not one ampersand), e.g.
&& y.BitBloqueada == true
Upvotes: 4