New Posts New Posts RSS Feed: Predicate + Navigation
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Predicate + Navigation

 Post Reply Post Reply
Author
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Topic: Predicate + Navigation
    Posted: 07-Feb-2011 at 9:29am
Hi Sivio,

Now I have more one problem... =/   two tables (Person) (Person_Email) example : one person has Zero Or More Person_Email

public void Get(Person QueryOperation)
{
aPredicateDescription = PredicateBuilder.Make(typeof(Person), "Person_Email.Email", FilterOperator.Contains, QueryOperation.Person_Email.First().Email);

}

show error (Unable to locate property 'EMAIL' on type 'IdeaBlade.EntityModel.RelatedEntityList`1[Project.Entities.Person_Email]'.)

how solve ?

thanks
Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jan-2011 at 10:04am
Ok.. thanks
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jan-2011 at 9:51am
Hi Molinari,
 
It will be possible in DevForce6.0.8 coming up this week:
 
aPredicateDescription = PredicateBuilder.Make(typeof(Person), "Person_Profile.Id_Person_Profile", FilterOperator.IsEqualTo, QueryOperation.Person_Profile.Id_Person_Profile);

Regards,
   Silvio.
Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jan-2011 at 5:29am
Hi,

I have one problem in execute this query with predicate

_em.Person.Where(f=>f.Person_Profile.Id_Person_Profile == 1); to works perfectly....

but i trying using with predicate....

public void Get(Person QueryOperation)
{

List<PredicateDescription> predicateDescriptions = new List<PredicateDescription>();

PredicateDescription aPredicateDescription;

if (QueryOperation.Person.Person_Profile != null)
{
aPredicateDescription = PredicateBuilder.Make(typeof(Person), "Person_Profile", FilterOperator.IsEqualTo, QueryOperation.Person_Profile);
              
predicateDescriptions.Add(aPredicateDescription);
}

//TODO: execute the query ...
}

then show this error

Unable to create a constant value of type 'Crmall.Entities.Person_Profile'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.

then i change code    

aPredicateDescription = PredicateBuilder.Make(typeof(Person), "Person_Profile.Id_Person_Profile", FilterOperator.IsEqualTo, QueryOperation.Person_Profile.Id_Person_Profile);

then show this error..

Unable to locate property 'Person_Profile.Id_Person_Profile' on type 'Crmall.Entities.Person'.......

Ok... then change code

aPredicateDescription = PredicateBuilder.Make(typeof(Person_Profile), "Person_Profile.Id_Person_Profile", FilterOperator.IsEqualTo, QueryOperation.Person_Profile.Id_Person_Profile);

then show same error

Unable to locate property 'Person_Profile.Id_Person_Profile' on type 'Crmall.Entities.Person_Profile'.......


then ideabladeTeam is that possible ?

thanks...






Edited by Molinari - 26-Jan-2011 at 5:29am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down