Linked Questions

1 vote
1 answer
3k views

I've this GET method in my MVC Web Api: public IQueryable<Employee> GetEmployeeByJobTitle(List<string> jobTitles) { var employeeByJobTitle = from e in db.Employee ...
LarAnto's user avatar
  • 136
-1 votes
2 answers
1k views

Using Asp.Net Core 2.2 I am calling an API using: products?productsIds=1,2&offset=10&limit=4 But I get the error on model binding for productsIds: The value '1,2' is not valid. I tried with ...
Miguel Moura's user avatar
1 vote
0 answers
728 views

My endpoint is decorated like [HttpGet("{data}")] public async Task<MyObj> Get([FromQuery]List<string> data) And I call this via https:.........../api/Learning/one,other,hello ...
MyDaftQuestions's user avatar
1 vote
3 answers
451 views

I have the following code. I'd like to do away with ContactIdsString, but I don't then know how to send the int[] in JavaScript to an IEnumerable in C#. Is there any way? Html: @model MyNamespace....
Sarov's user avatar
  • 665
0 votes
0 answers
127 views

Web API code [HttpGet] public string GetMore([FromUri] Int32[] dd) { return ""; } I need to be able to call this web api passing in an array of integers The route at the WebApiconfig is as ...
user581157's user avatar
  • 1,429
638 votes
11 answers
1.2m views

Is there a standard way of passing an array through a query string? To be clear, I have a query string with multiple values, one of which would be an array value. I want that query string value to be ...
Yarin's user avatar
  • 186k
130 votes
12 answers
187k views

I'm trying to pass an array (or IEnumerable) of ints from via AJAX to an MVC action and I need a little help. the javascript is $.get('/controller/MyAction', { vals: arrayOfValues }, function (...
Dave's user avatar
  • 2,562
67 votes
8 answers
131k views

I want to do this, but I want to also be able to pass in arrays into the query string. I've tried things like: http://www.sitename.com/route?arr[]=this&arr[]=that http://www.sitename.com/route?...
user3685285's user avatar
  • 6,726
13 votes
3 answers
35k views

My api client code sends an authentication token in the querystring like: www.example.com/api/user/get/123?auth_token=ABC123 I'm using Mvc Web api controller, and I have a filter that checks if the ...
loyalflow's user avatar
  • 15.1k
13 votes
6 answers
33k views

I am trying to send an array of integers to my action method the code looks like so: [HttpGet] public async Task<IActionResult> ServicesByCategoryIds([FromQuery] int[] ids) { ...
zoran djipanov's user avatar
9 votes
3 answers
8k views

How do you model bind an array from the URI with GET in ASP.NET Core 1 Web API (implicitly or explicitly)? In ASP.NET Web API pre Core 1, this worked: [HttpGet] public void Method([FromUri] ...
marras's user avatar
  • 91
6 votes
2 answers
9k views

I have the following: [HttpDelete] public HttpResponseMessage DeleteFolder(int[] ids) { and I'm trying to use this: DELETE http://localhost:24144/api/folder/1483; DELETE http://...
SB2055's user avatar
  • 13k
5 votes
2 answers
12k views

My webAPI solution currently works if I send a single id to the delete endpoint: DELETE /api/object/1 With: [HttpDelete] public HttpResponseMessage DeleteFolder(int id) { // Do ...
SB2055's user avatar
  • 13k
3 votes
1 answer
10k views

I have this Web API method: [Route("api/[controller]")] [ApiController] public class SubjectsController : ControllerBase { [HttpGet("children")] public IActionResult GetAllFromChildren([...
g_b's user avatar
  • 12.5k
2 votes
2 answers
4k views

I am new to asp.net mvc webapi.I am create one webapi service.In this service I am sending parameter as an array class. Below is my service : [AcceptVerbs("GET", "POST")] public HttpResponseMessage ...
Anil Kumar's user avatar

15 30 50 per page