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 8484561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:24:51+00:00 2026-06-10T20:24:51+00:00

Previously in WebAPI (beta) I was able to create a GetAll method that took

  • 0

Previously in WebAPI (beta) I was able to create a “GetAll” method that took in optional parameters added on the URI:

http://localhost/api/product?take=5&skip=10 

This still seems to work but only if I include all the parameters. In (beta), I could omit the parameters ( http://localhost/api/product/ ) and the “GetAll” method would get called (take & skip would be null). I could also omit some of the parameters http://localhost/api/product?take=5 (skip would be null)

public IEnumerable<ProductHeaderDto> GetAll(int? take, int? skip)
{
    var results = from p in productRepository
                  select new ProductHeaderDto
                    {
                        Id = p.Id,
                        Version = p.Version,
                        Code = p.Code,
                        Description = p.DescriptionInternal,
                        DisplayName = p.Code + " " + p.DescriptionInternal
                    };
    if (skip != null) results = results.Skip(skip.Value);
    if (take != null) results = results.Take(take.Value);
    return results;
}

In (RC), I now get “No action was found on the controller ‘Product’ that matches the request.” when both or one of the parameters are missing. I have tried adding [FromUri] on the method parameters but that has no affect:

public IEnumerable<ProductHeaderDto> GetAll([FromUri] int? take, [FromUri] int? skip)

I have also tried setting default values:

public IEnumerable<ProductHeaderDto> GetAll(int? take = null, int? skip = null)

Is there some sort of “optional” parameter attribute that could be used when trying to match the method signature?

  • 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-10T20:24:52+00:00Added an answer on June 10, 2026 at 8:24 pm

    This is a bug which has been fixed in RTM. You can have optional parameter by specifying default value.

    public IEnumerable<string> Get(int? take = null, int? skip = null)
    

    BTW, you can use $skip and $top in web api odata package to achieve the same functions.

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

Sidebar

Related Questions

Previously, I have an app that uses core data. I use same store url
Previously, I was passing information to a Silverlight control inside of the Page_Load method.
Previously, I asked about a clever way to execute a method on a given
Previously i was able to download YouTube videos as mp3 via youtube-mp3.org Using this
I’ve got a Web API that I’ve added [Authorize] attributes to, which means that
I have a user input form here: http://www.7bks.com/create (Google login required) When you first
Previously I'd worked on a flash application that would be embedded into a webpage
I am attempting to get my .war file that was previously running on my
I know that there is a previously posted question that is very similar to
Previously, I have worked on local notifications, but I got problem in it now.

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.