ASP.NET Web API is a framework for building HTTP services for clients like browsers and mobile devices. It is based on the Microsoft .NET Framework and ideal choice for building RESTful services.

learn more… | top users | synonyms

8
votes
0answers
267 views

OData using $expand breaks cast operation due to wrapper

I'm experiencing the same problem as addressed here: However, the answer is not sufficient for me. First of all I cannot for the life of me find HierarchyNodeExpressionVisitor in OData 5.0.0 (not ...
7
votes
0answers
585 views

MultipartFormDataStreamProvider vs HttpContext.Current

I am struggling to understand why would I want to use MultipartFormDataStreamProvider when I can get all the information using HttpContext.Current. It is much easier to do this: var mydata = ...
6
votes
0answers
501 views

Generating version specific help documentation pages for ASP.NET Web API application

I am using the WebAPI Versioning package to version my API by the X-Api-Header by using the "VersionHeaderVersionedControllerSelector". I am also using the Microsoft.AspNet.WebApi.HelpPage to ...
4
votes
0answers
98 views

Working with Secure implementation of web api

I am new to Web-Api, Cloud etc. I have some requirements with my project but as lots of resources are available over internet, I am not able to decide which way should i go. Requirements: The user ...
4
votes
0answers
683 views

ASP.NET Identity using WebApi & External Login

Once again I am stuck! I am trying to implement a secure WebApi service with ASP.NET Identity using Individual Account. The WebApi service will be consumed by a mobile app developed with phonegap. My ...
4
votes
0answers
144 views

Getting InRequestScope working with Ninject and WebApi

I've got an MVC4/WebApi project that I'm trying to wire up with Ninject 3. I would like to share a particular object across a number of entities within request scope, however I understand that I need ...
4
votes
0answers
3k views

Any benefit in using ServiceStack over ASP.NET WebAPI

I'm planning a web API which will be used by browsers/JavaScript and Android App (open to other potential clients too). While I read there are many benefits in using ServiceStack vs WCF, I'm not sure ...
4
votes
0answers
2k views

WebAPI ODATA without Entity Framework

Consider the following method in a Web Api controller: [Queryable(AllowedQueryOptions= AllowedQueryOptions.All)] public override IQueryable<Mandate> Get() { return new ...
3
votes
0answers
318 views

Abstract Generic ODataController Class Leads To 'No HTTP resource was found'

I am trying to abstract the auto-generated ODataController class in VS 2013 because the code looks identical across different controllers except the name of the POCO, so, I did the following: public ...
3
votes
0answers
162 views

How to specify the shape of results with WebApi2, OData with $expand

I have a problem executing my AutoMapper mappings when using OData with specific $select or $expand values. Using the WebApi Action: public IQueryable<BookInRequestDto> ...
3
votes
0answers
413 views

Web API OAuthAuthorizationServer using Authorization Code flow

I am working on Asp.net MVC5 app and a Web APi2 ,The API is to be used across multiple sites and to be used to authenticate the user as well. I have created the MVC5 and Web API project in VS ...
3
votes
0answers
153 views

ASP.NET OData - Implementing PATCH with Delta<T> with Data Transfer Objects

In my OData controller I'm converting my EF entities to a DTO because the entity contains many fields which just aren't used by the UI. This question and answer (ASP.NET WebApi OData support for ...
3
votes
0answers
297 views

SwaggerUI not working with API versioning

I'm trying to use SwaggerUI, but I'm having some problems. When I call http://mysite.com/api/swagger I get this: { "apiVersion":"4.0.0.0", "swaggerVersion":"2.0", ...
3
votes
0answers
132 views

Patterns for handling scheduled/unscheduled downtime using ServiceStack and WebApi

Now that we have webservices running, we need to make changes to db, servers etc. so .. wondering if there are any patterns for handling planned and unplanned downtime using ServiceStack and also ...
3
votes
0answers
728 views

ASP.NET Web API StreamContent vs IIS Static File handler

I'm putting together a document-management service using ASP.NET Web API, and performance is of some concern. Based on this article by Nathanael Jones, author of the IIS / ASP.NET ImageResizer ...
3
votes
0answers
623 views

WebApi optional parameter - is required?

I have a web api controller (TasksController) with a get method like : public IEnumerable<TimeUnitModel> Get(DateTime startDate, DateTime endDate, string projectCode = "") If I call ...
3
votes
0answers
530 views

Required to install asp.net (“Application Server”) when deploying WebApi to server 2012?

I'm new to WebAPI in .Net 4.5. Probably my question is an FAQ, but I couldn't find how to solve it: Do I need to add the application server role in addition to IIS to have an IIS hosted WebApi ...
3
votes
0answers
210 views

Error when disposing a IActivationBlock and importing IKernel

The problem started when I was trying to use the solution below to use Ninject 3 with a MVC 4 RC Web Api project: http://www.peterprovost.org/blog/2012/06/19/adding-ninject-to-web-api/ This solution ...
3
votes
0answers
743 views

Entity Framework Composite Foreign Key and Navigational Property not being populated in entity during an Include

There are two entities pointing to a legacy database, the main entity should take in the secondary entity using an Include and eager load the data. Unfortunately, the entity comes up null even though ...
2
votes
0answers
58 views
+100

OWIN Self-Host CookieAuthentication & Legacy .NET 4.0 Application / FormsAuthenticationTicket

I have two bounded contexts: ASP.NET 4.0 MVC/WebForms Application OWIN Self-Hosted w/ ASP.NET Web API 2 The former is an existing well-established product, however, its lack of architecture ...
2
votes
0answers
56 views

Injected IPrincipal is anonymous but Web API Controller User object is authenticated

I'm writing a Web API 2/MVC5 project and I wanted to unit test some code that had to work with an IPrincipal using ASP.Net Identity. Instead of relying on IPrincipal I wanted to abstract that behind ...
2
votes
0answers
19 views

High-level overview of how can I use my own schema and DAL/ORM (not EF) in conjunction with the default Web API 2 ApplicationOAuthProvider

I am rewriting a web service that is already backed by a relatively large database with existing "membership" tables. The reason I put "membership" in quotes is because the database is an Oracle ...
2
votes
0answers
122 views

AngularJS + ASP.NET Web API + ASP.NET MVC Authentication

I am new to AngularJS and trying to evaluate it for my new web application. Requirement: I will have one ASP.NET Web API which will be consumed from an Android, an iPhone and from a web application ...
2
votes
0answers
22 views

Web-Api v2 Individual User Authentication - customization and within web farm

I am trying to use the new authentication system and I cannot find any decent articles/documentation to get what i want. Plenty of stuff out there explaining how the authentication process works out ...
2
votes
0answers
42 views

How do I retrieve body values from an HTTP POST request in an ASP.NET Web API ValueProvider?

I want to send a HTTP POST request with the body containing information that makes up a simple blog post, nothing fancy. I've read here that when you want to bind a complex type (i.e. a type that is ...
2
votes
0answers
25 views

Can Our Own “Frontend Web Application” & “Third Party Custom Applications” be authenticated against RESTful backend?

I'm currently developing restful backend and implementing the authentication, i want my both frontend(web interface) and api(third party applications) to use same backend. As i have same set of ...
2
votes
0answers
34 views

Update published self-hosted WebApi

I've created an WebApi service, which runs self-hosted on hardly accessible computer. It also is unavailable for remote desktop connection. So main problem is - how to update the api? Is there any ...
2
votes
0answers
71 views

Phonegap and asp.net webapi user authentication

Im currently busy with a asp.net webapi project with a phonegap client, having issues getting started with how the user will be authenticated using javascript in my phonegap project? I already have ...
2
votes
0answers
142 views

Using ASP.NET WebAPI v2, how do I POST PDF data in a WebAPI method?

The idea is that there will be an external entity (SharePoint) that will call my WebAPI and pass in a PDF file as well as some extra, metadata information about that PDF file. I'm stuck on how to ...
2
votes
0answers
157 views

Authenticating ASP.NET Web API with OAuth 2 - Best type of Authorization Grant to use?

I'm trying to build the following: Website with local user accounts (using ASP.NET MVC) API to expose data to mobile apps (using ASP.NET Web API) Mobile app(s) (initially Android, connecting via ...
2
votes
0answers
96 views

Using ninject dependecyResolver for both MVC and WebAPI

I have created and MVC 4 web application and decided to use web api in this app. I'm using ninject dependency resolver for MVC web app. and now I want to use this ninject dependency resolver for web ...
2
votes
0answers
214 views

call a ASP.net web API restful put method from R and pass in a custom object

I am trying to invoke a C# restful service's PUT method. The signature is as below: public HttpResponseMessage PutAccount(string custID, Account acc) { } I am calling this method from in R using ...
2
votes
0answers
301 views

asp.net-web-api self hosted gets statuscode=405 (method not allowed) for POST but it is OK for GET

Asp.net-web-api self hosted gets statuscode = 405 (method not allowed) for POST but it is OK for GET. The result is the same with Fiddler or using a .NET Http client. I tried several different option ...
2
votes
0answers
163 views

Parameter binding With Nested Objects in ASP.NET Web API

I have following model classes in my project: public class RiskInfo { /// <summary> /// Gets or sets the risk id. /// </summary> public string RiskId { get; set; } ...
2
votes
0answers
93 views

asp.net MVC 4 webapi authentication for IOS

I need to implement authentication in my webapi. Is any one know how to do that like link to the code that is authenticating asp.net mvc4 web api for IOS . Kindly provide me the link or data so that ...
2
votes
0answers
65 views

Create Delegate throws a binding error due to signature or security transparency

I am using C#4.0 and .NET 4.5. I have this class which is the point of entry in the current context: public static class HttpConfigurationImporter { public static readonly ...
2
votes
0answers
380 views

Subclassing IdentityUser ASP.NET

I have a Web API and I want my AutoHubUser to be used instead of the default one (IdentityUser). But I keep getting internal server error when I try to save it. What needs to be changed? public class ...
2
votes
0answers
64 views

Setting CLRConfig file per app pool in IIS 7.5

I am using HttpClient from an ASP.NET app to invoke a WebAPI based REST service. Both the REST service and the ASP.NET app are secured using Windows authentication using Kerberos. I need to ...
2
votes
0answers
99 views

Best practice to pass a very long string trough WebAPI to another WebAPI Service

im fairly new to ASP.Net programming. I have the following question. I have two WebAPI Projects on two different servers. One API collects some data from different XML files. The other API has the ...
2
votes
0answers
219 views

cannot create new user in web-api 2

I'm trying to create a new user when receiving a POST request to api/accounts/ in my asp.net web-api 2 project. Attempt 1: Create Identity User I've tried exactly as it was shown in the project ...
2
votes
0answers
985 views

Web API 2 routing attributes work in one controller but not another

Using .NET 4.5.1, Web API 2, Visual Studio 2013: I have a Web API which has the following routes... /api/providers/specialties /api/providers/specialties/123 /api/providers/specialties/medicine ...
2
votes
0answers
280 views

The static container already has a kernel associated with it! when deployed to a virtual application

I am trying to get ninject to work in a production environment. My solution consists of the following projects Data Model WebApi2 MVC5 Everything is getting deployed as webrole to azure. My api ...
2
votes
0answers
326 views

WebApi Not Working When Deployed to Azure Website

My WebApi works perfectly on my local machine, but when published to Azure (azure website) I get the following: No HTTP resource was found that matches the request URI ...
2
votes
0answers
104 views

WebApi doesn't get published?

I currently have two controllers. One is MVC and the other is a WebApi controller. I've published these two with ease on the IIS server with the following settings: WebApiConfig: ...
2
votes
0answers
270 views

ASP.NET Web API Facebook authentication

I'm developing a system which consists of a few components: RESTful services - public API that has to be accessible from mobile devices. (ASP.NET Web API) ASP.NET MVC 4 Web site, that also uses the ...
2
votes
0answers
569 views

Web API, model binding, [FromUri], and WebApiExplorer not playing well together

I have a fairly simple web api project and have the following method in a CustomerController: public class CustomerController : ApiController { [HttpGet] public UpdatePasswordResult ...
2
votes
0answers
275 views

ASP.NET WebApi authentication with AngularJS

I need to restrict my WebApi service to only logged in users. The clients that will be hitting the service will be mobile so I am using CORS. I am looking for the simplest way to implement ...
2
votes
0answers
898 views

“The type IUnitOfWork does not have an accessible constructor” with Umbraco 6.1, UmbracoApiController (Web API) & Dependency Injection (Unity)

I am using Umbraco 6.1 with an UmbracoApiController which has a IUnitOfWork injected into it's constructor. To inject the dependencies, I am using Unity, like I have in the past with standard Web API ...
2
votes
0answers
528 views

EF Code First, Web API, Json serialization Many to Many

Having som major problem with many to many relation. public class Team { public Team() { Users = new HashSet<User>(); } public int Id { get; set; } public string ...
2
votes
0answers
110 views

ASP.NET Web API: How to use multiple HttpClientCredentialTypes for authentication in selfhosted szenario

I have a selfhosted ASP.NET Web API server (HttpSelfHostServer) running under .NET 4.0. In the HttpSelfHostConfiguration I can set one ClientCredentialType, for example to ...