
Programming C# 12
Beschreibung
Weitere Details
Weitere Ausgaben
Inhalt
- Intro
- 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
- Targeting Multiple .NET Runtimes
- 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
- Tuple Deconstruction
- 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
- Initialization Inputs
- 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
- Static Virtual Members
- 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
- Generic Math
- Generic Math Interfaces
- Numeric Category Interfaces
- Operator Interfaces
- Function Interfaces
- Parsing and Formatting
- Generics and Tuples
- Summary
- Chapter 5. Collections
- Arrays
- Array Initialization
- Searching and Sorting
- Multidimensional Arrays
- Copying and Resizing
- List&T&
- List and Sequence Interfaces
- Implementing Lists and Sequences
- Implementing IEnumerable&T& with Iterators
- Collection&T&
- ReadOnlyCollection&T&
- 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
- Frozen 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
- Static Virtual Methods
- Default Constraints
- Sealed Methods and Classes
- Accessing Base Members
- Inheritance and Construction
- Primary Constructors
- Mandatory Properties
- Field Initialization
- 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
- Lightening the Load with Inline Arrays
- Garbage Collector Modes
- Temporarily Suspending Garbage Collections
- Accidentally Defeating Compaction
- Forcing Garbage Collections
- Destructors and Finalization
- IDisposable
- Optional Disposal
- Boxing
- Boxing Nullable&T&
- 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
- Lambdas and Default Arguments
- 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
- Deferred Evaluation
- LINQ, Generics, and IQueryable&T&
- Standard LINQ Operators
- Filtering
- Select
- SelectMany
- Ordering
- Containment Tests
- Specific Items and Subranges
- Whole-Sequence, Order-Preserving Operations
- Aggregation
- Grouping
- Conversion
- Sequence Generation
- Other LINQ Implementations
- Entity Framework Core
- Parallel LINQ (PLINQ)
- LINQ to XML
- IAsyncEnumerable&T&
- Reactive Extensions
- Summary
- Chapter 11. Rx: Reactive Extensions
- Fundamental Interfaces
- IObserver&T&
- IObservable&T&
- 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&T&
- BehaviorSubject&T&
- ReplaySubject&T&
- AsyncSubject&T&
- Adaptation
- IEnumerable&T& and IAsyncEnumerable&T&
- .NET Events
- Asynchronous APIs
- Timed Sequences
- Timed Sources
- Timed Operators
- Timed Windowing Operators
- Reaqtor-Rx as a Service
- Summary
- Chapter 12. Assemblies and Deployment
- Anatomy of an Assembly
- .NET Metadata
- Resources
- Multifile Assemblies
- Other PE Features
- Type Identity
- Deployment
- Framework-Dependent
- Self-Contained
- Trimming
- Ahead-of-Time (AOT) Compilation
- 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
- Generic Types
- MethodBase, ConstructorInfo, and MethodInfo
- ParameterInfo
- FieldInfo
- PropertyInfo
- EventInfo
- Reflection Contexts
- Summary
- Chapter 14. Attributes
- Applying Attributes
- Attribute Targets
- Compiler-Handled Attributes
- CLR-Handled Attributes
- Debugging Attributes
- Build-Time Attributes
- Defining and Consuming Attributes
- Attribute Types
- Retrieving Attributes
- Metadata-Only Load
- Generic Attribute Types
- 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
- Text-Oriented Types
- TextReader and TextWriter
- Concrete Reader and Writer Types
- Encoding
- Files and Directories
- FileStream Class
- File Class
- Directory Class
- Path Class
- 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
- Other Synchronization Primitives
- Interlocked
- Lazy Initialization
- Other Class Library Concurrency Support
- Tasks
- The Task and Task&T& 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&T&
- Utility Methods
- Collection Expressions and Spans
- Pattern Matching
- Stack Only
- Using ref with Fields
- Representing Sequential Elements with Memory&T&
- ReadOnlySequence&T&
- Processing Data Streams with Pipelines
- Processing JSON in ASP.NET Core
- Summary
- Index
- About the Author
- Colophon
Systemvoraussetzungen
Dateiformat: PDF
Kopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
- Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).
- Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).
- E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)
Das Dateiformat PDF zeigt auf jeder Hardware eine Buchseite stets identisch an. Daher ist eine PDF auch für ein komplexes Layout geeignet, wie es bei Lehr- und Fachbüchern verwendet wird (Bilder, Tabellen, Spalten, Fußnoten). Bei kleinen Displays von E-Readern oder Smartphones sind PDF leider eher nervig, weil zu viel Scrollen notwendig ist.
Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.
Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.