studentoffuturearts
Anyone with DBInitializer experience/.NET mentor? Could use some help
considering good practice, should i be using less ?
And yeah, i figured, been at this for hours but i can't seem to find a reason the constraint fails
I though is was some underlying framework thing
57 replies
Anyone with DBInitializer experience/.NET mentor? Could use some help
https://paste.mod.gg/qxkomveatail/1
here is 'in' and 'out'
the [Key] and [database..] clauses i added to make sure primary key was recognized and hoped to make sure the seeded data PK was incremented from 0 (to make sure i was adding correct values and that wasn't the constraint problem)
57 replies
Anyone with DBInitializer experience/.NET mentor? Could use some help
Thanks for helping me, really appreciate it
If there's a better way for me to troubleshoot and things to watch out for/tips to trace such errors, you're welcome to inform me
57 replies
Anyone with DBInitializer experience/.NET mentor? Could use some help
thrown at call stack Microsoft.Data.SqlClient.SqlConnection.OnError(Microsoft.Data.SqlClient.SqlException, bool, System.Action<System.Action>)
Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(Microsoft.Data.SqlClient.TdsParserStateObject, bool, bool)
Microsoft.Data.SqlClient.TdsParser.TryRun(Microsoft.Data.SqlClient.RunBehavior, Microsoft.Data.SqlClient.SqlCommand, Microsoft.Data.SqlClient.SqlDataReader, Microsoft.Data.SqlClient.BulkCopySimpleResultSet, Microsoft.Data.SqlClient.TdsParserStateObject, out bool)
Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreRows(out bool)
Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreResults(out bool)
Microsoft.Data.SqlClient.SqlDataReader.TryNextResult(out bool)
Microsoft.Data.SqlClient.SqlDataReader.NextResult()
Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(Microsoft.EntityFrameworkCore.Storage.RelationalDataReader)
57 replies
Anyone with DBInitializer experience/.NET mentor? Could use some help
exception is SqlException: The MERGE statement conflicted with the FOREIGN KEY constraint "FK_Ins_Contacts_ContactId". The conflict occurred in database "FinAppAPI", table "dbo.Contacts", column 'ContactId'.
occurs at the end of DBInitializer/seeder
at context.saveChanges()
57 replies
Anyone with DBInitializer experience/.NET mentor? Could use some help
Here is most of the relevant code
https://paste.mod.gg/xpxtoxoywybd/5
57 replies