Skip to content

Instantly share code, notes, and snippets.

@mikebeaton
Last active September 3, 2019 19:26
Show Gist options
  • Save mikebeaton/2aac2a970be8d7cb1251e2a165a3c0a5 to your computer and use it in GitHub Desktop.
Save mikebeaton/2aac2a970be8d7cb1251e2a165a3c0a5 to your computer and use it in GitHub Desktop.
Mighty article: Example #4
var db = new MightyOrm<Employee>(connectionString);
// the rest of the previous code sample stays exactly the same,
// though each employee value will now be strongly typed
var smiths = db.Query("SELECT * FROM Employees WHERE FamilyName = @0", "Smith");
foreach (var employee in smiths)
{
Console.WriteLine($"ID={employee.ID} GivenName={employee.GivenName}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment