IObjectMapper.cs 1.1 KB

12345678910111213141516171819202122232425
  1. namespace Abp.ObjectMapping
  2. {
  3. /// <summary>
  4. /// Defines a simple interface to map objects.
  5. /// </summary>
  6. public interface IObjectMapper
  7. {
  8. /// <summary>
  9. /// Converts an object to another. Creates a new object of <see cref="TDestination"/>.
  10. /// </summary>
  11. /// <typeparam name="TDestination">Type of the destination object</typeparam>
  12. /// <param name="source">Source object</param>
  13. TDestination Map<TDestination>(object source);
  14. /// <summary>
  15. /// Execute a mapping from the source object to the existing destination object
  16. /// </summary>
  17. /// <typeparam name="TSource">Source type</typeparam>
  18. /// <typeparam name="TDestination">Destination type</typeparam>
  19. /// <param name="source">Source object</param>
  20. /// <param name="destination">Destination object</param>
  21. /// <returns>Returns the same <see cref="destination"/> object after mapping operation</returns>
  22. TDestination Map<TSource, TDestination>(TSource source, TDestination destination);
  23. }
  24. }