text: Using Cloud SQL with .NET | .NET | Google Cloud
  Using Cloud SQL with .NET
  This part of the .NET Bookshelf tutorial shows how the sample app stores its persistent data in Cloud SQL.
  At the bottom of the page, click Create. It might take a few minutes to create the instance. When the instance is ready, it appears in the Instances list.
  Download and set up the Cloud SQL Proxy to securely access your Cloud SQL Second Generation instance.
  Set up the Cloud SQL Proxy
  To open the sample app in Visual Studio, in the getting-started-dotnet\aspnet\2-structured-data directory, double-click 2-structured-data.sln .
  Set GoogleCloudSamples:BookStore to mysql.
  Near the bottom of the file, under <connectionStrings>, find the connectionStrings XML sub-element with the attribute name="LocalMySqlServer". Update the connectionString value with the IP address, username, and password of your Cloud SQL instance.
  In the Visual Studio menu, click Build, and then click Build Solution to build the solution.
  Create the tables in the Cloud SQL database that are used to store the books' data for the Bookshelf app. In the Package Manager Console, enter the following command:
  This diagram shows the app's components and how they fit together. The app follows the classic ASP.NET MVC pattern. An IBookStore interface lives between the BooksController and DbBookStore so that you can switch to storing your book data in Cloud Datastore without changing any code.
  The Book class contains information about one book as well as additional fields that are used in later tutorials.
  Entity Framework's DbSet converts LINQ queries and Create, Read, Update, and Delete (CRUD) operations into SQL queries. The ApplicationDbContext keeps a DbSet of books.
  The HTML form is created by using Razor templates. The Razor template specifies that the form includes text input fields for Title, Author, Date Published, and Description.
  The DbBookStore class invokes the ApplicationDbContext to perform queries and CRUD operations for data stored in the Cloud SQL database. The SQL query is created by using an Object-relational mapper (ORM) called Entity Framework. Object-relational mappers let you write data models as simple C# classes, and they generate all the SQL for you.
  DbBookStore's CRUD methods, such as Create, are simple calls to the ApplicationDbContext.
  After books are added, click the Books link to go to the /Books page, which lists all the books currently stored in the Cloud SQL database. The List method does the work of listing all the books by using data retrieved from the database.
  The List method composes a LINQ query that reads books from the book's DbSet. The query gets a little complicated in order to implement paging. The query reads ten books and then stores the Id for the last book in NextPageToken. When you click the More button, the List method unpacks the nextPageToken to get the Id of the last book and then queries for books with larger IDs.