ASPNet Core
Course
Udemy Course: Build an app with ASPNET Core and Angular from scratch
Creating Angular
ng new <client name>
Get dotnet command line help
dotnet -h
dotnet new -h
Creating ASP.Net Core Web API
dotnet new webapi
Adding files to project
- Add Data/DataContext inheriting DBContext
- Add below line statup.cs/ConfigureServices :
services.AddDbContext<DataContext>(option => option.UseSqlite("ConnectionString"))
- Add Model/
is mapped to table
Adding refernce project
dotnet add reference <Reference Project Path>
EntityFrameWork Commands
Install entity framework command line tools
dotnet tool install --global dotnet-ef
Initial DB Create
dotnet-ef migrations add InitialCreate
Generate the SQL Script
dotnet ef migrations script | out-file ./script.sql
DB Update
dotnet-ef database update
DB Drop
dotnet-ef database drop
Adding test cases
Convert appsettings.json to azure configuration file
dotnet tool install --global dotnet-appsettings
dotnet tool list --global
Usage: appsettings [appsettings.json]
example: appsettings appsettings.json -o appsettings.azure.json