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:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user