Iago
Iago
CC#
Created by Iago on 5/21/2024 in #help
SqlException: The INSERT statement conflicted with the FOREIGN KEY
Guys, I have this error in ASP.NET 8 "Internal Exception 1: SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_RegistrationFormModels_SportModel_SportId". The conflict occurred in database "RegistrationFormDb", table "dbo.SportModel", column 'Id'." I am inserting the value 2 in this sport_id, but this value 2 exists in the bank. I don't know why it's giving this error
6 replies
CC#
Created by Iago on 5/1/2024 in #help
Middleware Error
Guys, I created a middleware to handle exceptions and added it to "Program.cs" but it is giving this error when running. .NET 8 Error:
"System.InvalidOperationException: 'An error occurred when configuring the exception handler middleware. Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' property must be set in 'UseExceptionHandler()'. Alternatively, set one of the aforementioned properties in 'Startup.ConfigureServices' as follows: 'services.AddExceptionHandler(options => { ... });' or configure to generate a 'ProblemDetails' response in 'service.AddProblemDetails()'.'"
"System.InvalidOperationException: 'An error occurred when configuring the exception handler middleware. Either the 'ExceptionHandlingPath' or the 'ExceptionHandler' property must be set in 'UseExceptionHandler()'. Alternatively, set one of the aforementioned properties in 'Startup.ConfigureServices' as follows: 'services.AddExceptionHandler(options => { ... });' or configure to generate a 'ProblemDetails' response in 'service.AddProblemDetails()'.'"
My Code:
app.UseMiddleware<ExceptionHandlerMiddleware>();
app.UseMiddleware<ExceptionHandlerMiddleware>();
4 replies
CC#
Created by Iago on 10/6/2022 in #help
name variables
Guys I need to get the amount of variables that an object has and their names, can you?
4 replies