using Marten;
using Netina.Common.Models.Entity;
using Netina.Repository.Repositories.Marten;

namespace Netina.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);
}