work with filter

Posts   
 
    
PierreCB
User
Posts: 13
Joined: 24-Jul-2020
# Posted on: 28-Jul-2020 22:26:05   

I'm starting to work with Genpro V5. (I was working with GenPro V1) where can I find a simple example, ideally in vb.net to make a request on a table and a view

I can't use the predicateExpression class.

here's what I tried ' Dim filter1 As PredicateExpression = FournisseurFields.FournisseurID.Equals(1) Dim filter2 As PredicateExpression = (FournisseurFields.FournisseurID = 1) Dim fournisseur As New FournisseurCollection

    fournisseur.GetMulti(filter2)

I use SelfServicing.TowClasses


with this code i have error

    Dim qf as New QueryFactory
    Dim q = QF.Fournisseur.Where(FournisseurFields.FournisseurID.Equal("ABC"))
    Dim fourni as New FournisseurCollection

    fourni.GetMulti(q)

error:

System.InvalidCastException: 'Unable to cast object of type 'SD.LLBLGen.Pro.QuerySpec.EntityQuery`1[ExpertisaBusiness.EntityClasses.FournisseurEntity]' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IPredicate'.'

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-Jul-2020 08:00:02   

Hi Pierre,

With first query, I'm not sure whether that worked or not to you.

In the second query, for SelfServicing, extension methods are defined for IDao and IEntityCollection, to execute a defined query. The extension methods are specified in the SelfServicing specific namespace SD.LLBLGen.Pro.QuerySpec.SelfServicing. It's therefore key your code file contains a using / Imports statement for this namespace to use the QuerySpec methods. Please double check that.

David Elizondo | LLBLGen Support Team