I'm happy to say that my book entitled Building Web, Cloud, and Mobile Solutions with F# is now available in both print and electronic formats. The description of the book is provided below and you can find the book examples on my GitHub.
Learn how to build key aspects of web, cloud, and mobile solutions by combining F# with various .NET and open source technologies. With helpful examples, this hands-on book shows you how to tackle concurrency, asynchrony, and other server-side challenges. You’ll quickly learn how to be productive with F#, whether you want to integrate the language into your existing web application or use it to create the next Twitter.
If you’re a mid- to senior-level .NET programmer, you’ll discover how this expressive functional-first language helps you write robust, maintainable, and reusable solutions that scale easily and target multiple devices.
Use F# with ASP.NET MVC, ASP.NET Web API, WCF, Windows Azure, HTML5, CSS3, jQuery Mobile, and other tools
Build next-generation ASP.NET MVC 4 web applications, using F# to do the heavy lifting on the server
Create WCF SOAP and HTTP web services
Develop F# web applications and services that run on Windows Azure
Build scalable solutions that allow reuse by mobile and web front-ends
Use F# with the WebSharper and Pit frameworks to build end-to-end web stacks
There is a new version of each of the available F# PowerPack NuGet packages. These packages include the original F# PowerPack functionality recompiled for F# 3.0, .NET 4.x, and Silverlight 5 that were provided today on the F# PowerPack CodePlex site.
In order to use these updated NuGet packages in a .NET 4.x project, you will need to be using F# 3.0. If that is not an option for you, the previous version of each package can be installing using any of the following commands:
In my last post, I showed an example of an ASP.NET MVC 4 application built in MonoDevelop. Since that time, an ASP.NET MVC 4 project template has been created for MonoDevelop that makes it very easy to create a similar app.
Here are the steps for using this template:
1. To get started, install version 3.0.2+ of Mono, the latest version of MonoDevelop, and the F# Language Binding (through the MonoDevelop Add-in Manager). If you've already installed each of these, make sure that the F# Language Binding version is 3.2.8+.
2. Create a new solution (File | New | Solution) and select F# | ASP.NET | F# ASP.NET MVC 4 (Razor) as shown here:
3. Add the desired solution name, click OK, and your done.
Well that was easy, but where do you go from here? Let's walk through a simple example of creating an app for keeping track of contacts. The end result will be similar to the screenshot shown in my post entitled A Single Page App with Backbone.js, ASP.NET Web API, and F#.
1. I've already followed the previous steps to create an ASP.NET MVC 4 application in MonoDevelop called MyContacts. To quickly add a decent look to the app, I'll use the responsive front-end framework from ZURB called Foundation. All that I really need is the CSS, so I add the foundation.min.css file to the Content folder in the project. I also add an app.css file for any custom styles that are needed. The content of the app.css file is shown below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2. I can now reference these CSS files in _Layout.cshtml. The modified file looks like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3. Now I modify the Index.cshtml file in the Home folder so that it will display the list of contacts. The result is shown below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4. Lastly we make a few modifications to the HomeController. Here's the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters