As an addition to the previous answers:
Since C# 12, collection expressions can also be used. This simplifies the conversion to:
List<ProfitMargin> profitMargin = [.. await conn.QueryAsync<ProfitMargin>(sqlQuery, new { QuoteId = QuoteIds.ToArray()})]