I'm trying to build an asp.net api using Entity Framework MySql
(IQueryable).where(b=>(((fliter ^ b.BlogStatus) & mask) == 0));
error=System.InvalidOperationException: Unsupported Binary operator type specified.
But EOR(^) doesn't work I couldn't find a solution for this so I decided not to use "EOR"
(IQueryable).where(b=>(((fliter | b.BlogStatus) & ~(fliter & b.BlogStatus)) & mask) == 0);
// x^y == (x|y) & ~(x&y)
error=MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT (0 & 'b'.'BlogStatus')) & 7) = 0
But NOT(~) doesn't work I couldn't find a solution for this so I decided not to use "NOT"
(IQueryable).where(b=>(((fliter | b.BlogStatus) & (2147483647-(fliter & b.BlogStatus))&mask)) == 0);
// ~x == 2147483647-x
Surprisingly it works but only locally.
(sorry for my bad english)
User contributions licensed under CC BY-SA 3.0