F# and ASP.NET Web API
Join the DZone community and get the full member experience.Join For Free
One of the sweet spots for F# is in the services layer and this makes ASP.NET Web API + F# great friends. To make it easy to get started with F# and ASP.NET Web API, I've added an ASP.NET Web API template to the already existing F#/C# ASP.NET MVC 4 Visual Studio extension. Note: The template requires that ASP.NET MVC 4 Beta is installed.
To install the template, do the following:
1. Launch the project creation wizard (Ctrl+Shift+N), select Online in the left hand nav, search for "fsharp mvc4", and click OK. In VS11 Beta, it looks something like the following. Note: It may take a few seconds to download.
2. After clicking OK and installing the extension, you will see a dialog that allows the creation of a new ASP.NET Web API solution with an F# project that contains the server-side code.
3. Once the project has been created, you can run it however you desire and hit the service via http://localhost:###/api/values.
Published at DZone with permission of Daniel Mohl, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.