DapperLib / DapperAOT

Build time tools in the flavor of Dapper
Other
365 stars 22 forks source link

DAP037 error when return type is an array #123

Closed Jure-BB closed 1 month ago

Jure-BB commented 2 months ago

Hello,

for ExecuteScalar and QuerySingleOrDefault methods DAP037 error is reported ("No settable members exist for user type"), when return type is an array like byte[] or string[].

public async Task<byte[]?> TryGetByteArray(NpgsqlConnection conn, long id)
{
    var bytes = await conn.ExecuteScalarAsync<byte[]>(
        "select blob from foo where id = @id",
        param: new { id });
    return bytes;
}

Expected behavior: No error.