- Use ASP.NET to build a simple API
- Use RestController classes to map HTTP requests to class methods
- Fork this repository
- Clone your fork to your machine
- Open the project in Visual Studio
- In the
CounterController
class, implement the requirements below
You're going to add some controller methods to the counter API. Examine the code already written in the controller. The Counter object is a model to represent an item (using Name property) and how many of those items (Value property) you may have. It has Id, Name and Value properties.
The List counters is the collection you will use within the controller to store counters.
Follow the tasks with the //TODO
comments. You can use the Task List pane if you wish to view all.
I would encourage you to attempt the Core and Extensions in this exercise.
Explore the documentation of the ASP.NET framework as much as you are able, you'll be using it for almost everything going forward. We'll be introducing new components of the framework in future exercises.
Try building your own simple API using what you've learned so far.