Skip to content

KarateJB/AspNetCore.Profiler.Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AspNetCore.Profiler.Sample

Features

Database Migration

Install Entity Framework Core CLI

dotnet tool install --global dotnet-ef

See Entity Framework Core tools reference - .NET Core CLI and Managing Migrations

Create migration

1. Create new migration file

$ cd src/AspNetCore.Profiler.Mvc
$ dotnet ef  --project ../AspNetCore.Profiler.Dal --startup-project . migrations add <migration_name>

2. Update database

Use either the environment variable or dotnet-ef argument --connection to specify the DB connection string for executing the migration.

export ConnectionStrings__DefaultConnection

$ cd src/AspNetCore.Profiler.Mvc
$ export ConnectionStrings__DefaultConnection="Server=localhost\\SQLEXPRESS;Database=demo;Trusted_Connection=True;TrustServerCertificate=True;"
$ dotnet ef  --project ../AspNetCore.Profiler.Dal --startup-project . database update

--connection <your_connection_string>

$ cd src/AspNetCore.Profiler.Mvc
$ dotnet ef  --project ../AspNetCore.Profiler.Dal --startup-project . database update --connection "Server=localhost\\SQLEXPRESS;Database=demo;Trusted_Connection=True;TrustServerCertificate=True;"

Endpoints

URL Method Description
1 https://host/profiler/results GET Profiling result for the latest request.
2 https://host/profiler/results-index GET Profiling results for stored requests.
3 https://host/profiler/results-list GET Profiling results in JSON for stored requests.
4 https://host/api/DemoApi/TestOpenTelemetry GET Test Open Telemetry to show Trace and Span ID.

Reference

About

Profiler sample code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors