FPish.net - Blog entries tagged 'asp.net'Blog entries shared on FPish.net by our members and tagged 'asp.net'.uuid:8ae26da4-5e5b-4e54-bf92-26d8d97ca094;id=4842018-02-18T07:00:37Ztag:blogger.com,1999:blog-1033232967128707730.post-7500532952611846715Save array of string EntityFramework Core2017-12-22T12:54:00Z2018-02-18T07:00:37ZSave array of string EntityFramework Core
EntityFramework is a ORM where R stands for Relational (database). Relational databases operate with tables, rows and columns. If we have an object containing an array of objects, by default, it would translate to two tables and a JOIN between the two tables. This behaviour is great if our initial model has links to other objects but not so great when thetag:blogger.com,1999:blog-1033232967128707730.post-1094922498688686556Microsoft Orleans logs warnings and errors2017-12-15T01:29:00Z2018-02-18T07:00:37ZMicrosoft Orleans logs warnings and errors
Microsoft Orleans is a framework which helps building distributed system by implementing the actor model together with the concept of virtual actors, taking care of availability and concurrency. If you are unfamiliar with Microsoft Orleans, you can look at my previous blog post explaining the benefits of Microsoft Orleans. Even though Orleans promises totag:blogger.com,1999:blog-1033232967128707730.post-9085372222998847301Validation in ASP NET Core and Angular2017-11-24T01:06:00Z2018-02-18T07:00:37ZValidation in ASP NET Core and Angular
Validation is an important part of any application. There are two parts where validation is required, the API level and the frontend. The API validation is meant to prevent any malformed input to corrupt our data while the frontend validation is meant to guide the user to fill in a form by providing interactive feedback on her input. ASP NET Core for the tag:blogger.com,1999:blog-1033232967128707730.post-8656943412410943510Implement PATCH on ASP NET Core with JSON Patch2017-11-16T13:18:00Z2018-02-18T07:00:37ZImplement PATCH on ASP NET Core with JSON Patch
When building web APIs, most of the HTTP methods are implemented, GET, POST, PUT, PATCH and DELETE. While GET, POST and PUT are easily implemented, PATCH functionality is slightly different as it allows to change one or more properties of the resource. It is used to patch the resource. One way to do it is to use a protocol called JSON Patch. Today http://cyanbyfuchsia.wordpress.com/?p=938Make IIS Express works with http://127.0.0.12014-07-30T01:58:00Z2018-02-18T07:00:37ZI never notice that IIS Express doesn’t listen to web requests other than localhost. So, to my surprise, when I try http://127.0.0.1, I got HTTP 400, Bad Request instead. &#160; &#160; Change 127.0.0.1 to localhost and everything is fine. &#160; Anyway, you can set your IIS Express to let it listen to a request for &#8230; <a href="http://cyanbyfuchsia.wordpress.com/2014/07/29/make-iis-express-works-with-http127-0-0-1/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://pixel.wp.com/b.gif?host=cyanbyfuchsia.wordpress.com&#038;blog=32389157&#038;post=938&#038;subd=cyanbyfuchsia&#038;ref=&#038;feed=1" width="1" height="1" />https://cyanbyfuchsia.wordpress.com/?p=660Create and Run ASP.NET MVC project with Durandal Starter Kit on Visual Studio 20132013-12-30T00:04:00Z2018-02-18T07:00:37ZIf you&#8217;d like to support the Durandal project, please back their Kickstarter project With Visual Studio 2013 One ASP.NET Web Project, I couldn&#8217;t find a way to choose Durandal SPA Template directly even after I install the VSIX file. The easiest way is to create an empty MVC project and install the entire starter kit &#8230; <a href="http://cyanbyfuchsia.wordpress.com/2013/12/29/create-and-run-durandal-starter-kit-on-visual-studio-2013/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cyanbyfuchsia.wordpress.com&#038;blog=32389157&#038;post=660&#038;subd=cyanbyfuchsia&#038;ref=&#038;feed=1" width="1" height="1" />91d46819-8472-40ad-a661-2c78acb4018c:10481507New Visual F# Templates for ASP.NET, Web API, MSTest and Nancy Now Available2013-12-12T12:52:00Z2018-02-18T07:00:37Z<p><span style="font-size: medium;">&nbsp;The F# community and the Visual F# team have been working together to bring new community-authored templates for Visual F# into the Visual Studio Gallery.</span></p>
<p><span style="font-size: medium;">One step in this has been to create <a href="https://github.com/fsharp/FSharpCommunityTemplates/">a central GitHub repository for F# community templates</a>, where you can contribute new templates and improve the existing ones. In this way you can make sure your templates get maintained over time and become available for use with new versions of Visual Studio as soon as possible. Contributing your templates to this repository also helps keep consistent naming and style, making them easier for people to use.</span></p>
<p><span style="font-size: medium;">Dan Mohl has don an excellent job writing up these templates, here are the articles:</span></p>
<ul>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/12/a-new-f-aspnet-mvc-5-and-web-api-2.html">A New F# ASP.NET MVC 5 and Web API 2 Project Template</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/12/a-few-other-template-additions-and.html">Nancy Templates for F#</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/12/a-few-other-template-additions-and.html">MSTest Project Template for F#</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/12/a-few-other-template-additions-and.html">FSharpTest Template for F#</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/12/new-f-web-app-item-templates.html">New F# Web App Item Templates</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/11/adding-new-items-to-pure-f-aspnet.html">Adding New Items to a Pure F# ASP.NET MVC/Web API Project</a></span></li>
<li><span style="font-size: medium;"><a href="http://bloggemdano.blogspot.com/2013/11/a-few-changes-to-fc-mvc-4-project.html">A Few Changes to the F#/C# MVC 4 Project Template</a> </span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-size: medium;">Kevin Ransom and Don Syme</span></p>
<p><span style="font-size: medium;"></span></p>
<p>&nbsp;</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10481507" width="1" height="1">91d46819-8472-40ad-a661-2c78acb4018c:10421743Using F# and Entity Framework with an Azure Database (Windows Azure Training in F#, Part Three)2013-05-28T12:39:00Z2018-02-18T07:00:37Z<p>The indefatigable <a href="http://sireel-world.azurewebsites.net/">Sir Eel</a> has published a series on the The Windows Azure Training Kit in F#. Part&nbsp;3 covers <a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt3">Using Entity Framework with an Azure Database</a>.</p>
<p><span style="color: #888888;"><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt1"><span style="color: #888888;">Part 1 - WATK in F#, Part 1: Building and Publishing Windows Azure Web Sites</span></a></span></p>
<p><span style="color: #888888;"><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt2"><span style="color: #888888;">Part 2 - WATK in F#, Part 2: Deploying an Azure Web Site with Git</span></a></span></p>
<p><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt3">Part 3 - WATK in F#, Part 3: Using Entity Framework with an Azure Database</a></p>
<p style="padding-left: 30px;"><em>In <a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt1">Part 1</a> and <a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt2">Part 2</a> we skipped the database part of the HOL to concentrate on web deployment. Now it's time to complete the lab by hooking up SQL Azure with Entity Framework. The main difference in doing this with F# is that we'll need to write our own EF code, as the Visual Studio Controller Wizard doesn't know how to do it for us in F#. But our <a href="http://visualstudiogallery.msdn.microsoft.com/3d2bf938-fc9e-403c-90b3-8de27dc23095">project template</a> has built in EF support, and F#'s concise syntax reduces what we need to write.</em></p>
<p>&nbsp;&nbsp;</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10421743" width="1" height="1">91d46819-8472-40ad-a661-2c78acb4018c:10421741Building and Publishing Web Sites containing F# Code (Windows Azure Training in F#, Part One)2013-05-28T12:30:00Z2018-02-18T07:00:37Z<p>The indefatigable <a href="http://sireel-world.azurewebsites.net/">Sir Eel</a> has published a series on the The Windows Azure Training Kit in F#. Part&nbsp;1 covers building and publishing Window Azure web sites which contain F# code.</p>
<p><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt1">Part 1 - WATK in F#, Part 1: Building and Publishing Windows Azure Web Sites</a></p>
<p style="padding-left: 30px;"><em>Here begins a series of posts showing how I used F# to write some of the Hands-On Labs in the Windows Azure Training Kit (WATK). WATK is a good way to learn the basics of Windows Azure development, but all the labs and samples are in C#. I want to show what it takes to write the HOLs in F# instead.</em></p>
<p><span style="color: #808080;"><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt2"><span style="color: #808080;">Part 2 - WATK in F#, Part 2: Deploying an Azure Web Site with Git</span></a></span></p>
<p><span style="color: #888888;"><a href="http://sireel-world.azurewebsites.net/sir-eel-visions/WATK-FS-Pt3"><span style="color: #888888;">Part 3 - WATK in F#, Part 3: Using Entity Framework with an Azure Database</span></a></span></p>
<p>&nbsp;</p>
<p style="padding-left: 30px;">&nbsp;</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10421741" width="1" height="1">http://wizardsofsmart.wordpress.com/?p=366Web API and Dynamic Data Access2013-03-22T03:34:00Z2018-02-18T07:00:37ZIn .NET Rocks episode 855, Jeff Fritz commented on ASP.NET Web API being somewhat confusing in terms of its intended use. I don’t tend to agree, but I thought I would address one point he made in particular: that Web API is perhaps just another form of repository. Web API is much more than a <a class="read-more" href="http://wizardsofsmart.net/post/web-api-and-dynamic-data-access/">[&#8230;]</a>91d46819-8472-40ad-a661-2c78acb4018c:10391051Learn How to Create an Internet Game Using F#, C#, and ASP.NET2013-02-05T01:08:00Z2018-02-18T07:00:37Z<p>We have just released a new MSDN sample and tutorial that shows <a href="http://msdn.microsoft.com/en-us/library/jj865569.aspx">how to use F# and C# in a Windows Azure cloud service</a>. If you are&nbsp;interested in&nbsp;cloud programming with F# or any other language, we encourage you try out the sample!</p>
<p>The sample is a crossword game called WordGrid, which is reminiscent of Scrabble, Words with Friends and similar games. It shows some basic concepts&nbsp;of&nbsp;cloud programming in F#, such as using Windows Azure queues in F#, and using type providers to access a Windows Azure SQL database.&nbsp; It also demonstrates how you might use F# and C# together in an ASP.NET MVC 4 web role.</p>
<p>Get started with an overview and setup instructions <a href="http://msdn.microsoft.com/en-us/library/jj865569.aspx">here</a>, and dive into the code by reviewing the article <a href="http://msdn.microsoft.com/en-us/library/jj906431.aspx">here</a>. You can find the sample code itself on <a href="http://wordgrid.codeplex.com/">CodePlex</a>.</p>
<p>Enjoy!</p>
<p>Gordon and Donna, for the Visual F# Team</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10391051" width="1" height="1">91d46819-8472-40ad-a661-2c78acb4018c:10360551“B-Movie Madness” Sample Now Available2012-10-17T21:17:00Z2018-02-18T07:00:37Z<p>When we released <a href="http://blogs.msdn.com/b/fsharpteam/archive/2012/09/12/announcing-the-release-of-f-tools-for-visual-studio-express-2012-for-web.aspx" target="_blank">F# Tools for Visual Studio Express 2012 for Web</a> last month, we made a short F# launch video available: <a href="http://www.visualstudiolaunch.com/vs2012vle/Theater?sid=1775" target="_blank">F# 3.0 Information Rich Programming</a>. </p> <p>The video featured a sample C#/F# MVC4 ASP.NET app named “B-Movie Madness,” which we’ve now made available as part of the <a href="http://fsharp3sample.codeplex.com/" target="_blank">F# 3.0 Sample Pack</a> on CodePlex.&#160; You can browse the source code online, or download and build locally.&#160; The project can be opened and built using either Visual Studio Express for Web (with F# Tools installed) or a full version of Visual Studio 2012.</p> <p>&#160;</p> <p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71-metablogapi/8424.codeplexbmovie_5F00_3D013B24.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="codeplexbmovie" border="0" alt="codeplexbmovie" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71-metablogapi/4237.codeplexbmovie_5F00_thumb_5F00_2EC2C234.png" width="640" height="440" /></a></p> <p>&#160;</p> <p>README.txt contains important release notes, including required steps for adding NuGet references to various web frameworks, so don’t forget to take a look before building the project.</p> <p>Enjoy!</p> <p>Lincoln Atkinson <br />Visual Studio F# Test Team</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10360551" width="1" height="1">91d46819-8472-40ad-a661-2c78acb4018c:10346084Exploring the Online Templates: Creating a Web API with F# and ASP.NET 2012-09-04T08:10:00Z2018-02-18T07:00:37Z<p>Over on the F# team blog, there's a new article about <a href="http://blogs.msdn.com/b/fsharpteam/archive/2012/09/04/exploring-the-online-templates-creating-a-web-api-with-f-and-asp-net.aspx">Getting Started with Implementing Web APIs using F# and ASP.NET</a></p>
<p style="padding-left: 30px;"><em>F# 3.0 is included as part of Visual Studio 2012 and comes with a gallery of community contributed online templates for F#.</em></p>
<p style="padding-left: 30px;"><em>Time to explore!</em></p>
<p style="padding-left: 30px;"><em>One online template is "F#/C# MVC 4" using <a href="http://www.asp.net/web-api">ASP.NET Web API</a>. </em></p>
<p style="padding-left: 30px;"><em>Let's use this template to create a HTTP REST Web API which responds to requests as follows...</em></p>
<p style="padding-left: 30px;"><em>....</em></p>
<p><em><a href="http://blogs.msdn.com/b/fsharpteam/archive/2012/09/04/exploring-the-online-templates-creating-a-web-api-with-f-and-asp-net.aspx">Full post</a></em></p>
<p style="padding-left: 30px;"><em></em></p>
<p style="padding-left: 30px;"><em></em></p>
<p style="padding-left: 30px;"><em></em></p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10346084" width="1" height="1">91d46819-8472-40ad-a661-2c78acb4018c:10346081Exploring the Online Templates: Creating a Web API with F# and ASP.NET 2012-09-04T08:00:00Z2018-02-18T07:00:37Z<p>F# 3.0 is&nbsp;included as part&nbsp;of Visual Studio 2012 and comes with a gallery of community contributed online templates for F#.</p>
<p>Time to explore!</p>
<p>One online template is "F#/C# MVC 4" using <a href="http://www.asp.net/web-api">ASP.NET Web API</a>. Let's use this template to create a HTTP REST Web API which responds to requests as follows:</p>
<p>&nbsp;&nbsp;&nbsp; GET <a href="http://myhost.com/api/values">http://myhost.com/api/values</a>&nbsp; --&gt; the JSON&nbsp;value&nbsp;&nbsp; &nbsp;["value1","value2"]</p>
<p>&nbsp;&nbsp;&nbsp; GET <a href="http://myhost.com/api/values">http://myhost.com/api/values/5</a>&nbsp; --&gt; the JSON value&nbsp;&nbsp;&nbsp; 5</p>
<p>&nbsp;&nbsp;&nbsp; POST <a href="http://myhost.com/api/values">http://myhost.com/api/values</a>&nbsp; --&gt; does nothing by default, but you can adjust to write to a backend service</p>
<p>&nbsp;&nbsp;&nbsp; PUT <a href="http://myhost.com/api/values">http://myhost.com/api/values/5</a> --&gt; again, does nothing by default, but you can adjust to write to a backend service</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;DELETE <a href="http://myhost.com/api/values">http://myhost.com/api/values/5</a> --&gt; again, does nothing by default, but you can adjust to write to a backend service</p>
<p>To start, create a New Project in Visual Studio 2012 and choose the Online section of the New Project dialog, as shown below.</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2068.pic2.png"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2068.pic2.png" width="166" height="213" /></a></p>
<p>Next, choose the "F# C# MVC 4" template. For me, this is the first template on the list.</p>
<p><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2388.pic3.png" width="387" height="223" /></p>
<p>Give the solution project a name, then create the solution. This will download and install the project template. Accept the MS-PL license conditions, and then choose the "WebAPI" project kind. If desired, include a project for tests.</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/3107.pic4.png"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/3107.pic4.png" width="387" height="236" /></a><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2388.pic3.png"></a></p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2068.pic2.png"></a>&nbsp;Your solution will have three projects:</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/5344.pic5.PNG"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/5344.pic5.PNG" width="228" height="96" /></a></p>
<p>&nbsp;</p>
<p>The first,&nbsp;"...WebApi"&nbsp;is&nbsp;a standard C# Web site project to act as a service API host for your service code (which is written in F#). You can apply all standard C# ASP.NET Web API programming techniques here.</p>
<p>The second, "...WebAppApi" is your F# implementation of your Web API.</p>
<p>The third, "...WebAppTests" contains tests for your Web API.</p>
<p>You can now run your solution&nbsp; by hitting F5, deploying to localhost. This starts the C# Web site project:</p>
<p>&nbsp;</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/4034.pic6.PNG"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/4034.pic6.PNG" /></a></p>
<p>You can now use HTTP requests directly to access the data returned by the Web API. For example, try&nbsp;accessing <a href="http://.../api/values">http://.../api/values</a> directly from your browser</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2768.pic7.PNG"><img style="margin-right: auto; margin-left: auto; display: block;" border="0" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-39-71/2768.pic7.PNG" width="295" height="45" /></a></p>
<p>&nbsp;</p>
<p>This will give a download of either JSON or XML text. If JSON it will contain the data:</p>
<p style="text-align: center;"><span style="font-family: courier new,courier;">["value1","value2"]</span></p>
<p>This data is derived from the F# code for implementing the "ValueController" controller which governs everything returned by <a href="http://.../api/values">http://.../api/values</a> and any subordinate requests such as <a href="http://.../api/values/5">http://.../api/values/5</a>. These permissible HTTP requests form the WebAPI you have implemented.</p>
<p>The F# code that implements the various HTTP actions is in ValueController.fs and is as follows:</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">namespace FsWeb.Controllers</span><br />&nbsp;<br /><span style="font-family: courier new,courier;">open System.Web</span><br /><span style="font-family: courier new,courier;">open System.Web.Mvc</span><br /><span style="font-family: courier new,courier;">open System.Net.Http</span><br /><span style="font-family: courier new,courier;">open System.Web.Http</span><br />&nbsp;<br /><span style="font-family: courier new,courier;">type ValuesController() =</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; inherit ApiController()</span><br />&nbsp;<br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; // GET /api/values</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; member x.Get() = [| "value1"; "value2" |] |&gt; Array.toSeq</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; // GET /api/values/5</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; member x.Get (id:int) = "value"</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; // POST /api/values</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; member x.Post ([&lt;FromBody&gt;] value:string) = ()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; // PUT /api/values/5</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; member x.Put (id:int) ([&lt;FromBody&gt;] value:string) = ()</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; // DELETE /api/values/5</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; member x.Delete (id:int) = ()</span><br />&nbsp;</p>
<p>This F# type has a specific form that is expected by the <a href="http://www.asp.net/web-api">ASP.NET Web API</a>.&nbsp; The mappinng is somewhat obvious: the Get methods implement the HTTP GET actions, the GET method with a parameter implements the api request .../values/5 where an integer parameter is given, and so forth.&nbsp;&nbsp; In the case of Get(), the return values are presented as a sequence (IEnumerable) of strings, which is automatically marshalled to XML or JSON.</p>
<p>This shows how simple it is to get started with an HTTP&nbsp;Web API implementation in F#.&nbsp;&nbsp; The start page for the ASP.NET application you have created gives further links to documentation on the ASP.NET Web API which you can use to get started with writing more detailed controllers.&nbsp; Most the documentation will be in C#, but it is simple to translate the documentation on controllers into F#.</p>
<p>If you're interested in contributing to more samples of using ASP.NET and F# together,&nbsp;the F# MVP&nbsp;<a href="http://wizardsofsmart.net/">Ryan Riley</a> is working on a &nbsp;<a href="http://github.com/panesofglass/WebApiKoans/tree/fsharp">Web API Koans</a> project, and working on porting the ASP.NET MVC4 samples (see <a href="http://aspnetwebstack.codeplex.com">http://aspnetwebstack.codeplex.com</a> and <a href="http://aspnet.codeplex.com">http://aspnet.codeplex.com</a>&nbsp;)<span style="font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-GB; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA;">. </span>One place to discuss things with Ryan is on the email lists of the <a href="http://www.developerfusion.com/article/136179/an-introduction-to-fsharpx/">FSharpx</a> project.</p>
<p>There are endless possibilities for what you can do from here such as</p>
<ul>
<li>Use <a href="http://msdn.microsoft.com/en-us/library/hh297121(v=vs.100).aspx">F# functional programming</a> to control the complexity of information-shovelling, database access&nbsp;and analytical computations in the server-side of your web application</li>
<li>Use <a href="http://msdn.microsoft.com/en-us/magazine/hh394149.aspx">F# asynchronous programming</a> for efficient management of server-side computation</li>
<li>Use&nbsp;<a href="http://msdn.microsoft.com/en-us/library/hh156509.aspx">F# 3.0 type providers</a> and other data-access capabilities to implement data-rich server-side functionality</li>
<li>Use&nbsp;F# 3.0 NuGET integration to access the huge range of NuGET packages that are available&nbsp;(one example: <a href="http://www.mathdotnet.com/">Math.NET</a>&nbsp;for statistics and matrix computations)</li>
<li>Using the F# interoperability with C# to design an ASP.NET&nbsp;website that accompanies your service</li>
<li>Using Javascript, Coffeescript for the client-side of your web application. (Or, for 100% F# fans, use the&nbsp;open source F#-for-HTML5&nbsp;<a href="http://www.websharper.com">WebSharper</a> framework)</li>
<li><a href="http://www.strathweb.com/2012/07/deploy-your-asp-net-web-api-application-to-windows-azure-in-3-minutes/">Deploy the Web API to Azure</a></li>
</ul>
<p>Thanks to <a href="http://bloggemdano.blogspot.ch/">Dan Mohl</a> for this great template.</p>
<p>Enjoy!</p>
<p>The F# Team</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p><div style="clear:both;"></div><img src="http://blogs.msdn.com/aggbug.aspx?PostID=10346081" width="1" height="1">