Update Program.cs
parent
bb0c64b68d
commit
62700a4c22
|
@ -321,14 +321,10 @@ app.Run();
|
||||||
// <snippet_sampleproblemdetailswriter>
|
// <snippet_sampleproblemdetailswriter>
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
|
||||||
// addd SampleProblemDetailsWriter to dependency injection
|
|
||||||
builder.Services.AddTransient<IProblemDetailsWriter, SampleProblemDetailsWriter>();
|
builder.Services.AddTransient<IProblemDetailsWriter, SampleProblemDetailsWriter>();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Middleware to handle writing problem details to the response.
|
// Middleware to handle writing problem details to the response.
|
||||||
app.Use(async (context, next) =>
|
app.Use(async (context, next) =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue