65.9K
CodeProject is changing. Read more.
Home

EF 4.1 Cached object performance tip

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Jan 25, 2012

CPOL
viewsIcon

15231

A performance tip for EF 4.1

The Find() method on your DbContext allows you to get a specific object, based on its primary key from the database the first time. Thereafter, it gets it from the context's cache, instead of making a round trip to the database each time you request that object. Thus, you get faster performance because there are no extra calls to the database.