chore:目录重构

This commit is contained in:
陈淳
2023-04-15 17:35:22 +08:00
parent a612af4f68
commit fb27fb8aa4
238 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Infrastructure.Helper
{
public static class EnumHelper
{
public static New EnumToEnum<New>(this object oldEnum)
{
if (oldEnum is null)
{
throw new ArgumentNullException(nameof(oldEnum));
}
return (New)Enum.ToObject(typeof(New), oldEnum.GetHashCode());
}
public static TEnum StringToEnum<TEnum>(this string str)
{
return (TEnum)Enum.Parse(typeof(TEnum), str);
}
}
}