I play with an ASP.MVC site, I want one of three images to be displayed depending on the enumeration value in the strongly typed model that I had.
I could use the IF / Case statement in the view, but it should be responsible for the controller, which I feel is the best way to implement it?
If you have Enumerable<YourModel>, you can point Dictionary<YourEnum, Uri>to the view from the controller.
Enumerable<YourModel>
Dictionary<YourEnum, Uri>
In this way, the controller can decide what valid images are, etc.
, . , , , WinForms, -.
, Dictionary<YourEnum, string>, . URL-, , .
Dictionary<YourEnum, string>
, . .
Source: https://habr.com/ru/post/1767600/More articles:Servlet includes runs HTTP headers in Tomcat - javaThe fastest scripting language for Java? - javaHow to make Unicode escape decoding in Antlr tokenizer - javaMagento - creating a new getProductCollection () function - magentoHow to stop the process programmatically - c ++Select a row that matches the condition if no other rows match another condition - sqlSearch for applications without launching Market - androidCruiseControl.NET with web deployment project - msbuildjQuery ui autocomplete -.ui-autocomplete-loading - jqueryFormatting strings in Java - javaAll Articles