Skip to content

Add support for QueryMultiple, QueryMultipleAsync #161

@ninety7

Description

@ninety7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions