using Marten;

namespace NetinaShop.Infrastructure.Marten;

public class MartenRepositoryWrapper : IMartenRepositoryWrapper
{
    private readonly IDocumentStore _documentStore;

    public MartenRepositoryWrapper(IDocumentStore documentStore)
    {
        _documentStore = documentStore;
    }

    public IMartenRepository<TMartenEntity> SetRepository<TMartenEntity>() where TMartenEntity : IMartenEntity
        => new MartenRepository<TMartenEntity>(_documentStore);
}