asp.net mvc - How does the Generic UpdateModel<T> differ from UpdateModel in MVC 'Controller'? -


Updates to the ASP.NET MVC controller class Many loads of models are overloaded.

Some of them are normal, and nothing is there.

Obviously I want to use the generic version but I do not know what exactly does this make for me? Correction is a method of replacing the properties using model reflection.

So what's the difference between:

  UpdateModel & lt; ContestModel & gt; (Model);  

versus

  updateModel (model);  

Is the reflection just a little faster if it knows the type - or is there any other reason?

There is no UpdateModel overload without a normal type of signature. How smart the compiler is watching you are when you call a method with a general signature and there are only one common type in the parameter, then the compiler guides the type for you.

In other words, the two examples you have posted, the compiler's eyes in exactly the same way.


Comments