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
Key Data Type other than int and writable key (e.g. Guid) #107
Conversation
jd4u
commented
Dec 14, 2013
- IsKeyWriteable to return default value
- Insert<T,TKey> method
- ISqlAdapter.Insert returns TKey
- SqlServerAdapter.Insert (Set Key value only if writeable)
- PostgressAdapter.Insert (Set Key value only if writeable)
- Updated KeyAttribute to support AllowWrite property
- Tests for Generic with Int64 and Guid datatype.
- IsKeyWriteable to return default value - Insert<T,TKey> method - ISqlAdapter.Insert<TKey> returns TKey - SqlServerAdapter.Insert<TKey> (Set Key value only if writeable) - PostgressAdapter.Insert<TKey> (Set Key value only if writeable) - Updated KeyAttribute to support AllowWrite property
- Created RunTestsGeneric - Setup adds two tables Persons and Managers
- Added TestsGeneric.cs - <Compile Include="TestsGeneric.cs" />
- Tests with Int64/Long as BigInt with Identity(0,0) in SqlCE. - Tests with Guid as UniqueIdentifier in SqlCE with Key created in Code.
Revert "Escape column names"
…KeyDataType Conflicts: Dapper.Contrib/SqlMapperExtensions.cs
…rge from upstream.
Key Data Type and Upstream updates
@jd4u & @majorsilence Have you done any more work around this and support for keys other than integers? As long as it doesn't break existing interfaces I think we should include it. |
I have a cleaned up copy at https://github.com/majorsilence/dapper-dot-net/commits/KeyDataType that I occasionally rebase. I have been using this for about a year and have not noticed any problems. |
Good. I'll try to get a good look at it this weekend. Från: Peter Gillmailto:notifications@github.com I have a cleaned up copy at https://github.com/majorsilence/dapper-dot-net/commits/KeyDataType that I occasionally rebase. I have been using this for about a year and have not noticed any problems. Reply to this email directly or view it on GitHub: |
I have a new branch https://github.com/majorsilence/dapper-dot-net/commits/KeyDataType2 that I am using to do my work on this change. It is currently only rebased as of June 11. I was doing some work last night to fix some test failures. I'll need to rebase again and fix some problems. @jd4u Currently the TestGeneric.InsertGetUpdate test is failing. I am not as familiar with the changes as you. Would you be wiling to review the above branch to see if I overlooked/broke something from your original changes. The code below fails with a "Entity must have at least one [Key] property" message. connection.Get<IPerson<Int64>>(id); |
I think the |