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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:31:08+00:00 2026-05-12T15:31:08+00:00

I have created a table in the database that has a System.Guid as it’s

  • 0

I have created a table in the database that has a System.Guid as it’s primary key. The required ADO.Net Entity Framework model has been generated and the required stored procedures has been mapped.

I created a new controller and added the basic required code for Create and Edit for the data. However when the clicking on the link to edit the a particular record the following error is generated:


The parameters dictionary contains a null entry for parameter '[MyId]' of non-nullable type 'System.Guid' for method 'System.Web.Mvc.ActionResult Edit(System.Guid)' in '[MySite].[MyController].[SpecificController]'. To make a parameter optional its type should be either a reference type or a Nullable type.
Parameter name: parameters

The edit action is declared in the controller as follows:

public ActionResult Edit(Guid itemId)
{
    return View();
}

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(MyItem itemToModify)
{

}

When adding a new record the new Guid is generated via a Stored Procedure and the list is displaying the correct Guid. The Url is also passing the correct Guid for retrieval.

I can’t seem to capture the point at which this fails, but how would I go about passing a System.Guid as a parameter to the Controller?

  • 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-05-12T15:31:08+00:00Added an answer on May 12, 2026 at 3:31 pm

    Unless you’ve updated your routes, it is expecting (by default) the final parameter in a route to be named “id”. That is, if you have a route like /specific/edit/5646-0767-…, it will map the guid into the route value dictionary with key “id” regardless of what the parameter on your method is named. I’d follow this convention and change the method definition to:

    public ActionResult Edit(Guid id)
    

    You can get around this, by explicitly specifying the name of the route parameter, but then you end up with a url that looks like: /specific/edit?itemid=5646-0767-…

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

Sidebar

Ask A Question

Stats

  • Questions 197k
  • Answers 197k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use IOUtils.writeLines(), it receives a Writer object which… May 12, 2026 at 7:17 pm
  • Editorial Team
    Editorial Team added an answer Define an interface for the properties you want in the… May 12, 2026 at 7:17 pm
  • Editorial Team
    Editorial Team added an answer Using GROUP BY/COUNTING: SELECT t.bus_line_id, t.bus_line_type, t.bus_line_number FROM BUS_LINE t… May 12, 2026 at 7:17 pm

Related Questions

I have created a dataset and in the designer I have created the relations
I have created a table in ASP MVC and populate it with data from
I am somewhat new to transactional databases and have come across an issue I
The concept So, I've already made (upgraded actually) this website with its own Content
I have two tables: CREATE TABLE [dbo].[Context] ( [Identity] int IDENTITY (1, 1) NOT

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.