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

Related Questions

I have an SQL Azure database with a table that has JobId primary key.
I created an asp.net application that fills a table with information from a database,
I have created a table on an Oracle 10g database with this structure :
I have the following database table created thus: CREATE TABLE AUCTIONS ( ARTICLE_NO VARCHAR(20),
I have created a MySQL database using MySQL Workbench. It has about 20 tables.
I have the following problem: Our system has products that when released only are
I have a table that has the following columns: GRVLID GRID Timein Timeout This
Suppose I have this database table (some sample code below) that stores the relationship
I am developing a system that will have a database backend. I am intending
The situation is that I have a table that models an entity. This entity

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.