1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-26 17:47:08 +00:00
Lidarr/NzbDrone.Core/Datastore/Database.cs
Keivan Beigi 28a919e74a fixed marr threading bug.
datamapper instances should not be reused!!!
2013-07-15 17:46:52 -07:00

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();
}
}
}