Back to Devexpress

DataSourceCacheKeyCreatedEventArgs.InvalidateCacheRecord() Method

dashboard-devexpress-dot-dashboardweb-dot-datasourcecachekeycreatedeventargs.md

latest1.5 KB
Original Source

DataSourceCacheKeyCreatedEventArgs.InvalidateCacheRecord() Method

Invalidates the associated cache record.

Namespace : DevExpress.DashboardWeb

Assembly : DevExpress.Dashboard.v25.2.Web.dll

NuGet Package : DevExpress.Web.Dashboard.Common

Declaration

csharp
public void InvalidateCacheRecord()
vb
Public Sub InvalidateCacheRecord

Remarks

Use the InvalidateCacheRecord method to reset the cache record referenced by the current cache key. This way you can ensure that data is always requested from the server and users have access to the latest changes.

The following code snippet invalidates the cache record for the sqlDataSource1 data source in the ASP.NET Core Dashboard Control:

cs
configurator.DataSourceCacheKeyCreated += (sender, args) => {
    if(args.Key.DataSourceId == "sqlDataSource1")
        args.InvalidateCacheRecord();
};

See Also

DataSourceCacheKeyCreatedEventArgs Class

DataSourceCacheKeyCreatedEventArgs Members

DevExpress.DashboardWeb Namespace