Home

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.
SELECT TOP 10 p.party_no, p.ext_name, p.party_type FROM party p WHERE p.party_type = p.party_type | 2
order by p.party_no DESC
I used this equivalent in LINQPAD, but it gave me an error.
var q= from p in Parties
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();
The error message is:
Operator '|' cannot be applied to operands of type 'int' and 'bool'

Comments

Sign In or Register to comment.