O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Beginning C# 7 Programming with Visual Studio 2017

Book Description

 Easily get started programming using the ultra-versatile C# 7 and Visual Studio 2017

Beginning C# 7 Programming with Visual Studio 2017 is the beginner’s ultimate guide to the world’s most popular programming language. Whether you’re new to programming entirely, or just new to C#, there has never been a better time to get started. The new C# 7 and Visual Studio 2017 updates feature a number of new tools and features that streamline the workflow, simplify the code, and make it easier than ever to build high-quality apps. This book walks you through everything you need to know, starting from the very basics, to have you programming in no time. You’ll learn about variables, flow control, and object oriented programming, then move into Web and Windows programming as well as databases and XML. The companion website provides downloadable code examples, and practical Try It Out sections provide explicit, step-by-step instructions for writing your own useful, customizable code.

C# 7 can be used to build Windows applications, program Windows 10, and write Web apps when used alongside ASP.NET. With programming skills becoming de rigueur in fields far beyond the tech world, C# 7 is a great place to start building versatile, helpful skills. This book gets you started quickly and easily with instruction from a master-team of C# programmers.

  • Learn how to program using the world’s leading programming language
  • Build smarter, faster apps using the latest features in C# 7 and Visual Studio 2017
  • Find and fix bugs sooner, saving headaches down the line
  • Integrate with all .NET Core, Azure applications, cloud services, Docker containers, and more

The world of programming can seem intimidating to a beginner, and the prospect of learning a whole new “language” can seem daunting. Beginning C# 7 Programming with Visual Studio 2017 demystifies the process and shows you how to bring your ideas to life.

Table of Contents

  1. Cover
  2. Title Page
  3. Introduction
  4. PART I: The C# Language
    1. 1 Introducing C#
      1. WHAT IS THE .NET FRAMEWORK?
      2. WHAT IS C#?
      3. VISUAL STUDIO 2017
    2. 2 Writing a C# Program
      1. THE VISUAL STUDIO 2017 DEVELOPMENT ENVIRONMENT
      2. CONSOLE APPLICATIONS
      3. DESKTOP APPLICATIONS
    3. 3 Variables and Expressions
      1. BASIC C# SYNTAX
      2. BASIC C# CONSOLE APPLICATION STRUCTURE
      3. VARIABLES
      4. EXPRESSIONS
    4. 4 Flow Control
      1. BOOLEAN LOGIC
      2. BRANCHING
      3. LOOPING
    5. 5 More about Variables
      1. TYPE CONVERSION
      2. COMPLEX VARIABLE TYPES
      3. STRING MANIPULATION
    6. 6 Functions
      1. DEFINING AND USING FUNCTIONS
      2. VARIABLE SCOPE
      3. THE MAIN() FUNCTION
      4. STRUCT FUNCTIONS
      5. OVERLOADING FUNCTIONS
      6. USING DELEGATES
    7. 7 Debugging and Error Handling
      1. DEBUGGING IN VISUAL STUDIO
      2. ERROR HANDLING
    8. 8 Introduction to Object‐Oriented Programming
      1. WHAT IS OBJECT‐ORIENTED PROGRAMMING?
      2. OOP TECHNIQUES
      3. OOP IN DESKTOP APPLICATIONS
    9. 9 Defining Classes
      1. CLASS DEFINITIONS IN C#
      2. SYSTEM.OBJECT
      3. CONSTRUCTORS AND DESTRUCTORS
      4. OOP TOOLS IN VISUAL STUDIO
      5. CLASS LIBRARY PROJECTS
      6. INTERFACES VERSUS ABSTRACT CLASSES
      7. STRUCT TYPES
      8. SHALLOW COPYING VERSUS DEEP COPYING
    10. 10 Defining Class Members
      1. MEMBER DEFINITIONS
      2. ADDITIONAL CLASS MEMBER TOPICS
      3. INTERFACE IMPLEMENTATION
      4. PARTIAL CLASS DEFINITIONS
      5. PARTIAL METHOD DEFINITIONS
      6. EXAMPLE APPLICATION
      7. THE CALL HIERARCHY WINDOW
    11. 11 Collections, Comparisons, and Conversions
      1. COLLECTIONS
      2. COMPARISONS
      3. CONVERSIONS
    12. 12 Generics
      1. WHAT ARE GENERICS?
      2. USING GENERICS
      3. DEFINING GENERIC TYPES
      4. VARIANCE
    13. 13 Additional C# Techniques
      1. THE :: OPERATOR AND THE GLOBAL NAMESPACE QUALIFIER
      2. CUSTOM EXCEPTIONS
      3. EVENTS
      4. EXPANDING AND USING CARDLIB
      5. ATTRIBUTES
      6. INITIALIZERS
      7. TYPE INFERENCE
      8. ANONYMOUS TYPES
      9. DYNAMIC LOOKUP
      10. ADVANCED METHOD PARAMETERS
      11. LAMBDA EXPRESSIONS
  5. PART II: Windows Programming
    1. 14 Basic Desktop Programming
      1. XAML
      2. THE PLAYGROUND
      3. CONTROL LAYOUT
      4. THE GAME CLIENT
    2. 15 Advanced Desktop Programming
      1. CREATING AND STYLING CONTROLS
      2. WPF USER CONTROLS
      3. THE MAIN WINDOW
      4. PUTTING IT ALL TOGETHER
  6. PART III: Cloud and Cross‐Platform Programming
    1. 16 Basic Cloud Programming
      1. THE CLOUD, CLOUD COMPUTING, AND THE CLOUD OPTIMIZED STACK
      2. CLOUD PATTERNS AND BEST PRACTICES
      3. USING MICROSOFT AZURE C# LIBRARIES TO CREATE A STORAGE CONTAINER
      4. CREATING AN ASP.NET 4.7 WEB SITE THAT USES THE STORAGE CONTAINER
    2. 17 Advanced Cloud Programming and Deployment
      1. CREATING AN ASP.NET WEB API
      2. DEPLOYING AND CONSUMING AN ASP.NET WEB API ON MICROSOFT AZURE
      3. SCALING AN ASP.NET WEB API ON MICROSOFT AZURE
    3. 18 .NET Standard and .NET Core
      1. CROSS‐PLATFORM BASICS AND KEY “MUST KNOW” TERMS
      2. WHAT IS .NET STANDARD, AND WHY IS IT NEEDED?
      3. REFERENCING AND TARGETING FRAMEWORKS
      4. WHAT IS .NET CORE?
      5. BUILDING AND PACKAGING A .NET STANDARD LIBRARY
      6. BUILDING A .NET CORE APPLICATION WITH VISUAL STUDIO
      7. PORTING FROM .NET FRAMEWORK TO .NET CORE
    4. 19 ASP.NET and ASP.NET Core
      1. OVERVIEW OF WEB APPLICATIONS
      2. WHICH ASP.NET TO USE AND WHY
      3. USING ASP.NET WEB FORMS
      4. CREATING ASP.NET CORE WEB APPLICATIONS
  7. PART IV: Data Access
    1. 20 Files
      1. FILE CLASSES FOR INPUT AND OUTPUT
      2. STREAMS
      3. MONITORING THE FILE SYSTEM
    2. 21 XML and JSON
      1. XML BASICS
      2. JSON BASICS
      3. XML SCHEMAS
      4. XML DOCUMENT OBJECT MODEL
      5. CONVERTING XML TO JSON
      6. SEARCHING XML WITH XPATH
    3. 22 LINQ
      1. LINQ TO XML
      2. LINQ PROVIDERS
      3. LINQ QUERY SYNTAX
      4. LINQ METHOD SYNTAX
      5. ORDERING QUERY RESULTS
      6. UNDERSTANDING THE ORDERBY CLAUSE
      7. QUERYING A LARGE DATA SET
      8. USING AGGREGATE OPERATORS
      9. USING THE SELECT DISTINCT QUERY
      10. ORDERING BY MULTIPLE LEVELS
      11. USING GROUP QUERIES
      12. USING JOINS
    4. 23 Databases
      1. USING DATABASES
      2. INSTALLING SQL SERVER EXPRESS
      3. ENTITY FRAMEWORK
      4. A CODE FIRST DATABASE
      5. BUT WHERE IS MY DATABASE?
      6. NAVIGATING DATABASE RELATIONSHIPS
      7. HANDLING MIGRATIONS
      8. CREATING AND QUERYING XML FROM AN EXISTING DATABASE
  8. PART V: Additional Techniques
    1. 24 Windows Communication Foundation
      1. WHAT IS WCF?
      2. WCF CONCEPTS
      3. WCF PROGRAMMING
    2. 25 Universal Apps
      1. GETTING STARTED
      2. WINDOWS UNIVERSAL APPS
      3. APP CONCEPTS AND DESIGN
      4. APP DEVELOPMENT
      5. COMMON ELEMENTS OF WINDOWS STORE APPS
      6. THE WINDOWS STORE
  9. Appendix: Exercise Solutions
    1. CHAPTER 3 SOLUTIONS
    2. CHAPTER 4 SOLUTIONS
    3. CHAPTER 5 SOLUTIONS
    4. CHAPTER 6 SOLUTIONS
    5. CHAPTER 7 SOLUTIONS
    6. CHAPTER 8 SOLUTIONS
    7. CHAPTER 9 SOLUTIONS
    8. CHAPTER 10 SOLUTIONS
    9. CHAPTER 11 SOLUTIONS
    10. CHAPTER 12 SOLUTIONS
    11. CHAPTER 13 SOLUTIONS
    12. CHAPTER 14 SOLUTIONS
    13. CHAPTER 15 SOLUTIONS
    14. CHAPTER 16 SOLUTIONS
    15. CHAPTER 17 SOLUTIONS
    16. CHAPTER 20 SOLUTIONS
    17. CHAPTER 21 SOLUTIONS
    18. CHAPTER 22 SOLUTIONS
    19. CHAPTER 23 SOLUTIONS
    20. CHAPTER 24 SOLUTIONS
    21. CHAPTER 25 SOLUTIONS
  10. End User License Agreement