Init
This commit is contained in:
22
Prefab.Catalog/Data/ICatalogDbContextFactory.cs
Normal file
22
Prefab.Catalog/Data/ICatalogDbContextFactory.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Prefab.Catalog.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Provides factory methods that create catalog module database contexts on demand.
|
||||
/// </summary>
|
||||
public interface ICatalogDbContextFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new writable catalog database context instance for the current operation.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Token used to cancel context creation.</param>
|
||||
/// <returns>An <see cref="IModuleDb"/> instance that must be disposed by the caller.</returns>
|
||||
ValueTask<IModuleDb> CreateWritableAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new read-only catalog database context instance for the current operation.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Token used to cancel context creation.</param>
|
||||
/// <returns>An <see cref="IModuleDbReadOnly"/> instance that must be disposed by the caller.</returns>
|
||||
ValueTask<IModuleDbReadOnly> CreateReadOnlyAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user