So, I read all about the new localization system in ASP.Net Core (3.1) and successfully made use of the IStringLocalizer<MyController>
and the IViewLocalizer<MyView>
. I also could use the localization for the [DisplayName("Property description")
in Models.
Below what I seem unable to do: In good old .Net Framework I could do this:
public class Month
{
public int MonthNumber { get; set; }
public string Name
{
get
{
switch(MonthNumber)
{
case 1:
return Properties.Resources.Jan;
case 2:
return Properties.Resources.Feb;
default:
return "?";
}
}
}
But how can I do this in a Model in ASP.Net Core 3.1?