0%

Learn how to build web applications efficiently using ASP.NET Core 5 with the C# programming language and related frameworks

Key Features

  • Build web apps and services and cross-platform applications using .NET and C#
  • Understand different web programming concepts with the help of real-world examples
  • Explore the new features and APIs in ASP.NET Core 5, EF Core, Visual Studio, and Blazor

Book Description

ASP.NET Core 5 for Beginners is a comprehensive introduction for those who are new to the framework. This condensed guide takes a practical and engaging approach to cover everything that you need to know to start using ASP.NET Core for building cloud-ready, modern web applications.

The book starts with a brief introduction to the ASP.NET Core framework and highlights the new features in its latest release, ASP.NET Core 5. It then covers the improvements in cross-platform support, the view engines that will help you to understand web development, and the new frontend technologies available with Blazor for building interactive web UIs. As you advance, you'll learn the fundamentals of the different frameworks and capabilities that ship with ASP.NET Core. You'll also get to grips with securing web apps with identity implementation, unit testing, and the latest in containers and cloud-native to deploy them to AWS and Microsoft Azure. Throughout the book, you'll find clear and concise code samples that illustrate each concept along with the strategies and techniques that will help to develop scalable and robust web apps.

By the end of this book, you'll have learned how to leverage ASP.NET Core 5 to build and deploy dynamic websites and services in a variety of real-world scenarios.

What you will learn

  • Explore the new features and APIs introduced in ASP.NET Core 5 and Blazor
  • Put basic ASP.NET Core 5 concepts into practice with the help of clear and simple samples
  • Work with Entity Framework Core and its different workflows to implement your application's data access
  • Discover the different web frameworks that ASP.NET Core 5 offers for building web apps
  • Get to grips with the basics of building RESTful web APIs to work with real data
  • Deploy your web apps in AWS, Azure, and Docker containers
  • Work with SignalR to add real-time notifications to your app

Who this book is for

This book is for developers who want to learn how to develop web-based applications using the ASP.NET Core framework. Familiarity with the C# language and a basic understanding of HTML and CSS is required to get the most out of this book.

Table of Contents

  1. ASP.NET Core 5 for Beginners
  2. Why subscribe?
  3. Contributors
  4. About the authors
  5. About the reviewers
  6. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Reviews
  8. Section 1 – Crawling
  9. Chapter 1: Introduction to ASP.NET Core 5
    1. Technical requirements
    2. Explaining ASP.NET Core
    3. Managed versus unmanaged code
    4. Introducing the .NET platform
    5. Supportability strategy
    6. Refreshing your C# knowledge
    7. What's new in .NET 5?
    8. What's new in C# 9?
    9. Understanding websites and web servers
    10. Web server configuration
    11. Certificate trust
    12. Session stickiness
    13. Troubleshooting communication with web servers
    14. Choosing a web server option
    15. Exploring Visual Studio Code
    16. Leveraging Windows Terminal
    17. Summary
    18. Questions
    19. Further reading
  10. Chapter 2: Cross-Platform Setup
    1. Technical requirements
    2. Leveraging the .NET framework
    3. Why cross-platform?
    4. Why not cross-platform?
    5. Combining cross-platform and single-platform code
    6. .NET cross-platform availability
    7. What cross-platform does not do for you
    8. Getting started on Windows, Linux, and macOS
    9. Windows
    10. Linux
    11. Windows Subsystem for Linux (WSL)
    12. macOS
    13. A word on cross-platform and containers
    14. Making your code cross-platform
    15. A more complicated cross-platform example
    16. Self-contained .NET apps
    17. Cross-platform for mobile devices
    18. Debugging Linux on Windows with Visual Studio 2019
    19. Summary
    20. Questions
    21. Appendix
    22. Installing your app as a Windows service – the advanced method
  11. Chapter 3: Dependency Injection
    1. Technical requirements
    2. Learning dependency injection in ASP.NET Core
    3. Understanding what DI is
    4. The common dependency problem
    5. Making use of DI
    6. Registering the service
    7. Benefits of DI
    8. Reviewing types of dependency injection
    9. Constructor injection
    10. Method injection
    11. Property injection
    12. View injection
    13. Understanding dependency injection containers
    14. Understanding dependency lifetimes
    15. Transient service
    16. Scoped service
    17. Singleton service
    18. Handling complex scenarios
    19. Service descriptors
    20. Add versus TryAdd
    21. Dealing with multiple service implementations
    22. Replacing and removing service registrations
    23. Summary
    24. Questions
    25. Further reading
  12. Chapter 4: Razor View Engine
    1. Technical requirements
    2. Understanding the Razor view engine
    3. Reviewing the Razor view engine
    4. Learning the basics of Razor syntax
    5. Rendering simple data
    6. Rendering data from a view model
    7. Introduction to HTML helpers and tag helpers
    8. Building a to-do application with MVC
    9. Understanding the MVC pattern
    10. Creating an MVC application
    11. Running the app for the first time
    12. Configuring in-memory databases
    13. Creating the to-do controller
    14. Creating a view
    15. Running the to-do app
    16. Implementing add item functionality
    17. Implementing edit functionality
    18. Building a to-do app with Razor Pages
    19. Reviewing Razor Pages
    20. Creating a Razor Pages application
    21. Understanding the Razor Pages structure
    22. Creating the to-do pages
    23. Differences between MVC and Razor Pages
    24. Summary
    25. Further reading
  13. Chapter 5: Getting Started with Blazor
    1. Technical requirements
    2. Understanding the Blazor web framework
    3. Reviewing the different flavors of Blazor
    4. Understanding the goal of what we are going to build using various technologies
    5. Building a tourist spot application
    6. Creating the backend application
    7. Configuring an in-memory database
    8. Implementing real-time functionality with SignalR
    9. Creating the API endpoints
    10. Summary
    11. Questions
    12. Further reading
  14. Section 2 – Walking
  15. Chapter 6: Exploring the Blazor Web Framework
    1. Creating the Blazor Server project
    2. Creating the model
    3. Implementing a service for web API communication
    4. Implementing the application state
    5. Creating Razor components
    6. Running the application
    7. Creating the Blazor Web Assembly project
    8. Creating the model
    9. Composing the Index component
    10. Running the application
    11. Uninstalling the PWA app
    12. Summary
    13. Further reading
  16. Chapter 7: APIs and Data Access
    1. Technical requirements
    2. Understanding ORM and Entity Framework Core
    3. Reviewing EF Core design workflows
    4. Learning database-first development
    5. Creating a .NET Core console app
    6. Integrating Entity Framework Core
    7. Creating a database
    8. Generating models from an existing database
    9. Performing basic database operations
    10. Learning code-first development and migrations
    11. Reviewing ASP.NET Core Web API
    12. Creating a Web API project
    13. Configuring data access
    14. Managing database migrations
    15. Reviewing DTO classes
    16. Creating Web API endpoints
    17. Summary
    18. Further reading
  17. Chapter 8: Working with Identity in ASP.NET
    1. Technical requirements
    2. Understanding authentication concepts
    3. Base64 encoding
    4. How hashing works
    5. Understanding authorization concepts
    6. The role of middleware in ASP.NET and identity
    7. OAuth and OpenID Connect basics
    8. JSON web tokens
    9. How to generate/issue a token
    10. How to validate a token
    11. OAuth flows
    12. Integrating with Azure Active Directory
    13. Understanding single tenancy versus multi-tenancy
    14. Understanding consent and permissions
    15. Working with federated identity
    16. Summary
    17. Questions
    18. Further reading
  18. Chapter 9: Getting Started with Containers
    1. Technical requirements
    2. Hardware virtualization
    3. Overview of containerization
    4. Getting started with Docker
    5. What is Docker?
    6. Installing Docker
    7. Windows Security Alert
    8. Running Redis on Docker
    9. Starting Redis
    10. Running ASP.NET Core in a container
    11. Accessing Redis
    12. Adding container support
    13. Docker multi-container support
    14. Summary
    15. Questions
    16. Further reading
  19. Section 3 – Running
  20. Chapter 10: Deploying to AWS and Azure
    1. Technical requirements
    2. Working with AWS
    3. Working with Azure
    4. GitHub source code
    5. Overview of cloud computing
    6. Cloud computing models
    7. Cloud computing providers
    8. Creating a sample ASP.NET Core web application
    9. Adding a health endpoint
    10. Publishing to AWS
    11. Creating a user for publishing from Visual Studio
    12. Publishing from AWS
    13. Publishing to Azure
    14. Using the Publish wizard in Azure
    15. Azure next steps
    16. Summary
    17. Questions
    18. Further reading
  21. Chapter 11: Browser and Visual Studio Debugging
    1. Technical requirements
    2. Browser
    3. GitHub source
    4. Setting up the sample application
    5. Creating a progressive web application
    6. Saving the state of an application
    7. Understanding PWAs
    8. Accessing browser session and local storage
    9. Using debugging tools in the browser
    10. The Elements tab
    11. The Console tab
    12. The Sources tab
    13. The Network tab
    14. The Application tab
    15. Debugging in Visual Studio
    16. Controlling the application launch and target
    17. Logging activity
    18. Setting a breakpoint
    19. Using conditional breakpoints
    20. Summary
    21. Questions
    22. Further reading
  22. Chapter 12: Integrating with CI/CD
    1. Technical requirements
    2. An overview of CI/CD
    3. Understanding why CI/CD
    4. Introducing GitHub
    5. Is GitHub free?
    6. Some Git terminology
    7. Making a copy of the repo
    8. GitHub support for CI/CD
    9. Building CI/CD using GitHub Actions
    10. What is GitHub Pages?
    11. Creating a CI/CD workflow
    12. Creating a continuous integration job
    13. Creating a continuous deployment job
    14. Monitoring actions
    15. Configuring GitHub Pages
    16. Fixing the base reference
    17. Logging the CI/CD workflow
    18. Next steps with GitHub Actions
    19. Summary
    20. Questions
    21. Further reading
  23. Chapter 13: Developing Cloud-Native Apps
    1. Technical requirements
    2. What makes an application cloud-native?
    3. Comparing characteristics of on-premises versus the cloud
    4. Monolithic versus microservices architecture
    5. Planning for scalability
    6. Working with different database types
    7. Synchronicity and multi-processing tasks
    8. Avoiding failure versus expecting failure
    9. Understanding cloud update schedules
    10. Administration of servers and services
    11. Pets versus cattle
    12. Understanding the role of DevOps
    13. Understanding cost in the cloud
    14. Cloud storage versus local disk
    15. Ephemeral versus persistent storage
    16. Storing and reading files in Azure Blob storage
    17. Dealing with storage latency
    18. Introducing Infrastructure as Code (IaC)
    19. Imperative IaC
    20. Declarative IaC
    21. Learning about monitoring and health
    22. Summary
    23. Questions
    24. Further reading
  24. Assessments
    1. Chapter 1 – Introduction to ASP.NET Core 5
    2. Chapter 2 – Cross-Platform Setup
    3. Chapter 3 – Dependency Injection
    4. Chapter 5 – Getting Started with Blazor
    5. Chapter 8 – Working with Identity in ASP.NET
    6. Chapter 9 – Getting Started with Containers
    7. Chapter 10 – Deploying to AWS and Azure
    8. Chapter 11 – Browser and Visual Studio Debugging
    9. Chapter 12 – Integrating with CI/CD
    10. Chapter 13 – Developing Cloud-Native Apps
  25. Other Books You May Enjoy
    1. Modern Web Development with ASP.NET Core 3 - Second Edition
    2. Practical Microservices with Dapr and .NET
    3. Leave a review - let other readers know what you think
3.145.36.10