iam trying to delete an object from RacineDesReferntiel table that has a relational with service table how to fix this problm
its a aspnet web api project and i use the remove built in function and the same problm happen
please help me to fix this problm
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
Failed executing DbCommand (32ms) [Parameters=[@p0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30'] SET NOCOUNT ON;
DELETE FROM [racine des referentiels]
WHERE [id] = @p0;
SELECT @@ROWCOUNT;
fail: Microsoft.EntityFrameworkCore.Update[10000]
An exception occurred in the database while saving changes for context type 'Referentiels.Data.referentielsContext'.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_services_racine des referentiels". The conflict occurred in database "referentiels", table "dbo.services", column 'racineid'.
The statement has been terminated.