Skip to content

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

License

Notifications You must be signed in to change notification settings

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

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Introduction

The application is a Minimalist Book Manager API with synchronous API endpoints.

Project Structure

The project/solution consists of the following structure:

  • BookManagerAPI
    • Contains the application files
  • BookManagerApi.Tests
    • Contains the tests for the application

Application Components

The application contains two models with the following properties:

  • Book

    • ID
    • Title
    • Description
    • Author
    • Genre
  • Author

    • ID
    • Name

The application has 3 environment profiles:

  • Testing: - configured to use In-Memory database
  • Development: - configured to use MySQL database
  • Production: - configured to use MS SQL Server database

The connection strings for both MySQL and MS SQL Server are currently defined in Environment variables:

  • MySQL: env variable name = CUSTOMCONNSTR_MyContextDb

  • MS SQL Server: env variable name = CUSTOMCONNSTR_MyContextDbSQLServer

Application Features

The API features are:

  • Get All Books - retrieves a list of all books
  • Get a Book by ID - retrieve a single book via the book id
  • Add a Book - add a book
  • Update a Book - modify an existing book via the book id
  • Delete a Book - delete a book via the book id
  • Get All Authors - return a list of authors
  • Get Author by ID - return a single author via the author id
  • Add author - add a author

Pre-Requisites

  • C# / .NET 6
  • NuGet

Technologies & Dependencies

  • ASP.NET Core MVC 6 (Web API Project)
  • MS Entity Framework Core 6
    • In Memory
    • SQL Server
    • MySSQL
    • Design
  • MS Extensions
  • Pomelo
  • NUnit testing framework
  • Moq

How to Get Started

  • Fork this repo to your Github and then clone the forked version of this repo.
  • Restore dependencies:
    • Open up project in Visual Studio
    • Open up a terminal and navigate to the root folder of the main application directory BookManagerApi:
    • run: dotnet restore

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%