Converting Lambda expressions at runtime

Έχουν δημοσιευτεί 16 Νοεμβρίου 10 04:01 πμ | tolisss 
DevExpress XPO as all modern ORM supports object querying using linq and lamda expressions. A sample query can be written as             var xpQuery = new XPQuery < Customer >( Session . DefaultSession );             IQueryable < Customer > customers = xpQuery. Where (customer => customer. Age == 25);   From the above query we can get a list of customers that are 25  years old . As you can see the code is very simple. The problem   When working with modularized applications you may be in context that you have access to the Customer type  only at runtime or you may want to apply that query to different object types that all have an Age property. How that can be done? 1st attempt Lets register the customer to our module and use reflection to create the XPQuery.             ModuleXXX moduleXxx = new ModuleXXX ();            

Διαβάστε περισσότερα »

Δημοσίευση στην κατηγορία: , ,

Σχόλια:

Χωρίς Σχόλια
Έχει απενεργοποιηθεί η προσθήκη σχολίων από ανώνυμα μέλη

Search

Go

Το Ιστολόγιο

Ιστορικό Δημοσιεύσεων

Συνδρομές