public enum WeightGoalStatus
{
InProgress,
Failed,
Succeded
}
public static class WeightGoalStatusExtensions
{
public static string ToLocalizedString(this WeightGoalStatus status)
{
return "Localizedstring";//should be code that queries a resource based on the value of the enum
}
}
這可能嗎? 也。好主意? 它基本上是一個剃刀視圖,我需要此資源lookup.cant顯示「INProgress」給用戶。資源查找枚舉
ASP.NET MVC不會使用這個,AFAIK。 – usr 2012-03-05 23:34:06
可能不是現成的,但你可以寫一個自定義的顯示屬性。 – RPM1984 2012-03-06 05:56:44