c# - Can ServiceStack.OrmLite "LoadSelect" not load IEnumerable references? -
given next abbreviated dto's...
public class order { public int id { get; set; } [references(typeof(customer))] public int? customerid { get; set; } [reference] public list<orderitem> orderitems { get; set; } } public class orderitem { public int id { get; set; } [references(typeof(order))] public int? orderid { get; set; } public string productid { get; set; } [reference] public product product { get; set; } }
...with next service...
[route("/orders", "get")] public class getorders : ireturn<ienumerable<order>> { public int? page { get; set; } public int? show { get; set; } } public class orderservice : service { public list<order> get(getorders request) { var query = db.from<order>() .orderbydescending(q => q.id) .limit(request.page.getvalueordefault(0) * request.show.getvalueordefault(25), request.show.getvalueordefault(25)); homecoming db.loadselect(query); } }
the loadselect
load customer
reference, not load orderitems
reference. there way forcefulness to? i've tried throwing in join
forcefulness it, seek seems either bomb because of orderby , limit, or homecoming entire dataset before limiting kills performance.
am missing something, or not supported?
firstly recommend using id
naming convention instead of id
when using servicestack libraries.
this looks it's similar issue loading reference info loadselect
in sqlserver in paged query has been resolved in latest v4.0.34+ now available on myget.
c# servicestack ormlite-servicestack
No comments:
Post a Comment