Data dodania Pytanie
2017-03-17 15:03 How do you store the current user as a property on a web api model »
I am using a web api 2 and creating a message object to save to the database. This message object needs to have the current user stored on it as an ap...
(2) odpowiedzi
2017-03-14 10:03 Web API Request is null in ExecuteAsync method of ApiController »
I am trying to access the Request property in my ApiController-derived class. For some reason, Request is null in ExecuteAsync method. I've seen the ...
(1) odpowiedzi
2017-03-13 14:03 Web API 2 - Communication between controllers »
Have anyone experience with communication between controllers in Web API 2 ?? Let's assume, we are working in web zone. Little example: public class...
(2) odpowiedzi
2017-03-09 19:03 How to add MessageHandler for a specific controller that is using Routing Attributes in ASP.NET WebAPI 2? »
It is possible to add a MessageHandler only for a specific controller that is using Route Attributes? I want to cut the request earlier in the pipeli...
(2) odpowiedzi
2017-03-06 16:03 Cannot reuse an 'ApiController' instance - Unity DI »
I followed this tutorial to use Unity dependency injection in WebAPI. To avoid registering each type seperatly I used this setup _container.Register...
(1) odpowiedzi
2017-02-26 18:02 Return custom XML response from IHttpActionResult »
I have following code in my controller [HttpGet] public IHttpActionResult Get_User_Info(long id) { user u = new user(); ...
(0) odpowiedzi
2017-02-24 16:02 Angular 2 http request is not hitting web api get method with a string parameter overload »
My problem is that the first Get method is called from this http request: http://localhost:56690/api/testelements/?name=aeg wouldn't I expect my this...
(1) odpowiedzi
2017-02-17 16:02 Validating Enums in Web api 2 object parameters »
Suppose you send a class-instance to controller and the class has a property of Enum type. public class CoffeeController : ApiController { [HttpP...
(3) odpowiedzi
2017-02-15 17:02 Web API RPC vs WCF and JSON »
I've been doing some research into which protocol / technology stack to use when creating a web service and I would like to get a clear answer on it w...
(1) odpowiedzi
2017-02-14 08:02 Rewriting api and deserializing objects »
I am trying to migrate an old api to webapi. Problem is that experience is limited so I am here asking this question. The current api accepts a json ...
(1) odpowiedzi
2017-02-12 11:02 Authenticating AD user automatically and manually - WebAPI 2 server and SPA client »
I'm developing an Enterprise/Internet Application with WebAPI 2 RESTful server and SPA web client (Angular2) —So I have two separated projects creat...
(0) odpowiedzi
2017-02-08 20:02 Is NuGet Microsoft.AspNet.WebAPI 5.2.3 a WebAPI 2.2? »
There are some confusion of versions of Web API. Check out this Web API at NuGet, Microsoft ASP.NET Web API 2.2 5.2.3 What? Here is the desc...
(1) odpowiedzi
2017-02-04 02:02 WebAPI serializes classes that derive from abstract type properly when returning JSON, but not XML »
my model: public abstract class BaseClass { public string id { get; set; } } [KnownType(typeof(BaseClass))] public c...
(1) odpowiedzi
2017-02-02 20:02 Webapi 2 controllers on 2 projects »
I have a webapi2 C# projects on which I have all the controllers in a controllers folder. I now have some functionality that I want to add but I want ...
(5) odpowiedzi
2017-01-28 23:01 Set the type of registered Service during runtime within an action filter/message handler »
public class ActionFilterVersionAttribute : ActionFilterAttribute { public override void OnActionExecuting(HttpActionContext...
(1) odpowiedzi
2017-01-26 11:01 ASP.NET Web API IExceptionLogger called twice »
My exception logger implementing [IExceptionLogger][1] is called twice when an exception is thrown from a controller action. context.RequestContext....
(1) odpowiedzi
2017-01-12 00:01 C# WebAPI not serializing dynamic properties correctly »
I am creating a new C# OData4 Web API with a class named Call that has dynamic properties, which OData 4 allows via "Open Types". I believe I've set e...
(2) odpowiedzi
2017-01-11 21:01 POST from Typescript to Web API API, unable to pass a JSON Object »
I am trying to pass a JSON Object from a typescript POST call to a Web API method. Fiddler shows that the object has been converted into JSON and the...
(1) odpowiedzi
2017-01-04 17:01 Ensure that WebAPI2 routes are matched before MVC Routes »
I have a web application which uses both MVC and WebAPI2. I would like for requests to always be matched up with WebAPI2 attribute routes before matc...
(0) odpowiedzi
2017-01-04 10:01 Are WebApi 2 request calls processed in logical threads of execution from stack? »
When ASP.NET Web Api 2 processes requests in asynchronous manner are they considered logical threads of execution? I.e. does setting up CallContext...
(0) odpowiedzi
2016-12-20 15:12 .NET WebApi How to prevent "$ref": "x" output of JSON »
I'm Using Web Api with Entity Framework, I have a controller named as Gift, when client GET's the API I'm getting all Gifts from DB by using entity fr...
(1) odpowiedzi
2016-12-19 21:12 Wrapping IHttpActionResult - Generic solution »
I'd like to wrap IHttpActionResult because I need some extra data to be consumed by the client app. My first approach was to create and return simple...
(2) odpowiedzi
2016-12-12 17:12 Calling GET method that return IHttpActionResult from AJAX? »
AJAX works fine with the GetAll method that returns IQueryable, but with GetOne, it doesn't work and return "undefined" to the browser, here is the G...
(2) odpowiedzi
2016-12-11 19:12 Is EntityFramework supposed to be that slow? »
I'm trying to create a simple API for my client mobile app. I created new empty Web API project and an action but it is extremely slow: [HttpGet, Ro...
(1) odpowiedzi
2016-12-10 20:12 Custom authorization in Web API v2 »
My Web API v2 application uses IdentityServer to authorise API requests by checking for a valid bearer token in the request header. This works fine. H...
(0) odpowiedzi
2016-12-02 21:12 Why do I get an HTTP 400 - Bad Request for an apparently successful request? »
I have an action filter to trace the success/failure of requests to actions/controllers with the filter. It has this method: OnActionExecuted(HttpAct...
(0) odpowiedzi
2016-12-02 08:12 asp.net webapi 2 post parameter is always null »
I have been trying to figure this our for the last hour, but I can't see what's wrong with it the post is from a xamarin app that I'm writing, using ...
(2) odpowiedzi
2016-11-30 16:11 Multiple controllers with same URL routes but different HTTP methods »
I've got a following two controllers: [RoutePrefix("/some-resources") class CreationController : ApiController { [HttpPost, Route] public ......
(1) odpowiedzi
2016-11-27 18:11 WebApi unable to return to HttpClient »
It gets stuck after the end curly-brace when I am trying to call GetAllFiles() from HttpClient (MVC application). I can see the data in debug mode, b...
(1) odpowiedzi
2016-11-24 03:11 Configure webapi2 route to support different kind of GET requests (action/id) »
I would like to be able to support those URLs: // GET: api/Users returns a list (all) // GET: api/Users/5 returns the user ...
(1) odpowiedzi
2016-11-21 06:11 Unit testing using Nunit gives an error »
I just started with unit testing using Nunit with my WebApi project. I've developed one test case for my controller: private readonly INewsBusinessL...
(1) odpowiedzi
2016-11-19 21:11 Scaffold automatic WebApi Controller generation »
I'm learning Web Api and I'm a bit confused. When I create a controller for my Person class, how does it defines which method is GET, POST, DELETE? I...
(1) odpowiedzi
2016-11-19 14:11 How to use code first migrations to update a database? »
I made a c#.NET WebAPI and it worked when I changed the model it stopped working and it gives me the following error message. The model backing the '...
(1) odpowiedzi
2016-11-12 10:11 Configuring Route to allow dot as extension? »
Imagine the following: client app, which no one has control over, calls Web API methods but each of these methods ends in extensions such as : /api/...
(1) odpowiedzi
2016-11-08 17:11 Optional string input when following string inputs are not optional? »
I am trying to implement an interface as a service controller. I do not maintain this interface, so I am unable to modify it. For simplicity, let's sa...
(0) odpowiedzi