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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:26:51+00:00 2026-06-14T16:26:51+00:00

I am working on a medium sized MVC project. The View Models have all

  • 0

I am working on a medium sized MVC project.

The View Models have all been pulled out the web assembly to a separate library. One of the data structures is represented by a listbox and has a MultiSelectList property.

The external VM project does not currently have a reference to the System.Web.Mvc assembly.

Should I add the reference?

Should I refactor the code to not have a reference to the MultiSelectList class? If this is the case where does the RawOptionValues property get converted to a MultiSelectList?

public class SelectListPrompt{

    public IDictionary<string, string> RawOptionValues { get; set; }

    public MultiSelectList OptionValues
    {
        get
        {
            return new MultiSelectList(RawOptionValues.ToList(), "Key", "Value");
        }
    }
}
  • 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-06-14T16:26:52+00:00Added an answer on June 14, 2026 at 4:26 pm

    View models are tightly coupled to your views. This is their purpose. So, yes, they should absolutely know about System.Web.Mvc. You have put them in a separate class library – great, but while this might not be necessary, if you decide to go that way, this library should know about classes like SelectListItem, MultiSelectList, … So go ahead and add reference. Don’t refactor your view models – they should work with those classes.

    What you should be careful about is not to couple your domain models with ASP.NET MVC.

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

Sidebar

Related Questions

I'm currently working on a medium-sized web project, and I've ran into a problem.
A medium sized rails app that our company has been working on is getting
I am working on a web application with a medium sized team. We are
I'm working on a medium-sized project in Java (GWT to be precise), and I'm
I am working on a medium sized app and i have around 30 views
I am working on a medium size web site that has plenty of custom
I'm working on a medium-size project using JBoss Developer Studio (based on Eclipse ).
I'm working on a medium sized PHP site. I'm writing provider classes for my
I'm working on making a skeleton from which to build small to medium-sized sites
I'm currently maintaining a small-medium sized java web application (using only plain JSPs/Servlets) that

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.