89 Commits

Author SHA1 Message Date
Marc Gravell 6ab170c160 .Net 5 (#1572)
* initial net5.0 tweaks; also fix current IDE warnings

* lib updates and fixes

* more cleanup

* fix snafu

* skip locals init

* disable xunit shadow copy in tests

* test records

* explore scenario that currently works re #1571
2020-11-17 09:57:17 +00:00
Damir Ainullin 2bc267f529 Fixes of grammar typos (#1458)
Fixes of grammar typos
2020-05-09 16:00:24 -04:00
Damir Ainullin 9b010240c7 Set initial capacity for collections (#1449)
* Set initial capacity for collections
* Revert Massive changes

Co-authored-by: Nick Craver <nrcraver@gmail.com>
2020-05-02 08:15:46 -04:00
Damir Ainullin 981cfe4ddf Replaced ContainsKey and [] with TryGetValue (#1339) 2019-09-27 10:42:46 +01:00
Nick Craver 1481c4d379 Tooling and project updates (#1333)
This is a branch cleaning up old `#if` clauses, `.csproj` bits, Linux build compatibility, and a few other tid-bits (broken out by commit).

In general: we're on 3.0 tooling and all previous cruft has been removed.
2019-09-26 19:47:55 -04:00
Marc Gravell 8152f2c718 WIP: Lib updates and prepare for Microsoft.Data.SqlClient (#1313)
v2 work; primarily prep for split SqlClient
2019-08-28 15:07:32 +01:00
Wixely b961089eff Improve Exception message (#1154)
In cases where the object has a property named ID, the property will automatically be assigned as [Key], even if [Computed] is added manually in an attempt to override it. This can cause confusion, this exception will be thrown despite the code looking fine and there only being one [ExplicitKey] defined. I've added this extra line of information to help diagnosis.
2019-02-09 07:19:33 -05:00
Nick Craver 2a2ff86561 Fix Dapper.Contrib to prefer its attribute but still fall back to others 2018-09-11 20:59:15 -04:00
Brian Drupieski 39b1fd5a13 IEnumerable<T> check when updating and deleting 2018-05-14 06:44:11 -04:00
Sergey fc38c4234f Removing unjustified use of AppendFormat in StringBuilder class (#989) 2018-03-30 17:32:28 -04:00
Brian Drupieski 6e9099d68e fix Insert<T> when T is declared as IEnumerable<T> (#948) 2018-03-29 21:12:46 -04:00
Jase 07fe543f15 Change to GetAll to allow the usage of a nullable type in T when T is an interface… #933 (#936)
* Change to GetAll to allow the usage of a nullable type in T when T is an interface.

* Change to GetAll to allow the usage of a nullable type in T when T is an interface: further change to check if val == null and if so then don't try to assign it as a property value.

* Change to Get to allow the usage of a nullable type in T when T is an interface. (effectively the same change as the previous change to GetAll.)

* Change to GetAsync and GetAllAsync to allow the usage of a nullable type in T when T is  an interface.

* Added in UserWithNullableDob and IUserWithNullableDob.

Added in tests for GetAndGetAllWithNullableValues and  GetAsyncAndGetAllAsyncWithNullableValues.

* Added in .ConfigureAwait(false) in the GetAsync Test.
Added comment to identify which issue the test relates to.

* Added NullableDates tables to the test databases.
Adjusted variable names in GetAndGetAllWithNullableValues and GetAsyncAndGetAllAsyncWithNullableValues.

* Changed IUserWithNullableDob to INullableDate.
2018-03-09 06:41:01 -08:00
Brian Drupieski d269a5a4b8 when inserting, check if type implements IEnumerable<T> to determine if it's a collection (#880)
* when inserting check if type implements IEnumerable<T> to determine if it's a collection
* when inserting, check if type is a collection by comparing its implemented interfaces to unbound generic type IEnumerable<> instead of the name "IEnumerable`1"
2017-11-25 20:37:19 -05:00
Nick Craver e2ebdb08ac Dapper.Contrib: netstandard2.0 2017-09-14 10:37:18 -04:00
Nick Craver 071a3fd5a0 .editorconfig and formatting 2017-08-21 16:25:48 -04:00
Nick Craver 7e5bd308f9 netstandard2.0 functionality (w/ runtime breaks)
This adds a netstandard2.0 build to Dapper (and StrongName until v2),
adds a netstandard2.0 test lineup, restores most functionality (except
UDTs for SQL, e.g. .UdtTypeName isn't in netstandard2), and also breaks
things not actually implemented or implemented correctly in
netstandard2.0. Pushing this up so we can work through these with the
.NET teams.

Several things are still broken here (and fail tests):
- Parameter decimal values (not filed yet)
- DataTables as parameters
(https://github.com/dotnet/corefx/issues/19708)
- .GetSchemaTable() (not yet filed, implementation is completely missing
from SqlDataReader in CoreFX)

While the compile is clean, the above are runtime issues.
`SqlParameter.UdtTypeName` is a separate issue, that one just wasn't in
`netstandard2.0` at all...so we can't support UDTs there until it is.
See https://github.com/dotnet/corefx/issues/17126 for details.
2017-05-12 10:03:00 -04:00
Nick Craver c3b2b34b54 Documentation: contrib 2017-05-08 14:46:34 -04:00
Nick Craver f613234413 Lots of code cleanup, no functional changes 2017-05-07 15:49:01 -04:00
Nick Craver 4be8df7988 Lots of documentation fixes/additions. 2017-05-06 18:57:10 -04:00
Phelipe de Sterlich 16d8691892 added firebird support
added firebird sql adapter to allow record insert and key retrieving
2016-12-01 11:38:38 +01:00
Nick Craver 8e070ddca5 Interfaces are back, simplifying code.
Related issue: #520
2016-05-23 20:43:30 -04:00
Shrayas d0505aaf97 Fix small typo in contrib
default was misspelt as defualt
2016-01-29 17:54:34 +05:30
joncloud a967b0c2fa Added checks to make sure that arrays get the appropriate type when delete/insert/update is called. 2015-12-25 10:49:45 -08:00
Johan Danforth 5c5eae8e8f Fix and test for issue #418 2015-12-06 11:37:12 +01:00
Nick Craver eb51910ca6 Merging #370 2015-11-26 15:50:14 -05:00
Nick Craver 63706bb877 Merge branch 'pr/368' 2015-11-26 15:27:12 -05:00
Nick Craver 336cacbe05 Contrib: fix #404 changes and other issues in MySQL
This fixes some MySQL issues - test suite that confirms issues and fixes
is incoming. TODO shortly after: implement the Insert<T, TKey> style
methods. I just want to get tests running (and some added) first.
2015-11-25 06:04:07 -05:00
Nick Craver b9c5d5d8d5 Contrib: DRY code current keys implementation 2015-11-24 21:45:12 -05:00
Nick Craver ad0a262285 Contrib, Rainbow, EntityFramework & SqlBuilder: code cleanup 2015-11-24 20:20:52 -05:00
Nick Craver bc8468f494 Merge pull request #410 from joncloud/issue#404
Provided a name for MySql LAST_INSERT_ID call to allow the result to …
2015-11-24 19:21:25 -05:00
joncloud 9bd979845d Provided a name for MySql LAST_INSERT_ID call to allow the result to map correclty. 2015-11-24 14:39:55 -08:00
Nick Craver fd10fe7ccb A full CoreCLR/DNX friendly conversion
This eliminates the dual solutions and brings Contrib into the
project.json fold.
- Tests are ported to xUnit though SQLite is disabled on DNX due to
Issue #375 (Interop loads fail in the VS runner and  params are busted
regardless).
- Projects are consolidated down to what's currently possible with
project.json.
- Contrib moved to: Dapper.Contrib and Dapper.Tests.Contrib (so tests
appear at the end, no other reason vs. Dapper.Contrib.Tests)
- EF moved to: Dapper.EntityFramework(.StrongName)
- Rainbow moved to: Dapper.Rainbow
- SqlBuilder moved to: Dapper.SqlBuilder
- Packages are removed since it's not current-tooling friendly to keep
them (nor was it using them).
- xUnit implemented in Contrib via abstracts - this allow us to very
quickly add any database provider to the rig in a very concise way.
- Contrib unit tests fixed in various places - they were not
parallel-runner friendly
- Nuspecs removed, since they aren't used anymore (to eliminate
confusion)
- Removed speed tests for libraries that aren't on current versions of
.Net (what would we be comparing?)
- Perf tests moved to Dapper.Tests (consolidation from
Dapper.DNX.Tests), but aren't activated yet (no define)
2015-11-22 17:56:33 -05:00
JanZakrzewski e447523d65 fixed GetAll when used with ExplicitKey 2015-10-28 12:01:57 +01:00
johandanforth 61998c4fa2 bug in keypropertiescache 2015-10-27 15:13:05 +01:00
johandanforth 4012fbfef5 Fix for issue #361 2015-10-27 14:25:10 +01:00
Nick Craver 8662754801 Code readability: property naming
TODO: Centralize the adapter repeated code down to an abstract class
2015-10-15 06:42:50 -07:00
johandanforth 3ad263d242 Fixes for #336 escape column names 2015-10-14 14:16:23 +02:00
johandanforth 2f7125a0ec Fixes for issue #351 2015-10-13 22:42:16 +02:00
ithero7 bbf93cb260 Little changes :)
Correct the spelling mistake, and change the variable name to satisfy the naming conventions.
2015-09-06 23:46:14 +08:00
johandanforth 984055aabf Specific insert adapters for sql/sql ce. Faster inserts for sql server now 2015-06-20 13:36:08 +02:00
Tor c625042594 Brackets around property names in Update & Delete
Modified Update & Delete method to be consistent with Insert by adding brackets around property names
2015-06-09 15:12:32 +02:00
johandanforth c8ca11efb4 Contrib Insert support for short/int16 id/key Issue #196 2015-06-07 20:56:22 +02:00
johandanforth e408faba82 Contrib Insert now handles closed connection 2015-06-07 13:54:35 +02:00
johandanforth 62cb035dbc Custom table name mapper for Contrib 2015-06-06 19:30:03 +02:00
johandanforth beb675d1dc GetDatebaseType delegate for Contrib Insert 2015-06-06 18:01:40 +02:00
johandanforth 63460c60e9 specify sqladapter for insert() and insertasync() 2015-05-27 00:01:17 +02:00
Johan Danforth d6e068d348 Added InsertAsync to Dapper.Contrib and small fix to GetAllAsync 2015-05-12 20:21:01 +02:00
Johan Danforth c4905c5750 New features in Dapper.Contrib 2015-05-12 18:18:10 +02:00
johandanforth a67ed727e6 Cleaned up shared files in Contrib and tests. Also added tests for transactions in Contrib 2015-05-01 22:52:13 +02:00
johandanforth c8bd264d01 Revert "spring cleaning in Contrib areas, more share of code between framework versions in Contrib"
This reverts commit 27abc447e1.
2015-05-01 22:19:36 +02:00