ASP.Net Core Web API Demo
This is simple ASP.Net Core 3.1 Web API Application having some common features that required by allmost Web API app.
Feel free to Fork/PR.
Features
- ASP.Net Core 3.1
- Model Validations
- Dynamic Service Register
- Localization
- Authentication
- Asp.Net Core Identity
- JWT based Auth
- Custom User/Roles
- Entity Framework Core 3.1
- Code First Approach
- Unit of Work with Repository
- Automatic Seeding
- Third-party
- Swagger
- Auto Mapper
- Logs with NLog
- Mail send with SendGrid
- Deploy
- CI GitHub Actions
- Deploy on Heroku
- Use Docker
Commands for SQL Server Migration
- Open src folder
cd src
- Add Migration
dotnet ef migrations add <Migration name> -o "Migrations" -p "DemoApp.EntityFramework" -s "DemoApp.API" -c "AppDBContext"
- Update Database
dotnet ef migrations update <Migration name> -o "Migrations" -p "DemoApp.EntityFramework" -s "DemoApp.API" -c "AppDBContext"
- Remove Last Migration
dotnet ef migrations remove -p "DemoApp.EntityFramework" -s "DemoApp.API" -c "AppDBContext"
- Generate full Script for all Migrations
dotnet ef migrations script -i -v -o script.sql -o "Migrations" -p "DemoApp.EntityFramework" -s "DemoApp.API" -c "AppDBContext"
Project Dependency
API
↑
Business
↑
DataAccess
↑
AutoMapper
↑
Models
🡕 🡔
EntityFramework Localization
Setup
- Download this Repo.
- Update AppSettings.json file Under API project.
- Create App on Heroku.
- Add Secrets in GitHub.
- HEROKU_API_KEY
- HEROKU_APP_NAME
- Create & Push repo on Github.
- Open your Heroku App page.
That's it! 😎