Removed the uow ctor from the SaveEventArgs for testing as the test will still prove that

multi-threading works with the services without proving access to a single uow, the db will error first anyways.
This commit is contained in:
Shannon Deminick
2012-12-11 22:56:34 +05:00
parent 43e74fa7a4
commit cfa8fc2bba
4 changed files with 9 additions and 71 deletions

View File

@@ -42,30 +42,7 @@ namespace Umbraco.Core
/// </summary>
public int Id { get; set; }
}
public class SaveEventArgs : System.ComponentModel.CancelEventArgs
{
/// <summary>
/// public constructor
/// </summary>
public SaveEventArgs()
{
}
/// <summary>
/// internal constructor used for unit testing
/// </summary>
/// <param name="unitOfWork"></param>
internal SaveEventArgs(IUnitOfWork unitOfWork)
{
UnitOfWork = unitOfWork;
}
/// <summary>
/// Used for unit testing
/// </summary>
internal IUnitOfWork UnitOfWork { get; private set; }
}
public class SaveEventArgs : System.ComponentModel.CancelEventArgs { }
public class NewEventArgs : System.ComponentModel.CancelEventArgs
{
/// <summary>

View File

@@ -430,7 +430,7 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
using (var repository = RepositoryResolver.Current.Factory.CreateContentRepository(uow))
{
var e = new SaveEventArgs(uow);
var e = new SaveEventArgs();
if (Saving != null)
Saving(content, e);
@@ -490,7 +490,7 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
using (var repository = RepositoryResolver.Current.Factory.CreateContentRepository(uow))
{
var e = new SaveEventArgs(uow);
var e = new SaveEventArgs();
if (Saving != null)
Saving(content, e);
@@ -524,7 +524,7 @@ namespace Umbraco.Core.Services
{
var containsNew = contents.Any(x => x.HasIdentity == false);
var e = new SaveEventArgs(uow);
var e = new SaveEventArgs();
if (Saving != null)
Saving(contents, e);
@@ -573,7 +573,7 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
using (var repository = RepositoryResolver.Current.Factory.CreateContentRepository(uow))
{
var e = new SaveEventArgs(uow);
var e = new SaveEventArgs();
if (Saving != null)
Saving(contents, e);

View File

@@ -204,7 +204,7 @@ namespace Umbraco.Core.Services
{
var repository = _mediaRepository;
var e = new SaveEventArgs(_unitOfWork);
var e = new SaveEventArgs();
if (Saving != null)
Saving(media, e);