FLEUNT API WITH LINQ AND INNER JOIN

Posted by Community Admin on 03-Aug-2018 14:00

FLEUNT API WITH LINQ AND INNER JOIN

All Replies

Posted by Community Admin on 02-Feb-2011 00:00

I am getting two different result if i use the following code.i need to do this as inner join if PGSID value is common 
then it should get both value in one result

or 

if its possible to give idoc  as where condition in IdocFull?

 IQueryable<Document> IdocFull = App.WorkWith()
                                                   .Documents()
                                                   .Where(dc => dc.Parent.Title == "SS"
                                                         && dc.Status == ContentLifecycleStatus.Live)
                                                   .Get();


                 IQueryable<Document> idoc = App.WorkWith()
                                               .Documents()
                                               .Where(dcs => dcs.Parent.Title == "JPGroup"
                                                          && dcs.Status == ContentLifecycleStatus.Live
                                                          && dcs.GetValue("PGSID").Equals(UserEmailID))
                                               .Get();

 Thank you

Posted by Community Admin on 05-Feb-2011 00:00

Hi Jmr,

You can try the bellow code:

IQueryable<Document> IdocFull = App.WorkWith()
                                                  .Documents()
                                                  .Where(dc => dc.Parent.Title == "SS"
                                                        && dc.Status == ContentLifecycleStatus.Live)
                                                  .Where(dc=> idoc.Contains(dc));
                                                  .Get();

Best wishes,
Radoslav Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Feb-2011 00:00


Hi,

The following API working fine,now i want to check or get value using like operation For example dcs.GetValue("PGSID"). (or like ) Equals(UserEmailID)).

IQueryable<Document> idoc = App.WorkWith()
                                               .Documents()
                                               .Where(dcs => dcs.Parent.Title == "JPGroup"
                                                          && dcs.Status == ContentLifecycleStatus.Live
                                                          && dcs.GetValue("PGSID").Equals(UserEmailID))
                                               .Get();

Thanking you.

Posted by Community Admin on 07-Feb-2011 00:00

Hello Jmr,

The && is used for AND, for OR  you should use ||. What you can do is to cast the value to string and use contains: dcs.GetValue("PGSID").ToString().Contains(UserEmailID))

Best wishes,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-Feb-2011 00:00

Hello.
If i follow the above code i am getting the following error :Exception has been thrown by the target of an invocation.

Posted by Community Admin on 08-Feb-2011 00:00

Hi,

Here i am getting error like this for following API :

Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index


var SearchZIP =App.WorkWith()
                             .Documents()
    .Where(ts => ts.GetValue("ZIPCODE").ToString().StartsWith(sZip)).Get();

Posted by Community Admin on 10-Feb-2011 00:00

Hi Jmr,

Could it be possible that the ZIPCODE value is not set on some of your items and that the sZip variable exceets the length of the ZIPCODE field?

Greetings,
Radoslav Georgiev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed