Caching in .Net Windows application

2019-02-23 11:32发布

I am working in a windows based application which uses master data for every transaction. This master data normally doesn't change but in some cases it can be change. I am fetching this data into cache or DataSet once and use it for future transactions, but don't want to use time to extract data from database if data get changed in master table.

I want to create a dependency on a DataTable so that if data get changed only at that time it get information from database. As It is a windows based application and I didn't found any support for caching in Windows application, how can I do this either by caching or by DataSet?

标签: c# .net caching
2条回答
Explosion°爆炸
2楼-- · 2019-02-23 12:08
Summer. ? 凉城
3楼-- · 2019-02-23 12:21

"As It is a windows based application and I didn't found any support for caching in Windows application" False

You can get caching class in Framework 4.0 either it is windows based application or web-based http://msdn.microsoft.com/en-us/library/system.runtime.caching.memorycache.aspx

Example:

 using System.Runtime.Caching;

 private static MemoryCache cache = MemoryCache.Default;
查看更多
登录 后发表回答