我正在使用 Dapper 微型 ORM。我认为它可以处理这样的枚举:
string sql = @"SELECT * FROM Events WHERE TimestampTicks <= @TimestampTicks AND TelemetryId = @TelemetryId ORDER BY TimestampTicks DESC LIMIT 1";
var events = _connection.Query<ReplayEvent>(sql, telemetryIds.Select(ti => new { TimestampTicks = startTime.Ticks, TelemetryId = ti }));
唉,它给出了一个毫无价值的错误。Query 方法没有合并多个结果的方法吗?这样做的正确方法是什么?