Lesson 35. Capstone 6
Before you leave the world of data, let’s apply some of what you learned in this unit to the Bank Accounts solution you’ve been working on. In this lesson, you’ll plug in a SQL Database layer to the application instead of the file-based repository that you’ve been using until now.
This capstone is an exercise in hooking in a different data source to an existing code base, but it also explores challenges you might face with configuration and state in modules, particularly from an interoperability perspective—working with type providers in multilanguage solutions. You’ll then work on performing SQL queries and commands, configuration, and finally making a pluggable repository layer.
src/code-listings/lesson-35 has both a starting and a completed solution; there are three projects: the two from the previous (slightly modified) capstone, plus a new SQL database project. You’ll be deploying this locally before connecting the application to it. I’ve also added a binding redirect to the WPF application’s app.config file to ensure that you always look for F# 4’s FSharp.Core (4.4.0.0) rather than the F# 3.0 version (4.3.0.0).