More work on deep cloning, have test passing for IContent

This commit is contained in:
Shannon
2014-04-15 13:52:49 +10:00
parent b7f7775b89
commit 58758e7a41
18 changed files with 156 additions and 81 deletions

View File

@@ -96,7 +96,7 @@ namespace Umbraco.Core.Models.EntityBase
}
/// <summary>
/// /// Gets or sets the WasCancelled flag, which is used to track
/// Gets or sets the WasCancelled flag, which is used to track
/// whether some action against an entity was cancelled through some event.
/// This only exists so we have a way to check if an event was cancelled through
/// the new api, which also needs to take effect in the legacy api.
@@ -158,6 +158,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <summary>
/// Indicates whether the current entity has an identity, eg. Id.
/// </summary>
[DataMember]
public virtual bool HasIdentity
{
get
@@ -230,13 +231,13 @@ namespace Umbraco.Core.Models.EntityBase
return _hash.Value;
}
public virtual T DeepClone<T>() where T : IDeepCloneable
public virtual object DeepClone()
{
//Memberwise clone on Entity will work since it doesn't have any deep elements
// for any sub class this will work for standard properties as well that aren't complex object's themselves.
var clone = MemberwiseClone();
((TracksChangesEntityBase)clone).ResetDirtyProperties(true);
return (T)clone;
return clone;
//Using data contract serializer - has issues