Skip to content

hammond01/EcommerceSystem-Blazor-WebAPI-SQLServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EMS application with ASP.NET Core

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

SETUP Database API

Northwind and pubs sample databases for Microsoft SQL Server

DownloadLink

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.

Before you begin

To run this sample, you need a tool that can run Transact-SQL scripts. You can run the scripts in the following tools:

Run the scripts in SSMS

  1. Open SSMS.
  2. Connect to the target SQL Server.
  3. Open the script in a new query window.
  4. Run the script.

Run the scripts in SSDT or Visual Studio

  1. Open SSDT or Visual Studio.
  2. Open the SQL Server Object Explorer.
  3. Connect to the target SQL Server.
  4. Open the script in a new query window.
  5. Run the script.

Related links

SETUP Database Authentication

  1. Install the dotnet-ef tool: dotnet tool install dotnet-ef -g
  2. Navigate to the AuthenticationAPI folder. Run dotnet ef database update to create the database.
  3. Learn more about dotnet-ef

Config and start project

System requirements

  1. Dotnet 8.0 [Link download]: (https://dotnet.microsoft.com/en-us/download/dotnet/8.0)

Config

    • **Edit appsettings.json file of you

    In Authentication API

{
  "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;",
    • Visual Studio - Setup multiple startup projects by right clicking on the solution and selecting Properties. Select AuthenticationAPI, Server and Client as startup projects. image
  1. -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.

  2. -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.

Optional

Using the API standalone

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): image image

About

EcommerceSystem-Blazor-WebAPI-SQLServer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published