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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:32:06+00:00 2026-06-12T06:32:06+00:00

Possible Duplicate: Model relationships in ASP.NET MVC I have two tables. one is Country

  • 0

Possible Duplicate:
Model relationships in ASP.NET MVC

I have two tables. one is Country and other one is region.
country table has regionId.
one country has one region and one Region has many countries.

In the list of country view I want show country name and region name.
and also edit view I want to show region list.

This is my country model.

public partial class CountryModel : BaseNopEntityModel,
    {           

        public string Name { get; set; }

}

This is my Region Model

  public partial class  RegionModel :BaseNopEntityModel
    {         

        public virtual string Name { get; set; }


    }

How do I set the relationship between these two model?

  • 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-12T06:32:08+00:00Added an answer on June 12, 2026 at 6:32 am

    You can link each country with its associated region by making property of RegionModel class in CountryModel class.Through this property you can access a region against each country.

    public class CountryModel : BaseNopEntityModel,
    {
        public string Name { get; set; }
        public Regionmodel Region{get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: ASP.NET MVC - Can i have multiple names for the same action?
Possible Duplicate: ASP.NET MVC Razor render without encoding One of the proerties of my
Possible Duplicate: ASP.NET MVC - Linq to Entities model as the ViewModel - is
Possible Duplicate: If I have two tables in SQL with a many-many relationship, do
Possible Duplicate: HTML.ActionLink method In my ASP.NET MVC 3 application, I wish to generate
Possible Duplicate: Can I use pure SQL in ASP.net MVC? i asked a similar
Possible Duplicate: Combine two Arrays into Hash I have an model which stores key
I have two tables that model an inheritance relationship. This is expressed by a
Possible Duplicate: Can I have a Django model that has a foreign key reference
Possible Duplicate: Django Model Inheritance query a central table Following along the officail docs

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.