?.
(question mark, dot), null-conditional operator, 125–128
.
(dot) dot operator, 126
ArgumentNullException
, 434–435, 436
ArgumentOutOfRangeException
, 435, 436
Arrays, initializing anonymous type, 579–580
Automatically implemented properties
initializing, 242
NextId
implementation, 273
Boolean expressions, logical operators
?.
(question mark, dot), null-conditional operator, 125–128
.
(dot) dot operator, 126
Catching exceptions. See also Exception handling; Throwing exceptions.
conditional clauses, 438
exception conditions, 438
rethrowing existing exceptions, 438–439
System.InvalidOperationException
, 438
when
clauses, 438
Classes, inextensible, 273–275
Collection initializers, initializing anonymous type arrays, 579–580
Conditional clauses, catching exceptions, 438
Delegates, with the null-conditional operator, 128
Exception handling. See also Catching exceptions; Throwing exceptions.
guidelines, 445
passing null exceptions, 434
Immutability of value types, 357
Methods, declaring
expression bodied methods, 174
Move()
method, 357
nameof
operator, 246–247, 435, 436, 694–696
Namespaces, dropping, 53–54. See also using
directive.
.NET versions, 29
NextId
implementation, 273
NextId
initialization, 273
null,
checking code for, 548
NullReferenceException
, 128, 434, 436
OutOfMemoryException
, 435
Properties
automatically implemented, 242, 248, 273, 280
Publishing code, checking for null
, 548
readonly
modifier, 280
Read-only properties, 248, 280
struct
keyword, 356
Structs
declaring, 356
definition, 356
finalizer support, 360
referential identity, 360
System.ApplicationException
, 435, 436
System.ArgumentException
, 436
System.Environment.FailFast()
method, 435, 436
System.ExecutionEngineException
, 435
System.InvalidOperationException
, 438
System.OutOfMemoryException
, 435
System.Runtime.InteropServices.COMException
, 435
System.Runtime.InteropServices.SEHException
, 435
System.StackOverflowException
, 435
System.SystemException
, 435, 436
TextNumberParser.Parse()
method, 434
ArgumentNullException
, 434–435, 436
ArgumentOutOfRangeException
, 435, 436
code sample, 434
identifying the parameter name, 435
NullReferenceException
, 434, 436
System.ApplicationException
, 435, 436
System.ArgumentException
, 436
System.Environment.FailFast()
method, 435, 436
System.ExecutionEngineException
, 435
System.OutOfMemoryException
, 435
System.Runtime.InteropServices.COMException
, 435
System.Runtime.InteropServices.SEHException
, 435
System.StackOverflowException
, 435
System.SystemException
, 435, 436
Type names, abbreviating, 178–179
using static
directive
abbreviating a type name, 178–179
Value types
immutability, 357
when
clauses, 438