restapi asp.net core 中 3 列数据相同时如何创建 post api

问题描述 投票:0回答:0

【必填】

    [ForeignKey("AcquisitionMethodId")]
    public int? AcquisitionMethodId { get; set; }
    public AcquisitionMethod? AcquisitionMethod { get; set; }
    public AcquisitionMethod? ShutdownMethod { get; set; }
    public AcquisitionMethod? EquilibrationMethod { get; set; }

this is my workflow here 3columns data same I have only one class name that is AcquisitionMethod class. here how can i save this data into my workflow post api

` var 工作流 = 新工作流 {

            Id = workflowDto.Id,
            Name = workflowDto.Name,
          
       
            AcquisitionMethodId = workflowDto.AcquisitionMethodId

}

var 结果 = openAccessDBContext.Workflow.Add(workflow); 等待 openAccessDBContext.SaveChangesAsync(); 返回结果.Entity;`

asp.net rest entity-framework asp.net-core asp.net-core-webapi
© www.soinside.com 2019 - 2024. All rights reserved.