Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

(int? id, bool? saveChangesError=false

Posted on 2014-02-20
4
472 Views
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);
}
0
Comment
Question by:yguyon28
  • 2
4 Comments
 

Author Comment

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

Expert Comment

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

Accepted Solution

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

http://msdn.microsoft.com/en-us/library/2cf62fcy.aspx
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 250 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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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