.NET in Action

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Learn to build standout line-of-business applications using Microsoft’s .NET Framework, the premier platform for enterprise business development. Based on the bestselling .NET Core in Action, the new .NET in Action, Second Edition has been completely rewritten and updated by original author Dustin Metzgar—an industry veteran who helped develop both the original .NET Framework and .NET Core. .NET in Action, Second Edition presents the big picture of .NET application development, introducing core concepts like: • Designing applications to take full advantage of .NET 8 • Integrating the latest C# and .NET features • Building web services and applications with ASP.NET Core • Working with data in files and remote services, and databases via Entity Framework Core • Verifying code with unit and integration tests • Make applications ready for internationalization • Benchmarking and analyzing application performance .NET in Action, Second Edition offers a clear-headed introduction to implementing full-featured, cross-platform professional applications on the Microsoft .NET platform. It compiles the must-know skills of .NET into a format that’s clear and easy to follow. In each chapter, you’ll build new applications, pick up essential .NET skills, and test your knowledge against handy exercises. Foreword by Scott Hanselman. About the technology The Microsoft .NET platform is a godsend for application developers. .NET provides a comprehensive framework, with consistent tooling for web, mobile, and line-of-business applications, high-performance games, and massive distributed systems. A perfect blend of power and flexibility, its just-in-time compiler runs multiple languages, including C#, Visual Basic, and F#. About the book .NET in Action, Second Edition teaches you to build cross-platform applications and services on the .NET platform. It gives you the big picture, systematically presenting the features you need to ship high-quality apps, without bogging you down in low-level details. You’ll learn to benchmark and analyze performance issues, secure your sites and products, and explore modern architectures like microservices. This totally-revised new edition now covers .NET 8 and new C# language features, along with updates to ASP.NET Core and Entity Framework Core. What's inside • Take advantage of the latest C# and .NET features • Secure your applications • Performance analysis and tuning • Modern application design techniques About the reader For beginning-to-intermediate developers on any platform. No .NET experience required. About the author Dustin Metzgar is a seasoned developer and architect. At Microsoft, Dustin contributed to the .NET Framework, .NET Core, and the open sourcing of .NET.ƒ

Author(s): Dustin Metzgar
Edition: 1
Publisher: Manning Publications
Year: 2024

Language: English
Commentary: Publisher's PDF
Pages: 360
City: Shelter Island, NY
Tags: Security; C#; .NET; Docker; Profiling; Unit Testing; Integration Testing; Performance; Entity Framework; Containers; ASP.NET Core

.NET in Action, Second Edition
Praise for the first edition
brief contents
contents
foreword
preface
acknowledgments
about this book
Who should read this book
How this book is organized: A road map
About the code
liveBook discussion forum
about the author
about the cover illustration
Part 1: The basics
Chapter 1: Why .NET?
1.1 What is .NET?
1.2 Where is .NET used?
1.2.1 .NET in gaming and 3D graphics
1.2.2 Popular .NET open source projects
1.3 When to use .NET
1.4 What will I learn from this book?
1.5 What is in the .NET runtime?
1.5.1 Intermediate language
1.5.2 JIT compilation
1.5.3 Garbage collection
Chapter 2: Building a console application
2.1 Creating new applications from templates
2.2 Building and running
2.3 Writing code
2.4 Namespaces and conventions
2.5 Global using statements
2.6 Static using statements
2.7 Handling more command-line arguments
2.8 C# properties
2.8.1 Reflection
2.8.2 Interpolated strings
2.8.3 Null operators
2.8.4 Casting objects to types
Chapter 3: Creating web ser vices and applications with ASP.NET Core
3.1 Web services
3.1.1 Adding a service that responds with a collection of data
3.1.2 Controlling the response
3.2 Web applications
3.2.1 Razor pages
3.2.2 Code-behind
Part 2: Data
Chapter 4: File and network I/O
4.1 Reading and writing files
4.1.1 Building a custom template
4.1.2 Finding files in folders
4.1.3 Finding text in a file
4.1.4 Disposing the StreamReader with using
4.1.5 Parsing command-line arguments
4.2 Working with JSON
4.2.1 Reading JSON documents
4.2.2 Writing JSON documents
4.2.3 JSON serialization
4.3 Making HTTP requests
4.4 Unblocking programs with asynchronous programming
Chapter 5: Using Entity Framework Core with relational databases
5.1 Storing application data
5.2 Building your first EF Core application
5.2.1 Object-creation shorthand
5.2.2 Cleaning up the compiler warnings
5.2.3 Creating a relationship
5.3 Accessing data asynchronously
5.4 Using EF Core with ASP.NET Core
5.4.1 Request methods
5.5 Exposing your API via Swagger/OpenAPI
Part 3: Testing
Chapter 6: Unit-testing fundamentals
6.1 Writing code that’s easier to test
6.2 SOLID principles
6.2.1 S: Single responsibility principle
6.2.2 O: Open/closed principle
6.2.3 L: Liskov substitution principle
6.2.4 I: Interface segregation principle
6.2.5 D: Dependency inversion principle
6.3 An example test application: Sodoku
6.4 Building your first xUnit test project
6.5 Fact tests
6.6 Theory tests
6.6.1 Applying SOLID principles to SudokuSolver
6.6.2 Testing for exceptions
6.6.3 Theory testing with MemberData
Chapter 7: Substituting dependencies in tests
7.1 Testing code that relies on the current time
7.2 Testing code that uses Streams
7.2.1 Memory stream
7.2.2 File stream from copied files
7.2.3 Manifest resource streams
7.3 Finding easier ways to write large strings
7.4 Replacing dependencies with fakes
7.4.1 Considering an example repository design pattern
7.4.2 Setting up the unit-test class
7.4.3 Validating faked method calls
7.4.4 Verifying the number and order of calls
7.4.5 Throwing exceptions from fakes
Chapter 8: Integration testing
8.1 Applications with many dependencies
8.2 Testing with an in-memory database
8.3 Testing HTTP calls
8.4 Broader integration tests
8.5 Integration-testing ASP.NET Core APIs
Part 4: Getting ready for release
Chapter 9: Security
9.1 Securing applications
9.2 Threat modeling
9.3 Setting up HTTPS
9.4 Checking for SQL injection vulnerability
9.4.1 Adding an interceptor
9.4.2 Configuring the connection string safely
9.5 ASP.NET Core Identity
9.5.1 Setting up Microsoft authentication
9.5.2 Authenticating with Swagger UI
9.6 Authorization
Chapter 10: Performance and profiling
10.1 Why test performance?
10.2 Introduction to BenchmarkDotNet
10.3 Profiles
10.3.1 Capturing profiles with BenchmarkDotNet
10.3.2 Analyzing profiles
10.3.3 Using PerfView
10.3.4 Understanding garbage collection
10.4 Web performance testing
Chapter 11: Handling failures
11.1 Operating in the real world
11.2 EF Core
11.2.1 Database transactions
11.2.2 Retrying on transient faults
11.3 Polly
11.3.1 Simulating HTTP errors
11.3.2 Other Polly capabilities
Chapter 12: Building world-ready applications
12.1 Creating the sample application
12.2 Getting resource strings
12.3 Adding resource languages
12.4 ASP.NET Core’s built-in culture support
12.5 Internationalization
12.5.1 Globalization
12.5.2 Localizability review
12.5.3 Testing right-to-left languages
12.5.4 Other considerations for globalization
Chapter 13: Working with containers
13.1 Why use containers?
13.2 Container landscape
13.3 Building a container image
13.3.1 Using .NET 6 and earlier or custom Dockerfile
13.3.2 Using .NET 7 and later
13.4 Configuration
13.4.1 Controlling the .NET environment
13.4.2 Configuration order
13.4.3 Hierarchical configuration
13.4.4 Applying configuration in Docker Desktop
13.4.5 Mapping configuration to objects
13.5 Secrets
.Appendix A: NET history
A.1 Adoption of .NET Core
A.2 .NET 5/6 and the late majority
A.3 A brief introduction to ASP.NET Core
Appendix B: Setting up your development environment
Appendix C: MAUI and Blazor
C.1 MAUI
C.2 Blazor
Appendix D: The async state machine
Appendix E: Testing internal members
Appendix F: xUnit supplement
F.1 Traits
F.2 Collections
index
Numerics
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z