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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:46:26+00:00 2026-05-17T02:46:26+00:00

Possible Duplicate: What is the “??” operator for? Please explain me what is use

  • 0

Possible Duplicate:
What is the “??” operator for?

Please explain me what is use of “??” in below code and what is “??” used for.

if ((this.OrderDate ?? DateTime.MinValue) > DateTime.Today)

{
e.Description = “The Order Date must not be in the future.”;
return false;
}

the above code is at http://nettiers.com/EntityLayer.ashx

Thanks.

  • 1 1 Answer
  • 1 View
  • 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-17T02:46:27+00:00Added an answer on May 17, 2026 at 2:46 am

    (This is a duplicate, but it’s hard to search for, so I’m happy enough to provide more another target for future searches…)

    It’s the null-coalescing operator. Essentially it evaluates the first operand, and if the result is null (either a null reference or the null value for a nullable value type) then it evaluates the second operand. The result is whichever operand was evaluated last, effectively.

    Note that due to its associativity, you can write:

    int? x = E1 ?? E2 ?? E3 ?? E4;
    

    if E1, E2, E3 and E4 are all expressions of type int? – it will start with E1 and progress until it finds a non-null value.

    The first operand has to be a nullable type, but e second operand can be non-nullable, in which case the overall expression type is non-nullable. For example, suppose E4 is an expression of type int (but all the rest are still int? then you can make x non-nullable:

    int x = E1 ?? E2 ?? E3 ?? E4;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Scala “<-” for comprehension Could someone please explain how the <- operator
Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” This code shows warnings
Possible Duplicate: In Javascript, why is the “this” operator inconsistent? I have the following
Possible Duplicate: Shortcut “or-assignment” (|=) operator in Java I found the following example code
Possible Duplicate: where we use object operator “->” in php In PHP 5, what
Possible Duplicate: What is the “??” operator for? I saw a line of code
Possible Duplicate: Python “is” operator behaves unexpectedly with integers Usually I use the type(x)
Possible Duplicate: What is the “double tilde” (~~) operator in JavaScript? I found this
Possible Duplicate: JavaScript === vs == : Does it matter which “equal” operator I
Possible Duplicate: Weird “406 not acceptable” error following code generate a 406 Not Acceptable

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.