Jan
21
2012
New and improved Simple.Data.RawSql package released
Today, I published my first nuget package, Simple.Data.RawSql, a set of extensions to Simple.Data for raw sql queries. It includes some syntax improvements over the code from my previous post.
Here’s a few examples. First up, querying a single row:
Notice that we specify the type for the db
variable. Database.Open
returns dynamic
. If we left it as dynamic
(or used var
), we couldn’t call our ToRow
extension method.
To query several rows:
Finally, you may want to batch several queries together and return multiple result sets:
blog comments powered by Disqus