c# - MVC 3 (Preview 1) Dynamic ViewModel -


I have just taken a look at the new features available in the MVC 3 preview: very good improvements have been made and to see it It can be well read how MVC is running.

The thing that struck me is the dynamic type view modal point that you will not need to reference the data using ViewModel ["Message"] , but You can use ViewModel.Message .

What are people thinking about this? I am struggling to see why the dynamic type should be used in such a way. This gives a false sense of security for the developer about one member call because they believe it should be strongly typed. At least when you see an indicator with a "magic string" you are aware of the possibility of a run-time error.

What are the opinions of other people on this? Is this a sensible use of dynamic type?

Unless you only have string rendering for these dynamic properties in the view, I do not see any real problem If you are using it for anything other than something that will be provided in the form of a string, though, I think that you should still proceed and make a strongly written model. FWIW, I've gone away completely by using the ViewData magic string for "other than" message ".

Just with my opinion, I have to change the topic to get more experience with the new version.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -