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

  • Home
  • SEARCH
  • 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 9185685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:20:14+00:00 2026-06-17T19:20:14+00:00

I have an ASP.NET Web API Controller that exposes an IQueryable(Of String) – which

  • 0

I have an ASP.NET Web API Controller that exposes an IQueryable(Of String) – which is a list of descriptions. These fields can be in the order of tens of thousands, thus I use $top and $skip to only get a chunk of it – that works fine.

Now I am trying to filter these results, through the OData substringof('mydesc',Property) filter. As you can see, it requires for me to pass in a Property name on which to filter. However, since I’m returning a list of strings, I don’t actually have any properties to filter on.

This causes the server to return errors like
No property or field 'tostring' exists in type 'String' – when called with $filter=substringof('asd',tostring).

If I change the call to $filter=substringof('asd',''), no errors are thrown, but no results either.

My question is, can I somehow format the $filter operator to find substrings within my list of strings, without looking for a property/field, or am I going to have to declare a class with a single property, just to enable filtering?

  • 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-17T19:20:15+00:00Added an answer on June 17, 2026 at 7:20 pm

    Things have changed since the last time I answered this. OData V3 has support for querying collection of primitives using ‘$it’. Asp.net Web API supports this syntax as well. For example, in your controller you can return IQueryable<string> and send a request like

    $filter=substring(‘mydesc’, $it) or

    $filter=length($it) ge 5

    etc. You can also expose collections of other primitives like IQueryable etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a ASP.NET Web API controller that uses a service, which in
I have created an ASP.NET web API controller that is returning a strongly typed
I have a public self-hosted ASP.NET Web API service that exposes two controllers. One
I have a ASP.NET MVC Web API controller that returns public IEnumerable<IMessage> Get() It
Using the ASP.NET Web-Api, I have the following POST setup in my controller. When
All, I have a ASP.NET Web API project that is making a REST call
I am trying to make a secure asp.net web api. For that I have
I have an ASP.NET Web API (version 4) REST service where I need to
I have the following action in my ASP.NET Web API: public IEnumerable<Car> carssOfUser(int id,
I have a Asp.net WebAPI service that is hosted on AppHarbor which throws 404

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.