Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将通用对象JSX中的对象列表发布(使用fetch)到ASP.Net核心API_C#_Reactjs_Asp.net Core_Asp.net Web Api_Arraylist - Fatal编程技术网

C# 将通用对象JSX中的对象列表发布(使用fetch)到ASP.Net核心API

C# 将通用对象JSX中的对象列表发布(使用fetch)到ASP.Net核心API,c#,reactjs,asp.net-core,asp.net-web-api,arraylist,C#,Reactjs,Asp.net Core,Asp.net Web Api,Arraylist,我正在使用ReactJS和ASP.NETWebAPI 这就是模型: public class Skill { public int Id { get; set; } public string Description { get; set; } } public class RegisterProject { public class Request { public string Objective { get; set; } public string

我正在使用ReactJS和ASP.NETWebAPI

这就是模型:

  public class Skill
{
  public int Id { get; set; }
  public string Description { get; set; }
}

public class RegisterProject
{
  public class Request
  {
    public string Objective { get; set; }
    public string Description { get; set; }
    public long UserId { get; set; }
    public int CurrencyId { get; set; }
    public int BudgetId { get; set; }

    public List<Skill> Skills = new List<Skill>();
  }

  public class Response : Models.Common.Generic
})

在下面的控制器调试图像中,我没有收到技能列表,我不知道我的技能定义是否错误,或者是否存在其他问题


请改变这样的技能

public List<Skill> Skills { get; set; }
公共列表技能{get;set;}
“公共列表技能{get;set;}”应该怎么办
fetch(global.config.url + "Project/postRegisterProject/", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Accept: "application/json",
  },
  body: JSON.stringify({
    Objective: "a",
    Description: "b",
    UserId: 1,
    CurrencyId: 1,
    BudgetId: 1,
    Skills: [
      { Id: 1, Description: "ReactJS" },
      { Id: 2, Description: "Html" },
    ],
  }),
})
  .then(function (response) {
    response.json().then(function (data) {
      console.log("llego aqui");
      console.log(data);
    });
  })
  .catch(function (err) {
    console.log("Fetch Error :-S", err);
  });
public List<Skill> Skills { get; set; }