TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rithik Banerjee
NA
2.5k
480.2k
Post Action method overload with same route name in API Controller
Jul 21 2020 5:21 AM
Is it possible to have two actions with same route name and same method but different parameter?
I want this:
[HttpPost]
[Route(
"gstr4"
)]
public
HttpResponseMessage SubmitGSTR4([FromBody] RequestPayloadWithoutSign requestPayload)
{ }
[HttpPost]
[Route(
"gstr4"
)]
public
HttpResponseMessage FileGSTR4([FromBody] RequestPayloadWithSign requestPayload)
{ }
I got a HTTPStatusCode of 500 (InternalServerError) and here is the response payload:
{
"Message"
:
"An error has occurred."
,
"ExceptionMessage"
:
"Multiple actions were found that match the request: \r\nFileGSTR4 on type APIPortal.Controllers.GSTR4Controller\r\nSubmitGSTR4 on type APIPortal.Controllers.GSTR4Controller"
,
"ExceptionType"
:
"System.InvalidOperationException"
,
"StackTrace"
:
" at System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controllerContext)\r\n at System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
Reply
Answers (
2
)
I am creating a website of Online test in which i want bookmark color
How to save values in asp.net mvc when using checkbox and dropdownlist