Public API
This page documents Orleans.Lattice.Api.Data 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.Orleans.Lattice.Api.Data declares two public types of its own: the LatticeApiDataOptions options class and the AddLatticeDataApi registration extension. Registration installs the package's implementation of the shared ILatticeDataApi contract, whose interface and request/response records live in Orleans.Lattice.Api.Abstractions under the Orleans.Lattice.Api.Data namespace. Both inventories are listed below. The package guide explains each operation, how it routes onto ILattice, and the tenant-scoping and authorization behaviour; this page is the declaration reference.
The remote transport's surface - LatticeDataApiGrpcClient, the wire records, and the authorization and identity seams - belongs to the gRPC binding and is listed in the gRPC binding's public API.
Registration
AddLatticeDataApi(this ISiloBuilder builder, Action<LatticeApiDataOptions>? configure = null) registers ILatticeDataApi as a silo singleton and binds LatticeApiDataOptions. It must be called after AddLattice(...): called first, it throws InvalidOperationException. Repeat calls are idempotent for the facade registration and still apply any supplied configure delegate. See Configuration for the option values.
Contract summary
ILatticeDataApi groups its methods as follows. Every treeId is a tenant-local name; see Tenant-scoped tree names.
| Group | Methods |
|---|---|
| Point and bulk writes | SetAsync, DeleteAsync, DeleteRangeAsync, SetManyAsync |
| Streamed bulk write | SetManyStreamAsync - writes an IAsyncEnumerable<DataEntry> non-atomically in batches of DataSetManyStreamOptions.BatchSize (256 by default), reporting each batch's DataSetManyStreamBatch outcome as it completes and returning the DataSetManyStreamResult totals; memory is bounded by the batch, never by the stream. An entry refused for its own sake - a key the caller may not write (denied), a value the schema policy rejects (schema), or an invalid write (invalid) - is reported in the batch's Rejections with its ordinal, key and reason, and every other entry still lands; any other fault ends the stream. A default interface member over SetManyAsync and SetAsync, so an existing implementer streams without change; the gRPC binding streams over one duplex call. Used by the Explorer's import (issue #5365). |
| Atomic batches | SetManyAtomicAsync, SetManyAtomicCrossTreeAsync |
| Reads | GetAsync, ReadRangeAsync |
| Capability probe | ProbeCapabilitiesAsync - whether the caller may write or delete at a key, or anywhere in a tree, answered from the access gate with no side effects. A default interface member: an implementer written before it existed keeps compiling and reports no write and no delete (fail-closed), so a management surface hides its write controls against it while real writes are still authorized on attempt. This package's facade, the gRPC binding and the MCP remote adapter answer the real probe. |
| Typed CRDT verbs | the PN-counter, OR-set, OR-flag, RW-flag, G-counter, G-set, RW-set, version-vector, multi-value register, max/min register, sequence and OR-map methods listed in Typed CRDT facade verbs |
Related
Public declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record members are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Api.Data.LatticeApiDataOptions
Source (line 17).
public sealed class LatticeApiDataOptions
public int DefaultRangePageSizepublic int MaxRangePageSizepublic int RangeDeleteStepSize
Orleans.Lattice.Api.Data.LatticeApiDataServiceCollectionExtensions
Source (line 12).
public static class LatticeApiDataServiceCollectionExtensions
public static ISiloBuilder AddLatticeDataApi(this ISiloBuilder builder, Action<LatticeApiDataOptions>? configure = null)
Shared contract declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record members are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Api.Data.ILatticeDataApi
Source (line 32).
public interface ILatticeDataApi
Task SetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)Task<bool> DeleteAsync(string treeId, string key, CancellationToken cancellationToken = default)Task<DataRangeDeleteResult> DeleteRangeAsync(DataRangeDeleteRequest request, CancellationToken cancellationToken = default)Task SetManyAtomicAsync(string treeId, DataAtomicBatch batch, string operationId, CancellationToken cancellationToken = default)Task<CrossTreeAtomicWriteOutcome> SetManyAtomicCrossTreeAsync(IReadOnlyList<DataTreeBatch> batches, string operationId, CancellationToken cancellationToken = default)Task SetManyAsync(string treeId, IReadOnlyList<DataEntry> upserts, CancellationToken cancellationToken = default)Task<DataSetManyStreamResult> SetManyStreamAsync(string treeId, IAsyncEnumerable<DataEntry> upserts, IProgress<DataSetManyStreamBatch>? progress = null, DataSetManyStreamOptions? options = null, CancellationToken cancellationToken = default)(default interface member; batches throughSetManyAsync, isolating per-entry refusals throughSetAsync)Task<DataReadResult> GetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task<DataRangePage> ReadRangeAsync(DataRangeRequest request, CancellationToken cancellationToken = default)Task<LatticeDataCapabilities> ProbeCapabilitiesAsync(string treeId, string? key = null, CancellationToken cancellationToken = default)(default interface member; reports no capability unless overridden)Task CounterIncrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)Task CounterDecrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)Task<long> CounterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task SetAddAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)Task SetRemoveAsync(string treeId, string key, byte[] element, CancellationToken cancellationToken = default)Task<IReadOnlyList<byte[]>> SetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task OrFlagEnableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)Task OrFlagDisableAsync(string treeId, string key, CancellationToken cancellationToken = default)Task<bool> OrFlagGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task RwFlagEnableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)Task RwFlagDisableAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)Task<bool> RwFlagGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task GCounterIncrementAsync(string treeId, string key, string replicaId, long amount, CancellationToken cancellationToken = default)Task<long> GCounterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task GSetAddAsync(string treeId, string key, byte[] element, CancellationToken cancellationToken = default)Task<IReadOnlyList<byte[]>> GSetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task RwSetAddAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)Task RwSetRemoveAsync(string treeId, string key, byte[] element, string replicaId, CancellationToken cancellationToken = default)Task<IReadOnlyList<byte[]>> RwSetGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task VersionVectorTickAsync(string treeId, string key, string replicaId, CancellationToken cancellationToken = default)Task<IReadOnlyDictionary<string, string>> VersionVectorGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task RegisterSetAsync(string treeId, string key, string replicaId, byte[] value, CancellationToken cancellationToken = default)Task<IReadOnlyList<byte[]>> RegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task MaxRegisterSetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)Task<byte[]?> MaxRegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task MinRegisterSetAsync(string treeId, string key, byte[] value, CancellationToken cancellationToken = default)Task<byte[]?> MinRegisterGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task SequenceInsertAtAsync(string treeId, string key, int index, string replicaId, byte[] value, CancellationToken cancellationToken = default)Task SequenceRemoveAtAsync(string treeId, string key, int index, CancellationToken cancellationToken = default)Task<IReadOnlyList<byte[]>> SequenceGetAsync(string treeId, string key, CancellationToken cancellationToken = default)Task MapSetAsync(string treeId, string key, string field, string replicaId, byte[] value, CancellationToken cancellationToken = default)Task MapRemoveAsync(string treeId, string key, string field, CancellationToken cancellationToken = default)Task<IReadOnlyDictionary<string, IReadOnlyList<byte[]>>> MapGetAsync(string treeId, string key, CancellationToken cancellationToken = default)
Orleans.Lattice.Api.Data.DataApiTypeAliases
Source (line 16).
public static class DataApiTypeAliases
public const string DataEntrypublic const string DataAtomicBatchpublic const string DataTreeBatchpublic const string DataRangeRequestpublic const string DataRangePagepublic const string DataReadResultpublic const string DataRangeDeleteRequestpublic const string DataRangeDeleteResultpublic const string LatticeDataCapabilitiespublic const string DataEntryRejectionpublic const string DataSetManyStreamBatchpublic const string DataSetManyStreamResult
Orleans.Lattice.Api.Data.DataAtomicBatch
Source (line 19).
public sealed record DataAtomicBatch
public List<DataEntry> Upsertspublic List<string> DeleteKeys
Orleans.Lattice.Api.Data.DataEntry
Source (line 18).
public sealed record DataEntry
public required string Keypublic byte[] Valuepublic LatticeMergeMode? MergeModepublic bool Rawpublic bool Equals(DataEntry? other)public override int GetHashCode()
Orleans.Lattice.Api.Data.DataRangeDeleteRequest
Source (line 20).
public sealed record DataRangeDeleteRequest
public required string TreeIdpublic required string StartInclusivepublic required string EndExclusive
Orleans.Lattice.Api.Data.DataRangeDeleteResult
Source (line 15).
public sealed record DataRangeDeleteResult
public required string TreeIdpublic required int DeletedCount
Orleans.Lattice.Api.Data.DataRangePage
Source (line 12).
public sealed record DataRangePage
public required string TreeIdpublic IReadOnlyList<DataEntry> Entriespublic string? ContinuationTokenpublic LatticeRangeReadGateCoverage? GateCoverage
Orleans.Lattice.Api.Data.DataRangeRequest
Source (line 19).
public sealed record DataRangeRequest
public required string TreeIdpublic string? StartInclusivepublic string? EndExclusivepublic int PageSizepublic string? ContinuationTokenpublic bool IncludeGateCoverage
Orleans.Lattice.Api.Data.DataReadResult
Source (line 12).
public sealed record DataReadResult
public required string TreeIdpublic required string Keypublic bool Foundpublic byte[] Valuepublic LatticeMergeMode? MergeModepublic bool Rawpublic bool Equals(DataReadResult? other)public override int GetHashCode()
Orleans.Lattice.Api.Data.DataTreeBatch
Source (line 19).
public sealed record DataTreeBatch
public required string TreeIdpublic List<DataEntry> Upsertspublic List<string> DeleteKeys
Orleans.Lattice.Api.Data.LatticeDataCapabilities
Source (line 27).
public sealed record LatticeDataCapabilities
public required string TreeIdpublic string? Keypublic bool CanWritepublic bool CanDelete
Orleans.Lattice.Api.Data.DataSetManyStreamOptions
Source (line 8).
public sealed record DataSetManyStreamOptions
public const int DefaultBatchSizepublic const int MaxBatchSizepublic static DataSetManyStreamOptions Defaultpublic int BatchSizepublic long FirstOrdinalpublic void Validate()
Orleans.Lattice.Api.Data.DataSetManyStreamBatch
Source (line 11).
public sealed record DataSetManyStreamBatch
public required string TreeIdpublic required long BatchIndexpublic required long FirstOrdinalpublic required int EntryCountpublic required int CommittedCountpublic IReadOnlyList<DataEntryRejection> Rejections
Orleans.Lattice.Api.Data.DataEntryRejection
Source (line 11).
public sealed record DataEntryRejection
public const string DeniedCodepublic const string SchemaCodepublic const string InvalidCodepublic required long Ordinalpublic required string Keypublic required string Codepublic required string Reason
Orleans.Lattice.Api.Data.DataSetManyStreamResult
Source (line 11).
public sealed record DataSetManyStreamResult
public required string TreeIdpublic required long EntryCountpublic required long CommittedCountpublic required long RejectedCountpublic required long BatchCount