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.
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:
using System.Collections.Generic; namespace HomeLibrary3.Models { public class LibraryModel { public List<BookModel> Books { get; set; } public int NextId { get; set; } public string Name { get; set...