Hi friends
when I am trying with this format api not working.
Web Api development(.net core 2.MVC)
api/controller?parameter=
where as when I am giving / in place of question mark it is giving the json result.
api/controller/parameter=
please help me to fix the above issue.
Thanks in advance.

Ramachandran MRank #2,660 · 522 reputationPosted Dec 2, 2019, 8:49 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 4, 2019, 12:26 AM EST
prasanna pRank #3,234 · 443 reputationPosted Dec 2, 2019, 9:03 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 2, 2019, 9:57 PM EST
prasanna pRank #3,234 · 443 reputationPosted Dec 2, 2019, 10:22 PM EST
Jenith ThakkarRank #789 · 2.9K reputationPosted Dec 2, 2019, 10:36 PM EST
prasanna pRank #3,234 · 443 reputationPosted Dec 2, 2019, 10:46 PM EST
Jenith ThakkarRank #789 · 2.9K reputationPosted Dec 2, 2019, 10:58 PM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 2, 2019, 10:59 PM EST
ApiControllerprasanna pRank #3,234 · 443 reputationPosted Dec 2, 2019, 11:02 PM EST
{
//[Authorize]
public class EntityController : ApiController
{
{
try
{
Dictionary
prasanna pRank #3,234 · 443 reputationPosted Dec 2, 2019, 11:46 PM EST
Jenith ThakkarRank #789 · 2.9K reputationPosted Dec 3, 2019, 12:08 AM EST
prasanna pRank #3,234 · 443 reputationPosted Dec 3, 2019, 12:26 AM EST
Ramachandran MRank #2,660 · 522 reputationPosted Dec 3, 2019, 1:06 AM EST
GetBooksByLocale(int lcid = 1033) { ... } } "> [Route("api/ GetBooksByLocale(int lcid = 1033) { ... } } "> GetBooksByLocale(int lcid = 1033) { ... } } ">GetBooksByLocale/{lcid:int?}")] public HttpResponseMessage> GetBooksByLocale(int lcid = 1033)prasanna pRank #3,234 · 443 reputationPosted Dec 3, 2019, 1:15 AM EST
GetBooksByLocale(int lcid = 1033) { ... } } "> [Route("api/ GetBooksByLocale(int lcid = 1033) { ... } } "> GetBooksByLocale(int lcid = 1033) { ... } } ">GetBooksByLocale/{lcid:int?}")] GetBooksByLocale(int lcid = 1033) { ... } } "> public HttpResponseMessage> GetBooksByLocale(int lcid = 1033) but in my case it is a string field.But the above method call syntax is not there to string,where as other datatypes are there. Is there any other way to resolve the issue with the same api? how to get that with questionmark call after controller name like this GetBooksByLocale(int lcid = 1033) { ... } } ">http://localhost:1201/api/Entity?keyword= --for optional GetBooksByLocale(int lcid = 1033) { ... } } ">Ramachandran MRank #2,660 · 522 reputationPosted Dec 3, 2019, 11:03 PM EST
public HttpResponseMessage Get([FromUri] string id)
{
prasanna pRank #3,234 · 443 reputationPosted Dec 4, 2019, 12:02 AM EST
Jenith ThakkarRank #789 · 2.9K reputationPosted Dec 4, 2019, 12:42 AM EST
prasanna pRank #3,234 · 443 reputationPosted Dec 6, 2019, 3:43 PM EST
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Dec 2, 2019, 11:30 PM EST
can you please try to below code.
http://localhost:1041/api/Entity/Get?keyword=A
And also check the below line if not added then please added.
[Route("api/[controller]")]
public class EntityController : ApiController
Thanks