More in this section

Forums / General Discussions / FLEUNT API WITH LINQ AND INNER JOIN

FLEUNT API WITH LINQ AND INNER JOIN

7 posts, 0 answered
  1. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    02 Feb 2011
    Link to this post
    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
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Feb 2011
    Link to this post
    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
  3. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    07 Feb 2011
    Link to this post

    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.

  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 Feb 2011
    Link to this post
    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
  5. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    07 Feb 2011
    Link to this post
    Hello.
    If i follow the above code i am getting the following error :Exception has been thrown by the target of an invocation.

  6. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    08 Feb 2011
    Link to this post
    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();
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    10 Feb 2011
    Link to this post
    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
7 posts, 0 answered