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

  • SEARCH
  • Home
  • 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 6389889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:27:36+00:00 2026-05-25T03:27:36+00:00

I’m learning to use the MVC 3 Framework, but I’m having some problems understanding

  • 0

I’m learning to use the MVC 3 Framework, but I’m having some problems understanding some concepts. I ask this question because I was trying to understand the code generated by the “Internet Application Template”
At the AccountModels.cs file in the RegisterModel we find:

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

It’s obvious you won’t have Password and ConfirmPassword fields in your database, you’ll just have a Password field. So, why this model doesn’t mirror a database? What am I missing?

  • 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-25T03:27:37+00:00Added an answer on May 25, 2026 at 3:27 am

    That’s a view model, not a model. A view model shouldn’t mirror any database. A view model doesn’t even know what a database is. A view model is something that you design in order to meet the requirements of a specific view. It is a class that a controller action passes to a view.

    When talking about models, we usually talk about domain models or domain entities. Those match your business requirements.

    So here’s the usual flow of a controller action:

    1. It fetches a domain model from the service layer
    2. It maps/converts this domain model into a view model
    3. It passes the view model to the view

    and the other way around:

    1. It takes a view model from a view
    2. It maps/converts this view model back to a domain model
    3. It passes the domain model to the service layer for processing

    So a single domain model could have multiple view model representations. And a single view model could be mapped to multiple domain models.

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

Sidebar

Related Questions

I am learning to use polymorphism in C#, but cannot figure out this one.
I'm learning MVC and trying to follow some tutorials and this video http://channel9.msdn.com/Events/DevDays/DevDays-2011-Netherlands/Devdays002 In
I am learning the Spring MVC 3 now. I meet some problems when set
I've been learning about the Model-View-Controller paradigm (MVC), but I'm quite confused since some
I am very new to MVC. I've been learning to use plain HTML or
I am learning to use the Dvorak keyboad layout, but I am not good
I'm learning to use vlad the deployer and I've got a question. Since I'm
I've been learning the ASP.NET MVC framework using the Apress book Pro ASP.NET MVC
I am learning ASP.NET MVC and many concepts of ASP.NET like authentication, authorization, session
So I'm working on my own little MVC framework as a learning exercise. It's

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.