Using AJAX object with ASP.NET WEB API




7,496 visits, 18,724 views


This tutorial hasn't been translated.



This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Second pass: Creating our first Controller

Now we will crete our first Controller. To create a Controller you will:

1. Right click the Controllers folder, and choose Add > Controller...

2. Choose "Web API X Controller actions, using Entity Framework" and click Add

3. In the Model class field select the PlayerData class.

(If it is not listed in the list, please bild the project by clicking BUILD > Build Solution and star from pass 1 again)

4. In the Data context class field select the ApplicationDbContext class. It will generate the database for us.

5. Now, give a name to the controller in the Controller name field. Lests call it PlayerDataController. Notice that in ASP.NET all controller names need to end with ...Controller

6. Finally, click Add


  • Order by
Want to leave a comment? Login or Register an account!