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?
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.