Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Microsoft.AspNetCore.Mvc Controller with same method name but different parameter

$
0
0

How can I have my controller actions get triggered by parameter names.

public IActionResult Test(int a1) ... http://test.com?a1=3

public IActionResult Test(string s1, string s2) http://test.com?s1=3&s2=10

I want the actions to get triggered by the matching parameter name. 

This is how the old web api used to work but since I am doing this with .net core mvc controller I am not able to produce the same results.

Appreciate in advance.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>