Allow CORS in Net Core application
It's not for production, but for developer environments
Add the block below to Program.cs. I talk about Net Core 5 or Net Core 6 application.
// global cors policy
app.UseCors(x => x
.AllowAnyMethod()
.AllowAnyHeader()
.SetIsOriginAllowed(origin => true) // allow any origin
.AllowCredentials()); // allow credentials

Create new list item in SharePoint with CSOM and .Net (C#) in 6 steps
PostgreSQL in Docker: when DBeaver lies (and psql saves the day)