public async Task <IEnumerable <BookingsAroundRes> > GetBookingsAround(BookingsAroundReq request) { try { if (request != null) { return(await driverRepository.GetBookingsAround(request)); } return(null); } catch (Exception ex) { throw ex; } }
public async Task <IEnumerable <BookingsAroundRes> > GetBookingsAround(BookingsAroundReq request) { try { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@DriverId", request.DriverId); parameters.Add("@InRadius", request.InRadius); return(await SqlMapper.QueryAsync <BookingsAroundRes>( cnn : connection, sql : "sp_GetBookingsAround", param : parameters, commandType : CommandType.StoredProcedure)); } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> GetBookingsAround(BookingsAroundReq request) { return(Ok(await driverService.GetBookingsAround(request))); }