/// <summary> /// Executes the specified SQL command text and maps the results to the /// specified type. /// </summary> /// <typeparam name="T">Result type.</typeparam> /// <param name="context">A SQL command context which includes a SELECT command.</param> /// <param name="map">The map.</param> /// <returns> /// The result of the SQL command. /// </returns> internal T ExecuteMapResult <T>(IContext context, IEnumerable <Tuple <PropertyInfo, Type> > map) where T : new() { var processor = new MappedResultProcessor <T>(map); return(RunCommand <T>(context, processor)); }
/// <summary> /// Executes the specified SQL command text and maps the results to the /// specified type. /// </summary> /// <typeparam name="T">Result type.</typeparam> /// <param name="context">A SQL command context which includes a SELECT command.</param> /// <param name="map">The map.</param> /// <param name="cancel">A token to monitor for cancellation requests.</param> /// <returns> /// The result of the SQL command. /// </returns> internal Task <T> ExecuteMapResultAsync <T>(IContext context, IEnumerable <Tuple <PropertyInfo, Type> > map, CancellationToken cancel) where T : new() { var processor = new MappedResultProcessor <T>(map); return(RunCommandAsync <T>(context, processor, cancel)); }