Get the App
SLTechnology News&Howtos  ›  Development  › 

How Vue and. Net Core receive List < T > generic parameters

Shulou Source: shulou.com Published: 2022-05-31 20:40:25 10月04日 Update

In this article, the editor introduces in detail "Vue and .net Core how to receive List < T > generic parameters". The content is detailed, the steps are clear, and the details are handled properly. I hope this "Vue and .net Core how to receive List < T > generic parameters" article can help you solve your doubts.

1. Situations that cannot be received

Front-end parameter value

/ * request parameter value * / var data= [] data.push ({id:1, name:'aaa'}) data.push ({id:2, name:'bbb'}) data.push ({id:3, name:'ccc'})

Back-end code

[HttpPost] public JsonResult Data (List list) {return Json (new {c = 200, m = "test"});} public class entity {public int id {get; set;} public string name {get; set;} 2, the situation that can be received

Front-end parameter value

/ * request parameter value * / var data= {length:0, list: []} var list= [] list.push ({id:1, name:'aaa'}) list.push ({id:2, name:'bbb'}) list.push ({id:3, name:'ccc'}) data.length=list.lenghtdata.list=list

Back-end code

[HttpPost] public JsonResult Data (entity entity) {return Json (new {c = 200, m = "test"});} public class entity {public int length {get; set;} public List list {get; set;}} public class model {public int id {get; set;} public string name {get; set }} after reading this, the article "how Vue and .net Core receive List < T > generic parameters" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Parameters articles code content front end situation proper ideas new knowledge more steps knowledge knowledge points articles details industry information information channels follow channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS Xiaomi MySQL Huawei