mirror of
https://github.com/Radarr/Radarr
synced 2024-12-28 02:40:01 +00:00
28a919e74a
datamapper instances should not be reused!!!
25 lines
No EOL
505 B
C#
25 lines
No EOL
505 B
C#
using System;
|
|
using Marr.Data;
|
|
|
|
namespace NzbDrone.Core.Datastore
|
|
{
|
|
public interface IDatabase
|
|
{
|
|
IDataMapper GetDataMapper();
|
|
}
|
|
|
|
public class Database : IDatabase
|
|
{
|
|
private readonly Func<IDataMapper> _dataMapperFactory;
|
|
|
|
public Database(Func<IDataMapper> dataMapperFactory)
|
|
{
|
|
_dataMapperFactory = dataMapperFactory;
|
|
}
|
|
|
|
public IDataMapper GetDataMapper()
|
|
{
|
|
return _dataMapperFactory();
|
|
}
|
|
}
|
|
} |