fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (4ms) [Parameters=[@p0='?' (Size = 450), @p1='?' (DbType = Int32), @p2='?' (Size = 4000), @p3='?' (Size = 13), @p4='?' (Size = 256), @p5='?' (DbType = Boolean), @p6='?' (DbType = Boolean), @p7='?' (DbType = DateTimeOffset), @p8='?' (Size = 4000), @p9='?' (Size = 4000), @p10='?' (Size = 256), @p11='?' (Size = 256), @p12='?' (Size = 4000), @p13='?' (Size = 4000), @p14='?' (DbType = Boolean), @p15='?' (Size = 4000), @p16='?' (Size = 4000), @p17='?' (DbType = Boolean), @p18='?' (Size = 256), @p19='?' (DbType = Int32), @p20='?' (DbType = DateTime2), @p21='?' (Precision = 20) (Scale = 17) (DbType = Decimal), @p22='?' (Precision = 20) (Scale = 17) (DbType = Decimal), @p23='?' (Size = 450), @p24='?' (DbType = Boolean), @p25='?' (DbType = Boolean), @p26='?' (Size = 4000), @p27='?' (Size = 4000), @p28='?' (DbType = Double), @p29='?' (DbType = Double), @p30='?' (Size = 450), @p31='?' (DbType = DateTime2), @p32='?' (DbType = DateTime2), @p33='?' (Size = 450), @p34='?' (Size = 4000), @p35='?' (Size = 450), @p36='?' (Size = 450), @p37='?' (DbType = Int32), @p38='?' (DbType = Double), @p39='?' (Precision = 30) (Scale = 25) (DbType = Decimal), @p40='?' (DbType = Int32), @p41='?' (Size = 450), @p42='?' (DbType = Boolean), @p43='?' (DbType = Boolean), @p44='?' (DbType = Int32), @p45='?' (Size = 450), @p46='?' (Size = 450), @p47='?' (Size = 450), @p48='?' (DbType = Int32), @p49='?' (DbType = Boolean), @p50='?' (Size = 450), @p51='?' (Size = 450)], CommandType='Text', CommandTimeout='30'] SET NOCOUNT ON; INSERT INTO [AspNetUsers] ([Id], [AccessFailedCount], [ConcurrencyStamp], [Discriminator], [Email], [EmailConfirmed], [LockoutEnabled], [LockoutEnd], [MatriculeSopal], [Nom], [NormalizedEmail], [NormalizedUserName], [PasswordHash], [PhoneNumber], [PhoneNumberConfirmed], [Prenom], [SecurityStamp], [TwoFactorEnabled], [UserName]) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18); INSERT INTO [Localisation] ([Id], [Date], [Lattitude], [Longitude]) VALUES (@p19, @p20, @p21, @p22); INSERT INTO [Vehicule] ([Matricule], [Bloque], [IsLibre], [Marque], [Modele], [Poids], [Volume]) VALUES (@p23, @p24, @p25, @p26, @p27, @p28, @p29); INSERT INTO [Voyage] ([IdVoyage], [DateDepartVoyage], [DateSortieBon], [DemandeurMatriculeSopal], [Etat], [MagasinierDemandeurMatriculeSopal], [MagasinierMatriculeSopal], [NbrePalette], [Poids], [Priorite], [TypeVoyageId]) VALUES (@p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40); INSERT INTO [Transporteur] ([UserId], [Active], [ExterneDuService], [LocalisationId], [VehiculeMatricule]) VALUES (@p41, @p42, @p43, @p44, @p45); INSERT INTO [TransporteurVoyage] ([TransporteurMatriculeSopal], [VoyageId], [LocalisationsId], [Panne], [TransporteurUserId], [VoyageIdVoyage]) VALUES (@p46, @p47, @p48, @p49, @p50, @p51); fail: Microsoft.EntityFrameworkCore.Update[10000] An exception occurred in the database while saving changes for context type 'backend.Data.ApplicationDBContext'. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_AspNetUsers'. Cannot insert duplicate key in object 'dbo.AspNetUsers'. The duplicate key value is (tr). Cannot insert explicit value for identity column in table 'Localisation' when IDENTITY_INSERT is set to OFF. Violation of PRIMARY KEY constraint 'PK_Vehicule'. Cannot insert duplicate key in object 'dbo.Vehicule'. The duplicate key value is (transporteur2). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Voyage_Magasinier_MagasinierDemandeurMatriculeSopal". The conflict occurred in database "sopal2", table "dbo.Magasinier", column 'MatriculeSopal'. Violation of PRIMARY KEY constraint 'PK_Transporteur'. Cannot insert duplicate key in object 'dbo.Transporteur'. The duplicate key value is (tr). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransporteurVoyage_Localisation_LocalisationsId". The conflict occurred in database "sopal2", table "dbo.Localisation", column 'Id'. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. at Microsoft.Data.SqlClient.SqlCommand.<>c.b__211_0(Task`1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) ClientConnectionId:68f8eb57-746d-4eae-a827-3dd94581582b Error Number:2627,State:1,Class:14 --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_AspNetUsers'. Cannot insert duplicate key in object 'dbo.AspNetUsers'. The duplicate key value is (tr). Cannot insert explicit value for identity column in table 'Localisation' when IDENTITY_INSERT is set to OFF. Violation of PRIMARY KEY constraint 'PK_Vehicule'. Cannot insert duplicate key in object 'dbo.Vehicule'. The duplicate key value is (transporteur2). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Voyage_Magasinier_MagasinierDemandeurMatriculeSopal". The conflict occurred in database "sopal2", table "dbo.Magasinier", column 'MatriculeSopal'. Violation of PRIMARY KEY constraint 'PK_Transporteur'. Cannot insert duplicate key in object 'dbo.Transporteur'. The duplicate key value is (tr). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransporteurVoyage_Localisation_LocalisationsId". The conflict occurred in database "sopal2", table "dbo.Localisation", column 'Id'. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. at Microsoft.Data.SqlClient.SqlCommand.<>c.b__211_0(Task`1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) ClientConnectionId:68f8eb57-746d-4eae-a827-3dd94581582b Error Number:2627,State:1,Class:14 --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) Detailed Stack Trace: at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Update.Internal.SqlServerModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at backend.Repository.VoyageRepo.Create(Voyage voyage) in D:\Projet PFE\code\backend\Repository\VoyageRepo.cs:line 23 at backend.Service.VoyageService.CreateVoyage(VoyageDTO voyageDTO) in D:\Projet PFE\code\backend\Service\VoyageService.cs:line 209 Microsoft.EntityFrameworkCore.Relational Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_AspNetUsers'. Cannot insert duplicate key in object 'dbo.AspNetUsers'. The duplicate key value is (tr). Cannot insert explicit value for identity column in table 'Localisation' when IDENTITY_INSERT is set to OFF. Violation of PRIMARY KEY constraint 'PK_Vehicule'. Cannot insert duplicate key in object 'dbo.Vehicule'. The duplicate key value is (transporteur2). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Voyage_Magasinier_MagasinierDemandeurMatriculeSopal". The conflict occurred in database "sopal2", table "dbo.Magasinier", column 'MatriculeSopal'. Violation of PRIMARY KEY constraint 'PK_Transporteur'. Cannot insert duplicate key in object 'dbo.Transporteur'. The duplicate key value is (tr). The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransporteurVoyage_Localisation_LocalisationsId". The conflict occurred in database "sopal2", table "dbo.Localisation", column 'Id'. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. The statement has been terminated. at Microsoft.Data.SqlClient.SqlCommand.<>c.b__211_0(Task`1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) ClientConnectionId:68f8eb57-746d-4eae-a827-3dd94581582b Error Number:2627,State:1,Class:14