Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Set route in net core api

$
0
0
Hi all, how do I set a route ( or attribute or whatever ) so I can call this method which is present in a net core api controller ? assume my controller is called MyController - I've googled endlessly and can't find a simple answer

I would like to be able to access it something like this
myipaddress:myportnumber/MyController/1
public ActionResult<Actuator> GetAValue(int id)
{
// businesslayer is my DAL and is instantiated in my controller c'tor
    return businessLayer.GetAValue(id);
}
"We can't stop here - this is bat country" - Hunter S Thompson - RIP

Viewing all articles
Browse latest Browse all 3938

Latest Images

Trending Articles



Latest Images

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