This commit is contained in:
2025-10-27 17:39:18 -04:00
commit 31f723bea4
1579 changed files with 642409 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using Prefab.Catalog.Data;
namespace Prefab.Catalog.Api.Data;
internal sealed class CatalogDbContextFactory(
IDbContextFactory<AppDb> writeFactory,
IDbContextFactory<AppDbReadOnly> readFactory) : ICatalogDbContextFactory
{
public async ValueTask<IModuleDb> CreateWritableAsync(CancellationToken cancellationToken = default) =>
await writeFactory.CreateDbContextAsync(cancellationToken);
public async ValueTask<IModuleDbReadOnly> CreateReadOnlyAsync(CancellationToken cancellationToken = default) =>
await readFactory.CreateDbContextAsync(cancellationToken);
}