Answer the question
In order to leave comments, you need to log in
How to pass a parameter to the controller?
Hello everyone, the question is the following, I have such a controller
[HttpGet]
public async Task<ContentResult> Auction([FromQuery(Name = "ids")] int[] ids, AuctionModel auctionModel)
{
var partners = _AdCampaignMsSqlBl.GetRtbPartners(ids);
var result = await _rtbService.GetAuctionResult(partners.Values, auctionModel);
return new ContentResult
{
Content = result,
ContentType = "application/xml",
StatusCode = 200
};
}
Answer the question
In order to leave comments, you need to log in
1. Make a string parameter and parse it in the controller
2. Make a non-string parameter and parse it with ModelBinder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question