Search for an entity in your Entity Data Model

Last week i discovered a feature of Entity Data Model which i have not seen extensively being promoted. I accidentally run into it because of the size of my model. If you have a large model and want to search for an entity, it becomes tedious to zoom in and out and scroll up and down to find your entity. In Entity Framework 4, on the model browser there is a new search option that allows you to search for any artifact on your model, whether it be a property, association, column, entity. Below are some ways to search for any artifact on the model.

1. If you do not have your model browser open, type Cntrl + 1 or go to View,Other Windows and choose Entity Data Model Browser to open up the Entity Model Browser window. Figure below shows the model browser.

image

On the position where it says  Type here to search, I can type in entity, property, association. For an instance I will type Software, a derived entity in my model(Make sure to press enter otherwise search results won’t appear).

Figure below shows the results from my search.

image

Notice when you search, it searches not only the conceptual model, but also the store storage model and the mapping section of the edmx file. If the results are found on the conceptual model, you can right click the results and select show in the designer.image 

However if the search result is found in the SSDL layer, you do not get an option to show in the designer , because designer only displays artifacts from the conceptual model.

If you have a large model, you would find the search feature  useful.

2 Comments

  • I would like to buy your new book: Entity Framework 4.0 Recipes A Problem-Solution Approach.

    I am a VB.Net Programmer and have trouble reading C# Code.
    Does your book contain VB.Net samples. My experience is that most .Net books only have C# samples.

    Thanks
    Andy

  • Hello Andy,

    I am afraid the answer is no. The book was written using C# 4.0 cuz that's the only language i code in at work. We do not have VB.net samples. However the best thing is, every recipe in the book is stand alone and does not build up from some other recipe. This makes it easy to follow each concept

Comments have been disabled for this content.