Caching in a .Net Windows Application
I am working in a windows based application that uses master data for every transaction. This master data usually does not change, but in some cases it can be changed. I am fetching this data to the cache or DataSet
once and using it for future transactions, but I do not want to use the time to fetch data from the database if the data changes in the main table.
I want to create a dependency on DataTable
so that if the data is changed only then it will get the information from the database. Since this is a Windows based application and I have not found support for caching in a Windows application, how do I do this, either by caching or using DataSet
?
source to share
"Since this is a Windows application and I have not found support for caching in a Windows application"
It's a lie.
You can get the caching class in Framework 4.0. These can be both Windows-based applications and web applications. Here are the docs .
Example:
using System.Runtime.Caching;
private static MemoryCache cache = MemoryCache.Default;
source to share