Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1031503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:56:22+00:00 2026-05-16T13:56:22+00:00

In my understanding, the ViewModel pattern was designed to pass all the relevant data

  • 0

In my understanding, the ViewModel pattern was designed to pass all the relevant data to View because 1) the view shouldn’t perform any data retrieval or application logic and 2) it enables type-safety, compile-time checking, and editor intellisense within view templates.

Since dynamic expressions are defined at runtime, does this mean we don’t get any of the 2)’s goodies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T13:56:23+00:00Added an answer on May 16, 2026 at 1:56 pm

    You do not lose any of the existing functionality. You can still have a strongly-typed view such that when you access the Model property it will be of your specified type. The only thing that is added is a shorter way of accessing items in the ViewData dictionary.

    Instead of the following

    ViewData["MyData"]
    

    you can have

    View.MyData
    

    Notice that you do not lose any type-safety because you never really had any. In the former case the key is a string (no certainty that it exists in the dictionary) and the value is an object so unless you cast it you can’t do that much with it. In the latter you also get no intellisense and the returned value must be cast to something useful.

    In fact the implementation of View.MyData simply takes the property name (“MyData”) and returns the value coming from the ViewData dictionary.

    Arguably the one thing you lose is the ability to have spaces or other characters that are not legal C# identifiers in your key names.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my ASP MVC 2 application I follow the strongly typed view pattern with
I'm having a problem understanding something about MVVM. My application relies on dialogs for
My understanding is that any event handlers wired up in C# need to be
Complete knockout.js newbie here. I'm having some trouble understanding how knockout.js works. Any help
I have a Silverlight application architected using an MVVM approach. In my ViewModel it
My understanding was that ruby blocks have block scope, and all variables created inside
I have a silverlight wp7 application and I'm applying the MVVM pattern. The model
I've got a Razor partial view backed by a viewmodel containing, among other things,
I'll keep it short. My view model looks like this: var ViewModel = {
Understanding Magento Models by reference of SQL: select * from user_devices where user_id =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.