【发布时间】:2018-06-29 20:59:50
【问题描述】:
我有 2 个简单的模型:
public class Country
{
public int ID { get; set; }
public string Name { get; set; }
public virtual ICollection<Region> Region { get; set; }
}
public partial class Region
{
public int ID { get; set; }
public string Name { get; set; }
public int CountryID { get; set; }
public virtual Country Country { get; set; }
}
是否可以有一个页面来处理一个国家的创建,用户输入多个地区的国家,然后只发布到服务器?
我看到了一个实现 here,您可以在其中创建具有编号属性(Region1、Region2、Region3 等)的自定义 ViewModel,但它有限制,有什么建议吗?
(我知道 AngularJS 可以用来做这件事,但我目前还没有这方面的经验。)
谢谢
【问题讨论】:
标签: c# html asp.net-mvc