且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将查询参数绑定到ASP.NET Core中的模型

更新时间:2022-04-23 02:39:27

您需要将[FromQuery]属性分别添加到模型属性中

You need to add [FromQuery] attribute to the model properties individually

public class Criteria
{
  [FromQuery(Name = "first_name")]
  public string FirstName { get; set; }
}