Given the benefits of using strongly typed views to eliminate typed errors and the use of lambda expressions why would one use a dynamically typed view? When I use them I don't feel as safe as with strongly typed views. Am I missing something? Is there a special use for them? =)
Regards RaVen
you are not because strongly typed views gives you ease of use and many benefits. If you have complex model which may contain list instance, other object than also FormViewModel helps you. so there are very few scenario where you really need a dynamically typed view. e.g. I have Product view and I need to show Categories on that, so i created separate view model and i used it for Product and list of categories.
public class ProductViewModel
{
public Product Product { get; set; }
public List<Category> Categories { get; set; }
}
Major disadvantage with dynamically typed view is that you need to write large amount of code as compare to strongly typed views.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With