C# 10.0 All-in-One For Dummies

Book description

Look sharp—learn or refresh your C# skills with the latest version

C# is one of the most popular programming languages, and frequent updates help it keep pace as the world of coding changes. You can keep pace too, thanks to C# 10.0 All-in-One For Dummies, where you'll learn the basics of the language itself, how to code in Visual Studio, and how to take advantage of the new features in the latest release. At every stage of your career, you'll need to know the cutting-edge trends and techniques that clients want. This book has your back, with info on object-oriented programming, writing secure code, building web applications, and more.

The six standalone mini-books you'll find inside this all-in-one will take you through the changes to C# and the practical applications and dev tools that you need to know. New features covered include records, init only setters, top-level statements, pattern matching enhancements, fit and finish features, and a lot more. Plus, this version is packed with more examples and code snippets, so you can sharply see C# in action!

  • Learn the very basics of C# programming, even if you have no prior experience
  • Refresh your knowledge of the language and learn how to use the new features in the 10.0 version release
  • Read six mini-books on hot coding topics like object-oriented programming, Visual Studio, and Windows 10 development
  • Enhance your employability and join the 6.5-million-strong community of C# developers

You need an easy-to-read C# guide that will help you understand the incoming updates, and this For Dummies reference is it.

Table of contents

  1. Cover
  2. Title Page
  3. Copyright
  4. Introduction
    1. About This Book
    2. Foolish Assumptions
    3. Icons Used in This Book
    4. Beyond the Book
    5. Where to Go from Here
  5. Book 1: The Basics of C# Programming
    1. Chapter 1: Creating Your First C# Console Application
      1. Getting a Handle on Computer Languages, C#, and .NET
      2. Creating Your First Console Application
      3. Making Your Console App Do Something
      4. Reviewing Your Console Application
      5. Replacing All that Ceremonial Code: Top-Level Statements
      6. Introducing the Toolbox Trick
      7. Interacting with C# Online
      8. Working with Jupyter Notebook: The Short Version
    2. Chapter 2: Living with Variability — Declaring Value-Type Variables
      1. Declaring a Variable
      2. What’s an int?
      3. Representing Fractions
      4. Handling Floating-Point Variables
      5. Using the Decimal Type: Is It an Integer or a Float?
      6. Examining the bool Type: Is It Logical?
      7. Checking Out Character Types
      8. What’s a Value Type?
      9. Comparing string and char
      10. Calculating Leap Years: DateTime
      11. Declaring Numeric Constants
      12. Changing Types: The Cast
      13. Letting the C# Compiler Infer Data Types
    3. Chapter 3: Pulling Strings
      1. The Union Is Indivisible, and So Are Strings
      2. Performing Common Operations on a String
      3. Comparing Strings
      4. What If I Want to Switch Case?
      5. Looping through a String
      6. Searching Strings
      7. Getting Input from Users in Console Applications
      8. Controlling Output Manually
      9. Formatting Your Strings Precisely
      10. StringBuilder: Manipulating Strings More Efficiently
    4. Chapter 4: Smooth Operators
      1. Performing Arithmetic
      2. Performing Logical Comparisons — Is That Logical?
      3. Matching Expression Types at TrackDownAMate.com
    5. Chapter 5: Getting into the Program Flow
      1. Branching Out with if and switch
      2. Here We Go Loop-the-Loop
      3. Looping a Specified Number of Times with for
    6. Chapter 6: Lining Up Your Ducks with Collections
      1. The C# Array
      2. Processing Arrays by Using foreach
      3. Sorting Arrays of Data
      4. Using var for Arrays
      5. Loosening Up with C# Collections
      6. Understanding Collection Syntax
      7. Using Lists
      8. Using Dictionaries
      9. Array and Collection Initializers
      10. Using Sets
    7. Chapter 7: Stepping through Collections
      1. Iterating through a Directory of Files
      2. Iterating foreach Collections: Iterators
      3. Accessing Collections the Array Way: Indexers
      4. Looping Around the Iterator Block
    8. Chapter 8: Buying Generic
      1. Writing a New Prescription: Generics
      2. Classy Generics: Writing Your Own
      3. Understanding Variance in Generics
    9. Chapter 9: Some Exceptional Exceptions
      1. Using an Exceptional Error-Reporting Mechanism
      2. Can I Get an Exceptional Example?
      3. Working with Custom Exceptions
      4. Planning Your Exception-Handling Strategy
      5. Grabbing Your Last Chance to Catch an Exception
      6. Throwing Expressions
    10. Chapter 10: Creating Lists of Items with Enumerations
      1. Seeing Enumerations in the Real World
      2. Working with Enumerations
      3. Creating Enumerated Flags
      4. Defining Enumerated Switches
      5. Working with Enumeration Methods
  6. Book 2: Object-Oriented C# Programming
    1. Chapter 1: Showing Some Class
      1. A Quick Overview of Object-Oriented Programming
      2. Defining a Class and an Object
      3. Accessing the Members of an Object
      4. Working with Object-Based Code
      5. Discriminating between Objects
      6. Can You Give Me References?
      7. Classes That Contain Classes Are the Happiest Classes in the World
      8. Generating Static in Class Members
      9. Defining const and readonly Data Members
    2. Chapter 2: We Have Our Methods
      1. Defining and Using a Method
      2. Method Examples for Your Files
      3. Having Arguments with Methods
      4. Using the Call-by-Reference Feature
      5. Defining a Method with No Return Value
      6. Returning Multiple Values Using Tuples
    3. Chapter 3: Let Me Say This about this
      1. Passing an Object to a Method
      2. Comparing Static and Instance Methods
      3. Accessing the Current Object
      4. Using Local Functions
    4. Chapter 4: Holding a Class Responsible
      1. Restricting Access to Class Members
      2. Why You Should Worry about Access Control
      3. Defining Class Properties
      4. Using Target Typing for Your Convenience
      5. Dealing with Covariant Return Types
      6. Getting Your Objects Off to a Good Start — Constructors
      7. Using Expression-Bodied Members
    5. Chapter 5: Inheritance: Is That All I Get?
      1. Why You Need Inheritance
      2. Inheriting from a BankAccount Class (a More Complex Example)
      3. IS_A versus HAS_A — I’m So Confused_A
      4. Other Features That Support Inheritance
    6. Chapter 6: Poly-what-ism?
      1. Overloading an Inherited Method
      2. Polymorphism
      3. C# During Its Abstract Period
      4. Sealing a Class
    7. Chapter 7: Interfacing with the Interface
      1. Introducing CAN_BE_USED_AS
      2. Knowing What an Interface Is
      3. Using an Interface
      4. Using the C# Predefined Interface Types
      5. Looking at a Program That CAN_BE_USED_AS an Example
      6. Unifying Class Hierarchies
      7. Hiding Behind an Interface
      8. Inheriting an Interface
      9. Using Interfaces to Manage Change in Object-Oriented Programs
    8. Chapter 8: Delegating Those Important Events
      1. E.T., Phone Home — The Callback Problem
      2. Defining a Delegate
      3. Pass Me the Code, Please — Examples
      4. A More Real-World Example
      5. Shh! Keep It Quiet — Anonymous Methods
      6. Stuff Happens — C# Events
    9. Chapter 9: Can I Use Your Namespace in the Library?
      1. Dividing a Single Program into Multiple Source Files
      2. Working with Global using Statements
      3. Dividing a Single Program into Multiple Assemblies
      4. Putting Your Classes into Class Libraries
      5. Going Beyond Public and Private: More Access Keywords
      6. Putting Classes into Namespaces
      7. Working with Partial Methods
    10. Chapter 10: Improving Productivity with Named and Optional Parameters
      1. Exploring Optional Parameters
      2. Looking at Named Parameters
      3. Using Alternative Methods to Return Values
      4. Dealing with null Parameters
    11. Chapter 11: Interacting with Structures
      1. Comparing Structures to Classes
      2. Creating Structures
      3. Working with Read-only Structures
      4. Working with Reference Structures
      5. Using Structures as Records
      6. Using the New Record Type
  7. Book 3: Designing for C#
    1. Chapter 1: Writing Secure Code
      1. Designing Secure Software
      2. Building Secure Windows Applications
      3. Using System.Security
    2. Chapter 2: Accessing Data
      1. Getting to Know System.Data
      2. How the Data Classes Fit into the Framework
      3. Getting to Your Data
      4. Using the System.Data Namespace
    3. Chapter 3: Fishing the File Stream
      1. Going Where the Fish Are: The File Stream
      2. StreamWriting for Old Walter
      3. Pulling Them Out of the Stream: Using StreamReader
      4. More Readers and Writers
      5. Exploring More Streams than Lewis and Clark
    4. Chapter 4: Accessing the Internet
      1. Getting to Know System.Net
      2. How Net Classes Fit into the Framework
      3. Using the System.Net Namespace
    5. Chapter 5: Creating Images
      1. Getting to Know System.Drawing
      2. How the Drawing Classes Fit into the Framework
      3. Using the System.Drawing Namespace
    6. Chapter 6: Programming Dynamically!
      1. Shifting C# Toward Dynamic Typing
      2. Employing Dynamic Programming Techniques
      3. Putting Dynamic to Use
      4. Running with the Dynamic Language Runtime
      5. Using Static Anonymous Functions
  8. Book 4: A Tour of Visual Studio
    1. Chapter 1: Getting Started with Visual Studio
      1. Versioning the Versions
      2. Installing Visual Studio
      3. Breaking Down the Projects
    2. Chapter 2: Using the Interface
      1. Designing in the Designer
      2. Paneling the Studio
      3. Coding in the Code Editor
      4. Using the Tools of the Trade
      5. Using the Debugger as an Aid to Learning
    3. Chapter 3: Customizing Visual Studio
      1. Setting Options
      2. Creating Your Own Templates
  9. Book 5: Windows Development with WPF
    1. Chapter 1: Introducing WPF
      1. Understanding What WPF Can Do
      2. Introducing XAML
      3. Diving In! Creating Your First WPF Application
      4. Whatever XAML Can Do, C# Can Do Better!
    2. Chapter 2: Understanding the Basics of WPF
      1. Using WPF to Lay Out Your Application
      2. Arranging Elements with Layout Panels
      3. Exploring Common XAML Controls
    3. Chapter 3: Data Binding in WPF
      1. Getting to Know Dependency Properties
      2. Exploring the Binding Modes
      3. Investigating the Binding Object
      4. Editing, Validating, Converting, and Visualizing Your Data
      5. Finding Out More about WPF Data Binding
    4. Chapter 4: Practical WPF
      1. Commanding Attention
      2. Using Built-In Commands
      3. Using Custom Commands
      4. Using Routed Commands
    5. Chapter 5: Programming for Windows 10 and Above
      1. What is the Universal Windows Platform (UWP)?
      2. Devices Supported by the UWP
      3. Creating Your Own UWP App
      4. Working with .NET Core Applications
  10. Book 6: Web Development with ASP.NET
    1. Chapter 1: Creating a Basic ASP.NET Core App
      1. Understanding the ASP.NET Core Templates
      2. Developing a Basic Web App
    2. Chapter 2: Employing the Razor Markup Language
      1. Avoiding Nicks from Razor
      2. Creating Variables
      3. Keeping Things Logical
      4. Implementing Loops
    3. Chapter 3: Generating and Consuming Data
      1. Understanding Why These Projects Are Important
      2. Serialized Data Isn’t for Breakfast
      3. Developing a Data Generator and API
      4. Creating a Consumer Website
  11. Index
  12. About the Author
  13. Advertisement Page
  14. Connect with Dummies
  15. End User License Agreement

Product information

  • Title: C# 10.0 All-in-One For Dummies
  • Author(s): John Paul Mueller
  • Release date: March 2022
  • Publisher(s): For Dummies
  • ISBN: 9781119839071