Steven
asked on
is it posible to use operators with _context
good afternoon,
I was wondering if it is posible to use operators like OR/AND as follow in asp.net
or what is the right way of doing something similar to that.
I appreciate your help thanks.
I was wondering if it is posible to use operators like OR/AND as follow in asp.net
if (_context.User.Any(ac => ac.Id.Equals(23) && ac.Active.Equals(1)))
or what is the right way of doing something similar to that.
I appreciate your help thanks.
I think User is not an IEnumerable. You cannot use the method Any on it.
ASKER
Maybe I should've written what I was trying to accomplish, I'm trying to check if a specific user is active.
thanks
thanks
My last comment was just a thought I had when reading your code and I forgot to actually answer the question.
You can use boolean operators in asp.net. Are you getting an error when you use them?
You can use boolean operators in asp.net. Are you getting an error when you use them?
ASKER
Im new to MVC, so im not sure if what I was doing was posible, this is the error I get System.ArgumentException: 'DbComparisonExpression requires arguments with comparable types.'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Most probable cause of the problem