Is it possible to refactor this C# if(..) statement?
- by Pure.Krome
Hi folks,
simple question :-
i have the following simple if (..) statements :-
if (foo == Animal.Cat || foo == Animal.Dog)
{ .. }
if (baa == 1|| baa == 69)
{ .. }
is it possible to refactor these into something like ...
DISCLAIMER: I know this doesn't compile .. but this is sorta what i'm trying to get...
if (foo == (Animal.Cat || Animal.Dog))
{ .. }
if (baa == (1 || 69))
{ .. }
Cheers :)
EDIT
I wonder if a lambda expression extension could do this? :P