Questions tagged «asp.net-core-routing»

12
如何在ASP.NET Core中将多个参数传递给get方法
如何在MVC 6控制器中将多个参数传递给Get方法。例如,我希望能够拥有类似以下内容的东西。 [Route("api/[controller]")] public class PersonController : Controller { public string Get(int id) { } public string Get(string firstName, string lastName) { } public string Get(string firstName, string lastName, string address) { } } 所以我可以查询喜欢。 api/person?id=1 api/person?firstName=john&lastName=doe api/person?firstName=john&lastName=doe&address=streetA
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.