Adding unit test for saving bulk content, and adding lazy collection save overload.

Adding AuditTrail class and test case.
This commit is contained in:
Morten Christensen
2012-11-13 14:30:05 -01:00
parent 50dc9f2b7b
commit c9c160bc29
15 changed files with 356 additions and 28 deletions

View File

@@ -16,7 +16,7 @@ namespace Umbraco.Core.Models.EntityBase
{
private bool _hasIdentity;
private int? _hash;
private int _id;
private Lazy<int> _id;
private Guid _key;
/// <summary>
@@ -27,15 +27,15 @@ namespace Umbraco.Core.Models.EntityBase
{
get
{
return _id;
return _id == null ? default(int) : _id.Value;
}
set
{
_id = value;
_id = new Lazy<int>(() => value);
HasIdentity = true;
}
}
/// <summary>
/// Guid based Id
/// </summary>
@@ -47,7 +47,7 @@ namespace Umbraco.Core.Models.EntityBase
get
{
if (_key == Guid.Empty)
return Id.ToGuid();
return _id.Value.ToGuid();
return _key;
}
@@ -88,7 +88,7 @@ namespace Umbraco.Core.Models.EntityBase
protected void ResetIdentity()
{
_hasIdentity = false;
_id = 0;
_id = new Lazy<int>(() => default(int));
}
/// <summary>