1

タイムスタンプ列を持つ sqlserver テーブルがあります。次のような linq クエリをフィルター処理するために使用しようとしています。

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);

この方法を試してみると、エラーが表示されます: operator & can't be applied to operands of type bool and byte[]

Byte[] 値を linq Query のフィルターとして使用するにはどうすればよいですか?

4

2 に答える 2

4

&& (アンパサンドが 1 つではなく 2 つ) である必要があります。

&& y.BitBloqueada == true 
于 2012-12-10T16:14:21.853 に答える
2

論理 AND を実行する&& 演算子を使用する必要があります。

ubicAbiertas = ubicAbiertas.Where(y => y.BitAbierta == true 
                                  && y.BitBloqueada == true
                                  && y.TimeStampUltimoCambio == filtroTimeStamp);
于 2012-12-10T16:16:29.830 に答える