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 6847221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:43:08+00:00 2026-05-27T00:43:08+00:00

I have MVC administration screens that I use to create/delete/edit and list data. Right

  • 0

I have MVC administration screens that I use to create/delete/edit and list data. Right now I have many viewModels (edit/delete etc) for each class of model. For example:

public class cityViewModel () {
   public City City { get; set; }
}
public class buildingViewModel () {
   public Building Building { get; set; }
}

What I would like to know is would it be better for me to combine these viewModels into one and use this common model. Something like:

public class adminViewModel () {
   public City City { get; set; }
   public Building Building { get; set; }
}
  • 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-27T00:43:09+00:00Added an answer on May 27, 2026 at 12:43 am

    There are no official guidelines from creators of asp.net-mvc about when and how to use ViewModels. But from practical experience, single view model should be created for single view, 1:1. At the beginning, it may seem simpler to use single view model for everything, but as more data and fields appear on view model, you may find yourself explicitely excluding attributes while model-binding, complicated ifs when rendering views, etc. So include in view models only fields needed for its view.

    Also, check out How we do MVC – View models by Jimmy Bogard

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

Sidebar

Related Questions

I have an MVC-based site, which is using a Repository/Service pattern for data access.
I have an MVC application that among other things contains a small Silverlight menu
I have an MVC application view that is generating quite a large HTML table
I have a MVC app and using JQuery. I have anchor that I setup
I have an MVC app that does a lot of work with jQuery ajax
I have an MVC application that needs to login and verify a user against
I have built a custom administration panel into a Rails application that allows content
I have an ASP.NET MVC application running on IIS7. I use sessions to keep
Inside of my MVC application, I have a sub-folder named Admin that was Converted
I have an ASP.NET MVC 3 / .NET Web Application, which is heavily data-driven,

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.