【发布时间】:2020-08-09 22:45:26
【问题描述】:
您好,我在 ASP.NET Core 3.1 中使用 MVC 模式的实体框架有以下模型:
public class Parent
{
int ParentId {get; set;}
string name {get; set;}
ICollection<Child> childs {get; set;}
}
public class Child
{
int ChildId {get; set;}
string name{get;set;}
}
我想要父类的 CRUD 视图,我可以在其中动态添加和删除子类,然后通过提交将其发送到控制器并将父类和子类映射到 DBContext。 就像在购物车中一样,您可以在其中添加商品。 使用 Ajax 调用的孩子的部分视图是最好的方法吗? 任何建议将不胜感激。对于像我这样的初学者来说,如此复杂的任务很难。
【问题讨论】:
标签: c# jquery entity-framework asp.net-core-mvc