Skip to content
Advertisement

Dapper stopped pulling joined table after updating the table with a stored procedure

Because I was having this error

InnerException = {“Cannot insert explicit value for identity column in table ‘Loan’ when IDENTITY_INSERT is set to OFF.”}

So I decided to change it to this stored procedure.

Which is inserting the record successfully, after inserting the page will redirect to the index page and call another method to pull the list and display with this dapper query

There is a relationship between the Loan and customer table. The customer Id(CustId) is also inserted with the stored procedure. I noticed the customer names of the newly inserted records are not being displayed. the previous ones are showing. I don’t know why new records are not pulling the customer table

Advertisement

Answer

Looks like FirstName_CompanyName wasn’t mapped to any class property. This mapping change should fix the problem.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement