Enum ToString with user friendly strings

后端 未结 23 2140
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 11:44

My enum consists of the following values:

private enum PublishStatusses{
    NotCompleted,
    Completed,
    Error
};

I want to be able to

23条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 12:16

    I think the best (and easiest) way to solve your problem is to write an Extension-Method for your enum:

    public static string GetUserFriendlyString(this PublishStatusses status)
        {
    
        }
    

提交回复
热议问题