asp.net-apicontroller Questions
4
We have an ASP.NET MVC application that is authenticating without issue against IdentityServer3, however the web API part of the application using ApiController's start to fail if the user waits be...
Accouchement asked 10/8, 2015 at 5:22
6
Solved
i am using asp.net Authorization to log in with Angular js for client side ,i need to get Current user logged in
i need to get current User to save any operation in my logger Table,
and httpcontex...
Serin asked 30/1, 2019 at 13:16
1
Solved
I am trying to create an API controller in my ASP.NET core 5 Razor Pages web application.
I have created the Api Controller inside a folder named Api in Visual studio.
Then when I try to run the fo...
Branscum asked 11/7, 2021 at 13:34
3
I finally was able to get the HttpContext.Current to be not null by finding some code online. But I still have not be able to add custom headers to the request in my unit test. Here is my test:
[T...
Sustentacular asked 20/8, 2013 at 15:20
1
Solved
I've noticed it is the same thing if this attribute is used or not. Am I wrong?
As an example:
[Route("[controller]")]
[ApiController]
public class DataTablesController: ControllerB...
Baudoin asked 9/3, 2021 at 11:15
2
Solved
I've made an API where after an Entity Framework elaboration I send an object serialized in Json.
My Object:
public class Package
{
public int Items { get; set; }
public string Code { get; set;...
Dissolvent asked 11/12, 2019 at 8:51
1
Solved
Problem
Using ApiControllerAttribute and RouteAttribute on controllers and actions, everythings work fine.
When I change the code to work with Convetional Routing, the Identity property in reques...
Woodpecker asked 18/2, 2020 at 11:2
4
Solved
Problem:
I'm creating an API Application with NET Core 3.1.
I'd like to avoid to set route attribute over every ApiControllers and Actions. I tryed a lot of combinations over UseEndpoints to set a...
Petrolatum asked 13/2, 2020 at 10:23
3
Since a few days ago, I have started receiving error messages from all my Azure websites:
"The controller for path '/admin/host/synctriggers' was not found or does not implement IController."
Thi...
Stairway asked 20/7, 2019 at 6:23
1
Solved
Could someone please tell me how i can test this function :
[RoutePrefix("service")]
public class TestControler : ApiController
{
[Route("function-route")]
[HttpPost]
public HttpResponseMessage...
Gym asked 27/11, 2018 at 10:55
3
Solved
I was not able to get the JSON array parameters in web api controller method (SaveDetails).
Here are my code.
JavaScript Code:
$.ajax(
{
url : "api/Test/SaveDetails",
type : "POST",
data : ...
Campestral asked 21/10, 2014 at 5:42
1
Solved
I tried to do an api request to https://api.github.com/users and I got this forbidden response returned. As it doesn't need authentication, I don't know why I got that 403 returned.
{StatusCode: 40...
Viniculture asked 12/3, 2018 at 10:36
5
Solved
Currently, my ApiControllers are returning XML as a response, but for a single method, I want to return JSON. i.e. I can't make a global change to force responses as JSON.
public class CarControll...
Lido asked 2/3, 2018 at 16:48
1
Solved
I am working on an ASP.NET Core 2.0 RESTful API. I have a scenario where I need to use an HTTPGet method to call an action on my API controller and I need to extract a username and password value t...
Radium asked 6/1, 2018 at 2:56
2
Im working on an existing Windows Service project in VS 2013.
I've added a web API Controller class I cant remember now if its a (v2.1) or (v1) controller class....Anyway I've called it Synchronis...
Interrelated asked 5/1, 2018 at 5:24
0
Within a request on an ApiController, I'm tracking the duration of awaiting the Sql Connection to open.
await t.TrackDependencyAsync(async() => { await sqlConnection.OpenAsync(); return true; }...
Pedantry asked 24/2, 2017 at 8:28
0
I'm trying to send this json to my controller
{
"Name":"Ford Focus",
"CarProperties":[
{
"Name":"Airbag"
}
]
}
As you see there is a Collection named as CarProperties. I want to handle t...
Ahoy asked 11/11, 2016 at 10:7
1
Solved
I'm currently writing integration tests using nunit for a previously untested server that was written in C# using ApiController and Entity Framework. Most of the tests run just fine, but I've ran i...
Kaneshakang asked 25/5, 2016 at 21:54
4
Solved
I have searched long and hard but found nothing that helped yet. Where am I going wrong? I really do not know what to do. I wrote all the details below. I've tried and did not succeed.
An error ...
Cummings asked 28/7, 2014 at 9:55
1
I'm just getting started with Mobile Apps. I'm used to making APIs with ApiController of Web API.
The default project template for Mobile Apps in VS2015 comes with a sample TodoItemController that...
Megan asked 7/10, 2015 at 3:7
3
Solved
I'm trying to add API documentation at my backend system.
Default ApiExplorer and Help page worked absolutely great until the moment I introduced versions to my API Controllers.
In order to add ver...
Paraffinic asked 10/2, 2014 at 23:41
1
When calling the method shown below, Request is always null. I have some simple methods returning JSON data from controllers in an MVC4 app with controllers using ApiController as a base class. The...
Titivate asked 7/11, 2013 at 17:5
1
Solved
I've got a simple data model involving Weeds and Weed Families.
WeedFamily <-1---*-> Weed (WeedFamily and Weed have a one-to-many relationship)
I'm attempting to complete my first ApiContr...
Corri asked 22/8, 2013 at 23:33
1
Can someone explain me when I should inherit my controller form ODataController vs ApiController ?
The question is caused by the fact that results returned by ApiController can be filtered with ODa...
Spindell asked 14/8, 2013 at 13:27
1
© 2022 - 2024 — McMap. All rights reserved.