更新时间:2023-11-27 22:47:40
如果您最关心的是访问数据库,则应查看WCF服务数据层的缓存.如果您使用的是Entity Framework,则可以以此为指导:
实体框架-使用DbContext进行二级缓存 [ ^ ]
如果您使用的是NHibernate,则可以使用以下代码:
http://nhibernate.hibernatingrhinos.com/28/first-and-second- level-caching-in-nhibernate [ ^ ]
If hitting the database is your big concern, you should look at caching at the data layer of your WCF service. If you''re using Entity Framework you can use this as a guide:
Entity Framework - Second Level Caching with DbContext[^]
if you''re using NHibernate you can use this:
http://nhibernate.hibernatingrhinos.com/28/first-and-second-level-caching-in-nhibernate[^]