DapperLib / DapperLib/DapperAOT
Add support for `QueryMultiple`, `QueryMultipleAsync`
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 472
- Forks
- 43
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 18
Description
I have a simple net9 win x64 console app with Dapper and DapperAOT that uses QueryMultipleAsync. After publishing and running the aot compiled exe, I get the following error:
Unhandled exception: System.PlatformNotSupportedException: Dynamic code generation is not supported on this platform.
at System.Reflection.Emit.ReflectionEmitThrower.ThrowPlatformNotSupportedException() + 0x2b
at Dapper.SqlMapper.CreateParamInfoGenerator(SqlMapper.Identity, Boolean, Boolean, IList`1) + 0xf5
at Dapper.SqlMapper.GetCacheInfo(SqlMapper.Identity, Object, Boolean) + 0x11b
at Dapper.SqlMapper.<QueryMultipleAsync>d__57.MoveNext() + 0xf0
After trying several things, I just noticed that the analyzer reported that this method is not supported by Dapper.AOT.
I'm not familiar with how source generators work to know how complex would that be. How complex would it be to add support for this method? Using QueryMultipleAsync helps a lot when retrieving large amounts of data.
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 with the analyzer diagnostic for QueryMultipleAsync and the DapperAOT source-generation path it rejects. Compare the requested method with any existing QueryMultiple handling, then validate that the analyzer accepts it and a published net9 win-x64 Native AOT console app runs without the Reflection.Emit failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100