techgarage-ir.MTWireGuard/MikrotikAPI/Extensions.cs

14 lines
294 B
C#
Raw Normal View History

2023-06-02 15:26:29 +03:30
using Newtonsoft.Json;
namespace MikrotikAPI
{
public static class Extensions
{
public static T ToModel<T>(this string str)
{
if (string.IsNullOrWhiteSpace(str)) return default;
return JsonConvert.DeserializeObject<T>(str);
}
}
}