MVC REST API for Book database. It supports CRUD operations (HTTP Get, Post, Put, Patch, Delete) on Book objects. Book objects contain their title, author, genre and publisher data.
- Written in C#
- ASP.NET Core 5.0 (Entity Framework Core ORM)
- Microsoft SQL Server as RDBMS
- MVC design pattern
- Migration to create database schema within code
- Repository (Dependency Injection) to handle DbContext
- DTOs (Data Transfer Objects) to control visibilities of model properties
- Postman & Swagger to test API endpoint
Below depicts the whole application architecture of this project (created with draw.io)
- Clone this repo to your Windows machine
- Install .NET Core 5.0 SDK and SQL Server 2019
- Add a new user in your SQL Server and restart server
- Change
User ID
andPassword
fields inappsettings.json
to your credentials - Change IP address in
applicationURL
field fromProperties/launchSettings.json
to localhost or your machine's IP - Run
dotnet ef database update
to migrate database - Run
dotnet run
and visithttps://localhost/swagger/index.html
on browser!
All contributions are welcome!