37,950 questions
5
votes
1
answer
4k
views
Implementing .NET OAuth 2.0 Provider. 2 Legged DotNotOpenAuth samples?
I need a bit of help implementing an OAuth 2 provider for a rest service built on the new ASP.NET Web API. I'm aware there are some similar questions on Stack Overflow but they're more or less links ...
2
votes
1
answer
2k
views
Appropriate Structure for Task.Factory.ContinueWhenAll call
I want to make sure that I am using ContinueWhenAll appropriately. I have a number of calls which will run asynch and then I want to complete to a final task only after the other tasks have completed ...
6
votes
1
answer
5k
views
ASP.NET Web Api in Web forms
i´m trying to use the asp.net web api in WEB FORMS with visual studio 2010 (sp1)
i have done this steps http://myrandomykien.blogspot.com/2012/02/simplest-web-api-site-with-nuget.html
When i use the ...
84
votes
11
answers
100k
views
Cannot Inject Dependencies into ASP.NET Web API Controller using Unity
Has anyone had any success running using an IoC container to inject dependencies into ASP.NET WebAPI controllers? I cannot seem to get it to work.
This is what I'm doing now.
In my global.ascx.cs:
...
2
votes
2
answers
3k
views
In the new ASP.NET Web API, how do I design for "Batch" requests?
I'm creating a web API based on the new ASP.NET Web API. I'm trying to understand the best way to handle people submitting multiple data-sets at the same time. If they have 100,000 requests it would ...
1
vote
2
answers
1k
views
UriPathExtensionMapping in MVC 4
How do I use UriPathExtensionMapping in MVC4? I've added the mapping in the formatter such that:
MediaTypeMappings.Add(new UriPathExtensionMapping("json", new MediaTypeHeaderValue("application/json")...
6
votes
1
answer
3k
views
OData select query not working in ASP.NET WebAPI beta
I'm playing around with the WebAPI beta, and it seems that selects have no effect on the response of an action returning an IQueryable.
Eg:
http://localhost:62689/api/product?$select=Id,Name
...
24
votes
6
answers
11k
views
WCF Service or Web API [closed]
I'm going to be working on a project that involves a number of elements:
ASP.NET MVC website
C# console application
iPhone App
To get all these separate applications talking to the database, my ...
2
votes
1
answer
2k
views
ASP.NET Web API Ninject constructor injected custom filter and attributes
I'm struggling with getting a custom attribute / filter working with ninject, constructor injection on the ASP.NET Web API.
Here's a few snippets to give some context...
//controller
[ApiAuthorise]
...
202
votes
20
answers
337k
views
Single controller with multiple GET methods in ASP.NET Web API
In Web API I had a class of similar structure:
public class SomeController : ApiController
{
[WebGet(UriTemplate = "{itemSource}/Items")]
public SomeValue GetItems(CustomParam parameter) { ......
410
votes
9
answers
325k
views
Difference between ApiController and Controller in ASP.NET MVC
I've been playing around with ASP.NET MVC 4 beta and I see two types of controllers now: ApiController and Controller.
I'm little confused at what situations I can choose a particular controller.
...
1
vote
2
answers
3k
views
Web API, API Controller and how to update a model?
I'm trying out the API controller in MVC 4 and have a question about best practice when using put, updating an object.
I'm using RavenDB as data storage and I have created a custom MediaTypeFormatter ...
3
votes
5
answers
11k
views
Can Web API convert XML into Json?
I've got a legacy web service which I'd like to wrap with a new MVC Web API, question is can I get the ASP.NET Web API to convert my xml into json?
A thought that I had was to use XDocument to create ...
14
votes
2
answers
22k
views
Custom MVC AuthorizeAttribute for ASP.NET Web API
I am trying to implement a custom authorization attribute on my Web API controllers, but came across an unexpected behavior.
<Authorize(Users:="myUser")>
Public Function GetTodoItems()...
8
votes
2
answers
6k
views
What is the difference between Asp.Net Web API and WCF Service?
Since last few months this Asp.Net Web API seems to be an highlighted product from Microsoft. Is it an alternative to WS* Service. How is it different than WCF Service? And where can we see it as a ...
40
votes
7
answers
35k
views
What's the difference between WCF Web API and ASP.NET Web API
I've done a bit of work in the past using WCF WebAPI and really liked a lot of its features, I'm just playing with ASP.NET Web API at the moment and it seems completely different (IE completely ...
93
votes
17
answers
177k
views
Could not load file or assembly 'System.Net.Http, Version=2.0.0.0 in MVC4 Web API
I have a bit of a weird problem.
I developed an app with MVC 4 and the new Web API and it works fine locally.
I installed MVC4 on the server and deployed the app. Now I get the following error:
Could ...
5
votes
1
answer
6k
views
When to use the MVC4 Web-API vs a traditional HTTP web-service?
I noticed when the MVC4 beta was announced, it includes a new "Web-API".
(MVC 4 announcement)
In what circumstances should I use this Web-API instead of a normal HTTP/WCF Web-service?
What problem is ...
3
votes
3
answers
8k
views
ASP.NET Web API controller can't handle dynamic objects?
In my code I have a base class Foo and all my objects inherits from the Foo object.
So let's say I have a class like this
public class Bar : Foo {
public string Heading { get;set; }
}
I have ...
1
vote
1
answer
2k
views
ASP.NET MVC 4 ApiController doesn't serialize all properties
I'm testing the new ApiController in asp.net mvc 4 beta but when I try to return an class that looks like the following only a few properties gets serialized?
public class PageModel : IPageModel {
...
14
votes
4
answers
26k
views
Posting DateTime to a ApiController in ASP MVC 4 (Beta)
When I post a json object with a date property to a ApiController it won't deserialize into a date.
Server site code:
public class MegaTestController : ApiController
{
// POST /megatest
...
12
votes
1
answer
3k
views
ASP.NET Web Api Routing (IIS vs Self Hosted)
I have found a minor difference in the routing base classes in ASP.NET Web Api which has forced me to write a little helper class which will allow me to define my routes just once. Is there a reason ...
9
votes
1
answer
6k
views
ASP.NET Web Api and UrlDecode
Is this a bug in the framework?
I have to use HttpUtility.UrlDecode here. I thought things were automatically decoded in MVC.
public Thingy[] Get(string id)
{
var actualId = ...
33
votes
5
answers
16k
views
How do I set the default namespaces in MapHttpRoute?
With the standard MapRoute method a can pass a string collection representing the namespaces in which to search for my controller. This seems to have disappeared from MapHttpRoute. How does one define ...
2
votes
1
answer
575
views
Start developing with MVC4 Web Api today, using Beta?
I am struggeling...
Is it safe to start developing with MVC4 Web Api (BETA) in a project that will be released live 2012 Q2.
I have heard that final version of MVC4 will be released 2012 Q3.
Since I ...