Monday, 15 August 2011

entity framework - Read only Search function. Stored Procedures or IQueryable with POCOs and Ef 4.0 -


We have some search functionality that can get thousands of results from DB, although it will only be necessary to get the rows The first 10 records displayed in the example when the next page is requested, we hit DB again. It searches our database based on a set of variables and this search can be refined which will result in the other database hits. The question is quite complex.

We are looking at various ways of doing this that is fitted with our overall architecture.

The first method is to use a stored procedure, perhaps preparing a list of institutions. This stored procedure can be done quickly and extensively, but better performance will be done.

The second way is to use Linq to Entites or Entity SQL with Unit Framework 4.0 and will make the code in our conceptual layer and populate the POCO object through IOC. IQueryable has its advantages: / P>

  • Abstract : We are using EF at other places in the application, so we would like to search on the model if possible, if possible.
  • Type security and what we want to do in an object oirentated way, it can properly chain the filter on IQueryable

Our main focus is with this attitude, we expect Parrlel LINQ to use the units and throw more hardware on it if necessary. A small display hit for a cleaner development pattern is OK.

We appreciate people's thoughts and recommendations on this .... We are doing a lot of these techniques so that I want to hear the experience of people.

I have done some performance tests and using a procedure stored in EF 4.0, a unit or a complex Type ado It is almost identical to using SP through Net, so we are going to try this method. The use of built-in EF in the inquiry was slow twice, so we are going to use SP in the critical condition of this demonstration.


No comments:

Post a Comment