Exemplo n.º 1
0
 /// <summary>
 /// Adapte the source object to the destination type.
 /// </summary>
 /// <typeparam name="TSource">Source type.</typeparam>
 /// <typeparam name="TDestination">Destination type.</typeparam>
 /// <param name="source">Source object to adapt.</param>
 /// <returns>Adapted destination type.</returns>
 public static TDestination Adapt <TSource, TDestination>(TSource source)
 {
     try
     {
         return(TypeAdapter <TSource, TDestination> .Map(source));
     }
     finally
     {
         MapContext.Clear();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adapt the source object to the destination type.
 /// </summary>
 /// <typeparam name="TSource">Source type.</typeparam>
 /// <typeparam name="TDestination">Destination type.</typeparam>
 /// <param name="source">Source object to adapt.</param>
 /// <returns>Adapted destination type.</returns>
 public static TDestination Adapt <TSource, TDestination>(this TSource source)
 {
     return(TypeAdapter <TSource, TDestination> .Map(source));
 }