Using enum flags to write filters in Linq

Here’s the premise. Suppose we have a cookbook that contains all possible recipes with their names and needed ingredients. Using Linq it should be easy to query the cookbook and, for example, only show those recipes you can make given one or more ingredients you have at your house. My solution is a) extremely nice or b) very strange, bloated and way wrong. I leave it up to you and make sure to message me if you have a much nicer solution…because franky, I’m not a big fan of what follows (I have the itching sensation that using the correct binary logic I can solve this problem much easier…).

Read more of this post


Get every new post delivered to your Inbox.

Join 327 other followers