Sometimes I find myself wanting a quick way to compare an enum with a list of other enums… Basically, if the enum is one of these, then do this. It’s pretty easy to do with Linq, but if you want to do it a few times in a few other places, it pays to be DRY and make an extension method.
Note that you want to use .Equals and not ==. You can use == when you know the enum type, but if you’re creating a generic extension method to use with all enums, it won’t work.
500px.com
I don’t unremarkably comment but I gotta say regards for the post on this one :
D.