Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/persteenolsen/dotnet-6-signup-mssql-api
A .NET 6 Web API with EF Core serving as a Membership System - remote MS SQL for Prod + SQLite for Dev
https://github.com/persteenolsen/dotnet-6-signup-mssql-api
dotnet entity-framework-core mssql sqlite
Last synced: 13 days ago
JSON representation
A .NET 6 Web API with EF Core serving as a Membership System - remote MS SQL for Prod + SQLite for Dev
- Host: GitHub
- URL: https://github.com/persteenolsen/dotnet-6-signup-mssql-api
- Owner: persteenolsen
- License: mit
- Created: 2024-03-15T07:18:09.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-19T13:51:36.000Z (8 months ago)
- Last Synced: 2024-04-17T05:06:00.883Z (7 months ago)
- Topics: dotnet, entity-framework-core, mssql, sqlite
- Language: C#
- Homepage: https://dotnet.signup.mssql.api.persteenolsen.com/users
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dotnet-6-signup-mssql-api
.NET 6.0 - User Registration and Login Tutorial with Example API
# Functionality of the Web App
- JWT authentication
- CRUD Account management routes with role based access control# Tech used for creating the Web App
- A .NET 6 Web API
- An Angular 14 Web Client for the Frontend
- Entity Framework
- SQLite as a local DB
- A traditional Webhotel for hosting
- MS SQL for remote DB
- VS Code
- Azure Data Studio# Updated EF Core tool to the latest version
dotnet tool update --global dotnet-ef
# Development
Create the Initial Migration for SQLite DB - should work for any DB
set ASPNETCORE_ENVIRONMENT=Development
Make sure that the connection String points to the SQLite ( locally ) in the "appsettings.Development"
"WebApiDatabase": "Data Source=LocalDatabase.db"
dotnet ef migrations add InitialCreate --context SqliteDataContext --output-dir Migrations/SqliteMigrations
# Create the local SQLite DB
dotnet run
# Production
Migration - Initial Create locally towards a remote MS SQL Server
Change the connection String to the remote MS SQL Server in the "appsettings.Development" for these purpose
Note: When running the Web API locally it will use "appsettings.Development"
and not "appsettings" which must also have the MS SQL Server connection Stringset ASPNETCORE_ENVIRONMENT=Production
dotnet ef migrations add InitialCreate --context DataContext --output-dir Migrations/SqlServerMigrations
# Create the remote SQLite DB
remote-host.com/users