Bitwise operator query in LINQPad?
I have a column that contains party_types. The party_types are stored in a single column.
I use the following syntax in T-SQL.
Operator '|' cannot be applied to operands of type 'int' and 'bool'
I use the following syntax in T-SQL.
SELECT TOP 10 p.party_no, p.ext_name, p.party_type FROM party p WHERE p.party_type = p.party_type | 2I used this equivalent in LINQPAD, but it gave me an error.
order by p.party_no DESC
var q= from p in PartiesThe error message is:
where p.Party_type | 2 == 2
select new {p.Ext_name, p.Party_no, p.Title, p.Party_type};
q.OrderByDescending(eq => eq.Party_no).Take(10).Dump();
Operator '|' cannot be applied to operands of type 'int' and 'bool'
Comments
where p.Party_type | 2 == 2
to
where (p.Party_type | 2) == 2