Dynamic vs static type in asp.net mvc
Is car better than motorcycle? It all depends on the scenario you are using it. Without knowing the scenario it is not possible to make that determination!
Is Dynamic typing better than static typing for certain problems/situations.
In this case
I need to show the view when OnException() method of BaseController is called. This is one time thing and i show the error page once instead of yellow screen of death.
Suppose i need to show ErrorMessage and Stacktrace on the view. As this is one time thing is it not better to use dynamic than create a error model for this.
dynamic obj = new ExpandoObject();
obj.ErrorMessage = "message";
obj.StackTrace = "bla bla bal";
return to view.
What is the best practice. Thanks for the reply.