mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-28 22:08:08 +02:00
14 lines
294 B
C#
14 lines
294 B
C#
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|