Once you install all of MVC 4 Beta you can simply go to any web project (Web Application or Web Site), right-click, and add a Web API controller. This will automatically add all the right references to your project. Then you just need to register a route
for your API and you're good to go.
Thanks a lot, now i wonder in asp.net web api you no longer need a wcf service in place, so is it the end of WCF?
WCF web api was working fine with webGet, WebInvoke, UriTemplate, so why this is shifted to asp.net web api to bring the controller style ?
Now tell if i want to expose my WCF api in a rest full way over http how can i do this? will i use wcf web api style means webGet /Invoke/ UriTemplate ?
What if you have both a LARGE web application and a large api, I would like to split them in different projects/assemblies. What is the best way to do this?
neon2
Member
44 Points
48 Posts
Web Api in Asp.net Web App
Feb 21, 2012 09:01 AM|LINK
Hello,
Asp.net web api is with MVC4, ok but how can i used it in my webApp bulid with asp.net web forms?
Thanks.
maggie.ying
Member
183 Points
39 Posts
Microsoft
Re: Web Api in Asp.net Web App
Feb 21, 2012 03:48 PM|LINK
You'll need to create a separate project for the web api service.
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Web Api in Asp.net Web App
Feb 21, 2012 03:52 PM|LINK
Once you install all of MVC 4 Beta you can simply go to any web project (Web Application or Web Site), right-click, and add a Web API controller. This will automatically add all the right references to your project. Then you just need to register a route for your API and you're good to go.
ASP.NET Team
@marcind
Blog
neon2
Member
44 Points
48 Posts
Re: Web Api in Asp.net Web App
Feb 22, 2012 04:24 AM|LINK
thanks for the reply, working on this, hope it will be fine.
neon2
Member
44 Points
48 Posts
Re: Web Api in Asp.net Web App
Feb 22, 2012 05:26 AM|LINK
Thanks and u are very right abt it.
Thanks a lot, now i wonder in asp.net web api you no longer need a wcf service in place, so is it the end of WCF?
WCF web api was working fine with webGet, WebInvoke, UriTemplate, so why this is shifted to asp.net web api to bring the controller style ?
Now tell if i want to expose my WCF api in a rest full way over http how can i do this? will i use wcf web api style means webGet /Invoke/ UriTemplate ?
Thanks in advance.
racielrod
Member
2 Points
10 Posts
Re: Web Api in Asp.net Web App
May 05, 2012 12:30 AM|LINK
What if you have both a LARGE web application and a large api, I would like to split them in different projects/assemblies. What is the best way to do this?