Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 0035929

Browse files
committed
Add IsUserEnum()
1 parent d297f73 commit 0035929

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,14 @@ public static bool IsUserType(this Type type)
777777
&& type.Name.IndexOfAny(SystemTypeChars) == -1;
778778
}
779779

780+
public static bool IsUserEnum(this Type type)
781+
{
782+
return type.IsEnum()
783+
&& type.Namespace != null
784+
&& !type.Namespace.StartsWith("System")
785+
&& type.Name.IndexOfAny(SystemTypeChars) == -1;
786+
}
787+
780788
public static bool IsInt(this string text)
781789
{
782790
if (String.IsNullOrEmpty(text)) return false;

0 commit comments

Comments
 (0)