I am looking into ORMLite from ServiceStack and what I am trying to do here is that call a stored procedure which in turn return many many rows which definitely would not be bound to any domain object but also may or may not have a dto object to map with. I was wondering if I can bind it to a type. However, it sounds like ORMLite does not support dynamic type binding at this time. Does ORMLite support at this point?
Best How To :
By design OrmLite does not support marshalling to dynamic types, and expects resultsets to mapped to Typed POCO's.
Although it does have specialized API's to map into loose-typed .NET collections:
Dictionary<int, string> trackIdNamesMap = db.Dictionary<int, string>(
"select Id, Name from Track")
Dictionary<int, List<string>> albumTrackNames = db.Lookup<int, string>(
"select AlbumId, Name from Track")
List<string> trackNames = db.Column<string>("select Name from Track")
HashSet<string> uniqueTrackNames = db.ColumnDistinct<string>("select Name from Track")
Using Dapper's Query
OrmLite does have an embedded version of Dapper which does support dynamic results:
using (var db = new SqlConnection(@"Data Source=... etc."))
var p = new DynamicParameters();
IEnumerable<dynamic> dynamicResults = db.Query(sql:"GetPivotData", param: p,