小编ami*_*iko的帖子

更新包含实体框架中的对象列表的对象的最佳方法

我的 API 中有以下模型:

namespace API.Models
{
public class StudentDetailsViewModel
{
    [Key]
    public int StudentId { get; set; }
    public AddressViewModel Address  { get; set; }
    public List<CoursesViewModel> Courses { get; set; }
}

public class AddressViewModel
{
    public int AddressId { get; set; }
    public int StudentId { get; set; }
    public string Address { set; set; }
}

public CoursesViewModel
{
    public int CourseId { get; set; }
    public int StudentId { get; set; }
    public string Name { …
Run Code Online (Sandbox Code Playgroud)

.net c# entity-framework asp.net-web-api

2
推荐指数
1
解决办法
8436
查看次数

标签 统计

.net ×1

asp.net-web-api ×1

c# ×1

entity-framework ×1