mirror of https://github.com/Squidex/squidex.git
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.
27 lines
740 B
27 lines
740 B
// ==========================================================================
|
|
// EnumExtensions.cs
|
|
// PinkParrot Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) PinkParrot Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
|
|
namespace PinkParrot.Infrastructure
|
|
{
|
|
public static class EnumExtensions
|
|
{
|
|
public static bool IsEnumValue<TEnum>(this TEnum value) where TEnum : struct
|
|
{
|
|
try
|
|
{
|
|
return Enum.IsDefined(typeof(TEnum), value);
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|