C# Notes for Professionals book

    Amazing collection of free programming books

    Collecting
    Free
    Amazing collection of free programming books

    The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified

    Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners

    https://goalkicker.com/

    Content

    • 1-1
      Content list
    • 1-2
      About
    • 1-3
      Chapter 1: Getting started with C# Language
    • 1-4
      Section 1.1: Creating a new console application (Visual Studio)
    • 1-5
      Section 1.2: Creating a new project in Visual Studio (console application) and Running it in Debug mode
    • 1-6
      Section 1.3: Creating a new program using .NET Core
    • 1-7
      Section 1.4: Creating a new program using Mono
    • 1-8
      Section 1.5: Creating a new query using LinqPad
    • 1-9
      Section 1.6: Creating a new project using Xamarin Studio
    • 1-10
      Chapter 2: Literals
    • 1-11
      Section 2.1: uint literals
    • 1-12
      Section 2.2: int literals
    • 1-13
      Section 2.3: sbyte literals
    • 1-14
      Section 2.4: decimal literals
    • 1-15
      Section 2.5: double literals
    • 1-16
      Section 2.6: float literals
    • 1-17
      Section 2.7: long literals
    • 1-18
      Section 2.8: ulong literal
    • 1-19
      Section 2.9: string literals
    • 1-20
      Section 2.10: char literals
    • 1-21
      Section 2.11: byte literals
    • 1-22
      Section 2.12: short literal
    • 1-23
      Section 2.13: ushort literal
    • 1-24
      Section 2.14: bool literals
    • 1-25
      Chapter 3: Operators
    • 1-26
      Section 3.1: Overloadable Operators
    • 1-27
      Section 3.2: Overloading equality operators
    • 1-28
      Section 3.3: Relational Operators
    • 1-29
      Section 3.4: Implicit Cast and Explicit Cast Operators
    • 1-30
      Section 3.5: Short-circuiting Operators
    • 1-31
      Section 3.6: ? : Ternary Operator
    • 1-32
      Section 3.7: ?. (Null Conditional Operator)
    • 1-33
      Section 3.8: "Exclusive or" Operator
    • 1-34
      Section 3.9: default Operator
    • 1-35
      Section 3.10: Assignment operator '='
    • 1-36
      Section 3.11: sizeof
    • 1-37
      Section 3.12: ?? Null-Coalescing Operator
    • 1-38
      Section 3.13: Bit-Shifting Operators
    • 1-39
      Section 3.14: => Lambda operator
    • 1-40
      Section 3.15: Class Member Operators: Null Conditional Member Access
    • 1-41
      Section 3.16: Class Member Operators: Null Conditional Indexing
    • 1-42
      Section 3.17: Postfix and Prefix increment and decrement
    • 1-43
      Section 3.18: typeof
    • 1-44
      Section 3.19: Binary operators with assignment
    • 1-45
      Section 3.20: nameof Operator
    • 1-46
      Section 3.21: Class Member Operators: Member Access
    • 1-47
      Section 3.22: Class Member Operators: Function Invocation
    • 1-48
      Section 3.23: Class Member Operators: Aggregate Object Indexing
    • 1-49
      Chapter 4: Conditional Statements
    • 1-50
      Section 4.1: If-Else Statement
    • 1-51
      Section 4.2: If statement conditions are standard boolean expressions and values
    • 1-52
      Section 4.3: If-Else If-Else Statement
    • 1-53
      Chapter 5: Equality Operator
    • 1-54
      Section 5.1: Equality kinds in c# and equality operator
    • 1-55
      Chapter 6: Equals and GetHashCode
    • 1-56
      Section 6.1: Writing a good GetHashCode override
    • 1-57
      Section 6.2: Default Equals behavior
    • 1-58
      Section 6.3: Override Equals and GetHashCode on custom types
    • 1-59
      Section 6.4: Equals and GetHashCode in IEqualityComparator
    • 1-60
      Chapter 7: Null-Coalescing Operator
    • 1-61
      Section 7.1: Basic usage
    • 1-62
      Section 7.2: Null fall-through and chaining
    • 1-63
      Section 7.3: Null coalescing operator with method calls
    • 1-64
      Section 7.4: Use existing or create new
    • 1-65
      Section 7.5: Lazy properties initialization with null coalescing operator
    • 1-66
      Chapter 8: Null-conditional Operators
    • 1-67
      Section 8.1: Null-Conditional Operator
    • 1-68
      Section 8.2: The Null-Conditional Index
    • 1-69
      Section 8.3: Avoiding NullReferenceExceptions
    • 1-70
      Section 8.4: Null-conditional Operator can be used with Extension Method
    • 1-71
      Chapter 9: nameof Operator
    • 1-72
      Section 9.1: Basic usage: Printing a variable name
    • 1-73
      Section 9.2: Raising PropertyChanged event
    • 1-74
      Section 9.3: Argument Checking and Guard Clauses
    • 1-75
      Section 9.4: Strongly typed MVC action links
    • 1-76
      Section 9.5: Handling PropertyChanged events
    • 1-77
      Section 9.6: Applied to a generic type parameter
    • 1-78
      Section 9.7: Printing a parameter name
    • 1-79
      Section 9.8: Applied to qualified identifiers
    • 1-80
      Chapter 10: Verbatim Strings
    • 1-81
      Section 10.1: Interpolated Verbatim Strings
    • 1-82
      Section 10.2: Escaping Double Quotes
    • 1-83
      Section 10.3: Verbatim strings instruct the compiler to not use character escapes
    • 1-84
      Section 10.4: Multiline Strings
    • 1-85
      Chapter 11: Common String Operations
    • 1-86
      Section 11.1: Formatting a string
    • 1-87
      Section 11.2: Correctly reversing a string
    • 1-88
      Section 11.3: Padding a string to a fixed length
    • 1-89
      Section 11.4: Getting x characters from the right side of a string
    • 1-90
      Section 11.5: Checking for empty String using String.IsNullOrEmpty() and String.IsNullOrWhiteSpace()
    • 1-91
      Section 11.6: Trimming Unwanted Characters O the Start and/or End of Strings
    • 1-92
      Section 11.7: Convert Decimal Number to Binary,Octal and Hexadecimal Format
    • 1-93
      Section 11.8: Construct a string from Array
    • 1-94
      Section 11.9: Formatting using ToString
    • 1-95
      Section 11.10: Splitting a String by another string
    • 1-96
      Section 11.11: Splitting a String by specific character
    • 1-97
      Section 11.12: Getting Substrings of a given string
    • 1-98
      Section 11.13: Determine whether a string begins with a given sequence
    • 1-99
      Section 11.14: Getting a char at specific index and enumerating the string
    • 1-100
      Section 11.15: Joining an array of strings into a new one
    • 1-101
      Section 11.16: Replacing a string within a string
    • 1-102
      Section 11.17: Changing the case of characters within a String
    • 1-103
      Section 11.18: Concatenate an array of strings into a single string
    • 1-104
      Section 11.19: String Concatenation
    • 1-105
      Chapter 12: String.Format
    • 1-106
      Section 12.1: Since C# 6.0
    • 1-107
      Section 12.2: Places where String.Format is 'embedded' in the framework
    • 1-108
      Section 12.3: Create a custom format provider
    • 1-109
      Section 12.4: Date Formatting
    • 1-110
      Section 12.5: Currency Formatting
    • 1-111
      Section 12.6: Using custom number format
    • 1-112
      Section 12.7: Align left/ right, pad with spaces
    • 1-113
      Section 12.8: Numeric formats
    • 1-114
      Section 12.9: ToString()
    • 1-115
      Section 12.10: Escaping curly brackets inside a String.Format() expression
    • 1-116
      Section 12.11: Relationship with ToString()
    • 1-117
      Chapter 13: String Concatenate
    • 1-118
      Section 13.1: + Operator
    • 1-119
      Section 13.2: Concatenate strings using System.Text.StringBuilder
    • 1-120
      Section 13.3: Concat string array elements using String.Join
    • 1-121
      Section 13.4: Concatenation of two strings using $
    • 1-122
      Chapter 14: String Manipulation
    • 1-123
      Section 14.1: Replacing a string within a string
    • 1-124
      Section 14.2: Finding a string within a string
    • 1-125
      Section 14.3: Removing (Trimming) white-space from a string
    • 1-126
      Section 14.4: Splitting a string using a delimiter
    • 1-127
      Section 14.5: Concatenate an array of strings into a single string
    • 1-128
      Section 14.6: String Concatenation
    • 1-129
      Section 14.7: Changing the case of characters within a String
    • 1-130
      Chapter 15: String Interpolation
    • 1-131
      Section 15.1: Format dates in strings
    • 1-132
      Section 15.2: Padding the output
    • 1-133
      Section 15.3: Expressions
    • 1-134
      Section 15.4: Formatting numbers in strings
    • 1-135
      Section 15.5: Simple Usage
    • 1-136
      Chapter 16: String Escape Sequences
    • 1-137
      Section 16.1: Escaping special symbols in string literals
    • 1-138
      Section 16.2: Unicode character escape sequences
    • 1-139
      Section 16.3: Escaping special symbols in character literals
    • 1-140
      Section 16.4: Using escape sequences in identifiers
    • 1-141
      Section 16.5: Unrecognized escape sequences produce compile-time errors
    • 1-142
      Chapter 17: StringBuilder
    • 1-143
      Section 17.1: What a StringBuilder is and when to use one
    • 1-144
      Section 17.2: Use StringBuilder to create string from a large number of records
    • 1-145
      Chapter 18: Regex Parsing
    • 1-146
      Section 18.1: Single match
    • 1-147
      Section 18.2: Multiple matches
    • 1-148
      Chapter 19: DateTime Methods
    • 1-149
      Section 19.1: DateTime Formatting
    • 1-150
      Section 19.2: DateTime.AddDays(Double)
    • 1-151
      Section 19.3: DateTime.AddHours(Double)
    • 1-152
      Section 19.4: DateTime.Parse(String)
    • 1-153
      Section 19.5: DateTime.TryParse(String, DateTime)
    • 1-154
      Section 19.6: DateTime.AddMilliseconds(Double)
    • 1-155
      Section 19.7: DateTime.Compare(DateTime t1, DateTime t2 )
    • 1-156
      Section 19.8: DateTime.DaysInMonth(Int32, Int32)
    • 1-157
      Section 19.9: DateTime.AddYears(Int32)
    • 1-158
      Section 19.10: Pure functions warning when dealing with DateTime
    • 1-159
      Section 19.11: DateTime.TryParseExact(String, String, IFormatProvider, DateTimeStyles, DateTime)
    • 1-160
      Section 19.12: DateTime.Add(TimeSpan)
    • 1-161
      Section 19.13: Parse and TryParse with culture info
    • 1-162
      Section 19.14: DateTime as initializer in for-loop
    • 1-163
      Section 19.15: DateTime.ParseExact(String, String, IFormatProvider)
    • 1-164
      Section 19.16: DateTime ToString, ToShortDateString, ToLongDateString and ToString formatted
    • 1-165
      Section 19.17: Current Date
    • 1-166
      Chapter 20: Arrays
    • 1-167
      Section 20.1: Declaring an array
    • 1-168
      Section 20.2: Initializing an array filled with a repeated non-default value
    • 1-169
      Section 20.3: Copying arrays
    • 1-170
      Section 20.4: Comparing arrays for equality
    • 1-171
      Section 20.5: Multi-dimensional arrays
    • 1-172
      Section 20.6: Getting and setting array values
    • 1-173
      Section 20.7: Iterate over an array
    • 1-174
      Section 20.8: Creating an array of sequential numbers
    • 1-175
      Section 20.9: Jagged arrays
    • 1-176
      Section 20.10: Array covariance
    • 1-177
      Section 20.11: Arrays as IEnumerable<> instances
    • 1-178
      Section 20.12: Checking if one array contains another array
    • 1-179
      Chapter 21: O(n) Algorithm for circular rotation of an array
    • 1-180
      Section 21.1: Example of a generic method that rotates an array by a given shift
    • 1-181
      Chapter 22: Enum
    • 1-182
      Section 22.1: Enum basics
    • 1-183
      Section 22.2: Enum as flags
    • 1-184
      Section 22.3: Using << notation for flags
    • 1-185
      Section 22.4: Test flags-style enum values with bitwise logic
    • 1-186
      Section 22.5: Add and remove values from flagged enum
    • 1-187
      Section 22.6: Enum to string and back
    • 1-188
      Section 22.7: Enums can have unexpected values
    • 1-189
      Section 22.8: Default value for enum == ZERO
    • 1-190
      Section 22.9: Adding additional description information to an enum value
    • 1-191
      Section 22.10: Get all the members values of an enum
    • 1-192
      Section 22.11: Bitwise Manipulation using enums
    • 1-193
      Chapter 23: Tuples
    • 1-194
      Section 23.1: Accessing tuple elements
    • 1-195
      Section 23.2: Creating tuples
    • 1-196
      Section 23.3: Comparing and sorting Tuples
    • 1-197
      Section 23.4: Return multiple values from a method
    • 1-198
      Chapter 24: Guid
    • 1-199
      Section 24.1: Getting the string representation of a Guid
    • 1-200
      Section 24.2: Creating a Guid
    • 1-201
      Section 24.3: Declaring a nullable GUID
    • 1-202
      Chapter 25: BigInteger
    • 1-203
      Section 25.1: Calculate the First 1,000-Digit Fibonacci Number
    • 1-204
      Chapter 26: Collection Initializers
    • 1-205
      Section 26.1: Collection initializers
    • 1-206
      Section 26.2: C# 6 Index Initializers
    • 1-207
      Section 26.3: Collection initializers in custom classes
    • 1-208
      Section 26.4: Using collection initializer inside object initializer
    • 1-209
      Section 26.5: Collection Initializers with Parameter Arrays
    • 1-210
      Chapter 27: An overview of C# collections
    • 1-211
      Section 27.1: HashSet<T>
    • 1-212
      Section 27.2: Dictionary<TKey, TValue>
    • 1-213
      Section 27.3: SortedSet<T>
    • 1-214
      Section 27.4: T[ ] (Array of T)
    • 1-215
      Section 27.5: List<T>
    • 1-216
      Section 27.6: Stack<T>
    • 1-217
      Section 27.7: LinkedList<T>
    • 1-218
      Section 27.8: Queue
    • 1-219
      Chapter 28: Looping
    • 1-220
      Section 28.1: For Loop
    • 1-221
      Section 28.2: Do - While Loop
    • 1-222
      Section 28.3: Foreach Loop
    • 1-223
      Section 28.4: Looping styles
    • 1-224
      Section 28.5: Nested loops
    • 1-225
      Section 28.6: continue
    • 1-226
      Section 28.7: While loop
    • 1-227
      Section 28.8: break
    • 1-228
      Chapter 29: Iterators
    • 1-229
      Section 29.1: Creating Iterators Using Yield
    • 1-230
      Section 29.2: Simple Numeric Iterator Example
    • 1-231
      Chapter 30: IEnumerable
    • 1-232
      Section 30.1: IEnumerable with custom Enumerator
    • 1-233
      Section 30.2: IEnumerable<int>
    • 1-234
      Chapter 31: Value type vs Reference type
    • 1-235
      Section 31.1: Passing by reference using ref keyword
    • 1-236
      Section 31.2: Changing values elsewhere
    • 1-237
      Section 31.3: ref vs out parameters
    • 1-238
      Section 31.4: Assignment
    • 1-239
      Section 31.5: Dierence with method parameters ref and out
    • 1-240
      Section 31.6: Passing by reference
    • 1-241
      Chapter 32: Built-in Types
    • 1-242
      Section 32.1: Conversion of boxed value types
    • 1-243
      Section 32.2: Comparisons with boxed value types
    • 1-244
      Section 32.3: Immutable reference type - string
    • 1-245
      Section 32.4: Value type - char
    • 1-246
      Section 32.5: Value type - short, int, long (signed 16 bit, 32 bit, 64 bit integers)
    • 1-247
      Section 32.6: Value type - ushort, uint, ulong (unsigned 16 bit, 32 bit, 64 bit integers)
    • 1-248
      Section 32.7: Value type - bool
    • 1-249
      Chapter 33: Aliases of built-in types
    • 1-250
      Section 33.1: Built-In Types Table
    • 1-251
      Chapter 34: Anonymous types
    • 1-252
      Section 34.1: Anonymous vs dynamic
    • 1-253
      Section 34.2: Creating an anonymous type
    • 1-254
      Section 34.3: Anonymous type equality
    • 1-255
      Section 34.4: Generic methods with anonymous types
    • 1-256
      Section 34.5: Instantiating generic types with anonymous types
    • 1-257
      Section 34.6: Implicitly typed arrays
    • 1-258
      Chapter 35: Dynamic type
    • 1-259
      Section 35.1: Creating a dynamic object with properties
    • 1-260
      Section 35.2: Creating a dynamic variable
    • 1-261
      Section 35.3: Returning dynamic
    • 1-262
      Section 35.4: Handling Specific Types Unknown at Compile Time
    • 1-263
      Chapter 36: Type Conversion
    • 1-264
      Section 36.1: Explicit Type Conversion
    • 1-265
      Section 36.2: MSDN implicit operator example
    • 1-266
      Chapter 37: Casting
    • 1-267
      Section 37.1: Checking compatibility without casting
    • 1-268
      Section 37.2: Cast an object to a base type
    • 1-269
      Section 37.3: Conversion Operators
    • 1-270
      Section 37.4: LINQ Casting operations
    • 1-271
      Section 37.5: Explicit Casting
    • 1-272
      Section 37.6: Safe Explicit Casting (`as` operator)
    • 1-273
      Section 37.7: Implicit Casting
    • 1-274
      Section 37.8: Explicit Numeric Conversions
    • 1-275
      Chapter 38: Nullable types
    • 1-276
      Section 38.1: Initialising a nullable
    • 1-277
      Section 38.2: Check if a Nullable has a value
    • 1-278
      Section 38.3: Get the value of a nullable type
    • 1-279
      Section 38.4: Getting a default value from a nullable
    • 1-280
      Section 38.5: Default value of nullable types is null
    • 1-281
      Section 38.6: Eective usage of underlying Nullable<T> argument
    • 1-282
      Section 38.7: Check if a generic type parameter is a nullable type
    • 1-283
      Chapter 39: Constructors and Finalizers
    • 1-284
      Section 39.1: Static constructor
    • 1-285
      Section 39.2: Singleton constructor pattern
    • 1-286
      Section 39.3: Default Constructor
    • 1-287
      Section 39.4: Forcing a static constructor to be called
    • 1-288
      Section 39.5: Calling a constructor from another constructor
    • 1-289
      Section 39.6: Calling the base class constructor
    • 1-290
      Section 39.7: Finalizers on derived classes
    • 1-291
      Section 39.8: Exceptions in static constructors
    • 1-292
      Section 39.9: Constructor and Property Initialization
    • 1-293
      Section 39.10: Generic Static Constructors
    • 1-294
      Section 39.11: Calling virtual methods in constructor
    • 1-295
      Chapter 40: Access Modifiers
    • 1-296
      Section 40.1: Access Modifiers Diagrams
    • 1-297
      Section 40.2: public
    • 1-298
      Section 40.3: private
    • 1-299
      Section 40.4: protected internal
    • 1-300
      Section 40.5: internal
    • 1-301
      Section 40.6: protected
    • 1-302
      Chapter 41: Interfaces
    • 1-303
      Section 41.1: Implementing an interface
    • 1-304
      Section 41.2: Explicit interface implementation
    • 1-305
      Section 41.3: Interface Basics
    • 1-306
      Section 41.4: IComparable<T> as an Example of Implementing an Interface
    • 1-307
      Section 41.5: Implementing multiple interfaces
    • 1-308
      Section 41.6: Why we use interfaces
    • 1-309
      Section 41.7: "Hiding" members with Explicit Implementation
    • 1-310
      Chapter 42: Static Classes
    • 1-311
      Section 42.1: Static Classes
    • 1-312
      Section 42.2: Static class lifetime
    • 1-313
      Section 42.3: Static keyword
    • 1-314
      Chapter 43: Singleton Implementation
    • 1-315
      Section 43.1: Statically Initialized Singleton
    • 1-316
      Section 43.2: Lazy, thread-safe Singleton (using Lazy<T>)
    • 1-317
      Section 43.3: Lazy, thread-safe Singleton (using Double Checked Locking)
    • 1-318
      Section 43.4: Lazy, thread safe singleton (for .NET 3.5 or older, alternate implementation)
    • 1-319
      Chapter 44: Dependency Injection
    • 1-320
      Section 44.1: Dependency Injection C# and ASP.NET with Unity
    • 1-321
      Section 44.2: Dependency injection using MEF
    • 1-322
      Chapter 45: Partial class and methods
    • 1-323
      Section 45.1: Partial classes
    • 1-324
      Section 45.2: Partial classes inheriting from a base class
    • 1-325
      Section 45.3: Partial methods
    • 1-326
      Chapter 46: Object initializers
    • 1-327
      Section 46.1: Simple usage
    • 1-328
      Section 46.2: Usage with non-default constructors
    • 1-329
      Section 46.3: Usage with anonymous types
    • 1-330
      Chapter 47: Methods
    • 1-331
      Section 47.1: Calling a Method
    • 1-332
      Section 47.2: Anonymous method
    • 1-333
      Section 47.3: Declaring a Method
    • 1-334
      Section 47.4: Parameters and Arguments
    • 1-335
      Section 47.5: Return Types
    • 1-336
      Section 47.6: Default Parameters
    • 1-337
      Section 47.7: Method overloading
    • 1-338
      Section 47.8: Access rights
    • 1-339
      Chapter 48: Extension Methods
    • 1-340
      Section 48.1: Extension methods - overview
    • 1-341
      Section 48.2: Null checking
    • 1-342
      Section 48.3: Explicitly using an extension method
    • 1-343
      Section 48.4: Generic Extension Methods
    • 1-344
      Section 48.5: Extension methods can only see public (or internal) members of the extended class
    • 1-345
      Section 48.6: Extension methods for chaining
    • 1-346
      Section 48.7: Extension methods with Enumeration
    • 1-347
      Section 48.8: Extension methods dispatch based on static type
    • 1-348
      Section 48.9: Extension methods on Interfaces
    • 1-349
      Section 48.10: Extension methods in combination with interfaces
    • 1-350
      Section 48.11: Extension methods aren't supported by dynamic code
    • 1-351
      Section 48.12: Extensions and interfaces together enable DRY code and mixin-like functionality
    • 1-352
      Section 48.13: IList<T> Extension Method Example: Comparing 2 Lists
    • 1-353
      Section 48.14: Extension methods as strongly typed wrappers
    • 1-354
      Section 48.15: Using Extension methods to create beautiful mapper classes
    • 1-355
      Section 48.16: Using Extension methods to build new collection types (e.g. DictList)
    • 1-356
      Section 48.17: Extension methods for handling special cases
    • 1-357
      Section 48.18: Using Extension methods with Static methods and Callbacks
    • 1-358
      Chapter 49: Named Arguments
    • 1-359
      Section 49.1: Argument order is not necessary
    • 1-360
      Section 49.2: Named arguments and optional parameters
    • 1-361
      Section 49.3: Named Arguments can make your code more clear
    • 1-362
      Chapter 50: Named and Optional Arguments
    • 1-363
      Section 50.1: Optional Arguments
    • 1-364
      Section 50.2: Named Arguments
    • 1-365
      Chapter 51: Data Annotation
    • 1-366
      Section 51.1: Data Annotation Basics
    • 1-367
      Section 51.2: Creating a custom validation attribute
    • 1-368
      Section 51.3: Manually Execute Validation Attributes
    • 1-369
      Section 51.4: Validation Attributes
    • 1-370
      Section 51.5: EditableAttribute (data modeling attribute)
    • 1-371
      Chapter 52: Keywords
    • 1-372
      Section 52.1: as
    • 1-373
      Section 52.2: goto
    • 1-374
      Section 52.3: volatile
    • 1-375
      Section 52.4: checked, unchecked
    • 1-376
      Section 52.5: virtual, override, new
    • 1-377
      Section 52.6: stackalloc
    • 1-378
      Section 52.7: break
    • 1-379
      Section 52.8: const
    • 1-380
      Section 52.9: async, await
    • 1-381
      Section 52.10: for
    • 1-382
      Section 52.11: abstract
    • 1-383
      Section 52.12: fixed
    • 1-384
      Section 52.13: default
    • 1-385
      Section 52.14: sealed
    • 1-386
      Section 52.15: is
    • 1-387
      Section 52.16: this
    • 1-388
      Section 52.17: readonly
    • 1-389
      Section 52.18: typeof
    • 1-390
      Section 52.19: foreach
    • 1-391
      Section 52.20: dynamic
    • 1-392
      Section 52.21: try, catch, finally, throw
    • 1-393
      Section 52.22: void
    • 1-394
      Section 52.23: namespace
    • 1-395
      Section 52.24: ref, out
    • 1-396
      Section 52.25: base
    • 1-397
      Section 52.26: float, double, decimal
    • 1-398
      Section 52.27: operator
    • 1-399
      Section 52.28: char
    • 1-400
      Section 52.29: params
    • 1-401
      Section 52.30: while
    • 1-402
      Section 52.31: null
    • 1-403
      Section 52.32: continue
    • 1-404
      Section 52.33: string
    • 1-405
      Section 52.34: return
    • 1-406
      Section 52.35: unsafe
    • 1-407
      Section 52.36: switch
    • 1-408
      Section 52.37: var
    • 1-409
      Section 52.38: when
    • 1-410
      Section 52.39: lock
    • 1-411
      Section 52.40: uint
    • 1-412
      Section 52.41: if, if...else, if... else if
    • 1-413
      Section 52.42: static
    • 1-414
      Section 52.43: internal
    • 1-415
      Section 52.44: using
    • 1-416
      Section 52.45: where
    • 1-417
      Section 52.46: int
    • 1-418
      Section 52.47: ulong
    • 1-419
      Section 52.48: true, false
    • 1-420
      Section 52.49: struct
    • 1-421
      Section 52.50: extern
    • 1-422
      Section 52.51: bool
    • 1-423
      Section 52.52: interface
    • 1-424
      Section 52.53: delegate
    • 1-425
      Section 52.54: unchecked
    • 1-426
      Section 52.55: ushort
    • 1-427
      Section 52.56: sizeof
    • 1-428
      Section 52.57: in
    • 1-429
      Section 52.58: implicit
    • 1-430
      Section 52.59: do
    • 1-431
      Section 52.60: long
    • 1-432
      Section 52.61: enum
    • 1-433
      Section 52.62: partial
    • 1-434
      Section 52.63: event
    • 1-435
      Section 52.64: sbyte
    • 1-436
      Chapter 53: Object Oriented Programming In C#
    • 1-437
      Section 53.1: Classes:
    • 1-438
      Chapter 54: Recursion
    • 1-439
      Section 54.1: Recursion in plain English
    • 1-440
      Section 54.2: Fibonacci Sequence
    • 1-441
      Section 54.3: PowerOf calculation
    • 1-442
      Section 54.4: Recursively describe an object structure
    • 1-443
      Section 54.5: Using Recursion to Get Directory Tree
    • 1-444
      Section 54.6: Factorial calculation
    • 1-445
      Chapter 55: Naming Conventions
    • 1-446
      Section 55.1: Capitalization conventions
    • 1-447
      Section 55.2: Enums
    • 1-448
      Section 55.3: Interfaces
    • 1-449
      Section 55.4: Exceptions
    • 1-450
      Section 55.5: Private fields
    • 1-451
      Section 55.6: Namespaces
    • 1-452
      Chapter 56: XML Documentation Comments
    • 1-453
      Section 56.1: Simple method annotation
    • 1-454
      Section 56.2: Generating XML from documentation comments
    • 1-455
      Section 56.3: Method documentation comment with param and returns elements
    • 1-456
      Section 56.4: Interface and class documentation comments
    • 1-457
      Section 56.5: Referencing another class in documentation
    • 1-458
      Chapter 57: Comments and regions
    • 1-459
      Section 57.1: Comments
    • 1-460
      Section 57.2: Regions
    • 1-461
      Section 57.3: Documentation comments
    • 1-462
      Chapter 58: Inheritance
    • 1-463
      Section 58.1: Inheritance. Constructors' calls sequence
    • 1-464
      Section 58.2: Inheriting from a base class
    • 1-465
      Section 58.3: Inheriting from a class and implementing an interface
    • 1-466
      Section 58.4: Inheriting from a class and implementing multiple interfaces
    • 1-467
      Section 58.5: Constructors In A Subclass
    • 1-468
      Section 58.6: Inheritance Anti-patterns
    • 1-469
      Section 58.7: Extending an abstract base class
    • 1-470
      Section 58.8: Testing and navigating inheritance
    • 1-471
      Section 58.9: Inheriting methods
    • 1-472
      Section 58.10: Base class with recursive type specification
    • 1-473
      Chapter 59: Generics
    • 1-474
      Section 59.1: Implicit type inference (methods)
    • 1-475
      Section 59.2: Type inference (classes)
    • 1-476
      Section 59.3: Using generic method with an interface as a constraint type
    • 1-477
      Section 59.4: Type constraints (new-keyword)
    • 1-478
      Section 59.5: Type constraints (classes and interfaces)
    • 1-479
      Section 59.6: Checking equality of generic values
    • 1-480
      Section 59.7: Reflecting on type parameters
    • 1-481
      Section 59.8: Covariance
    • 1-482
      Section 59.9: Contravariance
    • 1-483
      Section 59.10: Invariance
    • 1-484
      Section 59.11: Variant interfaces
    • 1-485
      Section 59.12: Variant delegates
    • 1-486
      Section 59.13: Variant types as parameters and return values
    • 1-487
      Section 59.14: Type Parameters (Interfaces)
    • 1-488
      Section 59.15: Type constraints (class and struct)
    • 1-489
      Section 59.16: Explicit type parameters
    • 1-490
      Section 59.17: Type Parameters (Classes)
    • 1-491
      Section 59.18: Type Parameters (Methods)
    • 1-492
      Section 59.19: Generic type casting
    • 1-493
      Section 59.20: Configuration reader with generic type casting
    • 1-494
      Chapter 60: Using Statement
    • 1-495
      Section 60.1: Using Statement Basics
    • 1-496
      Section 60.2: Gotcha: returning the resource which you are disposing
    • 1-497
      Section 60.3: Multiple using statements with one block
    • 1-498
      Section 60.4: Gotcha: Exception in Dispose method masking other errors in Using blocks
    • 1-499
      Section 60.5: Using statements are null-safe
    • 1-500
      Section 60.6: Using Dispose Syntax to define custom scope
    • 1-501
      Section 60.7: Using Statements and Database Connections
    • 1-502
      Section 60.8: Executing code in constraint context
    • 1-503
      Chapter 61: Using Directive
    • 1-504
      Section 61.1: Associate an Alias to Resolve Conflicts
    • 1-505
      Section 61.2: Using alias directives
    • 1-506
      Section 61.3: Access Static Members of a Class
    • 1-507
      Section 61.4: Basic Usage
    • 1-508
      Section 61.5: Reference a Namespace
    • 1-509
      Section 61.6: Associate an Alias with a Namespace
    • 1-510
      Chapter 62: IDisposable interface
    • 1-511
      Section 62.1: In a class that contains only managed resources
    • 1-512
      Section 62.2: In a class with managed and unmanaged resources
    • 1-513
      Section 62.3: IDisposable, Dispose
    • 1-514
      Section 62.4: using keyword
    • 1-515
      Section 62.5: In an inherited class with managed resources
    • 1-516
      Chapter 63: Reflection
    • 1-517
      Section 63.1: Get the members of a type
    • 1-518
      Section 63.2: Get a method and invoke it
    • 1-519
      Section 63.3: Creating an instance of a Type
    • 1-520
      Section 63.4: Get a Strongly-Typed Delegate to a Method or Property via Reflection
    • 1-521
      Section 63.5: Get a generic method and invoke it
    • 1-522
      Section 63.6: Get a System.Type
    • 1-523
      Section 63.7: Getting and setting properties
    • 1-524
      Section 63.8: Create an instance of a Generic Type and invoke it's method
    • 1-525
      Section 63.9: Custom Attributes
    • 1-526
      Section 63.10: Instantiating classes that implement an interface (e.g. plugin activation)
    • 1-527
      Section 63.11: Get a Type by name with namespace
    • 1-528
      Section 63.12: Determining generic arguments of instances of generic types
    • 1-529
      Section 63.13: Looping through all the properties of a class
    • 1-530
      Chapter 64: IQueryable interface
    • 1-531
      Section 64.1: Translating a LINQ query to a SQL query
    • 1-532
      Chapter 65: Linq to Objects
    • 1-533
      Section 65.1: Using LINQ to Objects in C#
    • 1-534
      Chapter 66: LINQ Queries
    • 1-535
      Section 66.1: Chaining methods
    • 1-536
      Section 66.2: First, FirstOrDefault, Last, LastOrDefault, Single, and SingleOrDefault
    • 1-537
      Section 66.3: Except
    • 1-538
      Section 66.4: SelectMany
    • 1-539
      Section 66.5: Any
    • 1-540
      Section 66.6: JOINS
    • 1-541
      Section 66.7: Skip and Take
    • 1-542
      Section 66.8: Defining a variable inside a Linq query (let keyword)
    • 1-543
      Section 66.9: Zip
    • 1-544
      Section 66.10: Range and Repeat
    • 1-545
      Section 66.11: Basics
    • 1-546
      Section 66.12: All
    • 1-547
      Section 66.13: Aggregate
    • 1-548
      Section 66.14: Distinct
    • 1-549
      Section 66.15: SelectMany: Flattening a sequence of sequences
    • 1-550
      Section 66.16: GroupBy
    • 1-551
      Section 66.17: Query collection by type / cast elements to type
    • 1-552
      Section 66.18: Enumerating the Enumerable
    • 1-553
      Section 66.19: Using Range with various Linq methods
    • 1-554
      Section 66.20: Where
    • 1-555
      Section 66.21: Using SelectMany instead of nested loops
    • 1-556
      Section 66.22: Contains
    • 1-557
      Section 66.23: Joining multiple sequences
    • 1-558
      Section 66.24: Joining on multiple keys
    • 1-559
      Section 66.25: ToLookup
    • 1-560
      Section 66.26: SkipWhile
    • 1-561
      Section 66.27: Query Ordering - OrderBy() ThenBy() OrderByDescending() ThenByDescending()
    • 1-562
      Section 66.28: Sum
    • 1-563
      Section 66.29: GroupBy one or multiple fields
    • 1-564
      Section 66.30: OrderBy
    • 1-565
      Section 66.31: Any and First(OrDefault) - best practice
    • 1-566
      Section 66.32: GroupBy Sum and Count
    • 1-567
      Section 66.33: SequenceEqual
    • 1-568
      Section 66.34: ElementAt and ElementAtOrDefault
    • 1-569
      Section 66.35: DefaultIfEmpty
    • 1-570
      Section 66.36: ToDictionary
    • 1-571
      Section 66.37: Concat
    • 1-572
      Section 66.38: Build your own Linq operators for IEnumerable<T>
    • 1-573
      Section 66.39: Select - Transforming elements
    • 1-574
      Section 66.40: OrderByDescending
    • 1-575
      Section 66.41: Union
    • 1-576
      Section 66.42: GroupJoin with outer range variable
    • 1-577
      Section 66.43: Linq Quantifiers
    • 1-578
      Section 66.44: TakeWhile
    • 1-579
      Section 66.45: Reverse
    • 1-580
      Section 66.46: Count and LongCount
    • 1-581
      Section 66.47: Incrementally building a query
    • 1-582
      Section 66.48: Select with Func<TSource, int, TResult> selector - Use to get ranking of elements
    • 1-583
      Chapter 67: LINQ to XML
    • 1-584
      Section 67.1: Read XML using LINQ to XML
    • 1-585
      Chapter 68: Parallel LINQ (PLINQ)
    • 1-586
      Section 68.1: Simple example
    • 1-587
      Section 68.2: WithDegreeOfParallelism
    • 1-588
      Section 68.3: AsOrdered
    • 1-589
      Section 68.4: AsUnordered
    • 1-590
      Chapter 69: XmlDocument and the System.Xml namespace
    • 1-591
      Section 69.1: XmlDocument vs XDocument (Example and comparison)
    • 1-592
      Section 69.2: Reading from XML document
    • 1-593
      Section 69.3: Basic XML document interaction
    • 1-594
      Chapter 70: XDocument and the System.Xml.Linq namespace
    • 1-595
      Section 70.1: Generate an XML document
    • 1-596
      Section 70.2: Generate an XML document using fluent syntax
    • 1-597
      Section 70.3: Modify XML File
    • 1-598
      Chapter 71: C# 7.0 Features
    • 1-599
      Section 71.1: Language support for Tuples
    • 1-600
      Section 71.2: Local functions
    • 1-601
      Section 71.3: out var declaration
    • 1-602
      Section 71.4: Pattern Matching
    • 1-603
      Section 71.5: Digit separators
    • 1-604
      Section 71.6: Binary literals
    • 1-605
      Section 71.7: throw expressions
    • 1-606
      Section 71.8: Extended expression bodied members list
    • 1-607
      Section 71.9: ref return and ref local
    • 1-608
      Section 71.10: ValueTask<T>
    • 1-609
      Chapter 72: C# 6.0 Features
    • 1-610
      Section 72.1: Exception filters
    • 1-611
      Section 72.2: String interpolation
    • 1-612
      Section 72.3: Auto-property initializers
    • 1-613
      Section 72.4: Null propagation
    • 1-614
      Section 72.5: Expression-bodied function members
    • 1-615
      Section 72.6: Operator nameof
    • 1-616
      Section 72.7: Using static type
    • 1-617
      Section 72.8: Index initializers
    • 1-618
      Section 72.9: Improved overload resolution
    • 1-619
      Section 72.10: Await in catch and finally
    • 1-620
      Section 72.11: Minor changes and bugfixes
    • 1-621
      Section 72.12: Using an extension method for collection initialization
    • 1-622
      Section 72.13: Disable Warnings Enhancements
    • 1-623
      Chapter 73: C# 5.0 Features
    • 1-624
      Section 73.1: Async & Await
    • 1-625
      Section 73.2: Caller Information Attributes
    • 1-626
      Chapter 74: C# 4.0 Features
    • 1-627
      Section 74.1: Optional parameters and named arguments
    • 1-628
      Section 74.2: Variance
    • 1-629
      Section 74.3: Dynamic member lookup
    • 1-630
      Section 74.4: Optional ref keyword when using COM
    • 1-631
      Chapter 75: C# 3.0 Features
    • 1-632
      Section 75.1: Implicitly typed variables (var)
    • 1-633
      Section 75.2: Language Integrated Queries (LINQ)
    • 1-634
      Section 75.3: Lambda expresions
    • 1-635
      Section 75.4: Anonymous types
    • 1-636
      Chapter 76: Exception Handling
    • 1-637
      Section 76.1: Creating Custom Exceptions
    • 1-638
      Section 76.2: Finally block
    • 1-639
      Section 76.3: Best Practices
    • 1-640
      Section 76.4: Exception Anti-patterns
    • 1-641
      Section 76.5: Basic Exception Handling
    • 1-642
      Section 76.6: Handling specific exception types
    • 1-643
      Section 76.7: Aggregate exceptions / multiple exceptions from one method
    • 1-644
      Section 76.8: Throwing an exception
    • 1-645
      Section 76.9: Unhandled and Thread Exception
    • 1-646
      Section 76.10: Implementing IErrorHandler for WCF Services
    • 1-647
      Section 76.11: Using the exception object
    • 1-648
      Section 76.12: Nesting of Exceptions & try catch blocks
    • 1-649
      Chapter 77: NullReferenceException
    • 1-650
      Section 77.1: NullReferenceException explained
    • 1-651
      Chapter 78: Handling FormatException when converting string to other types
    • 1-652
      Section 78.1: Converting string to integer
    • 1-653
      Chapter 79: Read & Understand Stacktraces
    • 1-654
      Section 79.1: Stack trace for a simple NullReferenceException in Windows Forms
    • 1-655
      Chapter 80: Diagnostics
    • 1-656
      Section 80.1: Redirecting log output with TraceListeners
    • 1-657
      Section 80.2: Debug.WriteLine
    • 1-658
      Chapter 81: Overflow
    • 1-659
      Section 81.1: Integer overflow
    • 1-660
      Section 81.2: Overflow during operation
    • 1-661
      Section 81.3: Ordering matters
    • 1-662
      Chapter 82: Getting Started: Json with C#
    • 1-663
      Section 82.1: Simple Json Example
    • 1-664
      Section 82.2: First things First: Library to work with Json
    • 1-665
      Section 82.3: C# Implementation
    • 1-666
      Section 82.4: Serialization
    • 1-667
      Section 82.5: Deserialization
    • 1-668
      Section 82.6: Serialization & De-Serialization Common Utilities function
    • 1-669
      Chapter 83: Using json.net
    • 1-670
      Section 83.1: Using JsonConverter on simple values
    • 1-671
      Section 83.2: Collect all fields of JSON object
    • 1-672
      Chapter 84: Lambda expressions
    • 1-673
      Section 84.1: Lambda Expressions as Shorthand for Delegate Initialization
    • 1-674
      Section 84.2: Lambda Expression as an Event Handler
    • 1-675
      Section 84.3: Lambda Expressions with Multiple Parameters or No Parameters
    • 1-676
      Section 84.4: Lambdas can be emitted both as `Func` and `Expression`
    • 1-677
      Section 84.5: Put Multiple Statements in a Statement Lambda
    • 1-678
      Section 84.6: Lambdas for both `Func` and `Action`
    • 1-679
      Section 84.7: Using lambda syntax to create a closure
    • 1-680
      Section 84.8: Passing a Lambda Expression as a Parameter to a Method
    • 1-681
      Section 84.9: Basic lambda expressions
    • 1-682
      Section 84.10: Basic lambda expressions with LINQ
    • 1-683
      Section 84.11: Lambda syntax with statement block body
    • 1-684
      Section 84.12: Lambda expressions with System.Linq.Expressions
    • 1-685
      Chapter 85: Generic Lambda Query Builder
    • 1-686
      Section 85.1: QueryFilter class
    • 1-687
      Section 85.2: GetExpression Method
    • 1-688
      Section 85.3: GetExpression Private overload
    • 1-689
      Section 85.4: ConstantExpression Method
    • 1-690
      Section 85.5: Usage
    • 1-691
      Chapter 86: Properties
    • 1-692
      Section 86.1: Auto-implemented properties
    • 1-693
      Section 86.2: Default Values for Properties
    • 1-694
      Section 86.3: Public Get
    • 1-695
      Section 86.4: Public Set
    • 1-696
      Section 86.5: Accessing Properties
    • 1-697
      Section 86.6: Read-only properties
    • 1-698
      Section 86.7: Various Properties in Context
    • 1-699
      Chapter 87: Initializing Properties
    • 1-700
      Section 87.1: C# 6.0: Initialize an Auto-Implemented Property
    • 1-701
      Section 87.2: Initializing Property with a Backing Field
    • 1-702
      Section 87.3: Property Initialization during object instantiation
    • 1-703
      Section 87.4: Initializing Property in Constructor
    • 1-704
      Chapter 88: INotifyPropertyChanged interface
    • 1-705
      Section 88.1: Implementing INotifyPropertyChanged in C# 6
    • 1-706
      Section 88.2: INotifyPropertyChanged With Generic Set Method
    • 1-707
      Chapter 89: Events
    • 1-708
      Section 89.1: Declaring and Raising Events
    • 1-709
      Section 89.2: Event Properties
    • 1-710
      Section 89.3: Creating cancelable event
    • 1-711
      Section 89.4: Standard Event Declaration
    • 1-712
      Section 89.5: Anonymous Event Handler Declaration
    • 1-713
      Section 89.6: Non-Standard Event Declaration
    • 1-714
      Section 89.7: Creating custom EventArgs containing additional data
    • 1-715
      Chapter 90: Expression Trees
    • 1-716
      Section 90.1: Create Expression Trees with a lambda expression
    • 1-717
      Section 90.2: Creating Expression Trees by Using the API
    • 1-718
      Section 90.3: Compiling Expression Trees
    • 1-719
      Section 90.4: Parsing Expression Trees
    • 1-720
      Section 90.5: Expression Tree Basic
    • 1-721
      Section 90.6: Examining the Structure of an Expression using Visitor
    • 1-722
      Section 90.7: Understanding the expressions API
    • 1-723
      Chapter 91: Overload Resolution
    • 1-724
      Section 91.1: Basic Overloading Example
    • 1-725
      Section 91.2: "params" is not expanded, unless necessary
    • 1-726
      Section 91.3: Passing null as one of the arguments
    • 1-727
      Chapter 92: BindingList<T>
    • 1-728
      Section 92.1: Add item to list
    • 1-729
      Section 92.2: Avoiding N*2 iteration
    • 1-730
      Chapter 93: Preprocessor directives
    • 1-731
      Section 93.1: Conditional Expressions
    • 1-732
      Section 93.2: Other Compiler Instructions
    • 1-733
      Section 93.3: Defining and Undefining Symbols
    • 1-734
      Section 93.4: Region Blocks
    • 1-735
      Section 93.5: Disabling and Restoring Compiler Warnings
    • 1-736
      Section 93.6: Generating Compiler Warnings and Errors
    • 1-737
      Section 93.7: Custom Preprocessors at project level
    • 1-738
      Section 93.8: Using the Conditional attribute
    • 1-739
      Chapter 94: Structs
    • 1-740
      Section 94.1: Declaring a struct
    • 1-741
      Section 94.2: Struct usage
    • 1-742
      Section 94.3: Structs are copied on assignment
    • 1-743
      Section 94.4: Struct implementing interface
    • 1-744
      Chapter 95: Attributes
    • 1-745
      Section 95.1: Creating a custom attribute
    • 1-746
      Section 95.2: Reading an attribute
    • 1-747
      Section 95.3: Using an attribute
    • 1-748
      Section 95.4: DebuggerDisplay Attribute
    • 1-749
      Section 95.5: Caller info attributes
    • 1-750
      Section 95.6: Obsolete Attribute
    • 1-751
      Section 95.7: Reading an attribute from interface
    • 1-752
      Chapter 96: Delegates
    • 1-753
      Section 96.1: Declaring a delegate type
    • 1-754
      Section 96.2: The Func<T, TResult>, Action<T> and Predicate<T> delegate types
    • 1-755
      Section 96.3: Combine Delegates (Multicast Delegates)
    • 1-756
      Section 96.4: Safe invoke multicast delegate
    • 1-757
      Section 96.5: Delegate Equality
    • 1-758
      Section 96.6: Underlying references of named method delegates
    • 1-759
      Section 96.7: Assigning a named method to a delegate
    • 1-760
      Section 96.8: Assigning to a delegate by lambda
    • 1-761
      Section 96.9: Encapsulating transformations in funcs
    • 1-762
      Section 96.10: Passing delegates as parameters
    • 1-763
      Section 96.11: Closure inside a delegate
    • 1-764
      Chapter 97: File and Stream I/O
    • 1-765
      Section 97.1: Reading from a file using the System.IO.File class
    • 1-766
      Section 97.2: Lazily reading a file line-by-line via an IEnumerable
    • 1-767
      Section 97.3: Async write text to a file using StreamWriter
    • 1-768
      Section 97.4: Copy File
    • 1-769
      Section 97.5: Writing lines to a file using the System.IO.StreamWriter class
    • 1-770
      Section 97.6: Writing to a file using the System.IO.File class
    • 1-771
      Section 97.7: Create File
    • 1-772
      Section 97.8: Move File
    • 1-773
      Section 97.9: Delete File
    • 1-774
      Section 97.10: Files and Directories
    • 1-775
      Chapter 98: Networking
    • 1-776
      Section 98.1: Basic TCP Communication Client
    • 1-777
      Section 98.2: Download a file from a web server
    • 1-778
      Section 98.3: Async TCP Client
    • 1-779
      Section 98.4: Basic UDP Client
    • 1-780
      Chapter 99: Performing HTTP requests
    • 1-781
      Section 99.1: Creating and sending an HTTP POST request
    • 1-782
      Section 99.2: Creating and sending an HTTP GET request
    • 1-783
      Section 99.3: Error handling of specific HTTP response codes (such as 404 Not Found)
    • 1-784
      Section 99.4: Retrieve HTML for Web Page (Simple)
    • 1-785
      Section 99.5: Sending asynchronous HTTP POST request with JSON body
    • 1-786
      Chapter 100: Reading and writing .zip files
    • 1-787
      Section 100.1: Writing to a zip file
    • 1-788
      Section 100.2: Writing Zip Files in-memory
    • 1-789
      Section 100.3: Get files from a Zip file
    • 1-790
      Section 100.4: The following example shows how to open a zip archive and extract all .txt files to a folder
    • 1-791
      Chapter 101: FileSystemWatcher
    • 1-792
      Section 101.1: IsFileReady
    • 1-793
      Section 101.2: Basic FileWatcher
    • 1-794
      Chapter 102: Access network shared folder with username and password
    • 1-795
      Section 102.1: Code to access network shared file
    • 1-796
      Chapter 103: Asynchronous Socket
    • 1-797
      Section 103.1: Asynchronous Socket (Client / Server) example
    • 1-798
      Chapter 104: Action Filters
    • 1-799
      Section 104.1: Custom Action Filters
    • 1-800
      Chapter 105: Polymorphism
    • 1-801
      Section 105.1: Types of Polymorphism
    • 1-802
      Section 105.2: Another Polymorphism Example
    • 1-803
      Chapter 106: Immutability
    • 1-804
      Section 106.1: System.String class
    • 1-805
      Section 106.2: Strings and immutability
    • 1-806
      Chapter 107: Indexer
    • 1-807
      Section 107.1: A simple indexer
    • 1-808
      Section 107.2: Overloading the indexer to create a SparseArray
    • 1-809
      Section 107.3: Indexer with 2 arguments and interface
    • 1-810
      Chapter 108: Checked and Unchecked
    • 1-811
      Section 108.1: Checked and Unchecked
    • 1-812
      Section 108.2: Checked and Unchecked as a scope
    • 1-813
      Chapter 109: Stream
    • 1-814
      Section 109.1: Using Streams
    • 1-815
      Chapter 110: Timers
    • 1-816
      Section 110.1: Multithreaded Timers
    • 1-817
      Section 110.2: Creating an Instance of a Timer
    • 1-818
      Section 110.3: Assigning the "Tick" event handler to a Timer
    • 1-819
      Section 110.4: Example: Using a Timer to perform a simple countdown
    • 1-820
      Chapter 111: Stopwatches
    • 1-821
      Section 111.1: IsHighResolution
    • 1-822
      Section 111.2: Creating an Instance of a Stopwatch
    • 1-823
      Chapter 112: Threading
    • 1-824
      Section 112.1: Avoiding Reading and Writing Data Simultaneously
    • 1-825
      Section 112.2: Creating and Starting a Second Thread
    • 1-826
      Section 112.3: Parallel.ForEach Loop
    • 1-827
      Section 112.4: Deadlocks (hold resource and wait)
    • 1-828
      Section 112.5: Simple Complete Threading Demo
    • 1-829
      Section 112.6: Creating One Thread Per Processor
    • 1-830
      Section 112.7: Simple Complete Threading Demo using Tasks
    • 1-831
      Section 112.8: Deadlocks (two threads waiting on each other)
    • 1-832
      Section 112.9: Explicit Task Parallism
    • 1-833
      Section 112.10: Implicit Task Parallelism
    • 1-834
      Section 112.11: Starting a thread with parameters
    • 1-835
      Chapter 113: Async/await, Backgroundworker, Task and Thread Examples
    • 1-836
      Section 113.1: ASP.NET Configure Await
    • 1-837
      Section 113.2: Task "run and forget" extension
    • 1-838
      Section 113.3: Async/await
    • 1-839
      Section 113.4: BackgroundWorker
    • 1-840
      Section 113.5: Task
    • 1-841
      Section 113.6: Thread
    • 1-842
      Chapter 114: Async-Await
    • 1-843
      Section 114.1: Await operator and async keyword
    • 1-844
      Section 114.2: Concurrent calls
    • 1-845
      Section 114.3: Try/Catch/Finally
    • 1-846
      Section 114.4: Returning a Task without await
    • 1-847
      Section 114.5: Async/await will only improve performance if it allows the machine to do additional work
    • 1-848
      Section 114.6: Web.config setup to target 4.5 for correct async behaviour
    • 1-849
      Section 114.7: Simple consecutive calls
    • 1-850
      Section 114.8: Blocking on async code can cause deadlocks
    • 1-851
      Chapter 115: Synchronization Context in Async-Await
    • 1-852
      Section 115.1: Pseudocode for async/await keywords
    • 1-853
      Section 115.2: Disabling synchronization context
    • 1-854
      Section 115.3: Why SynchronizationContext is so important?
    • 1-855
      Chapter 116: BackgroundWorker
    • 1-856
      Section 116.1: Using a BackgroundWorker to complete a task
    • 1-857
      Section 116.2: Assigning Event Handlers to a BackgroundWorker
    • 1-858
      Section 116.3: Creating a new BackgroundWorker instance
    • 1-859
      Section 116.4: Assigning Properties to a BackgroundWorker
    • 1-860
      Chapter 117: Task Parallel Library
    • 1-861
      Section 117.1: Parallel.ForEach
    • 1-862
      Section 117.2: Parallel.For
    • 1-863
      Section 117.3: Parallel.Invoke
    • 1-864
      Chapter 118: Making a variable thread safe
    • 1-865
      Section 118.1: Controlling access to a variable in a Parallel.For loop
    • 1-866
      Chapter 119: Lock Statement
    • 1-867
      Section 119.1: Throwing exception in a lock statement
    • 1-868
      Section 119.2: Simple usage
    • 1-869
      Section 119.3: Return in a lock statement
    • 1-870
      Section 119.4: Anti-Patterns and gotchas
    • 1-871
      Section 119.5: Using instances of Object for lock
    • 1-872
      Chapter 120: Yield Keyword
    • 1-873
      Section 120.1: Simple Usage
    • 1-874
      Section 120.2: Correctly checking arguments
    • 1-875
      Section 120.3: Early Termination
    • 1-876
      Section 120.4: More Pertinent Usage
    • 1-877
      Section 120.5: Lazy Evaluation
    • 1-878
      Section 120.6: Try...finally
    • 1-879
      Section 120.7: Eager evaluation
    • 1-880
      Section 120.8: Using yield to create an IEnumerator<T> when implementing IEnumerable<T>
    • 1-881
      Section 120.9: Lazy Evaluation Example: Fibonacci Numbers
    • 1-882
      Section 120.10: The dierence between break and yield break
    • 1-883
      Section 120.11: Return another Enumerable within a method returning Enumerable
    • 1-884
      Chapter 121: Task Parallel Library (TPL) Dataflow Constructs
    • 1-885
      Section 121.1: ActionBlock<T>
    • 1-886
      Section 121.2: BroadcastBlock<T>
    • 1-887
      Section 121.3: BuerBlock<T>
    • 1-888
      Section 121.4: JoinBlock<T1, T2,…>
    • 1-889
      Section 121.5: WriteOnceBlock<T>
    • 1-890
      Section 121.6: BatchedJoinBlock<T1, T2,…>
    • 1-891
      Section 121.7: TransformBlock<TInput, TOutput>
    • 1-892
      Section 121.8: TransformManyBlock<TInput, TOutput>
    • 1-893
      Section 121.9: BatchBlock<T>
    • 1-894
      Chapter 122: Functional Programming
    • 1-895
      Section 122.1: Func and Action
    • 1-896
      Section 122.2: Higher-Order Functions
    • 1-897
      Section 122.3: Avoid Null References
    • 1-898
      Section 122.4: Immutability
    • 1-899
      Section 122.5: Immutable collections
    • 1-900
      Chapter 123: Func delegates
    • 1-901
      Section 123.1: Without parameters
    • 1-902
      Section 123.2: With multiple variables
    • 1-903
      Section 123.3: Lambda & anonymous methods
    • 1-904
      Section 123.4: Covariant & Contravariant Type Parameters
    • 1-905
      Chapter 124: Function with multiple return values
    • 1-906
      Section 124.1: "anonymous object" + "dynamic keyword" solution
    • 1-907
      Section 124.2: Tuple solution
    • 1-908
      Section 124.3: Ref and Out Parameters
    • 1-909
      Chapter 125: Binary Serialization
    • 1-910
      Section 125.1: Controlling serialization behavior with attributes
    • 1-911
      Section 125.2: Serialization Binder
    • 1-912
      Section 125.3: Some gotchas in backward compatibility
    • 1-913
      Section 125.4: Making an object serializable
    • 1-914
      Section 125.5: Serialization surrogates (Implementing ISerializationSurrogate)
    • 1-915
      Section 125.6: Adding more control by implementing ISerializable
    • 1-916
      Chapter 126: ICloneable
    • 1-917
      Section 126.1: Implementing ICloneable in a class
    • 1-918
      Section 126.2: Implementing ICloneable in a struct
    • 1-919
      Chapter 127: IComparable
    • 1-920
      Section 127.1: Sort versions
    • 1-921
      Chapter 128: Accessing Databases
    • 1-922
      Section 128.1: Connection Strings
    • 1-923
      Section 128.2: Entity Framework Connections
    • 1-924
      Section 128.3: ADO.NET Connections
    • 1-925
      Chapter 129: Using SQLite in C#
    • 1-926
      Section 129.1: Creating simple CRUD using SQLite in C#
    • 1-927
      Section 129.2: Executing Query
    • 1-928
      Chapter 130: Caching
    • 1-929
      Section 130.1: MemoryCache
    • 1-930
      Chapter 131: Code Contracts
    • 1-931
      Section 131.1: Postconditions
    • 1-932
      Section 131.2: Invariants
    • 1-933
      Section 131.3: Defining Contracts on Interface
    • 1-934
      Section 131.4: Preconditions
    • 1-935
      Chapter 132: Code Contracts and Assertions
    • 1-936
      Section 132.1: Assertions to check logic should always be true
    • 1-937
      Chapter 133: Structural Design Patterns
    • 1-938
      Section 133.1: Adapter Design Pattern
    • 1-939
      Chapter 134: Creational Design Patterns
    • 1-940
      Section 134.1: Singleton Pattern
    • 1-941
      Section 134.2: Factory Method pattern
    • 1-942
      Section 134.3: Abstract Factory Pattern
    • 1-943
      Section 134.4: Builder Pattern
    • 1-944
      Section 134.5: Prototype Pattern
    • 1-945
      Chapter 135: Implementing Decorator Design Pattern
    • 1-946
      Section 135.1: Simulating cafeteria
    • 1-947
      Chapter 136: Implementing Flyweight Design Pattern
    • 1-948
      Section 136.1: Implementing map in RPG game
    • 1-949
      Chapter 137: System.Management.Automation
    • 1-950
      Section 137.1: Invoke simple synchronous pipeline
    • 1-951
      Chapter 138: System.DirectoryServices.Protocols.LdapConnection
    • 1-952
      Section 138.1: Authenticated SSL LDAP connection, SSL cert does not match reverse DNS
    • 1-953
      Section 138.2: Super Simple anonymous LDAP
    • 1-954
      Chapter 139: C# Authentication handler
    • 1-955
      Section 139.1: Authentication handler
    • 1-956
      Chapter 140: Pointers
    • 1-957
      Section 140.1: Pointers for array access
    • 1-958
      Section 140.2: Pointer arithmetic
    • 1-959
      Section 140.3: The asterisk is part of the type
    • 1-960
      Section 140.4: void*
    • 1-961
      Section 140.5: Member access using ->
    • 1-962
      Section 140.6: Generic pointers
    • 1-963
      Chapter 141: Pointers & Unsafe Code
    • 1-964
      Section 141.1: Introduction to unsafe code
    • 1-965
      Section 141.2: Accessing Array Elements Using a Pointer
    • 1-966
      Section 141.3: Compiling Unsafe Code
    • 1-967
      Section 141.4: Retrieving the Data Value Using a Pointer
    • 1-968
      Section 141.5: Passing Pointers as Parameters to Methods
    • 1-969
      Chapter 142: How to use C# Structs to create a Union type (Similar to C Unions)
    • 1-970
      Section 142.1: C-Style Unions in C#
    • 1-971
      Section 142.2: Union Types in C# can also contain Struct fields
    • 1-972
      Chapter 143: Reactive Extensions (Rx)
    • 1-973
      Section 143.1: Observing TextChanged event on a TextBox
    • 1-974
      Section 143.2: Streaming Data from Database with Observable
    • 1-975
      Chapter 144: AssemblyInfo.cs Examples
    • 1-976
      Section 144.1: Global and local AssemblyInfo
    • 1-977
      Section 144.2: [AssemblyVersion]
    • 1-978
      Section 144.3: Automated versioning
    • 1-979
      Section 144.4: Common fields
    • 1-980
      Section 144.5: [AssemblyTitle]
    • 1-981
      Section 144.6: [AssemblyProduct]
    • 1-982
      Section 144.7: [InternalsVisibleTo]
    • 1-983
      Section 144.8: [AssemblyConfiguration]
    • 1-984
      Section 144.9: [AssemblyKeyFile]
    • 1-985
      Section 144.10: Reading Assembly Attributes
    • 1-986
      Chapter 145: Creating a Console Application using a Plain-Text Editor and the C# Compiler (csc.exe)
    • 1-987
      Section 145.1: Creating a Console application using a Plain-Text Editor and the C# Compiler
    • 1-988
      Chapter 146: CLSCompliantAttribute
    • 1-989
      Section 146.1: Access Modifier to which CLS rules apply
    • 1-990
      Section 146.2: Violation of CLS rule: Unsigned types / sbyte
    • 1-991
      Section 146.3: Violation of CLS rule: Same naming
    • 1-992
      Section 146.4: Violation of CLS rule: Identifier _
    • 1-993
      Section 146.5: Violation of CLS rule: Inherit from non CLSComplaint class
    • 1-994
      Chapter 147: ObservableCollection<T>
    • 1-995
      Section 147.1: Initialize ObservableCollection<T>
    • 1-996
      Chapter 148: Hash Functions
    • 1-997
      Section 148.1: PBKDF2 for Password Hashing
    • 1-998
      Section 148.2: Complete Password Hashing Solution using Pbkdf2
    • 1-999
      Section 148.3: MD5
    • 1-1000
      Section 148.4: SHA1
    • 1-1001
      Section 148.5: SHA256
    • 1-1002
      Section 148.6: SHA384
    • 1-1003
      Section 148.7: SHA512
    • 1-1004
      Chapter 149: Generating Random Numbers in C#
    • 1-1005
      Section 149.1: Generate a random int
    • 1-1006
      Section 149.2: Generate a random int in a given range
    • 1-1007
      Section 149.3: Generating the same sequence of random numbers over and over again
    • 1-1008
      Section 149.4: Create multiple random class with dierent seeds simultaneously
    • 1-1009
      Section 149.5: Generate a Random double
    • 1-1010
      Section 149.6: Generate a random character
    • 1-1011
      Section 149.7: Generate a number that is a percentage of a max value
    • 1-1012
      Chapter 150: Cryptography (System.Security.Cryptography)
    • 1-1013
      Section 150.1: Modern Examples of Symmetric Authenticated Encryption of a string
    • 1-1014
      Section 150.2: Introduction to Symmetric and Asymmetric Encryption
    • 1-1015
      Section 150.3: Simple Symmetric File Encryption
    • 1-1016
      Section 150.4: Cryptographically Secure Random Data
    • 1-1017
      Section 150.5: Password Hashing
    • 1-1018
      Section 150.6: Fast Asymmetric File Encryption
    • 1-1019
      Chapter 151: ASP.NET Identity
    • 1-1020
      Section 151.1: How to implement password reset token in asp.net identity using user manager
    • 1-1021
      Chapter 152: Unsafe Code in .NET
    • 1-1022
      Section 152.1: Using unsafe with arrays
    • 1-1023
      Section 152.2: Using unsafe with strings
    • 1-1024
      Section 152.3: Unsafe Array Index
    • 1-1025
      Chapter 153: C# Script
    • 1-1026
      Section 153.1: Simple code evaluation
    • 1-1027
      Chapter 154: Runtime Compile
    • 1-1028
      Section 154.1: RoslynScript
    • 1-1029
      Section 154.2: CSharpCodeProvider
    • 1-1030
      Chapter 155: Interoperability
    • 1-1031
      Section 155.1: Import function from unmanaged C++ DLL
    • 1-1032
      Section 155.2: Calling conventions
    • 1-1033
      Section 155.3: C++ name mangling
    • 1-1034
      Section 155.4: Dynamic loading and unloading of unmanaged DLLs
    • 1-1035
      Section 155.5: Reading structures with Marshal
    • 1-1036
      Section 155.6: Dealing with Win32 Errors
    • 1-1037
      Section 155.7: Pinned Object
    • 1-1038
      Section 155.8: Simple code to expose class for com
    • 1-1039
      Chapter 156: .NET Compiler Platform (Roslyn)
    • 1-1040
      Section 156.1: Semantic model
    • 1-1041
      Section 156.2: Syntax tree
    • 1-1042
      Section 156.3: Create workspace from MSBuild project
    • 1-1043
      Chapter 157: ILGenerator
    • 1-1044
      Section 157.1: Creates a DynamicAssembly that contains a UnixTimestamp helper method
    • 1-1045
      Section 157.2: Create method override
    • 1-1046
      Chapter 158: T4 Code Generation
    • 1-1047
      Section 158.1: Runtime Code Generation
    • 1-1048
      Chapter 159: Creating Own MessageBox in Windows Form Application
    • 1-1049
      Section 159.1: How to use own created MessageBox control in another Windows Form application
    • 1-1050
      Section 159.2: Creating Own MessageBox Control
    • 1-1051
      Chapter 160: Including Font Resources
    • 1-1052
      Section 160.1: Instantiate 'Fontfamily' from Resources
    • 1-1053
      Section 160.2: Integration method
    • 1-1054
      Section 160.3: Usage with a 'Button'
    • 1-1055
      Chapter 161: Import Google Contacts
    • 1-1056
      Section 161.1: Requirements
    • 1-1057
      Section 161.2: Source code in the controller
    • 1-1058
      Section 161.3: Source code in the view
    • 1-1059
      Chapter 162: Garbage Collector in .Net
    • 1-1060
      Section 162.1: Weak References
    • 1-1061
      Section 162.2: Large Object Heap compaction
    • 1-1062
      Chapter 163: Microsoft.Exchange.WebServices
    • 1-1063
      Section 163.1: Retrieve Specified User's Out of Oce Settings
    • 1-1064
      Section 163.2: Update Specific User's Out of Oce Settings
    • 1-1065
      Chapter 164: Windows Communication Foundation
    • 1-1066
      Section 164.1: Getting started sample
    • 1-1067
      Credits
    • 1-1068
      You may also like

    FAQ

    您可以透過手機、平板或是電腦登入 HiSKIO 平台,在【我的學習】>【我的書籍】頁面,選擇想看的電子書。

    Recommendations

    Reviews

    | Collecting

    Sales Plans