/lm-lab-csharp-book-manager-api

A synchronous version of the minimalist Book Manager Web API using ASP.NET Core 6

Primary LanguageC#GNU General Public License v3.0GPL-3.0

📖 Minimalist Book Manager API - C# ASP.NET Core MVC Web API

Introduction

This is the starter repository for the Further APIs session. It provides some starter code to creating a Minimalist Book Manager API with synchronous API endpoints.

Pre-Requisites

  • C# / .NET 6
  • NuGet

Technologies & Dependencies

  • ASP.NET Core MVC 6 (Web API Project)
  • NUnit testing framework
  • Moq

How to Get Started

  • Fork this repo to your Github and then clone the forked version of this repo.

Main Entry Point

  • The Main Entry Point for the application is: Program.cs

Running the Unit Tests

  • You can run the unit tests in Visual Studio, or you can go to your terminal and inside the root of this directory, run:

dotnet test

Tasks

Here are some tasks for you to work on:

📘 Discussion Task

Explore the code and make notes on the following features and how it is being implemented in the code. We'd like you to note down what classes and methods are used and how the objects interact.

The features are:

  • Get All Books
  • Get a Book by ID
  • Add a Book
  • Update a Book

📘 Task 1: Implement the following User Story with tests.

User Story: As a user, I want to use the Book Manager API to delete a book using its ID

📘 Extension Task: Oh no! 😭 We've only covered the happy paths in the solution, can you figure out a way to add in exception handling to the project?

  • Clue 1: What if someone wants to add a book with an ID for a book that already exists? How do we handle this gracefully?

  • Clue 2: What if someone wants to find a book by an ID that doesn't yet exist? How can we improve the API by handling errors gracefully and show a helpful message to the client?