WCF Data Services requires something like a DataContext. Web API doesn't.
Web API is a way to add a pure http API to your application. It can be hosted in MVC, webforms, in a console app etc.
It's much simpler to implement an http API with Web API (very similar to MVC controllers with routing being similar).
If you expose an IQueryable, you get basic ODATA support (like filtering, ordering etc.)
Going forward, if you're looking to implement an http API (specially a REST one) Web API will help. If you're looking for EF context + Data Services magic, then Data Services may be what you need.
"If I can see further than anyone else, it is only because I am standing on the shoulders of giants."blog: www.heartysoft.com twitter: @ashic
Marked as answer by maggie.ying on Feb 25, 2012 01:22 AM
colmac73
Member
4 Points
3 Posts
ASP.NET Web API vs WCF Data Services?
Feb 17, 2012 08:39 AM|LINK
Hi,
Where does this leave the WCF Data Services framework? Should the ASP.NET Web API be used going forward?
The WCF Data Services framework supports later versions and features of the ODATA protocol, are there any plans to do this in the Web API?
Thanks,
Colin
HeartattacK
All-Star
55262 Points
5917 Posts
Moderator
MVP
Re: ASP.NET Web API vs WCF Data Services?
Feb 17, 2012 08:53 AM|LINK
WCF Data Services requires something like a DataContext. Web API doesn't.
Web API is a way to add a pure http API to your application. It can be hosted in MVC, webforms, in a console app etc.
It's much simpler to implement an http API with Web API (very similar to MVC controllers with routing being similar).
If you expose an IQueryable, you get basic ODATA support (like filtering, ordering etc.)
Going forward, if you're looking to implement an http API (specially a REST one) Web API will help. If you're looking for EF context + Data Services magic, then Data Services may be what you need.
blog: www.heartysoft.com
twitter: @ashic