添加项目文件。
This commit is contained in:
24
common/Tnb.CollectiveOAuth/Enums/EnumHelper/EnumModel.cs
Normal file
24
common/Tnb.CollectiveOAuth/Enums/EnumHelper/EnumModel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace JNPF.Extras.CollectiveOAuth.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 枚举模型.
|
||||
/// </summary>
|
||||
public struct EnumModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数.
|
||||
/// </summary>
|
||||
/// <param name="um"></param>
|
||||
public EnumModel(Enum um)
|
||||
{
|
||||
this.value = (int)Convert.ChangeType(um, typeof(int));
|
||||
this.name = um.ToString();
|
||||
this.text = um.GetDesc();
|
||||
}
|
||||
|
||||
public int value { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public string text { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user