public static class ObjectExtension

    {

        public static T Convert<T>(this object target)

        {

            T result = default(T);

 

            if (target != null)

            {

                result = (T)System.Convert.ChangeType(target, typeof(T), CultureInfo.InvariantCulture);

            }

 

            return result;

        }

    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-03-11
  • 2021-11-14
相关资源
相似解决方案