Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library)(weblogs.asp.net)

submitted by JemmJemm(9604) 4 years, 4 months ago

While writing type-safe queries is great for most scenarios, there are cases where you want the flexibility to dynamically construct queries on the fly. For example: you might want to provide business intelligence UI within your application that allows an end-user business analyst to use drop-downs to build and express their own custom queries/views on top of data.

1 comment |category: |Views: 178

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by WallaWalla(0) 4 years, 4 months ago 0

How do I make this dynamic only one Query

WaDBLinQ db = new WaDBLinQ();

var res = from allPer in db.a_allPerson_CL
from premList in allPer.a_crmListsPermission_List
where allPer.allPerID == userAllPerID
orderby premList.a_crmListsName_Obj.crmLNaName + " "
select new { premList.crmLPeCanDelete, premList.a_crmListsName_Obj.crmLNaID, crmLNaName = premList.a_crmListsName_Obj.crmLNaName + " (" + premList.a_crmListsName_Obj.a_crmLists_List.Count().ToString() + ")" };
if (crmCTyID > 0)
res = from allPer in db.a_allPerson_CL
from premList in allPer.a_crmListsPermission_List
where allPer.allPerID == userAllPerID && (int)premList.a_crmListsName_Obj.crmCTyID == crmCTyID
orderby premList.a_crmListsName_Obj.crmLNaName
select new { premList.crmLPeCanDelete, premList.a_crmListsName_Obj.crmLNaID, crmLNaName = premList.a_crmListsName_Obj.crmLNaName + " (" + premList.a_crmListsName_Obj.a_crmLists_List.Count().ToString() + ")" };

Reply

information Login or create an account to comment on this story