Skip to content

Instantly share code, notes, and snippets.

@LexVocoder
LexVocoder / FastQuery.cs
Created December 28, 2017 14:57
FastQuery, a convenient way to run raw SQL queries in C#
// Apache 2.0 license... This code might not work at all.
/// <summary>
/// Must reference parameters in the query positionally, starting with @p0.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="query">example is "select foo from bar where frob = @p0 and quux = @p1"</param>
/// <param name="selector">
/// function that (usually) builds a new T from a database row-reader
/// </param>