A simple web-app backend API to handle Personnel Expenses
Produce a simple web-app backend API to complement an unknown frontend code that may be written in any front end library (vue/angular/react).
The APP is built using .Net Core 3.0, MSSQL Server and Visual Studio 2019. This app is build using Code First Approach
- Create an new ASP.Net Core Web API Application
- Go to Nuget Package Manager to install to following package
a. Microsoft.EntityFrameworkCore.SqlServer v3.1.1
b. Swashbuckle.AspNetCore v5.0 - Add folders with the following names to the project
a. DTO
b. Entities
c. Services - Creat a model class called Expense and Expense Context inside Entities
- Create ExpenseDTO, ResponseMessage and VATSetting inside DTO folder
- Add ExpenseService and ExpenseService interface inside Services folder
- Add Database connection to AppSettings.json
- Go to Start.cs to add database connection and VAT percentage value
- Go to Package Manager Console to run migration and update the database
Add-Migration MigrationName
Update-database - Create a controller to handle create and get expense
- Press F5 or Ctrl + F5 to run the APP