IIRC,
Dapper[
^] matches the query parameters based on the name of the property of the anonymous object.
Your query parameter is called
Id
, but your property is called
RouteId
.
You can either change the parameter name, or change the property name.
var x = connection.QueryAsync<LocationDto>("Select ROUTE_ID as RouteId, SCHEDULE_STOP as Location, START_TIME as StartTime From SCHEDULE WHERE ROUTE_ID = @RouteId", new { input.RouteId }).Result.ToList();
var x = connection.QueryAsync<LocationDto>("Select ROUTE_ID as RouteId, SCHEDULE_STOP as Location, START_TIME as StartTime From SCHEDULE WHERE ROUTE_ID = @Id", new { Id = input.RouteId }).Result.ToList();