Path: redb/redb.Core/Models/Contracts/IRedbObjectGeneric.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Models/Contracts/IRedbObjectGeneric.cs
----
using System;
using System.Threading.Tasks;
namespace redb.Core.Models.Contracts
{
///
/// Typed interface for REDB objects with specific properties type
/// Extends base IRedbObject adding type-safe access to properties
/// Provides IntelliSense and compile-time type checking
///
/// Type of object properties class
public interface IRedbObject : IRedbObject where TProps : class
{
///
/// Typed access to object properties
/// Replaces the need to work with raw JSON or type casting
///
TProps Props { get; set; }
///
/// Get scheme for TProps type (with cache usage)
/// Convenient method for getting metadata of specific type
///
Task GetSchemeForTypeAsync();
///
/// Get scheme structures for TProps type (with cache usage)
/// Returns encapsulated structures from scheme
///
Task> GetStructuresForTypeAsync();
///
/// Get structure by field name for TProps type
/// Uses fast name lookup in encapsulated scheme
///
Task GetStructureByNameAsync(string fieldName);
///
/// Recompute hash based on current TProps type properties
/// Typed version of RecomputeHash() considering specific type
///
void RecomputeHashForType();
///
/// Get new hash based on current properties without changing object
/// Typed version of GetComputedHash()
///
Guid ComputeHashForType();
///
/// Check if current hash matches TProps type properties
/// Typed data integrity check
///
bool IsHashValidForType();
///
/// Create object copy with same metadata but new properties
/// Useful for creating similar objects
///
IRedbObject CloneWithProperties(TProps newProperties);
///
/// Clear metadata cache for TProps type
/// Convenient method for cache invalidation at object level
///
void InvalidateCacheForType();
///
/// Preload metadata cache for TProps type
/// Useful for performance optimization
///
Task WarmupCacheForTypeAsync();
}
}