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
}
}
Is this possible?
also. good idea?
it’s basically for a razor view that I need this Resource lookup.cant be showing “INProgress” to the user.
Easy. And we actually do exactly this.
Just create a resource file as usual, being sure to set CustomTool to ResXFileCodeGenerator.
Also, make sure you set the culture info properly.