(int? id, bool? saveChangesError=false

Posted on 2014-02-20
Medium Priority
Last Modified: 2014-02-21
Could someone tell me what this line of code mean

int? id, bool? saveChangesError=false

public ActionResult Delete(int? id, bool? saveChangesError=false)
    if (id == null)
        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    if (saveChangesError.GetValueOrDefault())
        ViewBag.ErrorMessage = "Delete failed. Try again, and if the problem persists see your system administrator.";
    Student student = db.Students.Find(id);
    if (student == null)
        return HttpNotFound();
    return View(student);
Question by:yguyon28
  • 2

Author Comment

ID: 39875784
Does (int? id mean its nulable....
LVL 29

Expert Comment

by:Paul Jackson
ID: 39875792
Yes int? means id is nullable
LVL 29

Accepted Solution

Paul Jackson earned 750 total points
ID: 39875794
Here's some info on nullable types :

LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 750 total points
ID: 39876201
It is specifying that id is a Nullable<int> and saveChanges is a Nullable<bool> with a default value of false.

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question