برای استفاده از C# 10 به دنبال پاسخهای سریع میگردید؟ این راهنمای کاملاً متمرکز و کاربردی، بدون مقدمههای طولانی یا نمونههای پف کرده، دقیقاً آنچه را که باید بدانید به شما میگوید. این مرجع جیبی، یک منبع سریع اطلاعات ایده آل و مختصر است که برای مرور کردن آسان است. اگر جاوا، سی پلاس پلاس یا نسخههای قبلی سی شارپ را بلد هستید، این راهنما به شما کمک میکند تا به سرعت راه بیفتید.
همه برنامهها و تکه کدها به عنوان نمونههای تعاملی در LINQPad در دسترس هستند. شما میتوانید این نمونهها را ویرایش کنید و فوراً نتایج را بدون نیاز به راه اندازی پروژهها در ویژوال استودیو مشاهده کنید. کتاب C# 10 Pocket Reference (مرجع جیبی سی شارپ 10)، توسط نویسندگان کتاب C# 9.0 in a Nutshell نوشته شده است که موارد زیر را پوشش میدهد: مبانی سی شارپ و قابلیتهای جدید سی شارپ 10؛ مباحث پیشرفته مانند overloading عملگر، قیود نوع ها، انواع نال پذیر، lifting عملگر، closure ها، الگوها و توابع ناهمگام؛ LINQ: توالی ها، اجرای lazy، عملگرهای کوئری گرفتن استاندارد و عبارات کوئری؛ کد ناامن و اشاره گر ها، attributeهای سفارشی، دستورالعملهای پیش پردازنده و سند XML.
Table of Contents:
- A First C# Program
- Compilation
- Syntax
- Identifiers and Keywords
- Literals, Punctuators, and Operators
- Comments
- Type Basics
- Predefined Type Examples
- Custom Type Examples
- Types and Conversions
- Value Types Versus Reference Types
- Predefined Type Taxonomy
- Numeric Types
- Numeric Literals
- Numeric Conversions
- Arithmetic Operators
- Increment and Decrement Operators
- Specialized Integral Operations
- 8- and 16-Bit Integral Types
- Special Float and Double Values
- double Versus decimal
- Real Number Rounding Errors
- Boolean Type and Operators
- Equality and Comparison Operators
- Conditional Operators
- Strings and Characters
- String Type
- Arrays
- Default Element Initialization
- Indices and Ranges
- Multidimensional Arrays
- Simplified Array Initialization Expressions
- Variables and Parameters
- The Stack and the Heap
- Definite Assignment
- Default Values
- Parameters
- var—Implicitly Typed Local Variables
- Target-Typed new Expressions
- Expressions and Operators
- Assignment Expressions
- Operator Precedence and Associativity
- Operator Table
- Null Operators
- Null-Coalescing Operator
- Null-Coalescing Assignment Operator
- Null-Conditional Operator
- Statements
- Declaration Statements
- Expression Statements
- Selection Statements
- Iteration Statements
- Jump Statements
- Namespaces
- File-Scoped Namespaces (C# 10)
- The using Directive
- The global using Directive (C# 10)
- using static
- Rules Within a Namespace
- Aliasing Types and Namespaces
- Classes
- Fields
- Constants
- Methods
- Instance Constructors
- Deconstructors
- Object Initializers
- The this Reference
- Properties
- Indexers
- Static Constructors
- Static Classes
- Finalizers
- Partial Types and Methods
- The nameof Operator
- Inheritance
- Polymorphism
- Casting and Reference Conversions
- Virtual Function Members
- Abstract Classes and Abstract Members
- Hiding Inherited Members
- Sealing Functions and Classes
- The base Keyword
- Constructors and Inheritance
- Overloading and Resolution
- The object Type
- Boxing and Unboxing
- Static and Runtime Type Checking
- The GetType Method and typeof Operator
- Object Member Listing
- Equals, ReferenceEquals, and GetHashCode
- The ToString Method
- Structs
- Struct Construction Semantics
- readonly Structs and Functions
- Access Modifiers
- Friend Assemblies
- Accessibility Capping
- Interfaces
- Extending an Interface
- Explicit Interface Implementation
- Implementing Interface Members Virtually
- Reimplementing an Interface in a Subclass
- Default Interface Members
- Enums
- Enum Conversions
- Flags Enums
- Enum Operators
- Nested Types
- Generics
- Generic Types
- Generic Methods
- Declaring Type Parameters
- typeof and Unbound Generic Types
- The default Generic Value
- Generic Constraints
- Subclassing Generic Types
- Self-Referencing Generic Declarations
- Static Data
- Covariance
- Contravariance
- Delegates
- Writing Plug-In Methods with Delegates
- Instance and Static Method Targets
- Multicast Delegates
- Generic Delegate Types
- The Func and Action Delegates
- Delegate Compatibility
- Events
- Standard Event Pattern
- Event Accessors
- Lambda Expressions
- Capturing Outer Variables
- Lambda Expressions Versus Local Methods
- Anonymous Methods
- try Statements and Exceptions
- The catch Clause
- The finally Block
- Throwing Exceptions
- Key Properties of System.Exception
- Enumeration and Iterators
- Enumeration
- Collection Initializers
- Iterators
- Iterator Semantics
- Composing Sequences
- Nullable Value Types
- Nullable<T> Struct
- Nullable Conversions
- Boxing/Unboxing Nullable Values
- Operator Lifting
- bool? with & and | Operators
- Nullable Types and Null Operators
- Nullable Reference Types
- Extension Methods
- Extension Method Chaining
- Ambiguity and Resolution
- Anonymous Types
- Tuples
- Naming Tuple Elements
- Deconstructing Tuples
- Records
- Defining a Record
- Nondestructive Mutation
- Primary Constructors
- Records and Equality Comparison
- Patterns
- var Pattern
- Constant Pattern
- Relational Patterns
- Pattern Combinators
- Tuple and Positional Patterns
- Property Patterns
- LINQ
- LINQ Fundamentals
- Deferred Execution
- Standard Query Operators
- Chaining Query Operators
- Query Expressions
- The let Keyword
- Query Continuations
- Multiple Generators
- Joining
- Ordering
- Grouping
- OfType and Cast
- Dynamic Binding
- Static Binding Versus Dynamic Binding
- Custom Binding
- Language Binding
- RuntimeBinderException
- Runtime Representation of dynamic
- Dynamic Conversions
- var Versus dynamic
- Dynamic Expressions
- Dynamic Member Overload Resolution
- Uncallable Functions
- Operator Overloading
- Operator Functions
- Overloading Equality and Comparison Operators
- Custom Implicit and Explicit Conversions
- Attributes
- Attribute Classes
- Named and Positional Attribute Parameters
- Attribute Targets
- Specifying Multiple Attributes
- Writing Custom Attributes
- Retrieving Attributes at Runtime
- Caller Info Attributes
- CallerArgumentExpression (C# 10)
- Asynchronous Functions
- The await and async Keywords
- Capturing Local State
- Writing Asynchronous Functions
- Parallelism
- Asynchronous Lambda Expressions
- Asynchronous Streams
- Unsafe Code and Pointers
- Pointer Basics
- Unsafe Code
- The fixed Statement
- The Pointer-to-Member Operator
- The stackalloc Keyword
- Fixed-size buffers
- void*
- Function Pointers
- Preprocessor Directives
- Pragma Warning
- XML Documentation
- Standard XML Documentation Tags
- Index
- About the Authors