Contents
- Getting Started With C#
- Literals
- Operators
- Operator Precedence
- Overloadable Operators
- Overloading equality operators
- Relational Operators
- Implicit Cast and Explicit Cast Operators
- Short-circuiting Operators
- ? : Ternary Operator
- ?. (Null Conditional Operator)
- "Exclusive or" Operator
- default Operator
- Assignment operator '='
- sizeof
- ?? Null-Coalescing Operator
- Bit-Shifting Operators
- ⇒ Lambda operator
- Class Member Operators Null Conditional Member Access
- Class Member Operators Null Conditional Indexing
- Postfix and Prefix increment and decrement
- typeof
- Binary operators with assignment
- nameof Operator
- Class Member Operators Member Access
- Class Member Operators Function Invocation
- Class Member Operators Aggregate Object Indexing
- Conditional Statements
- Equality Operator
- Equals and GetHashCode
- Null-Coalescing Operator
- Null-Conditional Operators
- nameof Operator
- Verbatim String
- Common String Operations
- Padding a string to a fixed length
- Correctly reversing a string
- Formatting a string
- 0Checking for empty String using String.IsNullOrEmpty and String.IsNullOrWhiteSpace
- Getting x characters from the right side of a string
- Convert Decimal Number to BinaryOctal and Hexadecimal Format
- Trimming Unwanted Characters Off the Start andor End of Strings
- Construct a string from Array
- Formatting using ToString
- Splitting a String by specific character
- Joining an array of strings into a new one
- Getting a char at specific index and enumerating the string
- Determine whether a string begins with a given sequence
- Splitting a String by another string
- Getting Substrings of a given string
- Replacing a string within a string
- Changing the case of characters within a String
- Concatenate an array of strings into a single string
- String Concatenation
- String Format
- String.Format
- Since C# 6.0
- Places where String.Format is embedded in the framework
- Create a custom format provider
- Date Formatting
- Currency Formatting
- Using custom number format
- Align left right pad with spaces
- Numeric formats
- Escaping curly brackets inside a String.Format expression
- ToString
- Relationship with ToString
- String Concatenate
- String Manipulation
- String Interpolation
- String Escape Sequences
- StringBuilder
- Regex
- DateTime
- DateTime Formating
- DateTime.AddDaysDouble
- DateTime.AddHoursDouble
- DateTime.TryParseString DateTime
- DateTime.ParseString
- DateTime.CompareDateTime t1 DateTime t2
- DateTime.DaysInMonthInt32Int32
- DateTime.AddYearsInt32
- Pure functions warning when dealing with DateTime
- DateTime.AddMillisecondsDouble
- DateTime.TryParseExactStringStringIFormatProviderDateTimeStylesDateTime
- DateTime as initializer in for-loop
- DateTime ToString ToShortDateString ToLongDateString and ToString formatted
- Current Date
- Parse and TryParse with culture info
- DateTime.ParseExactStringStringIFormatProvider
- DateTime.AddTimeSpan
- Arrays
- Arrays
- Declaring an array
- Copying arrays
- Initializing an array filled with a repeated non-default value
- Comparing arrays for equality
- Multi-dimensional arrays
- Getting and setting array values
- Iterate over an array
- Creating an array of sequential numbers
- Jagged arrays
- Array covariance
- Checking if one array contains another array
- Arrays as IEnumerable instances
- On Algorithm for circular rotation of an array
- Enum
- Enum
- Enum basics
- Enum as flags
- Using notation for flags
- Test flags-style enum values with bitwise logic
- Enum to string and back
- Add and remove values from flagged enum
- Default value for enum ZERO
- Adding additional description information to an enum value
- Enums can have unexpected values
- Get all the members values of an enum
- Bitwise Manipulation using enums
- Tuples
- Overview of C# collections
- GUID
- BigInteger
- Collection Initializers
- Looping
- Iterators
- IEnumerable
- Value type vs Reference type
- Built-in Types
- Aliases of built-in types
- Anonymous types
- Dynamic type
- Type Conversion
- Casting
- Nullable types
- Constructors and Finalizers
- Static constructor
- Singleton constructor pattern
- Default Constructor
- Forcing a static constructor to be called
- Calling a constructor from another constructor
- Calling the base class constructor
- Finalizers on derived classes
- Exceptions in static constructors
- Calling virtual methods in constructor
- Generic Static Constructors
- Constructor and Property Initialization
- Access Modifiers
- Interfaces
- Static Classes
- Singleton Implementation
- Dependency Injection
- Partial class and methods
- Object Initializers
- Methods
- Extension Methods
- Extension Methods
- Extension methods - overview
- Null checking
- Explicitly using an extension method
- Generic Extension Methods
- Extension methods can only see public or internal members of the extended class
- Extension methods for chaining
- Extension methods with Enumeration
- Extension methods dispatch based on static type
- Extension methods on Interfaces
- Extension methods arent supported by dynamic code
- Extension methods in combination with interfaces
- Extensions and interfaces together enable DRY code and mixin-like functionality
- IListT Extension Method Example Comparing 2 Lists
- Extension methods as strongly typed wrappers
- Using Extension methods to create mapper classes
- Using Extension methods to build new collection types e.g. DictList
- Extension methods for handling special cases
- Using Extension methods with Static methods and Callbacks
- Named Arguments
- Named And Optional Arguments
- Data Annotation
- Keywords
- as
- goto
- volatile
- checked unchecked
- virtual override new
- stackalloc
- break
- const
- for
- async await
- abstract
- is
- default
- fixed
- sealed
- typeof
- readonly
- this
- dynamic
- foreach
- try catch finally throw
- namespace
- void
- ref out
- float double decimal
- char
- params
- base
- operator
- string
- null
- return
- while
- continue
- using
- ulong
- uint
- unsafe
- int
- var
- lock
- true false
- internal
- where
- extern
- switch
- when
- struct
- static
- if if...else if... else if
- do
- partial
- unchecked
- bool
- interface
- long
- sizeof
- in
- enum
- ushort
- delegate
- implicit
- sbyte
- event
- Recursion
- Naming Conventions
- XML Documentation Comments
- Comments and regions
- Inheritance
- Inheritance
- Implementing an interface
- Inheritance. Constructors calls sequence
- Explicit interface implementation
- Inheriting from a class and implementing an interface
- Implementing multiple interfaces
- Inheriting from a base class
- Inheriting from a class and implementing multiple interfaces
- Testing and navigating inheritance
- Extending an abstract base class
- Constructors in a subclass
- Inheritance Anti-patterns
- Inheriting methods
- Base class with recursive type specification
- Generics
- Generics
- Implicit type inference methods
- Type inference classes
- Using generic method with an interface as a constraint type
- Type constraints new-keyword
- Type constraints classes and interfaces
- Variant interfaces
- Covariance
- Contravariance
- Reflecting on type parameters
- Checking equality of generic values.
- Invariance
- Variant delegates
- Variant types as parameters and return values
- Type Parameters Interfaces
- Type Parameters Classes
- Explicit type parameters
- Type constraints class and struct
- Type Parameters Methods
- Generic type casting
- Configuration reader with generic type casting
- Using Statement
- Using Statement
- Using Statement Basics
- Gotcha returning the resource which you are disposing
- Multiple using statements with one block
- Gotcha Exception in Dispose method masking other errors in Using blocks
- Using statements are null-safe
- Using Dispose Syntax to define custom scope
- Using Statements and Database Connections
- Using alias directives
- Executing code in constraint context
- Using Directive
- IDisposable interface
- Reflection
- Reflection
- Get the members of a type
- Get a method and invoke it
- Creating an instance of a Type
- Get a Strongly-Typed Delegate to a Method or Property via Reflection
- Get a generic method and invoke it
- Get a System.Type
- Custom Attributes
- Create an instance of a Generic Type and invoke its method
- Instantiating classes that implement an interface e.g. plugin activation
- Getting and setting properties
- Determining generic arguments of instances of generic types
- Get a Type by name with namespace
- Looping through all the properties of a class
- IQueryable interface
- LINQ to Objects
- LINQ Queries
- LINQ Queries
- Chaining methods
- First FirstOrDefault Last LastOrDefault Single and SingleOrDefault
- Except
- SelectMany
- Any
- JOINS
- 0Skip and Take
- Zip
- 09Defining a variable inside a Linq query let keyword
- Range and Repeat
- All
- Basics
- Aggregate
- Distinct
- SelectMany Flattening a sequence of sequences
- Query collection by type cast elements to type
- GroupBy
- Enumerating the Enumerable
- Where
- Contains
- Using SelectMany instead of nested loops
- Using Range with various Linq methods
- Sum
- SkipWhile
- ToDictionary
- SequenceEqual
- Query Ordering - OrderBy ThenBy OrderByDescending ThenByDescending
- Any and FirstOrDefault - best practice
- GroupBy one or multiple fields
- OrderBy
- ElementAt and ElementAtOrDefault
- ToLookup
- Joining multiple sequences
- Joining on multiple keys
- DefaultIfEmpty
- GroupBy Sum and Count
- Count and LongCount
- Linq Quantifiers
- Build your own Linq operators for IEnumerableT
- GroupJoin with outer range variable
- Incrementally building a query
- Concat
- Reverse
- Union
- Select - Transforming elements
- OrderByDescending
- TakeWhile
- Select with FuncTSource int TResult selector - Use to get ranking of elements
- LINQ to XML
- Parallel LINQ PLINQ
- XmlDocument
- XDocument
- C# 7.0 Features
- C# 6.0 Features
- C# 6.0 Features
- Exception filters
- String interpolation
- Auto-property initializers
- Null propagation
- Expression-bodied function members
- Operator nameof
- Using static type
- Index initializers
- Improved overload resolution
- Await in catch and finally
- Minor changes and bugfixes
- Using an extension method for collection initialization
- Disable Warnings Enhancements
- C# 5.0 Features
- C# 4.0 Features
- C# 3.0 Features
- Exception Handling
- Creating Custom Exceptions
- Finally block
- Best Practices
- Exception Anti-patterns
- Handling specific exception types
- Basic Exception Handling
- Aggregate exceptions multiple exceptions from one method
- Throwing an exception
- Unhandled and Thread Exception
- Using the exception object
- Nesting of Exceptions try catch blocks.
- NullReferenceException
- Handling FormatException
- Read and Understand Stack trackes
- Diagnostics
- Overflow
- JSON handling
- Using json.net
- Lambda Expressions
- Lambda expressions
- Lambda expressions
- Lambda Expressions as Shorthand for Delegate Initialization
- Lambda Expression as an Event Handler
- Lambda Expressions with Multiple Parameters or No Parameters
- Lambdas can be emitted both as Func and Expression
- Put Multiple Statements in a Statement Lambda
- Lambdas for both Func and Action
- Passing a Lambda Expression as a Parameter to a Method
- Generic Lambda Query Builder
- Properties
- Initializing Properties
- INotifyPropertyChanged interface
- Events
- Expression Trees
- Overload Resolution
- Preprocessor directives
- Structs
- Attributes
- Delegates
- Delegates
- Declaring a delegate type
- Combine Delegates Multicast Delegates
- The FuncT TResult ActionT and PredicateT delegate types
- Safe invoke multicast delegate
- Delegate Equality
- Assigning a named method to a delegate
- Assigning to a delegate by lambda
- Underlying references of named method delegates
- Passing delegates as parameters
- Encapsulating transformations in functions
- Closure inside a delegate
- File and Stream IO
- File and Stream IO
- Reading from a file using the System.IO.File class
- Lazily reading a file line-by-line via an IEnumerable
- Copy File
- 0Writing lines to a file using the System.IO.StreamWriter class
- Async write text to a file using StreamWriter
- Writing to a file using the System.IO.File class
- Files and Directories
- Create File
- Move File
- Delete File
- Networking
- Performing HTTP requests
- Creating and sending an HTTP POST request
- Creating and sending an HTTP GET request
- Error handling of specific HTTP response codes such as 404 Not Found
- Sending asynchronous HTTP POST request with JSON body
- Retrieve HTML for Web Page Simple
- Sending asynchronous HTTP GET request and reading JSON request
- Reading and writing .zip files
- FileSystemWatcher
- Asynchronous Socket
- Action Filters
- Polymorphism
- Immutability
- Indexer
- Checked and Unchecked
- Stream
- Timers
- Stopwatches
- Threading
- Threading
- Avoiding Reading and Writing Data Simultaneously
- Parallel.ForEach Loop
- Creating and Starting a Second Thread
- Simple Complete Threading Demo
- Deadlocks hold resource and wait
- Creating One Thread Per Processor
- Implicit Task Parallelism
- Starting a thread with parameters
- Simple Complete Threading Demo using Tasks
- Explicit Task Parallism
- Deadlocks two threads waiting on each other
- Async/Await, BackgroundWorker, Task and Thread examples
- Async Await
- Async Await
- Await operator and async keyword
- Concurrent calls
- TryCatchFinally
- Returning a Task without await
- Web.config setup to target 4.5 for correct async behavior
- Async Await will only improve performance if it allows the machine to do additional work
- Simple consecutive calls
- Blocking on async code can cause deadlocks
- Synchronization Context in Async/Await
- BackgroundWorker
- Task Parallel Library
- Making a variable thread safe
- Lock Statement
- Yield Keyword
- Yield Keyword
- Simple Usage
- Correctly checking arguments
- Early Termination
- More Pertinent Usage
- Lazy Evaluation
- Try...finally
- Using yield to create an IEnumeratorT when implementing IEnumerableT
- Eager evaluation
- Return another Enumerable within a method returning Enumerable
- Lazy Evaluation Example Fibonacci Numbers
- The difference between break and yield break
- Task Parallel Library TPL Dataflow Constructs
- Functional Programming
- Func delegates
- Function with multiple return values
- Binary Serialization
- ICloneable
- IComparable
- Accessing Databases
- Using SQLite
- Caching
- Code Contracts
- Code Contracts and Assertions
- Structural Design Patterns
- Creational Design Patterns
- Implementing Decorating Design Pattern
- Implementing Flyweight Design Pattern
- System.Management.Automation
- Pointers
- Pointers and Unsafe Code
- Simulating C Unions with C# Structs
- Reactive Extensions Rx
- AsseblyInfo.cs examples
- Creating Console Application
- CLSCompliantAttribute
- ObservableCollection<T>
- Hash Functions
- Generating Random Numbers
- Generating Random Numbers in C#
- Generate a random int
- Generate a random int in a given range
- Generating the same sequence of random numbers over and over again
- Create multiple random class with different seeds simultaneously
- Generate a Random double
- Generate a random character
- Generate a number that is a percentage of a max value
- Cryptography
- Unsafe Code in .NET
- C# Script
- Runtime Compile
- Interoperability
- .NET Compiler Platform Roslyn
- Creating Own MessageBox in Windows Form Application
- Including Font Resources
- Garbage Collector
- Windows Communication Foundation
- Contributors