𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Programming C# 10: Build Cloud, Web, and Desktop Applications

✍ Scribed by Ian Griffiths


Publisher
O'Reilly Media
Year
2022
Tongue
English
Leaves
836
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 10.0 and .NET 6 fundamentals and techniques for building cloud, web, and desktop applications.

Designed for experienced programmers, this book provides many code examples to help you work with the nuts and bolts of C#, such as generics, LINQ, and asynchronous programming features. You'll get up to speed on .NET 6 and the latest C# 9.0 and 10.0 additions, including records, enhanced pattern matching, and new features designed to remove "ceremony" to improve productivity.

β€’ Understand how .NET has changed in the most recent releases, and learn what it means for application development
β€’ Select the most appropriate C# language features for any task
β€’ Learn when to use the new features and when to stick with older ones
β€’ Examine the range of functionality available in .NET's class libraries
β€’ Learn how you can apply these class libraries to practical programming tasks
β€’ Explore numerous small additions to .NET that improve expressiveness
"Unlike books that focus on Visual Studio and technologies that interact with C#, this one covers the core language, and mastery of this core is essential to successfully building good software. It covers important concepts followed by generous code examples to explain them. It's thorough, detailed, and gets at the nooks and crannies of the language rarely covered elsewhere. It's a complete course on C#." --Jeremy Morgan Software/DevOps Engineer

Ian Griffiths has worked in various aspects of computing, including computer networking, embedded real-time systems, broadcast television systems, medical imaging, and all forms of cloud computing. Ian is a Technical Fellow at endjin, and a Microsoft MVP in Developer Technologies. He's the author of several O'Reilly books and has written courses on Windows Presentation Foundation (WPF) and TPL Tables. Technology brings him joy.

✦ Table of Contents


Cover
Copyright
Table of Contents
Preface
Who This Book Is For
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Chapter 1. Introducing C#
Why C#?
Managed Code and the CLR
C# Prefers Generality to Specialization
C# Standards and Implementations
Many .NETs
Release Cycles and Long Term Support
Target Multiple .NET Versions with .NET Standard
Visual Studio, Visual Studio Code, and JetBrains Rider
Anatomy of a Simple Program
Writing a Unit Test
Namespaces
Classes
Unit Tests
Summary
Chapter 2. Basic Coding in C#
Local Variables
Scope
Variable Name Ambiguity
Local Variable Instances
Statements and Expressions
Statements
Expressions
Comments and Whitespace
Preprocessing Directives
Compilation Symbols
#error and #warning
#line
#pragma
#nullable
#region and #endregion
Fundamental Data Types
Numeric Types
Booleans
Strings and Characters
Tuples
Dynamic
Object
Operators
Flow Control
Boolean Decisions with if Statements
Multiple Choice with switch Statements
Loops: while and do
C-Style for Loops
Collection Iteration with foreach Loops
Patterns
Combining and Negating Patterns
Relational Patterns
Getting More Specific with when
Patterns in Expressions
Summary
Chapter 3. Types
Classes
Static Members
Static Classes
Records
References and Nulls
Banishing Null with Non-Nullable References
Structs
When to Write a Value Type
Guaranteeing Immutability
Record Structs
Class, Structs, Records, or Tuples?
Members
Accessibility
Fields
Constructors
Deconstructors
Methods
Properties
Operators
Events
Nested Types
Interfaces
Default Interface Implementation
Enums
Other Types
Anonymous Types
Partial Types and Methods
Summary
Chapter 4. Generics
Generic Types
Constraints
Type Constraints
Reference Type Constraints
Value Type Constraints
Value Types All the Way Down with Unmanaged Constraints
Not Null Constraints
Other Special Type Constraints
Multiple Constraints
Zero-Like Values
Generic Methods
Type Inference
Generics and Tuples
Inside Generics
Summary
Chapter 5. Collections
Arrays
Array Initialization
Searching and Sorting
Multidimensional Arrays
Copying and Resizing
List
List and Sequence Interfaces
Implementing Lists and Sequences
Implementing IEnumerable with Iterators
Collection
ReadOnlyCollection
Addressing Elements with Index and Range Syntax
System.Index
System.Range
Supporting Index and Range in Your Own Types
Dictionaries
Sorted Dictionaries
Sets
Queues and Stacks
Linked Lists
Concurrent Collections
Immutable Collections
Summary
Chapter 6. Inheritance
Inheritance and Conversions
Interface Inheritance
Generics
Covariance and Contravariance
System.Object
The Ubiquitous Methods of System.Object
Accessibility and Inheritance
Virtual Methods
Abstract Methods
Inheritance and Library Versioning
Sealed Methods and Classes
Accessing Base Members
Inheritance and Construction
Record Types
Records, Inheritance, and the with Keyword
Special Base Types
Summary
Chapter 7. Object Lifetime
Garbage Collection
Determining Reachability
Accidentally Defeating the Garbage Collector
Weak References
Reclaiming Memory
Garbage Collector Modes
Temporarily Suspending Garbage Collections
Accidentally Defeating Compaction
Forcing Garbage Collections
Destructors and Finalization
IDisposable
Optional Disposal
Boxing
Boxing Nullable
Summary
Chapter 8. Exceptions
Exception Sources
Exceptions from APIs
Failures Detected by the Runtime
Handling Exceptions
Exception Objects
Multiple catch Blocks
Exception Filters
Nested try Blocks
finally Blocks
Throwing Exceptions
Rethrowing Exceptions
Failing Fast
Exception Types
Custom Exceptions
Unhandled Exceptions
Summary
Chapter 9. Delegates, Lambdas, and Events
Delegate Types
Creating a Delegate
Multicast Delegates
Invoking a Delegate
Common Delegate Types
Type Compatibility
Behind the Syntax
Anonymous Functions
Captured Variables
Lambdas and Expression Trees
Events
Standard Event Delegate Pattern
Custom Add and Remove Methods
Events and the Garbage Collector
Events Versus Delegates
Delegates Versus Interfaces
Summary
Chapter 10. LINQ
Query Expressions
How Query Expressions Expand
Supporting Query Expressions
Deferred Evaluation
LINQ, Generics, and IQueryable
Standard LINQ Operators
Filtering
Select
SelectMany
Chunking
Ordering
Containment Tests
Specific Items and Subranges
Aggregation
Set Operations
Whole-Sequence, Order-Preserving Operations
Grouping
Joins
Conversion
Sequence Generation
Other LINQ Implementations
Entity Framework Core
Parallel LINQ (PLINQ)
LINQ to XML
IAsyncEnumerable
Reactive Extensions
Summary
Chapter 11. Reactive Extensions
Fundamental Interfaces
IObserver
IObservable
Publishing and Subscribing with Delegates
Creating an Observable Source with Delegates
Subscribing to an Observable Source with Delegates
Sequence Builders
Empty
Never
Return
Throw
Range
Repeat
Generate
LINQ Queries
Grouping Operators
Join Operators
SelectMany Operator
Aggregation and Other Single-Value Operators
Concat Operator
Rx Query Operators
Merge
Windowing Operators
The Scan Operator
The Amb Operator
DistinctUntilChanged
Schedulers
Specifying Schedulers
Built-in Schedulers
Subjects
Subject
BehaviorSubject
ReplaySubject
AsyncSubject
Adaptation
IEnumerable and IAsyncEnumerable
.NET Events
Asynchronous APIs
Timed Operations
Interval
Timer
Timestamp
TimeInterval
Throttle
Sample
Timeout
Windowing Operators
Delay
DelaySubscription
Reaqtorβ€”Rx as a Service
Summary
Chapter 12. Assemblies
Anatomy of an Assembly
.NET Metadata
Resources
Multifile Assemblies
Other PE Features
Type Identity
Loading Assemblies
Assembly Resolution
Explicit Loading
Isolation and Plug-ins with AssemblyLoadContext
Assembly Names
Strong Names
Version
Version Numbers and Assembly Loading
Culture
Protection
Target Frameworks and .NET Standard
Summary
Chapter 13. Reflection
Reflection Types
Assembly
Module
MemberInfo
Type and TypeInfo
MethodBase, ConstructorInfo, and MethodInfo
ParameterInfo
FieldInfo
PropertyInfo
EventInfo
Reflection Contexts
Summary
Chapter 14. Attributes
Applying Attributes
Attribute Targets
Compiler-Handled Attributes
CLR-Handled Attributes
Defining and Consuming Attributes
Attribute Types
Retrieving Attributes
Metadata-Only Load
Summary
Chapter 15. Files and Streams
The Stream Class
Position and Seeking
Flushing
Copying
Length
Disposal
Asynchronous Operation
Concrete Stream Types
One Type, Many Behaviors
Random Access and Scatter/Gather I/O Without Stream
Text-Oriented Types
TextReader and TextWriter
Concrete Reader and Writer Types
Encoding
Files and Directories
FileStream Class
File Class
Directory Class
Path Class
FileInfo, DirectoryInfo, and FileSystemInfo
Known Folders
Serialization
BinaryReader, BinaryWriter, and BinaryPrimitives
CLR Serialization
JSON
Summary
Chapter 16. Multithreading
Threads
Threads, Variables, and Shared State
Thread-Local Storage
The Thread Class
The Thread Pool
Thread Affinity and SynchronizationContext
ExecutionContext
Synchronization
Monitors and the lock Keyword
SpinLock
Reader/Writer Locks
Event Objects
Barrier
CountdownEvent
Semaphores
Mutex
Interlocked
Lazy Initialization
Other Class Library Concurrency Support
Tasks
The Task and Task Classes
Continuations
Schedulers
Error Handling
Custom Threadless Tasks
Parent/Child Relationships
Composite Tasks
Other Asynchronous Patterns
Cancellation
Parallelism
The Parallel Class
Parallel LINQ
TPL Dataflow
Summary
Chapter 17. Asynchronous Language Features
Asynchronous Keywords: async and await
Execution and Synchronization Contexts
Multiple Operations and Loops
Returning a Task
Applying async to Nested Methods
The await Pattern
Error Handling
Validating Arguments
Singular and Multiple Exceptions
Concurrent Operations and Missed Exceptions
Summary
Chapter 18. Memory Efficiency
(Don’t) Copy That
Representing Sequential Elements with Span
Utility Methods
Stack Only
Representing Sequential Elements with Memory
ReadOnlySequence
Processing Data Streams with Pipelines
Processing JSON in ASP.NET Core
Summary
Index
About the Author
Colophon

✦ Subjects


Programming; C#; Web Applications; Application Development; Cloud-Native; Applications Desktop


πŸ“œ SIMILAR VOLUMES


Programming C# 10: Build Cloud, Web, and
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2022 πŸ› O'Reilly Media 🌐 English

<p><span>C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 10.0 and .NET 6 fundamentals and techniques for buil

Programming C# 10. Build Cloud, Web, and
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2022 πŸ› O'Reilly Media, Inc. 🌐 English

<span><div><p>C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 10.0 and .NET 6 fundamentals and techniques for

Programming C# 10: Build Cloud, Web, and
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2022 πŸ› O'Reilly Media 🌐 English

<p>C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 10.0 and .NET 6 fundamentals and techniques for building c

Programming C# 12: Build Cloud, Web, and
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2024 πŸ› O'Reilly Media 🌐 English

C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 12.0 and .NET 8 fundamentals and techniques for building clou

Programming C# 8.0: Build Cloud, Web, an
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2019 πŸ› O’Reilly Media 🌐 English

C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 8.0 fundamentals and techniques for building cloud, web, and

Programming C# 8.0: Build Cloud, Web, an
✍ Ian Griffiths πŸ“‚ Library πŸ“… 2020 πŸ› O’Reilly Media 🌐 English

C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you’ll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 8.0 fundamentals and techniques for building cloud, web, and