Run Method


public IEnumerable<T> Run<T>(string sql, dynamic parameters = null)


Parameter Type Description
sql string The SQL to execute
parameters dynamic A dynamic object containing additional parameters, if any

Return value:

Type Description
IEnumerable<T> The enumerable list of returned objects represented by T


    // select birthdays for the current month for users in the system
    var users = Query.Run<dynamic>("select u.ContentId, FirstName, LastName, Birthday from [user] u inner join content c on u.contentid = c.contentid where c.deleted = 0 and u.isactive = 1 and u.BirthdayDisplay <> 3 and month(birthday) = month(getutcdate()) order by day(birthday) asc"); 

@foreach(var user in users)
      &lt;li&gt;@user.FirstName @user.LastName: @user.Birthday.ToShortDateString()&lt;/li&gt;


Dynamic objects returned will have case-sensitive properties exactly as they are constructed in the select for the query.