2013-03-25 06:51:32 +03:00
|
|
|
using System;
|
|
|
|
using Marr.Data;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Datastore
|
|
|
|
{
|
|
|
|
public interface IDatabase
|
|
|
|
{
|
|
|
|
IDataMapper DataMapper { get; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class Database : IDatabase
|
|
|
|
{
|
2013-05-11 23:06:57 +03:00
|
|
|
private readonly Func<IDataMapper> _dataMapperFactory;
|
2013-03-25 06:51:32 +03:00
|
|
|
|
2013-05-11 23:06:57 +03:00
|
|
|
public Database(Func<IDataMapper> dataMapperFactory)
|
2013-03-25 06:51:32 +03:00
|
|
|
{
|
2013-05-11 23:06:57 +03:00
|
|
|
_dataMapperFactory = dataMapperFactory;
|
2013-03-25 06:51:32 +03:00
|
|
|
}
|
|
|
|
|
2013-05-11 23:06:57 +03:00
|
|
|
public IDataMapper DataMapper
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return _dataMapperFactory();
|
|
|
|
}
|
|
|
|
}
|
2013-03-25 06:51:32 +03:00
|
|
|
}
|
|
|
|
}
|