I have a ViewModel that I pass from my server to my client:
public class SomeViewModel
{
public string ViewName {get;set;}
}
I have the following static class that I use to represent enum values as strings conveniently throughout my business logic:
public static class AnimalType
{
public static string Dog => "dog-string";
public static string Cat => "cat-string";
}
I'd like to attach this static class to the instance of the ViewModel so the client has access to the same enum values, without me having to duplicate code on the client:
public class SomeViewModel
{
public string ViewName {get;set;}
public AnimalType AnimalTypes {get { return AnimalType; }} // doesn't work
}
How can I concisely share this static "enum" solution with my client, via a ViewModel property?