using Elsa.KeyValues.Entities;
using Elsa.KeyValues.Models;
namespace Elsa.KeyValues.Contracts;
///
/// Store that holds key value entities not fit to store in specific stores.
///
public interface IKeyValueStore
{
///
/// Saves the key value pair.
///
Task SaveAsync(SerializedKeyValuePair keyValuePair, CancellationToken cancellationToken);
///
/// Retrieves the key value pair from the store.
///
/// if the key is found, otherwise null.
Task FindAsync(KeyValueFilter filter, CancellationToken cancellationToken);
///
/// Retrieves all key value pairs which match the predicate.
///
Task> FindManyAsync(KeyValueFilter filter, CancellationToken cancellationToken);
///
/// If the key is found it deletes the record from the store.
///
Task DeleteAsync(string key, CancellationToken cancellationToken);
}