Create a new Internet MVC 4 project, name it [MVC40_Knockout_App], and download knockout,js from NuGet. (or update KO version)
Use EF Power Tool’s Reverse Engineer to import the Company database into the project. After that, under /Models you can see the DbContext file, and the [EmployeeInfo] model class. Also a [CompanyContext] has been added to the web.config. Build the project so the [Employeeinfo] class is visible to the controller wizard.
Create a new API controller:
In the new API controller you get GET/POST/PUT/DELETE method which you can access via jQuery/Ajax.
Next, create a new empty EmployeeController
Add this method:
Add a new view Create.cshtml – empty view, no model. Update the CSS file per instructed.
Next, make sure add the KO and KO Mapping to the Create.cshtml
Make sure you include the new “KO” bundle in the _Layout.cshtml.
Copy the HTML (Create Employee Form) into Create.cshtml. Compile and browse, and you should the form page:
great example On ASP.NET MVC/Knockout!!!