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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:47:28+00:00 2026-06-17T09:47:28+00:00

I have two models: public class Resort { public int ID { get; set;

  • 0

I have two models:

public class Resort
{
    public int ID { get; set; }
    public String Name { get; set; }
    public int BlackDiamond { get; set; }
    public int BlueSquare { get; set; }
    public int GreenCircle { get; set; }
    public int TerrainPark { get; set; }
}

And

public class Input
{
    public int ID { get; set; }
    public string Name { get; set; }
    public bool GreenCircle { get; set; }
    public bool BlueSquare { get; set; }
    public bool BlackDiamond { get; set; }
    public bool TerrainPark { get; set; }
}

The idea here is to create a Controller that will allow me to have access to data from both Models as my logic will basically allow me to search through all Resorts looking for the Resort with the highest number of whichever experience level is preferred. As an example, let’s say that I prefer BlackDiamonds, so I would want to search for the Resort with the highest number of BlackDiamonds. So I will need to know which experience level is preferred and which Resort has the highest number of that preferred experience level.

  • 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-17T09:47:29+00:00Added an answer on June 17, 2026 at 9:47 am

    You could define a view model aggregating those 2 models:

    public class MyViewModel
    {
        public Input Input { get; set; }
        public Resort Resort { get; set; }
    }
    

    Now the controller actions could take/pass this view model from/to the views which will be strongly typed to the view model. Now you will have all the necessary data.

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

Sidebar

Related Questions

I have two models: class ModelIn{ public string FirstName { get; set; } public
I have two models: public class ProfessorModels { public string FullName { get; set;
i have these two models public class Group { [Key] public int GroupID {
I have the following two models [DataContract] public class Event { [Key] public int
I have two classes: public class DocumentViewModel { public virtual string DocumentNumber { get;
i have two simple models that have one-many relation public class X{ public int
I have two models: class Contact(models.Model): name = models.CharField(max_length=255) class Campaign(models.Model): contact = models.ForeignKey(Contact,
I have two object models that looks like this: public class MyObject { public
I have two models : class A extends Model { public bool active =
I have my view models : public class POReceiptViewModel { public virtual int PONumber

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.