Displaying a view for an object using EF 5 Code First

I developed a pretty nice web application using EF 5 and code. But during the execution of the tests, I found that the performance is not as good as I wanted ... looking further, I found out that all the requests that EF generates are similar Select * From, and this is not the best practice.

Read this answer here. Select specific columns from the database using the EF code first . I realized that I can create a view and match it with an entity. My question is how to transfer the view to an object or vice versa using EF 5 code?

The reason I ask is this: I have a very wide table, on which I do a preliminary search by name, and then return to the rest in one case ... in another I have a large table and most of the time I use only the title and description, not the LOB column ... in all cases touse Im, getting something from the database, I do not use ...

So, if I could really display a view for an entity, or vice versa, I could maintain a multi-band connection between the base and the applied degree ...

+2
source share
2 answers

This is not the same thing you are talking about, i.e. not the exact answer - but it concerns the performance through which EF calls "views."

EF Power Tools - " ".

- "views", .cs, EF ( EF, -) , ).

" Db", , , , SQL-.

" Entity Framework , . , . , , . , Entity Framework . . " "(Entity Framework)".
http://msdn.microsoft.com/en-us/library/bb896240.aspx

"" .

:
- , :

  • , ( ),
  • " dir" ( , power-shell), )

, "" Db "" , , ORM ( - ..)..).

+1

, , :

  • dbset
  • db
  • , ( ).

, , .

, . , , "" . , . , , .

, .

0

All Articles