Skip to main content
Filter by
Sorted by
Tagged with
1 vote
3 answers
289 views

Out of curiosity, I was trying to build API with the number of overloads. Initially, I was getting the below error -Multiple actions were found that match the request in Web Api But again, I wanted ...
Kgn-web's user avatar
  • 7,645
0 votes
1 answer
232 views

I have these three tables in SQL Server: Evaluations (id, textreview, stars, userId, BookId) Books (id, title, ..., userId) Users (id, name, ...) And I have this code to get data ...
Gizmo's user avatar
  • 31
0 votes
0 answers
358 views

I have a webapi project with a base ApiController named TestController: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web....
chrysa22's user avatar
0 votes
1 answer
365 views

I'm sending POST from PostMan: And the parameter keeps coming up as null. From what I read, changing Post([FromBody]Models.Question value) and setting the model should be able to handle the json ...
elquesogrand's user avatar
0 votes
0 answers
73 views

There is a WebAPI v1 controller with the following set of methods: public class MailMessagesController : ApiController { [HttpPost] [ActionName("Attachments")] public ...
Alec's user avatar
  • 1,526
3 votes
2 answers
3k views

I create a web application with Razor Pages. I have 2 Models with one to many relationship: one List can hold many Records. public class List { public int ID { get; set; } [StringLength(25,...
Mr.B's user avatar
  • 3,847
1 vote
1 answer
149 views

Is it possible to have a dynamic route name so that route name can be read from a config file? e.g. where someStringReadFromConfig would be populated from a config file. [Route("api/v1/test/"+ ...
Aaron's user avatar
  • 41
0 votes
0 answers
228 views

I am new to StackOverflow so if there is a right answer to my question below, I just didnt know what to look for.. I am currently working on a call to a API which works in the following matter: Send ...
M Menne's user avatar
  • 21
0 votes
1 answer
70 views

I'm trying to split a Core 2.1 WebAPI project into two in order that we can expose two different APIs according to circumstances. Simplified, we have one API and we want all the read-only (GET) ...
Mike's user avatar
  • 2,530
1 vote
2 answers
809 views

Background In most MVC and WebApi applications we typically see the following structure: /Controllers HomeController.cs /Models Typically this is generated from the MVC template. This will then ...
Andez's user avatar
  • 5,908
1 vote
1 answer
1k views

I'm running into an issue where Angular is unable to make a successful request on 2 of 3 endpoints but I have confirmed all work with postman and that the proxy is successfully routing the calls. ...
NuNn DaDdY's user avatar
  • 3,012
4 votes
2 answers
6k views

I have created a Web Api, and I want to set default landing url as Swagger url i.e:- http://localhost:65347/swagger/ui/index
MayankGaur's user avatar
2 votes
1 answer
436 views

I am working on a WebAPI 2 project which currently uses attribute-based routing exclusively, to the point that there are no routes defined in registration, and everything is working as expected. ...
David Keaveny's user avatar
1 vote
2 answers
2k views

Is it best practice to put each distinct Get method in its own controller class, or is it perfectly fine to have multiple (related and non-related) API methods in the same class, if the methods are ...
userSteve's user avatar
  • 1,654
1 vote
1 answer
6k views

I have created a class that inherit from DelegatingHandler and overwrite the SendAsync method. I wanted to validate the request parameters and encode them with AntiXss class before passing it to the ...
Running Rabbit's user avatar
0 votes
1 answer
3k views

I am using ASP.NET core 2.0 Web API Template and I have a couple of doubts: 1)How can i create custom actions and map the URIs to them. Like I have an Employee Model and I want to create an API ...
Aditya Joshi's user avatar
-1 votes
1 answer
246 views

I am trying to create an API and trying to access it via chrome, expecting it to return the list of Items public class ProductController : ApiController { Product product = new Product(); ...
Sandeep Pandey's user avatar
1 vote
2 answers
293 views

Please find the below details of my application public class CartController : ApiController { [HttpGet] public Response<CartDto> GetById(Guid customerId) { .... } } In ...
Coder's user avatar
  • 123
8 votes
1 answer
2k views

I am trying to get Web API versioning working with an inherited class. I am working with two very simple variations of the stock Values controller. [ApiVersion("1.0")] [RoutePrefix("api/v{version:...
Joe's user avatar
  • 5,497
0 votes
1 answer
655 views

I am trying to pass Date and time to HTTP GET API. It works well with just date. But I get following error when i try to pass time along with it. "A potentially dangerous Request.Path value was ...
sansy's user avatar
  • 139
0 votes
1 answer
175 views

I have a problem with routing, since I created "BaseController". I use only 4 methods name GET, POST, PUT, DELETE, to make easiest calls from front-end. So, when I have this controller: [RoutePrefix(...
David Pantea's user avatar
1 vote
0 answers
2k views

Making the first API with the sample code from ASP.NET Web API: In the WebApiConfig.cs, there is a route template: routeTemplate: "v1/{controller}/{text}", defaults: new { ...
kevin's user avatar
  • 11
0 votes
0 answers
638 views

I've got Swashbuckle going in my web api project. I want to get a custom handler invoked only when a user tries to hit the swagger ui page. I don't want to add the handler to the pipeline. I thought ...
user avatar
6 votes
2 answers
7k views

I have below route URL:- www.domanname.com/subroute/GetInfo?param1=somestring&param2=somestring I have function in webapi as:- public class HomeController : ApiController { public object ...
C Sharper's user avatar
  • 8,664
0 votes
1 answer
106 views

Hi I have the below Model class for my project. I am trying to get Form values in my WEB API POST method in Values Controller, however the values received are null. I am here for your suggestion on ...
Sarath Chirayil Subhash's user avatar

1 2 3
4
5
21