1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using SCC.Models;
- namespace SCC.Common
- {
-
-
-
- public static class EnumHelper
- {
-
-
-
-
-
- public static string GetSCCLotteryTableName(Enum value)
- {
- if (value == null)
- {
- throw new ArgumentException("value");
- }
- string TableName = value.ToString();
- var fieldInfo = value.GetType().GetField(TableName);
- var attributes = (TableNameAttribute[])fieldInfo.GetCustomAttributes(typeof(TableNameAttribute), false);
- if (attributes != null && attributes.Length > 0)
- {
- TableName = attributes[0].TableName;
- }
- return TableName;
- }
- }
- }
|