Table of Contents

Interface IQuery

Namespace
DotNetQuery.Core
Assembly
DotNetQuery.Core.dll

Base interface for a query. Provides lifecycle management and key access.

public interface IQuery : IDisposable
Inherited Members

Properties

CacheTime

The duration for which fetched data is kept in the cache after all subscribers have disposed. Once elapsed, the cache entry is evicted.

TimeSpan CacheTime { get; }

Property Value

TimeSpan

Key

The key that uniquely identifies this query in the client cache. Returns Default before args have been set for the first time. Check against Default to detect the uninitialized state.

QueryKey Key { get; }

Property Value

QueryKey

Methods

Cancel()

Cancels the currently running fetch, if any.

void Cancel()

Invalidate()

Marks the cached data as stale. If there are active subscribers, a re-fetch is triggered immediately; otherwise the fetch is deferred until the first subscriber joins.

If the last successful fetch occurred within the configured StaleTime window, this call is a no-op. Use Refetch() to bypass stale-time and force an immediate fetch.

void Invalidate()

Refetch()

Triggers an immediate re-fetch using the current args, bypassing stale-time checks.

void Refetch()