Table of Contents

Struct StorageObject<T>

Namespace
CloudStorageORM.Abstractions
Assembly
CloudStorageORM.dll

Represents a storage read result that includes the entity value, ETag, and existence status.

public readonly record struct StorageObject<T> : IEquatable<StorageObject<T>>

Type Parameters

T

Entity payload type.

Implements
Inherited Members

Examples

var result = await storageProvider.ReadWithMetadataAsync<User>("users/42.json");
if (result.Exists)
{
    Console.WriteLine(result.ETag);
}

Constructors

StorageObject(T?, string?, bool)

Represents a storage read result that includes the entity value, ETag, and existence status.

public StorageObject(T? Value, string? ETag, bool Exists)

Parameters

Value T

Deserialized entity value when the object exists; otherwise null.

ETag string

Provider ETag associated with the stored object when available.

Exists bool

true when the object exists in storage; otherwise false.

Examples

var result = await storageProvider.ReadWithMetadataAsync<User>("users/42.json");
if (result.Exists)
{
    Console.WriteLine(result.ETag);
}

Properties

ETag

Provider ETag associated with the stored object when available.

public string? ETag { get; init; }

Property Value

string

Exists

true when the object exists in storage; otherwise false.

public bool Exists { get; init; }

Property Value

bool

Value

Deserialized entity value when the object exists; otherwise null.

public T? Value { get; init; }

Property Value

T