using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace JSMachine.WMS.Infrastructure.Helper { /// /// 对象拷贝帮助类 /// public static class ObjectCloneHelper { /// /// 深拷贝 /// /// /// /// public static T DeepClone(T t) where T : class { if (t == null) return null; string json = JsonConvert.SerializeObject(t); return JsonConvert.DeserializeObject(json); } } }