You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
452 B
21 lines
452 B
using Newtonsoft.Json;
|
|
using System;
|
|
|
|
namespace BBWY.Client.Extensions
|
|
{
|
|
public static class CopyExtensions
|
|
{
|
|
public static T Copy<T>(this T p)
|
|
{
|
|
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(p));
|
|
}
|
|
}
|
|
|
|
public static class EnumExtension
|
|
{
|
|
public static T ToEnum<T>(this string value)
|
|
{
|
|
return (T)Enum.Parse(typeof(T), value);
|
|
}
|
|
}
|
|
}
|
|
|