DapperLib / DapperLib/Dapper.Contrib
Insert return identity 0
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 293
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
I´m using dapper with mysql and .net and I need to insert and object and recovery the Id insert in this object. I´m using this:
int supplierId = db.Suppliers.Insert( supplier });
This is working in my computer but in the client computer it is returning "0", but the object is inserted in the table, there isn't any errors in the insert, the error is that doesn`t return the last id inserted.
I´m looking for information about insert but I can not find it. Always returns the last id inserted? Or do I have to make another query to consult the last id inserted?
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 reported insert through Dapper.Contrib with MySQL and inspect the Insert entry point; the issue names no source file or test. Done means establishing whether returning identity 0 is expected or correcting the behavior, with a regression test if appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, mysql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100