DapperLib / DapperLib/Dapper.Contrib
Contrib: Insert - No Return Value if trigger (instead of insert) on table
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
Hello together,
I'm aware that following scenario is maybe not a "typical" one, but at least for Dapper.Contrib 1.43 it had worked.
Scenario:
I've got a table which use a "trigger instead of insert as" and within also a merge function. So if the Insert does not exist, it will insert it, otherwise update it.
Issue
The Insert will happen, but I will always receive "0" as value. At least for the 1.50.x (0 and 2 tested) release. The 1.43 return the correct id.
Example
I've created a solution which contain two project (one with Contrib 1.50, one with 1.43) to show the scenario. It's available at https://github.com/Telaran/dapper_trigger_issue
I hope I've provided enough information.
Workaround
Currently I'm not sure which workaround would make more sense: Use 1.43 (I currently don't need any Core Compability) or use 1.50 and always after insert make a query to get the Id.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the trigger-and-merge scenario with the linked Telaran/dapper_trigger_issue solution, comparing Dapper.Contrib 1.43 with 1.50.x. Trace the Insert behavior involved in returning the generated ID and use the reproduction to verify that an insert-or-update trigger no longer returns 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100