-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
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
AutoIncrement Int PK doesn't Increment through DapperLite? #4
Comments
In SqlMapper.cs I tried adding the following to the
|
Well, I'm a little ashamed to admit this but I got it 'working' doing the following.
|
@RefractedPaladin One other solution is having a |
The other thing you could try is making This should be a much better solution for you. |
Ah, thanks. Tried the |
Follow up to this, or maybe it's really seperate, but is there a way to get the auto ID back from the Insert? Otherwise, I seem to be stuck writing code like so: Where PIN is like a FK that is manually assigned though not guaranteed to be unique. |
Great question! It should be possible. We'll see what we can do On Tuesday, February 18, 2014, RefractedPaladin [email protected]
|
Clearly this won't work for you but I took a look at Dapper.Rainbow and what they were doing which was basically a I'd be interested in writing/seeing a better, more generic solution though. Mines below just in case you were curious.
and then of course changing the signature of both |
Looks like this could help you out:
|
Any ideas? I have the table set right and if I use straight SQL it works correctly but once I use DapperLite, like below, it only gives
Id
a value of0
.this.CurrentPunch = new Punches(){ PunchTime = DateTime.Now, Method = "PIN"};
db.Insert(CurrentPunch);
The text was updated successfully, but these errors were encountered: