Table of Contents

Interface IProjectionTagProvider<TState>

Namespace
Opossum.Projections
Assembly
Opossum.dll

Defines how to extract indexable tags from a projection state. Tag providers enable efficient querying of projections without loading all data into memory.

public interface IProjectionTagProvider<in TState> where TState : class

Type Parameters

TState

The projection state type

Methods

GetTags(TState)

Extracts indexable tags from the projection state. This method is called whenever a projection is saved or updated. The returned tags are used to build indices for efficient querying.

IEnumerable<Tag> GetTags(TState state)

Parameters

state TState

The projection state to extract tags from

Returns

IEnumerable<Tag>

Collection of tags that should be indexed for this projection

Remarks

Tags should be stable and deterministic - the same state should always produce the same tags. Common tag patterns:

  • Status flags: new Tag("IsActive", "true")
  • Enum values: new Tag("Status", state.Status.ToString())
  • Boolean flags: new Tag("IsMaxedOut", state.IsMaxedOut.ToString())