Example #1
0
 /// <summary>
 /// Map the <see cref="AutoGeneratedKey"/> created from the source EntityInfo
 /// to an AutoGeneratedKey for the <param name="targetEntity"></param>.
 /// </summary>
 /// <remarks>
 /// This implementation assumes that the Property name in <see cref="AutoGeneratedKey"/>
 /// is unchanged even though the type of the entity has changed.
 /// </remarks>
 protected virtual AutoGeneratedKey MapAutoGeneratedKey <T>(T targetEntity, AutoGeneratedKey autoGeneratedKey = null)
 {
     if (autoGeneratedKey != null)
     {
         autoGeneratedKey.Entity = targetEntity;
     }
     return(autoGeneratedKey);
 }