You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2020. It is now read-only.
Daniel Wertheim edited this page Nov 29, 2012
·
5 revisions
From v11.3.0 you can pass lambdas around as strings and turn them into queries. Install the package SisoDb.Dynamic and then you can do:
usingSisoDb.Dynamic;//IMPORTANT! Since extension methods are declared in herepublicstring[]GetSomeJson(stringstructureTypeName,stringpredicateExpression,stringorderByExpression){varstructureType=GetStructureType(structureTypeName);//Build according to your rulesusing(varsession=Db.BeginSession()){returnsession.Query(structureType).Where(predicateExpression).OrderBy(orderByExpression).ToArrayOfJson();}}