private void EnsureCreateTargetInstance(TOut target) { targetInstance = target; if (identicalPropertiesAutoTranslation) { BaseTranslator.Translate <TIn, TOut>(sourceInstance, targetInstance); } }
private bool EnsureCreateTargetInstance() { if ((sourceInstance != null) && (targetInstance == null)) { if (typeof(TOut) == typeof(string)) { targetInstance = (TOut)(object)string.Empty; } else { targetInstance = (TOut)Activator.CreateInstance(typeToInstantiate); } if (identicalPropertiesAutoTranslation) { BaseTranslator.Translate <TIn, TOut>(sourceInstance, targetInstance); } ResetTrackedVersioning(targetInstance); return(true); } return(false); }