Developing a Knockout MVC application

In this section, we will take the HomeLibrary application from the previous chapter and update it with Knockout MVC. We will discuss how this approach can help us simplify an ASP.NET application and allow us to get rid of the client JavaScript code.

Adding the model

We will update the model from the HomeLibrary2 project, as seen in Chapter 3, Integrating Knockout.js in ASP.NET MVC Applications. The BookModel class will "be equal to the version from the old project:

namespace HomeLibrary3.Models
{
  public class BookModel
  {
    public int Id { get; set; }
    public string Title { get; set; }
    public string Author { get; set; }
    public int Year { get; set; }
  }
}

The LibraryModel will be a little easier than its previous version: ...

Get Getting Started with Knockout.js for .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.