Пример #1
0
 private void EnsureCreateTargetInstance(TOut target)
 {
     targetInstance = target;
     if (identicalPropertiesAutoTranslation)
     {
         BaseTranslator.Translate <TIn, TOut>(sourceInstance, targetInstance);
     }
 }
Пример #2
0
 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);
 }