I am developing a project using Entity Framework 4. Having around 50 Entities, mostly all the tables are having relation with user table. The searching a user is bit more time to return the results. In user table I have removed navigation properties even it is taking more time.
Mostly on web the performance guidelines are provided for any particular scenario/problem. Is there any common checklist available for improving performance of Entity Frame work?
Search the user as dynamically like follows
var searchPredication = (from user in entities.Users
where ((searchKeyword == "") || (searchField != "" && searchKeyword != "" &&
searchField == "BarCode" && user.BarCode == searchKeyword)||
(searchField == "LastName" && user.LastName == searchKeyword) ||
(searchField == "FirstName" && user.FirstName == searchKeyword))) && !user.IsDeleted
select user).FirstOrDefault();
And also I need to give some more information about common performance management in EF.
There’s not really any ‘Checklist’ but here’s some tips for making sure your sites perform well:
Hope this helps, overall peformance is more of an art than a science. Its a bit of a sliding scale.