Remotely/Shared/Utilities/EnumMapper.cs
2023-07-21 10:16:29 -07:00

18 lines
406 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remotely.Shared.Utilities;
public static class EnumMapper
{
public static ToType ToEnum<ToType, FromType>(FromType fromValue)
where ToType : Enum
where FromType : Enum
{
return (ToType)Enum.Parse(typeof(ToType), fromValue.ToString());
}
}