MappingExtends.cs 584 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace WingServerCommon.Mapper
  7. {
  8. public static class MappingExtends
  9. {
  10. /// <summary>
  11. /// Mapping to Type C
  12. /// </summary>
  13. /// <typeparam name="T"></typeparam>
  14. /// <typeparam name="C"></typeparam>
  15. /// <param name="entity"></param>
  16. /// <returns></returns>
  17. public static C MappingTo<C>(this object entity)
  18. {
  19. return AutoMapping.MapperInstance.Map<C>(entity);
  20. }
  21. }
  22. }