简体   繁体   中英

LINQ-To-SQL - Is it possible to cache GetTable or serve it from repository?

I'm running profiler tools on the LINQ-to-SQL data access layer.

A lot of the time is spent on GetTable<clsName>() because it's being called each time i CRUD data.

Is it possible to cache GetTable<clsName>() for all the tables when the application starts or serve it through some sort of repository where it will be in memory?

Thank you

Edit: Alternatively, is there a way to avoid using GetTable<> ?

I don't think it's possible to avoid getting it, but caching it seems like to should be reasonable.

This seems like something that should be put to the "Engineer's Test" ("Make sure it's not between you & the door, and plug it it!")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM