It showcases:
- Blazor WebAssembly
- Minimal APIs
- Using EntityFramework and SQL Server for data access
- OpenAPI
- User management with ASP.NET Core Identity
- Cookie authentication
- JWT authentication
- REST API
This folder contains scripts to create and load the Northwind (instnwnd.sql
) and pubs (instpubs.sql
) sample databases.
These scripts were originally created for SQL Server 2000.
To run this sample, you need a tool that can run Transact-SQL scripts. You can run the scripts in the following tools:
-
SQL Server Management Studio (SSMS). To download SSMS, go to Download SQL Server Management Studio (SSMS).
-
SQL Server Data Tools (SSDT) or Visual Studio. To download SSDT, or to enable its features in Visual Studio, go to Download and install SQL Server Data Tools (SSDT) for Visual Studio.
- Open SSMS.
- Connect to the target SQL Server.
- Open the script in a new query window.
- Run the script.
- Open SSDT or Visual Studio.
- Open the SQL Server Object Explorer.
- Connect to the target SQL Server.
- Open the script in a new query window.
- Run the script.
- Install the dotnet-ef tool:
dotnet tool install dotnet-ef -g
- Navigate to the
AuthenticationAPI
folder. Rundotnet ef database update
to create the database. - Learn more about dotnet-ef
- Dotnet 8.0 [Link download]: (https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
-
- **Edit appsettings.json file of you
{
"ConnectionStrings": {
"SQLServer": "Data Source=(local);Initial Catalog=TS_Auth;User Id=sa;Password=123456; Trustservercertificate=True;"
}
}
# In Server API
"SQL": "Data Source=(local);Initial Catalog=MyDB;User Id=sa;Password=123456;trustservercertificate=True;",
-
-Terminal/CLI - Open up 2 terminal windows, one in AuthenticationAPI,Server and the other in Client run:
dotnet watch run -lp https
This will run both applications with the
https
profile. -
-Type - Install the global tool using the following command:
dotnet tool install --global Microsoft.Tye --version 0.11.0-alpha.22111.1
Run
tye run
in the repository root and navigate to the tye dashboard (usually http://localhost:8000) to see both applications running.
The Todo REST API can run standalone as well. You can run the Server project and make requests to various endpoints using the Swagger UI (or a client of your choice):