2015-08-25 15:42:33 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using Umbraco.Core.Persistence.Repositories;
|
|
|
|
|
|
using Umbraco.Core.Persistence.UnitOfWork;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Persistence
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class LockedRepository<TRepository>
|
|
|
|
|
|
where TRepository : IDisposable, IRepository
|
|
|
|
|
|
{
|
2017-01-18 14:53:24 +01:00
|
|
|
|
public LockedRepository(IDatabaseUnitOfWork unitOfWork, TRepository repository)
|
|
|
|
|
|
{
|
|
|
|
|
|
UnitOfWork = unitOfWork;
|
|
|
|
|
|
Repository = repository;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-08-25 15:42:33 +02:00
|
|
|
|
public LockedRepository(Transaction transaction, IDatabaseUnitOfWork unitOfWork, TRepository repository)
|
|
|
|
|
|
{
|
2017-01-18 14:53:24 +01:00
|
|
|
|
//Transaction = transaction;
|
2015-08-25 15:42:33 +02:00
|
|
|
|
UnitOfWork = unitOfWork;
|
|
|
|
|
|
Repository = repository;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-01-18 14:53:24 +01:00
|
|
|
|
//public Transaction Transaction { get; private set; }
|
2015-08-25 15:42:33 +02:00
|
|
|
|
public IDatabaseUnitOfWork UnitOfWork { get; private set; }
|
|
|
|
|
|
public TRepository Repository { get; private set; }
|
|
|
|
|
|
|
2017-01-18 14:53:24 +01:00
|
|
|
|
//public void Commit()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// UnitOfWork.Commit();
|
|
|
|
|
|
// Transaction.Complete();
|
|
|
|
|
|
//}
|
2015-08-25 15:42:33 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|