.NET MVC4, Entity, Search

I have an MVC4 project using EF. I have set up my schema so that all searchable items have have a Table that relates them to a "Tags" table. I am wondering what is the most efficient way to do a full search across all table related to this "Tags" table. In addition I will want to do a search across the titles/names of the item in question. Not sure what is the best way to go about this.

I drew a little diagram of this schema:

Thanks for your help!

Answers


Pseudo code would look like:

var tagged = db.Products.Where(p => p.ProductTag.Any(pt => pt.Tag.Name.Contains("Search")));

But it would all depend on how your model is setup.


Need Your Help

TypeError 'str' object is not callable in Python

python

The command prompt says TypeError: 'str' object is not callable.

Avoid Multiple Drawable Sets (hdpi/mdpi/ldpi)

android resize drawable resolution

Is there a way to avoid having multiple sets of drawables per resolution? I have close to 50 images (simple icons mostly, not using anything needing 9-patch), seems like a lot of redundant work to ...