ExpressionTreeCloner now can create shallow field-based clones of objects without a default constructor (before this, only deep clones worked); search-and-replace fix - some comments referred to something called 'propertys'; all cloners now correctly handle being passed null values (a clone of 'null' is also 'null' per definition)
git-svn-id: file:///srv/devel/repo-conversion/nusu@246 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
15300676ba
commit
d091061baa
8 changed files with 167 additions and 22 deletions
|
@ -101,8 +101,7 @@ namespace Nuclex.Support.Cloning {
|
|||
return default(TCloned);
|
||||
}
|
||||
|
||||
throw new NotImplementedException("Not implemented yet");
|
||||
Func<object, object> cloner = getOrCreateShallowFieldBasedCloner(typeof(TCloned));
|
||||
Func<object, object> cloner = getOrCreateShallowPropertyBasedCloner(typeof(TCloned));
|
||||
return (TCloned)cloner(objectToCloneAsObject);
|
||||
}
|
||||
|
||||
|
@ -239,8 +238,7 @@ namespace Nuclex.Support.Cloning {
|
|||
Func<object, object> cloner;
|
||||
|
||||
if(!shallowPropertyBasedCloners.TryGetValue(clonedType, out cloner)) {
|
||||
throw new NotImplementedException();
|
||||
//cloner = createShallowPropertyBasedCloner(clonedType);
|
||||
cloner = createShallowPropertyBasedCloner(clonedType);
|
||||
shallowPropertyBasedCloners.TryAdd(clonedType, cloner);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue