Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

14 lines
336B

  1. using Newtonsoft.Json;
  2. namespace HealthMonitor.Core.Common.Extensions
  3. {
  4. public static class ObjectExt
  5. {
  6. public static T DeepClone<T>(this object obj) where T : class
  7. {
  8. var jsonStr = JsonConvert.SerializeObject(obj);
  9. return JsonConvert.DeserializeObject<T>(jsonStr);
  10. }
  11. }
  12. }