Helion


Szczegóły ebooka

Adopting .NET 5

Adopting .NET 5


.NET 5 is the unification of all .NET technologies in a single framework that can run on all platforms and provide a consistent experience to developers, regardless of the device, operating system (OS), or cloud platform they choose.

By updating to .NET 5, you can build software that can quickly adapt to the rapidly changing demands of modern consumers and stay up to date on the latest technology trends in .NET.

This book provides a comprehensive overview of all the technologies that will form the future landscape of .NET using practical examples based on real-world scenarios, along with best practices to help you migrate from legacy platforms.

You'll start by learning about Microsoft's vision and rationale for the unification of the platforms. Then, you'll cover all the new language enhancements in C# 9. As you advance, you'll find out how you can align yourself with modern technology trends, focusing on everything from microservices to orchestrated containerized deployments. Finally, you'll learn how to effectively integrate machine learning in .NET code.

By the end of this .NET book, you'll have gained a thorough understanding of the .NET 5 platform, together with a readiness to adapt to future .NET release cycles, and you'll be able to make architectural decisions about porting legacy systems and code bases to a newer platform.

  • Adopting .NET 5
  • Why subscribe?
  • Contributors
  • About the authors
  • About the reviewers
  • Packt is searching for authors like you
  • Preface
    • Who this book is for
    • To get the most out of this book
    • Download the example code files
    • Download the color images
    • Conventions used
    • Get in touch
    • Reviews
  • Section 1: Features and Capabilities
  • Chapter 1: Introducing .NET 5 Features and Capabilities
    • Technical requirements
    • Evolution of .NET
    • Discovering the distinguishing factors in .NET versions
      • Understanding the advantages of one over the other
    • What is the outlook for jumping to .NET 5?
    • Types of applications developed using .NET
      • Web applications
      • Mobile development
      • Desktop applications
      • Internet of Things
      • Cloud-native development and microservices
      • Machine learning
      • Visual Studio solution templates for .NET
    • What are the .NET 5 headliners?
      • Discovering self-contained applications
      • .NET 5 app trimming optimizations
      • ReadyToRun
      • Developing programs for .NET
    • Performance improvements
      • Why performance is so important?
      • Performance improvements in .NET versions
      • Lets do some benchmarking
    • .NET release schedule
    • .NET support life cycle
      • .NET Framework support
      • .NET Core support
    • Summary
  • Chapter 2: What's New in C# 9?
    • Technical requirements
      • Having prior knowledge of C#
    • The .NET Framework requirements to use C# 9
      • Configuring LINQPad 6 for .NET 5 and C# 9
    • Understanding what's new in C# 9
      • Writing concise code with pattern matching
      • Keeping track of changes immutable records
      • Letting the new keyword infer the type for us
      • Embracing other productivity enhancements
    • Leveraging performance improvements
      • Introducing Span<T>
      • Choosing the winner Substring versus Slice showdown
      • Utilizing .NET library performance improvements
    • Summary
    • Further reading
  • Section 2: Design and Architecture
  • Chapter 3: Design and Architectural Patterns
    • Technical requirements
    • Why should we follow design strategies?
    • Application design patterns
      • Refreshing the GoF design patterns
      • Refresher of the SOLID design principles
      • Dependency injection
      • The Repository pattern
    • Communication styles and protocols
      • Synchronous and asynchronous communication
      • Standard communication protocols
    • Architectural patterns
      • Monolith application architecture
      • Microservices architecture
      • Backend for Frontend (BFF)
      • Serverless architecture
      • Enterprise Service Bus (ESB)
      • Distributed processing
    • Summary
  • Chapter 4: Containerized Microservices Architecture
    • Technical requirements
    • Why overview other topics and not just microservices?
    • The gRPC communication protocol
      • HTTP/2 and Protobuf
      • gRPC versus REST APIs versus SOAP
      • What's new with gRPC in .NET 5?
      • Sample service proto file
    • What is WSL?
      • Installing WSL on your development machine
      • Some useful VS Code-related extensions
      • Things to check before you start debugging with WSL
      • WSL as a Docker engine
    • What is Tye?
    • Introduction to containerization and container orchestration
      • What are some modern container fundamentals?
      • Kubernetes basics
    • Let's build a demo microservices application
      • What is the application?
      • Architecture for the demo application
      • Developing the microservices application
    • Summary
    • Further reading
  • Section 3: Migration
  • Chapter 5: Upgrading Existing .NET Apps to .NET 5
    • Technical requirements
    • Choosing the migration approach
      • Factors influencing the migration approach
      • Lift and shift versus architectural transformation
      • Replacing third-party libraries with platform-provided features
    • Points to ponder regarding an as-is upgrade
      • Unsupported technologies
      • Unsupported Windows OS-specific features
      • Transforming application configuration
      • Choosing the Entity Framework version
      • Using .NET Framework compatibility
      • Upgrading third-party NuGet packages
    • Upgrading a .NET Framework example app
      • Introducing BookApp
      • Preparing for migration
      • Migrating BookApp.Models
      • Upgrading the BookApp.DAL project
      • Migrating the admin desktop app
      • Migrating BookApp.Web
    • Summary
    • Further reading
  • Chapter 6: Upgrading On-Premises Applications to the Cloud with .NET 5
    • Technical requirements
      • Using the source code provided for this chapter
    • Planning for cloud-optimized application transformation
      • Infrastructure as a Service (IaaS)
      • Cloud-optimized applications
      • Cloud-native applications
    • Migrating SQL Server databases to the cloud
      • Comparing Azure SQL options
      • Migrating the BookApp database to Azure SQL Database
    • Deploying .NET 5 applications on Azure App Service
      • When should I use Azure App Service?
      • Alternatives to Azure App Service
      • Deploying BookApp.Web to Azure App Service
      • Best practices for deploying applications to Azure App Service
    • Serverless deployment Azure Functions
      • Benefits of using Azure Functions
      • Developing a function app project
      • Deploying the sentiment analysis function
      • Integrating the Azure function with BookApp
    • Deploying .NET 5 applications to containers
    • Cleaning up resources
    • Summary
  • Section 4: Bonus
  • Chapter 7: Integrating Machine Learning in .NET 5
    • Technical requirements
    • Machine learning explained for .NET developers
      • Understanding the jargon
      • Common types of ML problems
      • ML workflow
      • The importance of oil I mean, data!
    • Building an ML.NET-based service to predict the shopping score
      • Introduction to ML.NET
      • Obtaining the dataset
      • Classifying the problem
      • Enabling ML.NET Model Builder
      • Creating the solution file
      • Training the model
      • Evaluating the prediction service
      • Generating the code that will consume the model
      • Exploring the auto-generated code
      • Testing the application
    • Building Azure Functions using ML.NET models
      • Building the sentiment analysis service
      • Consuming the model from an Azure function
    • Summary
    • Further reading
  • Other Books You May Enjoy
    • Leave a review - let other readers know what you think