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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:32:41+00:00 2026-06-14T00:32:41+00:00

A real head-scrather this one. I have created two ApiControllers which I am using

  • 0

A real head-scrather this one. I have created two ApiControllers which I am using as a JSON webservice:-

namespace ControlTower.Controllers
{
    public class AirlinesController : ApiController
    {
        private static IEnumerable<Airline> MapAirlines()
        {
            return (Jetstream.AirlineObject.GetAirlines()).Select(x => x);
        }

        [HttpGet]
        public IEnumerable<Airline> GetAirlines()
        {
            return MapAirlines().AsEnumerable();
        }

        [HttpGet]
        public Airline GetAirlineByCode(string code)
        {
            return Jetstream.AirlineObject.GetAirline(code);
        }
    }
}

and:-

namespace ControlTower.Controllers
{
    public class ReviewsController : ApiController
    {
        private static IEnumerable<Review> MapReviews(int airline)
        {
            return (Jetstream.ReviewObject.GetReviews(airline)).Select(x => x);
        }

        [HttpGet]
        public IEnumerable<Review> GetReviews(int airline)
        {
            return MapReviews(airline).AsEnumerable();
        }

        [HttpGet]
        public Review GetReviewById(int review)
        {
            return Jetstream.ReviewObject.GetReview(review);
        }
    }
}

With this routing:-

config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/get/{code}",
                defaults: new { code = RouteParameter.Optional }
            );

And whilst visiting /api/airline/get/ba or /api/airline/get/ works perfectly, visiting any variation of Review does not. Can anyone see anything really obvious I’m missing here?

Help is appreciated.

  • 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-14T00:32:42+00:00Added an answer on June 14, 2026 at 12:32 am

    Your default route is expecting a parameter named “code”. You either need to add a route to accept a parameter named airline and/or review, or explicitly tell the controller the name of the parameter.

    ex. /api/reviews/get?airline=1

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

Sidebar

Related Questions

This one is a real head scratcher... I have a number of command links
This one is a real head scratcher for me... var matches = Regex.Matches(<p>test something<script
I'm trying to head this one off at the pass. I've got two database
Okay this is a real headscratcher. I have an application which calls a web
Real noob question no doubt, but I can't get my head around this behaviour.
I'm having a real problem with this because I just can't get my head
I'm a real noob to encryption. After breaking my head over this for a
I'm onto a real head scratcher here ... and it appears to be one
This is a real head scratcher for me. Our site (amyadele.com/labels/holiday-and-seasonal/…), has a price
I've been banging my head against this for the past two days and can't

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.