Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8961423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:53:21+00:00 2026-06-15T15:53:21+00:00

Can anyone help me understand why the piece of code below returns no results

  • 0

Can anyone help me understand why the piece of code below returns no results from the query yet the second sample does (though woe betide me if I try to use criteria on the second one!)

 type EbayData = 
    ODataService<"http://ebayodata.cloudapp.net">

let Ebay = EbayData.GetDataContext()

let Favourites title number = query{
    for deal in Ebay.Deals do
    where (deal.Title.Contains(title))
    take number
    }


let Esearch title number =  [for item in Favourites title number do 
                                  yield item]

The working version:

type Catalog = ODataService< "http://ebayodata.cloudapp.net/" >

let ebay = Catalog.GetDataContext()

let trial =
            [ for item in ebay.Deals do
               yield item]

I can’t seem to output the first to any kind of list, no matter what do with |> etc. The second sample doesn’t seem to bring back many resuls to do a text query on. However, my real issue is I can’t seem to get anything out of the LINQ in F# version.

The output is used in a WPF application where I use VB to talk to the list. I have populated a non discriminated list of 10 items with it, so that end does work. This is the VB code.

 For Each Deal In trial.Where(Function(p) p.Title.Contains(title.Text))
                DealResults.Items.Add(buildStackPanel(Deal))
            Next

The spacing for the F Sharp on this post doesn’t seem to work when I hit Ctrl-K so if anyone can tell me what I’m doing wrong – I guess that’s a second question!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:53:23+00:00Added an answer on June 15, 2026 at 3:53 pm

    I don’t know why this is not working for you. I knocked out the following and it seems to work:

    open Microsoft.FSharp.Data
    type Catalog = TypeProviders.ODataService< "http://ebayodata.cloudapp.net/" >
    
    let ebay = Catalog.GetDataContext()
    
    let trial =
                [ for item in ebay.Deals do
                   yield item]
    let trial2 = query {
                    for deal in ebay.Deals do
                    where (deal.Title.Contains "a")
                    take 2
                 }
    let ESearch title number =
                 query {
                    for deal in ebay.Deals do
                    where (deal.Title.Contains title)
                    take number
                 }
    
    [<EntryPoint>]
    let main argv = 
        trial |> Seq.take 2 |> Seq.iter (fun d -> printfn "%s" d.Title)
        trial2 |> Seq.iter (fun d -> printfn "%s" d.Title)
        ESearch "a" 2 |> Seq.iter (fun d -> printfn "%s" d.Title)
    
        0
    

    Maybe you tried searching for stuff that doesn’t exist? At the moment there are only 6 deals, so this is not unlikely.

    Querying Items

    Read about the eBay OData service here: http://ebayodata.cloudapp.net/docs
    It has special needs when querying for Items:

    (search parameter or $filter with Seller, PrimaryCategoryId or
    SecondaryCategoryId is required)

    So to query Items, you’ll need to provide at least a search phrase. Your where statement doesn’t get translated to a search parameter in the final url. To add custom parameters in this Type Provider, you do .AddQueryOption.

    let ItemSearch title number =
                 query {
                    for item in ebay.Items
                                 .AddQueryOption("search", title) do
                    take number
                 }
    // use
    ItemSearch "wario" 2 |> Seq.iter (fun d -> printfn "%s" d.Title)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me understand why my code (see below) is resulting in the
Can anyone help me understand this query? The mktpgmvhclxref.mktpgmvhclxrefId.mktgPgm part mostly. Generally it is
Can anyone help me understand what is going on here? Jenkins has been working
Hey can anyone help me understand how to do an edit method for my
Can anyone please help me to understand how should i access json data in
I wonder if anyone can help me to understand where I could be going
Can anyone help me understand when to use :NEW and :OLD in PLSQL blocks,
Can anyone help me understand #pragma? ifndef TARGET_OS_LINUX #pragma once endif What,when, where, why,
Can anyone help me understand why this is not working? <div id=css-check class=css-check tool-tip
Can anyone help me understand how the DataTables $.fn.dataTableExt.afnFiltering.push method works? I know that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.