C# 10.0 All-in-One For Dummies
- Length: 864 pages
- Edition: 1
- Language: English
- Publisher: For Dummies
- Publication Date: 2022-02-15
- ISBN-10: 1119839076
- ISBN-13: 9781119839071
- Sales Rank: #1494592 (See Top 100 Books)
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.
Title Page Copyright Page Table of Contents Introduction About This Book Foolish Assumptions Icons Used in This Book Beyond the Book Where to Go from Here Book 1 The Basics of C Programming Chapter 1 Creating Your First C Console Application Getting a Handle on Computer Languages, C , and .NET What’s a program? What’s C ? What’s .NET? What is Visual Studio 2022? Creating Your First Console Application Creating the source program Taking it out for a test drive Making Your Console App Do Something Reviewing Your Console Application The program framework Comments The meat of the program Replacing All that Ceremonial Code: Top-Level Statements Introducing the Toolbox Trick Saving code in the Toolbox Reusing code from the Toolbox Interacting with C Online Working with Jupyter Notebook: The Short Version Chapter 2 Living with Variability — Declaring Value-Type Variables Declaring a Variable What’s an int? Rules for declaring variables Variations on a theme: Different types of int Representing Fractions Handling Floating-Point Variables Declaring a floating-point variable Examining some limitations of floating-point variables Using the Decimal Type: Is It an Integer or a Float? Declaring a decimal Comparing decimals, integers, and floating-point types Examining the bool Type: Is It Logical? Checking Out Character Types The char variable type Special chars The string type What’s a Value Type? Comparing string and char Calculating Leap Years: DateTime Declaring Numeric Constants Changing Types: The Cast Letting the C Compiler Infer Data Types Chapter 3 Pulling Strings The Union Is Indivisible, and So Are Strings Performing Common Operations on a String Comparing Strings Equality for all strings: The Compare() method Would you like your compares with or without case? What If I Want to Switch Case? Distinguishing between all-uppercase and all-lowercase strings Converting a string to upper- or lowercase Looping through a String Searching Strings Can I find it? Is my string empty? Using advanced pattern matching Getting Input from Users in Console Applications Trimming excess white space Parsing numeric input Handling a series of numbers Joining an array of strings into one string Controlling Output Manually Using the Trim() and Pad() methods Using the Concatenate() method Go Ahead and Split() that concatenate program Formatting Your Strings Precisely Using the String.Format() method Using the interpolation method StringBuilder: Manipulating Strings More Efficiently Chapter 4 Smooth Operators Performing Arithmetic Simple operators Operating orders The assignment operator The increment operator Performing Logical Comparisons — Is That Logical? Comparing floating-point numbers: Is your float bigger than mine? Compounding the confusion with compound logical operations Matching Expression Types at TrackDownAMate.com Calculating the type of an operation Assigning types Changing how an operator works: Operator overloading Chapter 5 Getting into the Program Flow Branching Out with if and switch Introducing the if statement Examining the else statement Avoiding even the else Nesting if statements Running the switchboard Here We Go Loop-the-Loop Looping for a while Doing the do . . . while loop Breaking up is easy to do Looping until you get it right Focusing on scope rules Looping a Specified Number of Times with for A for loop example Why do you need another loop? Nesting loops Chapter 6 Lining Up Your Ducks with Collections The C Array The argument for the array The fixed-value array The variable-length array Initializing an array Processing Arrays by Using foreach Working with foreach loops in a standard way Relying on GetEnumerator support Sorting Arrays of Data Using var for Arrays Loosening Up with C Collections Understanding Collection Syntax Figuring out <T> Going generic Using Lists Instantiating an empty list Creating a list of type int Converting between lists and arrays Searching lists Performing other list tasks Using Dictionaries Creating a dictionary Searching a dictionary Iterating a dictionary Array and Collection Initializers Initializing arrays Initializing collections Using Sets Performing special set tasks Creating a set Adding items to a set Performing a union Performing an intersection Performing a difference Chapter 7 Stepping through Collections Iterating through a Directory of Files Using the LoopThroughFiles program Getting started Obtaining the initial input Creating a list of files Formatting the output lines Displaying the hexadecimal output Running from inside Visual Studio Iterating foreach Collections: Iterators Accessing a collection: The general problem Letting C access data foreach container Accessing Collections the Array Way: Indexers Indexer format An indexer program example Looping Around the Iterator Block Creating the required iterator block framework Iterating days of the month: A first example What a collection is, really Iterator syntax gives up so easily Iterator blocks of all shapes and sizes Chapter 8 Buying Generic Writing a New Prescription: Generics Generics are type-safe Generics are efficient Classy Generics: Writing Your Own Shipping packages at OOPs Queuing at OOPs: PriorityQueue Unwrapping the package Touring Main() Writing generic code the easy way Saving PriorityQueue for last Using a (nongeneric) Simple Factory class Understanding Variance in Generics Contravariance Covariance Chapter 9 Some Exceptional Exceptions Using an Exceptional Error-Reporting Mechanism About try blocks About catch blocks About finally blocks What happens when an exception is thrown Throwing Exceptions Yourself Can I Get an Exceptional Example? Working with Custom Exceptions Planning Your Exception-Handling Strategy Some questions to guide your planning Guidelines for code that handles errors well How to find out which methods throw which exceptions Grabbing Your Last Chance to Catch an Exception Throwing Expressions Chapter 10 Creating Lists of Items with Enumerations Seeing Enumerations in the Real World Working with Enumerations Using the enum keyword Creating enumerations with initializers Specifying an enumeration data type Creating Enumerated Flags Defining Enumerated Switches Working with Enumeration Methods Book 2 Object-Oriented C Programming Chapter 1 Showing Some Class A Quick Overview of Object-Oriented Programming Considering OOP basics Extending classes to meet other needs Keeping objects safe Working with objects Defining a Class and an Object Defining a class What’s the object? Accessing the Members of an Object Working with Object-Based Code Using the traditional approach Using the C 9.0 approach Discriminating between Objects Can You Give Me References? Classes That Contain Classes Are the Happiest Classes in the World Generating Static in Class Members Defining const and readonly Data Members Chapter 2 We Have Our Methods Defining and Using a Method Method Examples for Your Files Understanding the problem Working with standard coding methods Applying a refactoring approach Working with local functions Having Arguments with Methods Passing an argument to a method Passing multiple arguments to methods Matching argument definitions with usage Overloading a method doesn’t mean giving it too much to do Implementing default arguments Using the Call-by-Reference Feature Defining a Method with No Return Value Returning Multiple Values Using Tuples Using a tuple Relying on the Create() method Creating tuples with more than two items Chapter 3 Let Me Say This about this Passing an Object to a Method Comparing Static and Instance Methods Employing static properties and methods effectively Employing instance properties and methods effectively Expanding a method’s full name Accessing the Current Object What is the this keyword? When is the this keyword explicit? Using Local Functions Creating a basic local function Using attributes with local functions Chapter 4 Holding a Class Responsible Restricting Access to Class Members A public example of public BankAccount Jumping ahead — other levels of security Why You Should Worry about Access Control Accessor methods Working with init-only setters Access control to the rescue — an example Defining Class Properties Static properties Properties with side effects Accessors with access levels Using Target Typing for Your Convenience Dealing with Covariant Return Types Getting Your Objects Off to a Good Start — Constructors The C -Provided Constructor Replacing the Default Constructor Constructing something Initializing an object directly with an initializer Seeing that construction stuff with initializers Initializing an object without a constructor Using Expression-Bodied Members Creating expression-bodied methods Defining expression-bodied properties Defining expression-bodied constructors and destructors Defining expression-bodied property accessors Defining expression-bodied event accessors Chapter 5 Inheritance: Is That All I Get? Why You Need Inheritance Inheriting from a BankAccount Class (a More Complex Example) Working with the basic update Tracking the BankAccount and SavingsAccount classes features IS_A versus HAS_A — I’m So Confused_A The IS_A relationship Gaining access to BankAccount by using containment The HAS_A relationship When to IS_A and When to HAS_A Other Features That Support Inheritance Substitutable classes Invalid casts at runtime Avoiding invalid conversions with the is operator Avoiding invalid conversions with the as operator Chapter 6 Poly-what-ism? Overloading an Inherited Method It’s a simple case of method overloading Different class, different method Peek-a-boo — hiding a base class method Polymorphism Using the declared type every time (Is that so wrong?) Using is to access a hidden method polymorphically Declaring a method virtual and overriding it Getting the most benefit from polymorphism C During Its Abstract Period Class factoring The abstract class: Left with nothing but a concept How do you use an abstract class? Creating an abstract object — not! Sealing a Class Chapter 7 Interfacing with the Interface Introducing CAN_BE_USED_AS Knowing What an Interface Is How to implement an interface Using the newer C 8.0 additions How to name your interface Why C includes interfaces Mixing inheritance and interface implementation And he-e-e-re’s the payoff Using an Interface As a method return type As the base type of an array or collection As a more general type of object reference Using the C Predefined Interface Types Looking at a Program That CAN_BE_USED_AS an Example Creating your own interface at home in your spare time Implementing the incomparable IComparable<T> interface Creating a list of students Testing everything using Main() Unifying Class Hierarchies Hiding Behind an Interface Inheriting an Interface Using Interfaces to Manage Change in Object-Oriented Programs Making flexible dependencies through interfaces Abstract or concrete: When to use an abstract class and when to use an interface Doing HAS_A with interfaces Chapter 8 Delegating Those Important Events E.T., Phone Home — The Callback Problem Defining a Delegate Pass Me the Code, Please — Examples Delegating the task First, a simple example Considering the Action, Func, and Predicate delegate types A More Real-World Example Putting the app together Setting the properties and adding event handlers Looking at the workhorse code Shh! Keep It Quiet — Anonymous Methods Defining the basic anonymous method Using static anonymous methods Working with lambda discard parameters Stuff Happens — C Events The Observer design pattern What’s an event? Publish/Subscribe How a publisher advertises its events How subscribers subscribe to an event How to publish an event How to pass extra information to an event handler A recommended way to raise your events How observers “handle” an event Chapter 9 Can I Use Your Namespace in the Library? Dividing a Single Program into Multiple Source Files Working with Global using Statements Dividing a Single Program into Multiple Assemblies Executable or library? Assemblies Executables Class libraries Putting Your Classes into Class Libraries Creating the projects for a class library Creating a stand-alone class library Adding a second project to an existing solution Creating the code for the library Using a test application to test a library Going Beyond Public and Private: More Access Keywords Internal: For CIA eyes only Protected: Sharing with subclasses Putting Classes into Namespaces Declaring a namespace Using file-scoped namespaces Relating namespaces to the access keyword story Using fully qualified names Working with partial classes Working with Partial Methods Defining what partial methods do Creating a partial method Chapter 10 Improving Productivity with Named and Optional Parameters Exploring Optional Parameters Working with optional value parameters Avoiding optional reference types Looking at Named Parameters Using Alternative Methods to Return Values Output (out) parameters Working with out variables Returning values by reference Dealing with null Parameters Chapter 11 Interacting with Structures Comparing Structures to Classes Considering struct limits Understanding the value type difference Determining when to use struct versus class Creating Structures Defining a basic struct Including common struct elements Using supplemental struct elements Working with Read-only Structures Working with Reference Structures Using Structures as Records Managing a single record Adding structures to arrays Overriding methods Using the New Record Type Comparing records to structures and classes Working with a record Using the positional syntax for property definition Understanding value equality Creating safe changes: Nondestructive mutation Using the field keyword Book 3 Designing for C Chapter 1 Writing Secure Code Designing Secure Software Determining what to protect Documenting the components of the program Decomposing components into functions Identifying potential threats in functions Building Secure Windows Applications Authentication using Windows logon Encrypting information Deployment security Using System.Security Chapter 2 Accessing Data Getting to Know System.Data How the Data Classes Fit into the Framework Getting to Your Data Using the System.Data Namespace Setting up a sample database schema Creating the data access project Connecting to a data source Working with the visual tools Writing data code Chapter 3 Fishing the File Stream Going Where the Fish Are: The File Stream Streams Readers and writers StreamWriting for Old Walter Using the stream: An example Using some better fishing gear: The using statement Pulling Them Out of the Stream: Using StreamReader More Readers and Writers Exploring More Streams than Lewis and Clark Chapter 4 Accessing the Internet Getting to Know System.Net How Net Classes Fit into the Framework Understanding the System.Net subordinate namespaces Working with the System.Net classes Using the System.Net Namespace Checking the network status Downloading a file from the Internet Emailing a status report Logging network activity Chapter 5 Creating Images Getting to Know System.Drawing Graphics Pens Brushes Text How the Drawing Classes Fit into the Framework Using the System.Drawing Namespace Getting started Setting up the project Handling the score Creating an event connection Drawing the board Printing the score Starting a new game Chapter 6 Programming Dynamically! Shifting C Toward Dynamic Typing Employing Dynamic Programming Techniques Putting Dynamic to Use Classic examples Making static operations dynamic Understanding what’s happening under the covers Running with the Dynamic Language Runtime Using Static Anonymous Functions Book 4 A Tour of Visual Studio Chapter 1 Getting Started with Visual Studio Versioning the Versions An overview of Visual Studio 2022 updates Community edition Professional edition Enterprise edition MSDN Installing Visual Studio Breaking Down the Projects Exploring the Create a New Project dialog box Understanding solutions and projects Chapter 2 Using the Interface Designing in the Designer Universal Windows Platform (UWP) application Windows Presentation Foundation (WPF) Windows Forms Data View Paneling the Studio Solution Explorer Properties The Toolbox Server Explorer Class View Coding in the Code Editor Exercising the Code Editor Exploring the auxiliary windows Using the Tools of the Trade The Tools menu Building Using the Debugger as an Aid to Learning Stepping through code Going to a particular code location Watching application data Viewing application internals Chapter 3 Customizing Visual Studio Setting Options Environment Language Neat stuff Creating Your Own Templates Developing a project template Developing an item template Book 5 Windows Development with WPF Chapter 1 Introducing WPF Understanding What WPF Can Do Introducing XAML Diving In! Creating Your First WPF Application Declaring an application-scoped resource Making the application do something Whatever XAML Can Do, C Can Do Better! Chapter 2 Understanding the Basics of WPF Using WPF to Lay Out Your Application Arranging Elements with Layout Panels The Stack panel The Wrap panel The Dock panel Canvas The Grid Putting it all together with a simple data entry form Exploring Common XAML Controls Display-only controls Basic input controls List-based controls Chapter 3 Data Binding in WPF Getting to Know Dependency Properties Exploring the Binding Modes Investigating the Binding Object Defining a binding with XAML Defining a binding with C Editing, Validating, Converting, and Visualizing Your Data Validating data Converting your data Finding Out More about WPF Data Binding Chapter 4 Practical WPF Commanding Attention Traditional event handling ICommand Routed commands Using Built-In Commands Using Custom Commands Defining the interface Creating the window binding Ensuring that the command can execute Performing the task Using Routed Commands Defining the Command class Making the namespace accessible Adding the command bindings Developing a user interface Developing the custom command code-behind Chapter 5 Programming for Windows 10 and Above What is the Universal Windows Platform (UWP)? Devices Supported by the UWP Creating Your Own UWP App Configuring Developer Mode Defining the project Creating an interface Adding some background code Choosing a test device Working with .NET Core Applications Book 6 Web Development with ASP.NET Chapter 1 Creating a Basic ASP.NET Core App Understanding the ASP.NET Core Templates Starting with nothing using ASP.NET Core Empty Creating a basic app using the ASP.NET Core Web App Fumbling around with HTTPS-enabled sites Building in business logic using ASP.NET Core App (Model-View-Controller) Developing a programming interface using ASP.NET Core Web API An overview of those other weird templates Developing a Basic Web App Creating the project Considering the development process Adding web content Making some basic changes to the first page Chapter 2 Employing the Razor Markup Language Avoiding Nicks from Razor Comparing Razor to its predecessors Considering the actual file layout Understanding the syntax rules for C Working with some Razor basics Creating Variables Keeping Things Logical Starting simply by using if Sleeping at the switch Implementing Loops Creating an array Performing tasks a specific number of times using for Processing an unknown number of times using foreach and while Chapter 3 Generating and Consuming Data Understanding Why These Projects Are Important Serialized Data Isn’t for Breakfast Developing a Data Generator and API Creating the WeatherForecast project Making the data believable Looking at the API configuration Checking the API for functionality Creating a Consumer Website Creating the RetrieveWeatherForecast project Developing a user interface Getting and deserializing the data Seeing the application in action Index EULA
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.