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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:25:22+00:00 2026-06-12T11:25:22+00:00

I have a problem with a small app i am writing. Now either my

  • 0

I have a problem with a small app i am writing. Now either my error is in my controller class or its in Routes. See images below.

Controller Class.

This is the controller i am trying to execute

This is the default Route i have.

RouteConfig file

And this is the error i get when i run.
Image not very clear but it says:

The parameters dictionary contains a null entry for parameter ‘playerId’ of non-nullable type ‘System.Int32’ for method ‘System.Web.Mvc.ActionResult Detail(Int32)’ in ‘GlobalUnited.WebUI.Controllers.PlayerController’. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters

Error

I read through some posts on here, one particularly:
Similar Link

What exactly does he mean when Daniel Renshaw says:

First, I would suggest you use MVC’s automatic handling of parameters instead ofpulling them out of the Request yourself. Your controller action has an id parameter which seems to go ignored – use that and add others like it to get the input parameters.

Anyways, after reading that post, i changed my RouteConfig file to:

Changed Route

And Still i got this error. It says:

A route named ‘DefaultApi’ is already in the route collection. Route names must be unique.
Parameter name: name

Route

I even tried to change my Detail action parameter to: Note the int? declaration
method

And i got this error after changing:

enter image description here

Is there something i could do to fix this, something less complicated??
All help will be appreciated, thanks.

  • 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-12T11:25:23+00:00Added an answer on June 12, 2026 at 11:25 am

    Your parameter name playerID causes the problem here. ASP.NET MVC can only provide you a parameter named id using the default route. In your case, it cannot map the request to your action because playerID is not nullable or optional. Changing your parameter name to id will solve the problem.

    public ActionResult Detail(int id)
    

    You get the second error with route registration because you already have a route named “DefaultApi”. You won’t need this route if you change the parameter name(also it’s registered elsewhere).

    Third error is for trying to querying with the null value. ASP.NET MVC cannot map the value in URL to your parameter and you get the default value null. Since there isn’t a row with a null value you get an empty sequence, then Single() method throws an exception.

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

Sidebar

Related Questions

I'm developing small FTP upload app. for mac (10.6 if it matters) Have problem
I have a small problem during debugging my App in VS 2010 RC when
My problem is that I have an app which is writing a lot of
I have a small problem. My app has a database which stores lazy loaded
I have a problem with a small app I'm trying to build. When I
i have a small problem... i want to bind my app to adminsite. my
I'm currently writing a small test Android app, and have run across a small
I Have a small problem with NSCoding and NSKeyedArchiver when persisting my App Settings
I have got a small problem in an Android app I am working on
have small problem, and would very much appreciate help :) I should convert byte

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.