Chapter 1 C# Language Idioms Item1: Prefer Implicitly Typed Local Variables Item2: Prefer readonly to const Item3: Prefer the is or as Operators to Casts Item4: Replace string.Format() with Interpolated Strings Item5: Prefer FormattableString for Culture-Specific Strings Item6: Avoid String-ly Typed APIs Item7: Express Callbacks with Delegates Item8: Use the Null Conditional Operator for Event Invocations Item9: Minimize Boxing and Unboxing Item10: Use the new Modifier Only to React to Base Class Updates Chapter 2 .NET Resource Management Item11: Understand .NET Resource Management Item12: Prefer Member Initializers to Assignment Statements Item13: Use Proper Initialization for Static Class Members Item14: Minimize Duplicate Initialization Logic Item15: Avoid Creating Unnecessary Objects Item16: Never Call Virtual Functions in Constructors Item17: Implement the Standard Dispose Pattern Chapter 3 Wo with Generics Item18: Always Define Constraints That Are Minimal and Sufficient Item19: Specialize Generic Algorithms Using Runtime Type Che Item20: Implement Ordering Relations with IComparable<T> and IComparer<T> Item21: Always Create Generic Classes That Support Disposable Type Parame Item22: Support Generic Covariance and Contravariance Item23: Use Delegates to Define Method Constraints on Type Parameters Item24: Do Not Create Generic Specialization on Base Classes or Interfaces Item25: Prefer Generic Methods Unless Type Parameters Are Instance Fields Item26: Implement Classic Interfaces in Addition to Generic Interfaces Item27: Augment Minimal Interface Contracts with Extension Methods Item28: Consider Enhancing Constructed Types with Extension Methods Chapter 4 Wo with LINQ Item29: Prefer Iterator Methods to Returning Collections Item30: Prefer Query Syntax to Loops Item31: Create Composable APIs for Sequences Item32: Decouple Iterations from Actions, Predicates, and Functions Item33: Generate Sequence Items as Requested Item34: Loosen Coupling by Using Function Parameters Item35: Never Overload Extension Methods Item36: Understand How Query Expressions Map to Method Calls Item37: Prefer Lazy Evaluation to Eager Evaluation in Queries Item38: Prefer Lambda Expressions to Methods Item39: Avoid Throwing Exceptions in Functions and Actions Item40: Distinguish Early from Deferred Execution Item41: Avoid Capturing Expensive Resources Item42: Distinguish between IEnumerable and IQueryable Data Sources Item43: Use Single() and First() to Enforce Semantic Expectations on Queries Item44: Avoid Modifying Bound Variables Chapter 5 Exception Practices Item45: Use Exceptions to Report Method Contract Failures |