In this live, instructor-led training course, students who already have a programming background will learn to program in C#. Attendees will learn: how C# works and its place in the world of programming languages; its relationship with the Common Language Infrastructure and .NET Framework; C# data types and operators; to write selection statements and loops; generic programming and working with collections; processing data; and error handling. This C# course is taught using C# 8.
Audience
Students new to the C# language who already have experience with other programming languages.
Prerequisites
This course is specially designed for individuals with prior programming background. You should also have a working knowledge of Object Oriented Programming concepts. If you have no prior programming experience or are not familiar with Object Oriented Programming, you should consider our "C# Programming Level 1: Introduction for Non-Programmers" course instead.
Course Outline
Starting with the Building Blocks of C#
- The history of C#
- Understanding the CLI
- Common Type System (CTS)
- Common Language Specification (CLS)
- Common Intermediate Language (CIL)
- Virtual Execution System (VES)
- The .NET family of frameworks
- .NET Framework
- .NET Core
- Xamarin
- Assemblies in .NET
- Global Assembly Cache (GAC)
- Runtime package store
- Understanding the basic structure of a C# program
Data Types and Operators
- Basic data types
- The integral types
- The floating-point types
- The decimal type
- The char type
- The bool type
- The string type
- The object type
- Variables
- Naming convention
- Implicity-typed variables
- Understanding the scope and lifetime of variables
- Understanding constants
- Reference types and value types
- Value types
- Reference types
- Boxing and unboxing
- Nullable types
- Arrays
- One-dimensional arrays
- Multi-dimensional arrays
- Jagged arrays
- Type conversion
- Implicit type conversion
- Explicit type conversion
- User-defined type conversions
- Conversions with helper classes
- Operators
- Arithmetic operators
- Relational operators
- Logical operators
- Bitwise and shift operators
- Assignment operators
- Other operators
Control Statements and Exceptions
- Understanding control statements
- Selection statements
- Iteration statements
- The jump statements
- Exception handling
- Summary
- Test what you learned
Understanding the Various User-Defined Types
- Classes and objects
- Fields
- Methods
- Constructors
- Properties
- Indexers
- The this keyword
- The static keyword
- The ref, in, and out parameters
- Methods with a variable number of arguments
- Named and optional arguments
- Access modifiers
- Partial classes
- Structures
- Enumerations
- Namespaces
Object-Oriented Programming in C#
- Understanding OOP
- Abstraction
- Encapsulation
- Inheritance
- Virtual members
- Abstract classes and members
- Sealed classes and members
- Hiding base class members
- Interfaces
- Polymorphism
- Method overloading
- Operator overloading
- SOLID principles
Generics
- Understanding generics
- Generic types
- Generic classes
- Inheritance with generic classes
- Generic interfaces
- Variant generic interfaces
- Generic structures
- Generic methods
- Type parameter constraints
Collections
- Introducing the System.Collections.Generic namespace
- The List<T> collection
- The Stack<T> collection
- The Queue<T> collection
- The LinkedList<T> collection
- The Dictionary<TKey, TValue> collection
- The HashSet<T> collection
- Choosing the right collection type
- Using thread-safe collections
- IProducerConsumerCollection<T>
- BlockingCollection<T>
- ConcurrentQueue<T>
- ConcurrentStack<T>
- ConcurrentBag<T>
- ConcurrentDictionary<TKey, TValue>
- Choosing the right concurrent collection type
Files, Streams, and Serialization
- Overview of the System.IO namespace
- Working with paths
- Working with files and directories
- Working with streams
- Overview of the stream classes
- Working with file streams
- Working with memory streams
- Serializing and deserializing XML
- Serializing and deserializing JSON
- Using Json.NET
- Using System.Text.Json
Error Handling
- Errors
- Exceptions
- Catching exceptions
- The exception objects
- Conditional catch
- Throwing exceptions
- Creating a custom exception type
- Rethrowing an exception
- The finally block
- Debugging and monitoring exceptions
- Debugging second-chance exceptions
- Debugging first-chance exceptions
- AppDomain exception events
- Logging exceptions