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
TEntity 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
ValueTDeserialized entity value when the object exists; otherwise null.
ETagstringProvider ETag associated with the stored object when available.
Existsbool
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
Exists
public bool Exists { get; init; }
Property Value
Value
Deserialized entity value when the object exists; otherwise null.
public T? Value { get; init; }
Property Value
- T