We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge failed when PK column was not passed in the dataset. It used to be working but have now failed after the latest fixes in Master.
Tests available in my fork https://github.com/rdagumampan/RepoDb.
Open the
[Test] public void TestMergeInsert() { //arrange var repository = new DbRepository<SqlConnection>(Constants.TestDatabase); var fixtureData = new Customer { GlobalId = Guid.NewGuid(), FirstName = "Juan-MERGED", LastName = "de la Cruz-MERGED", MiddleName = "Pinto-MERGED", Address = "San Lorenzo, Makati, Philippines 4225-MERGED", IsActive = true, Email = "juandelacruz@gmai.com-MERGED", LastUpdatedUtc = DateTime.UtcNow, LastUserId = Environment.UserName }; //act repository.Merge(fixtureData); //assert var customer = repository.Query<Customer>(new { fixtureData.GlobalId }).FirstOrDefault(); customer.ShouldNotBeNull(); customer.Id.ShouldNotBe(0); customer.GlobalId.ShouldBe(fixtureData.GlobalId); customer.FirstName.ShouldBe(fixtureData.FirstName); customer.LastName.ShouldBe(fixtureData.LastName); customer.MiddleName.ShouldBe(fixtureData.MiddleName); customer.Address.ShouldBe(fixtureData.Address); customer.Email.ShouldBe(fixtureData.Email); customer.IsActive.ShouldBe(fixtureData.IsActive); customer.LastUpdatedUtc.ShouldBe(fixtureData.LastUpdatedUtc); customer.LastUserId.ShouldBe(fixtureData.LastUserId); }
System.Data.SqlClient.SqlException : Must declare the scalar variable "@Id". at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
The text was updated successfully, but these errors were encountered:
Closed as As Designed. Id must be passed when Merge is called. The internal generated SQL needs the column for identifying source and destination.
Sorry, something went wrong.
mikependon
No branches or pull requests
Merge failed when PK column was not passed in the dataset. It used to be working but have now failed after the latest fixes in Master.
Tests available in my fork https://github.com/rdagumampan/RepoDb.
Open the
The text was updated successfully, but these errors were encountered: