* Add Settings.PreferTypeHandlersForEnums opt-in flag
When enabled, Dapper checks for a registered TypeHandler for enum types
before falling back to the default integer boxing behavior. This allows
custom enum serialization (e.g. storing enums as strings via TypeHandlers)
to work on both reads and writes.
Patched locations:
- LookupDbType: return DbType.Object with handler when flag is on
- CreateParamInfoGenerator: skip integer boxing when handler exists
- GetSimpleValueDeserializer: route to TypeHandler before Enum.ToObject
- Parse<T>: route to TypeHandler before Enum.ToObject
Default is false — zero behavior change for existing users.
* Patch IL-emitted type deserializer and add tests
- Fix 6th enum-before-handler location in GetTypeDeserializer IL emit,
preserving Nullable<T> wrapping for nullable enum properties
- Fix em-dash in comment (non-ASCII)
- Add two tests: round-trip write+read via StringEnumHandler, and
nullable enum with null value
* Update SDK version from 10.0.102 to 8.0.100
* Update global.json
we have fixed the CI glitch separately
---------
Co-authored-by: Marc Gravell <marc.gravell@gmail.com>
* string and byte[] : add UseGetFieldValue to prevent problems with npgsql using global deserializer
* switch to GetFieldValue<T> changes some messaging in invalid cast scenarios; if anything, new version is clearer, so: fine
* test fixes
Simplifying and improve build speed.
- Decreases builds from 8-13 minutes down to ~2 minutes (while running more tests)
- Moves to SQL Server 2019 on AppVeyor
- Moves the 2 longest running tests with params to `[FactLongRunning]`
- Bumps tests up to `netcoreapp3.1`
- Also fixes .Contrib tests
- Moves to `Build.csproj`
- Simplifies `build.ps1`
- Removed defunct `build.sh`
- Nukes `IsAppveyor` (moves to environmental variable overloads)
- Builds now work in Linux/macOS
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.
Due to the way VS test works (by injecting an executable entry point), the performance tests needed to be factored out. I also organized all of our existing tests better along the way.
Actual code changes to Dapper itself are very minor, only formatting and documentation fixes (which we need many more of).
The build.ps1 script is upated to work, but note that <frameworkAssemblies> is not working in .nuspec inside the packages in the new .csproj system. I consider this to be a blocker. Issue is here: https://github.com/NuGet/Home/issues/4853
Class libraries should target net451 rather than dnx451, according to this: aspnet/Announcements#98
Also updated global.json to use DNX v1.0.0-rc1-update1