{"id":265,"date":"2023-10-15T17:49:26","date_gmt":"2023-10-15T09:49:26","guid":{"rendered":"https:\/\/miie.net\/?p=265"},"modified":"2023-10-15T17:49:26","modified_gmt":"2023-10-15T09:49:26","slug":"procshap10-introduction","status":"publish","type":"post","link":"https:\/\/diji.net\/?p=265","title":{"rendered":"Pro C#10 Introduction"},"content":{"rendered":"<h1>Pro C# 10 with .NET 6<\/h1>\n<h1>Introduction<\/h1>\n<h2>Choose Your Own Adventures<\/h2>\n<p>\u9009\u62e9\u4f60\u81ea\u5df1\u7684\u5192\u9669 <\/p>\n<p>From the very first editions that Andrew wrote, and the ensuing editions since I have taken over the book, the goal has been (and always will be) to help you be productive and informed software engineers. This book, like C# and the .NET platform, continues to grow with every release. This provides an opportunity for you, the reader, to choose your own adventures. Whether you are new to software development or a seasoned veteran, this book has content to take you to the next level.<br \/>\n\u4eceAndrew\u5199\u7684\u7b2c\u4e00\u7248\uff0c\u5230\u6211\u63a5\u624b\u8fd9\u672c\u4e66\u4ee5\u6765\u7684\u540e\u7eed\u7248\u672c\uff0c\u6211\u4eec\u7684\u76ee\u6807\u4e00\u76f4\u662f\uff08\u5e76\u4e14\u6c38\u8fdc\u662f\uff09\u5e2e\u52a9\u4f60\u6210\u4e3a\u9ad8\u6548\u548c\u77e5\u60c5\u7684\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u3002\u672c\u4e66\u4e0e C# \u548c .NET \u5e73\u53f0\u4e00\u6837\uff0c\u968f\u7740\u6bcf\u4e2a\u7248\u672c\u7684\u53d1\u5e03\u800c\u4e0d\u65ad\u589e\u957f\u3002\u8fd9\u4e3a\u4f60\uff08\u8bfb\u8005\uff09\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9009\u62e9\u81ea\u5df1\u7684\u5192\u9669\u7684\u673a\u4f1a\u3002\u65e0\u8bba\u4f60\u662f\u8f6f\u4ef6\u5f00\u53d1\u65b0\u624b\u8fd8\u662f\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8001\u624b\uff0c\u672c\u4e66\u90fd\u6709\u5185\u5bb9\u5c06\u5e26\u4f60\u66f4\u4e0a\u4e00\u5c42\u697c\u3002<\/p>\n<p>For the veteran C# developer, this book keeps you up to date with the latest that C# and .NET has to offer. Starting with C# 7, the section headers indicate when a feature was introduced or updated. Quickly scanning the table of contents highlights the new features so you can quickly read up on them and take them for a spin. This book can also serve as a reference manual, with code samples ready to help you complete that task that isn\u2019t quite muscle memory.<br \/>\n\u5bf9\u4e8e\u8d44\u6df1\u7684 C# \u5f00\u53d1\u4eba\u5458\uff0c\u672c\u4e66\u8ba9\u60a8\u4e86\u89e3 C# \u548c .NET \u63d0\u4f9b\u7684\u6700\u65b0\u4fe1\u606f\u3002\u4ece C# 7 \u5f00\u59cb\uff0c\u8282\u6807\u9898\u6307\u793a\u4f55\u65f6\u5f15\u5165\u6216\u66f4\u65b0\u529f\u80fd\u3002\u5feb\u901f\u626b\u63cf\u76ee\u5f55\u4f1a\u7a81\u51fa\u663e\u793a\u65b0\u529f\u80fd\uff0c\u4ee5\u4fbf\u60a8\u53ef\u4ee5\u5feb\u901f\u9605\u8bfb\u5b83\u4eec\u5e76\u8bd5\u4e00\u8bd5\u3002\u672c\u4e66\u8fd8\u53ef\u4ee5\u4f5c\u4e3a\u53c2\u8003\u624b\u518c\uff0c\u5176\u4e2d\u5305\u542b\u4ee3\u7801\u793a\u4f8b\uff0c\u53ef\u5e2e\u52a9\u60a8\u5b8c\u6210\u4e0d\u5b8c\u5168\u662f\u808c\u8089\u8bb0\u5fc6\u7684\u4efb\u52a1\u3002<\/p>\n<p>For the beginner, this book uses an organized approach to teaching C# and object oriented programming. Once you are comfortable with those topics, you can exercise them by skipping ahead and building application ASP.NET Core or Windows Presentation Foundation. Not ready to dive into data access? All of the code for each chapter is provide in the GitHub repo, so you can skip ahead in the book and use the provided code samples to explore in the order you choose.<br \/>\n\u5bf9\u4e8e\u521d\u5b66\u8005\uff0c\u672c\u4e66\u4f7f\u7528\u6709\u7ec4\u7ec7\u7684\u65b9\u6cd5\u6765\u6559\u6388C#\u548c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002\u719f\u6089\u8fd9\u4e9b\u4e3b\u9898\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u8df3\u8fc7\u5e76 ASP.NET Core \u6216 Windows Presentation Foundation \u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u6765\u7ec3\u4e60\u5b83\u4eec\u3002\u8fd8\u6ca1\u51c6\u5907\u597d\u6df1\u5165\u4e86\u89e3\u6570\u636e\u8bbf\u95ee\uff1f\u6bcf\u7ae0\u7684\u6240\u6709\u4ee3\u7801\u90fd\u5728 GitHub \u5b58\u50a8\u5e93\u4e2d\u63d0\u4f9b\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u8df3\u8fc7\u672c\u4e66\u5e76\u4f7f\u7528\u63d0\u4f9b\u7684\u4ee3\u7801\u793a\u4f8b\u6309\u60a8\u9009\u62e9\u7684\u987a\u5e8f\u8fdb\u884c\u63a2\u7d22\u3002<\/p>\n<p>As an author, I don\u2019t know what your individual needs are at any single point in time. As a CTO and Chief Architect, I know what our organization and software engineers need for the long haul. Not only for the software they build, but for their careers as the move towards tech lead and architect positions. My goal is to provide you with the same information that I provide my team and my organization. Chances are you don\u2019t need everything in this book \u2013 right now. Chances are also good that you will at some point in your development cycles. So, choose your own adventure, grab what you need to finish your task at hand, and know that we\u2019ll be ready for you when you come back to tackle another section.<br \/>\n\u4f5c\u4e3a\u4e00\u540d\u4f5c\u8005\uff0c\u6211\u4e0d\u77e5\u9053\u4f60\u7684\u4e2a\u4eba\u5728\u4efb\u4f55\u5355\u4e00\u65f6\u95f4\u70b9\u7684\u9700\u6c42\u662f\u4ec0\u4e48\u3002\u4f5c\u4e3a\u9996\u5e2d\u6280\u672f\u5b98\u548c\u9996\u5e2d\u67b6\u6784\u5e08\uff0c\u6211\u77e5\u9053\u6211\u4eec\u7684\u7ec4\u7ec7\u548c\u8f6f\u4ef6\u5de5\u7a0b\u5e08\u9700\u8981\u4ec0\u4e48\u3002\u4e0d\u4ec5\u662f\u4e3a\u4e86\u4ed6\u4eec\u6784\u5efa\u7684\u8f6f\u4ef6\uff0c\u4e5f\u662f\u4e3a\u4e86\u4ed6\u4eec\u7684\u804c\u4e1a\u751f\u6daf\uff0c\u56e0\u4e3a\u5411\u6280\u672f\u4e3b\u7ba1\u548c\u67b6\u6784\u5e08\u804c\u4f4d\u8fc8\u8fdb\u3002\u6211\u7684\u76ee\u6807\u662f\u4e3a\u60a8\u63d0\u4f9b\u4e0e\u6211\u63d0\u4f9b\u7ed9\u6211\u7684\u56e2\u961f\u548c\u7ec4\u7ec7\u76f8\u540c\u7684\u4fe1\u606f\u3002\u5f88\u53ef\u80fd\u4f60\u4e0d\u9700\u8981\u8fd9\u672c\u4e66\u4e2d\u7684\u6240\u6709\u5185\u5bb9\u2014\u2014\u73b0\u5728\u3002\u5728\u5f00\u53d1\u5468\u671f\u7684\u67d0\u4e2a\u65f6\u523b\uff0c\u60a8\u4e5f\u5f88\u6709\u53ef\u80fd\u4f1a\u8fd9\u6837\u505a\u3002\u56e0\u6b64\uff0c\u9009\u62e9\u60a8\u81ea\u5df1\u7684\u5192\u9669\uff0c\u6293\u4f4f\u5b8c\u6210\u624b\u5934\u4efb\u52a1\u6240\u9700\u7684\u4e1c\u897f\uff0c\u5e76\u77e5\u9053\u5f53\u60a8\u56de\u6765\u5904\u7406\u53e6\u4e00\u4e2a\u90e8\u5206\u65f6\uff0c\u6211\u4eec\u4f1a\u4e3a\u60a8\u505a\u597d\u51c6\u5907\u3002<\/p>\n<h2>The Source Code<\/h2>\n<p>\u6e90\u4ee3\u7801<\/p>\n<p>The source code for this book is hosted on GitHub in the <a href=\"https:\/\/github.com\/apress\/pro-c-sharp-10\"><a href=\"https:\/\/github.com\/apress\/pro-c-sharp-10\"><a href=\"https:\/\/github.com\/apress\/pro-c-sharp-10\">https:\/\/github.com\/apress\/pro-c-sharp-10<\/a><\/a><\/a> repository.<br \/>\n\u672c\u4e66\u7684\u6e90\u4ee3\u7801\u6258\u7ba1\u5728 GitHub \u7684\u5b58\u50a8\u5e93\u4e2d\u3002<br \/>\n<a href=\"https:\/\/github.com\/apress\/pro-c-sharp-10\"><a href=\"https:\/\/www.Github.com\/apress\/pro-c\"><a href=\"https:\/\/www.Github.com\/apress\/pro-c\">https:\/\/www.Github.com\/apress\/pro-c<\/a><\/a>- sharp-10 repository <\/a><\/p>\n<h2>An Overview of This Book<\/h2>\n<p>\u672c\u4e66\u6982\u8ff0<\/p>\n<p>Pro C# 10 with .NET 6 is logically divided into nine distinct parts, each of which contains a number of related chapters. Here is a part-by-part and chapter-by-chapter breakdown of the text.<br \/>\n\u5e26\u6709 .NET 10 \u7684 Pro C# 6 \u5728\u903b\u8f91\u4e0a\u5206\u4e3a\u4e5d\u4e2a\u4e0d\u540c\u7684\u90e8\u5206\uff0c\u6bcf\u4e2a\u90e8\u5206\u90fd\u5305\u542b\u8bb8\u591a\u76f8\u5173\u7ae0\u8282\u3002\u4ee5\u4e0b\u662f\u6587\u672c\u7684\u9010\u90e8\u5206\u548c\u9010\u7ae0\u5206\u89e3\u3002<\/p>\n<h2>Part I: Introducing C# and .NET 6<\/h2>\n<p>\u7b2c I \u90e8\u5206\uff1a\u4ecb\u7ecd C# \u548c .NET 6<\/p>\n<p>The purpose of Part I is to acclimate you to the nature of the .NET platform and various development tools used during the construction of .NET applications.<br \/>\n\u7b2c\u4e00\u90e8\u5206\u7684\u76ee\u7684\u662f\u8ba9\u60a8\u9002\u5e94 .NET \u5e73\u53f0\u7684\u6027\u8d28\u4ee5\u53ca\u5728\u6784\u5efa .NET \u5e94\u7528\u7a0b\u5e8f\u671f\u95f4\u4f7f\u7528\u7684\u5404\u79cd\u5f00\u53d1\u5de5\u5177\u3002<\/p>\n<h3>Chapter 1: Introducing C# and .NET 6<\/h3>\n<p>\u7b2c 1 \u7ae0\uff1a\u4ecb\u7ecd C# \u548c .NET 6<\/p>\n<p>This first chapter functions as the backbone for the remainder of the text. The primary goal of this chapter is to acquaint you with a number of .NET\u2013centric building blocks, such as the Common Language Runtime (CLR), Common Type System (CTS), Common Language Specification (CLS), and Base Class Libraries (BCL). Here, you will take an initial look at the C# programming language, namespaces, and the .NET assembly format.<br \/>\n\u7b2c\u4e00\u7ae0\u662f\u6587\u672c\u5176\u4f59\u90e8\u5206\u7684\u4e3b\u5e72\u3002\u672c\u7ae0\u7684\u4e3b\u8981\u76ee\u6807\u662f\u8ba9\u60a8\u719f\u6089\u8bb8\u591a\u4ee5 .NET \u4e3a\u4e2d\u5fc3\u7684\u6784\u5efa\u57fa\u5757\uff0c\u4f8b\u5982\u516c\u5171\u8bed\u8a00\u8fd0\u884c\u65f6 \uff08CLR\uff09\u3001\u901a\u7528\u7c7b\u578b\u7cfb\u7edf \uff08CTS\uff09\u3001\u516c\u5171\u8bed\u8a00\u89c4\u8303 \uff08CLS\uff09 \u548c\u57fa\u7c7b\u5e93 \uff08BCL\uff09\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u521d\u6b65\u4e86\u89e3 C# \u7f16\u7a0b\u8bed\u8a00\u3001\u547d\u540d\u7a7a\u95f4\u548c .NET \u7a0b\u5e8f\u96c6\u683c\u5f0f\u3002<\/p>\n<h3>Chapter 2: Building C# Applications<\/h3>\n<p>\u7b2c 2 \u7ae0\uff1a\u6784\u5efa C# \u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>The goal of this chapter is to introduce you to the process of compiling C# source code files. After installing the .NET SDK and runtimes, you will learn about the completely free (and fully functional) Visual Studio Community edition as well as the extremely popular (and also free) Visual Studio Code. You learn how to create, run, and debug .NET C# applications using both Visual Studio and Visual Studio Code.<br \/>\n\u672c\u7ae0\u7684\u76ee\u6807\u662f\u5411\u60a8\u4ecb\u7ecd\u7f16\u8bd1 C# \u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002\u5b89\u88c5 .NET SDK \u548c\u8fd0\u884c\u65f6\u540e\uff0c\u60a8\u5c06\u4e86\u89e3\u5b8c\u5168\u514d\u8d39\uff08\u4e14\u529f\u80fd\u9f50\u5168\uff09\u7684 Visual Studio \u793e\u533a\u7248\u4ee5\u53ca\u975e\u5e38\u6d41\u884c\uff08\u4e5f\u662f\u514d\u8d39\u7684\uff09Visual Studio Code\u3002\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u4f7f\u7528 Visual Studio \u548c Visual Studio Code \u521b\u5efa\u3001\u8fd0\u884c\u548c\u8c03\u8bd5 .NET C# \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2>Part II: Core C# Programming<\/h2>\n<p>\u7b2c\u4e8c\u90e8\u5206\uff1a\u6838\u5fc3 C# \u7f16\u7a0b<\/p>\n<p>The topics presented in this part of the book are quite important because you will use them regardless of which type of .NET software you intend to develop (e.g., web applications, desktop GUI applications, code libraries, services, etc.). Here, you will learn about the fundamental data types of .NET, work with text manipulation, and learn the role of various C# parameter modifiers (including optional and named arguments).<br \/>\n\u672c\u4e66\u8fd9\u4e00\u90e8\u5206\u4e2d\u4ecb\u7ecd\u7684\u4e3b\u9898\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u65e0\u8bba\u60a8\u6253\u7b97\u5f00\u53d1\u54ea\u79cd\u7c7b\u578b\u7684 .NET \u8f6f\u4ef6\uff08\u4f8b\u5982\uff0cWeb \u5e94\u7528\u7a0b\u5e8f\u3001\u684c\u9762 GUI \u5e94\u7528\u7a0b\u5e8f\u3001\u4ee3\u7801\u5e93\u3001\u670d\u52a1\u7b49\uff09\uff0c\u60a8\u90fd\u5c06\u4f7f\u7528\u5b83\u4eec\u3002\u5728\u8fd9\u91cc\uff0c\u4f60\u5c06\u4e86\u89e3 .NET \u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u4f7f\u7528\u6587\u672c\u64cd\u4f5c\uff0c\u5e76\u4e86\u89e3\u5404\u79cd C# \u53c2\u6570\u4fee\u9970\u7b26\uff08\u5305\u62ec\u53ef\u9009\u53c2\u6570\u548c\u547d\u540d\u53c2\u6570\uff09\u7684\u4f5c\u7528\u3002<\/p>\n<h3>Chapter 3: Core C# Programming Constructs, Part 1<\/h3>\n<p>\u7b2c 3 \u7ae0\uff1a\u6838\u5fc3 C# \u7f16\u7a0b\u6784\u9020\uff0c\u7b2c 1 \u90e8\u5206<\/p>\n<p>This chapter begins your formal investigation of the C# programming language. Here, you will learn about the role of the Main() method, top-level statements, and numerous details regarding the intrinsic data types of the .NET platform and variable declaration. You will work with and manipulate textual data using System. String and System.Text.StringBuilder. You will also examine iteration and decision constructs, pattern matching, narrowing and widening operations, and the unchecked keyword.<br \/>\n\u672c\u7ae0\u5f00\u59cb\u5bf9 C# \u7f16\u7a0b\u8bed\u8a00\u8fdb\u884c\u6b63\u5f0f\u7814\u7a76\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u4e86\u89e3 Main\uff08\uff09 \u65b9\u6cd5\u7684\u4f5c\u7528\u3001\u9876\u7ea7\u8bed\u53e5\u4ee5\u53ca\u6709\u5173 .NET \u5e73\u53f0\u548c\u53d8\u91cf\u58f0\u660e\u7684\u5185\u90e8\u6570\u636e\u7c7b\u578b\u7684\u5927\u91cf\u8be6\u7ec6\u4fe1\u606f\u3002\u60a8\u5c06\u4f7f\u7528\u7cfb\u7edf\u5904\u7406\u548c\u64cd\u4f5c\u6587\u672c\u6570\u636e\u3002String and System.Text.StringBuilder.\u60a8\u8fd8\u5c06\u68c0\u67e5\u8fed\u4ee3\u548c\u51b3\u7b56\u6784\u9020\u3001\u6a21\u5f0f\u5339\u914d\u3001\u7f29\u5c0f\u548c\u52a0\u5bbd\u64cd\u4f5c\u4ee5\u53ca\u672a\u9009\u4e2d\u7684\u5173\u952e\u5b57\u3002<\/p>\n<h3>Chapter 4: Core C# Programming Constructs, Part 2<\/h3>\n<p>\u7b2c 4 \u7ae0\uff1a\u6838\u5fc3 C# \u7f16\u7a0b\u6784\u9020\uff0c\u7b2c 2 \u90e8\u5206<\/p>\n<p>This chapter completes your examination of the core aspects of C#, beginning with creating and manipulating arrays of data. Next, you examine how to construct overloaded type methods and define parameters using the out, ref, and params keywords. You will also learn about the enum type, structures, and nullable data types, and you will understand the distinction between value types and reference types. Finally, you will learn about tuples.<br \/>\n\u672c\u7ae0\u5b8c\u6210\u4e86\u5bf9 C# \u6838\u5fc3\u65b9\u9762\u7684\u68c0\u67e5\uff0c\u4ece\u521b\u5efa\u548c\u64cd\u4f5c\u6570\u636e\u6570\u7ec4\u5f00\u59cb\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u5c06\u7814\u7a76\u5982\u4f55\u4f7f\u7528 out\u3001ref \u548c params \u5173\u952e\u5b57\u6784\u9020\u91cd\u8f7d\u7c7b\u578b\u65b9\u6cd5\u548c\u5b9a\u4e49\u53c2\u6570\u3002\u60a8\u8fd8\u5c06\u4e86\u89e3\u679a\u4e3e\u7c7b\u578b\u3001\u7ed3\u6784\u548c\u53ef\u4e3a null \u7684\u6570\u636e\u7c7b\u578b\uff0c\u5e76\u4e86\u89e3\u503c\u7c7b\u578b\u548c\u5f15\u7528\u7c7b\u578b\u4e4b\u95f4\u7684\u533a\u522b\u3002\u6700\u540e\uff0c\u60a8\u5c06\u4e86\u89e3\u5143\u7ec4\u3002<\/p>\n<h2>Part III: Object-Oriented Programming with C<\/h2>\n<p>\u7b2c\u4e09\u90e8\u5206\uff1a\u7528C#\u8bed\u8a00\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b<\/p>\n<p>In this part, you will come to understand the core constructs of the C# language, including the details of object-oriented programming. This part will also examine how to process runtime exceptions and will dive into the details of working with strongly typed interfaces. Finally, you will learn about object lifetime and garbage collection.<br \/>\n\u5728\u8fd9\u4e00\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u4e86\u89e3 C# \u8bed\u8a00\u7684\u6838\u5fc3\u7ed3\u6784\uff0c\u5305\u62ec\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u7ec6\u8282\u3002\u672c\u90e8\u5206\u8fd8\u5c06\u7814\u7a76\u5982\u4f55\u5904\u7406\u8fd0\u884c\u65f6\u5f02\u5e38\uff0c\u5e76\u5c06\u6df1\u5165\u63a2\u8ba8\u4f7f\u7528\u5f3a\u7c7b\u578b\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u6700\u540e\uff0c\u60a8\u5c06\u4e86\u89e3\u5bf9\u8c61\u751f\u5b58\u671f\u548c\u5783\u573e\u56de\u6536\u3002<\/p>\n<h3>Chapter 5: Understanding Encapsulation<\/h3>\n<p>\u7b2c 5 \u7ae0\uff1a\u4e86\u89e3\u5c01\u88c5<\/p>\n<p>This chapter begins your examination of object-oriented programming (OOP) using the C# programming language. After you are introduced to the pillars of OOP (encapsulation, inheritance, and polymorphism), the remainder of this chapter will show you how to build robust class types using constructors, properties, static members, constants, and read-only fields. You will also learn about partial type definitions, object initialization syntax, and automatic properties, and the chapter will wrap up with an examination of record types and record structs.<br \/>\n\u672c\u7ae0\u5f00\u59cb\u4f7f\u7528 C# \u7f16\u7a0b\u8bed\u8a00\u68c0\u67e5\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b \uff08OOP\uff09\u3002\u5728\u4ecb\u7ecd\u4e86 OOP \u7684\u652f\u67f1\uff08\u5c01\u88c5\u3001\u7ee7\u627f\u548c\u591a\u6001\u6027\uff09\u4e4b\u540e\uff0c\u672c\u7ae0\u7684\u5176\u4f59\u90e8\u5206\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u4f7f\u7528\u6784\u9020\u51fd\u6570\u3001\u5c5e\u6027\u3001\u9759\u6001\u6210\u5458\u3001\u5e38\u91cf\u548c\u53ea\u8bfb\u5b57\u6bb5\u6784\u5efa\u5065\u58ee\u7684\u7c7b\u7c7b\u578b\u3002\u60a8\u8fd8\u5c06\u4e86\u89e3\u5206\u90e8\u7c7b\u578b\u5b9a\u4e49\u3001\u5bf9\u8c61\u521d\u59cb\u5316\u8bed\u6cd5\u548c\u81ea\u52a8\u5c5e\u6027\uff0c\u672c\u7ae0\u5c06\u6700\u540e\u68c0\u67e5\u8bb0\u5f55\u7c7b\u578b\u548c\u8bb0\u5f55\u7ed3\u6784\u3002<\/p>\n<h3>Chapter 6: Understanding Inheritance and Polymorphism<\/h3>\n<p>\u7b2c6\u7ae0 \u7406\u89e3\u7ee7\u627f\u548c\u591a\u6001\u6027<\/p>\n<p>Here, you will examine the remaining pillars of OOP (inheritance and polymorphism), which allow you to build families of related class types. As you do this, you will examine the role of virtual methods, abstract methods (and abstract base classes), and the nature of the polymorphic interface. Then you will explore pattern matching with the is keyword, and finally, this chapter will explain the role of the ultimate base class of the .NET platform, System.Object.<br \/>\n\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u68c0\u67e5 OOP\uff08\u7ee7\u627f\u548c\u591a\u6001\u6027\uff09\u7684\u5176\u4f59\u652f\u67f1\uff0c\u5b83\u4eec\u5141\u8bb8\u60a8\u6784\u5efa\u76f8\u5173\u7c7b\u7c7b\u578b\u7684\u65cf\u3002\u6267\u884c\u6b64\u64cd\u4f5c\u65f6\uff0c\u60a8\u5c06\u68c0\u67e5\u865a\u62df\u65b9\u6cd5\u3001\u62bd\u8c61\u65b9\u6cd5\uff08\u548c\u62bd\u8c61\u57fa\u7c7b\uff09\u7684\u4f5c\u7528\u4ee5\u53ca\u591a\u6001\u63a5\u53e3\u7684\u6027\u8d28\u3002\u7136\u540e\uff0c\u60a8\u5c06\u63a2\u7d22\u4f7f\u7528 is \u5173\u952e\u5b57\u7684\u6a21\u5f0f\u5339\u914d\uff0c\u6700\u540e\uff0c\u672c\u7ae0\u5c06\u89e3\u91ca .NET \u5e73\u53f0\u7684\u6700\u7ec8\u57fa\u7c7b System.Object \u7684\u4f5c\u7528\u3002<\/p>\n<h3>Chapter 7: Understanding Structured Exception Handling<\/h3>\n<p>\u7b2c 7 \u7ae0\uff1a\u4e86\u89e3\u7ed3\u6784\u5316\u5f02\u5e38\u5904\u7406<\/p>\n<p>The point of this chapter is to discuss how to handle runtime anomalies in your code base through the use of structured exception handling. Not only will you learn about the C# keywords that allow you to handle such problems (try, catch, throw, when, and finally), but you will also come to understand the distinction between application-level and system-level exceptions. In addition, this chapter will show you how to set Visual Studio on break on all exceptions to debug the exceptions that escape your notice.<br \/>\n\u672c\u7ae0\u7684\u91cd\u70b9\u662f\u8ba8\u8bba\u5982\u4f55\u4f7f\u7528\u7ed3\u6784\u5316\u5f02\u5e38\u5904\u7406\u6765\u5904\u7406\u4ee3\u7801\u5e93\u4e2d\u7684\u8fd0\u884c\u65f6\u5f02\u5e38\u3002\u60a8\u4e0d\u4ec5\u5c06\u4e86\u89e3\u5141\u8bb8\u60a8\u5904\u7406\u6b64\u7c7b\u95ee\u9898\u7684 C# \u5173\u952e\u5b57\uff08\u5c1d\u8bd5\u3001\u6355\u83b7\u3001\u629b\u51fa\u3001\u4f55\u65f6\u548c\u6700\u540e\uff09\uff0c\u800c\u4e14\u8fd8\u5c06\u4e86\u89e3\u5e94\u7528\u7a0b\u5e8f\u7ea7\u548c\u7cfb\u7edf\u7ea7\u5f02\u5e38\u4e4b\u95f4\u7684\u533a\u522b\u3002\u6b64\u5916\uff0c\u672c\u7ae0\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728\u6240\u6709\u5f02\u5e38\u4e0a\u8bbe\u7f6e Visual Studio \u4e2d\u65ad\uff0c\u4ee5\u8c03\u8bd5\u9003\u8131\u60a8\u6ce8\u610f\u7684\u5f02\u5e38\u3002<\/p>\n<h3>Chapter 8: Working with Interfaces<\/h3>\n<p>\u7b2c 8 \u7ae0\uff1a\u4f7f\u7528\u63a5\u53e3<\/p>\n<p>The material in this chapter builds upon your understanding of object-based development by covering the topic of interface-based programming. Here, you will learn how to define classes and structures that support multiple behaviors, how to discover these behaviors at runtime, and how to selectively hide particular behaviors using explicit interface implementation. In addition to creating a number of custom interfaces, you will also learn how to implement standard interfaces found within the .NET platform. You will use these to build objects that can be sorted, copied, enumerated, and compared.<br \/>\n\u672c\u7ae0\u4e2d\u7684\u6750\u6599\u57fa\u4e8e\u60a8\u5bf9\u57fa\u4e8e\u5bf9\u8c61\u7684\u5f00\u53d1\u7684\u7406\u89e3\uff0c\u6db5\u76d6\u4e86\u57fa\u4e8e\u63a5\u53e3\u7684\u7f16\u7a0b\u4e3b\u9898\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u5b9a\u4e49\u652f\u6301\u591a\u79cd\u884c\u4e3a\u7684\u7c7b\u548c\u7ed3\u6784\uff0c\u5982\u4f55\u5728\u8fd0\u884c\u65f6\u53d1\u73b0\u8fd9\u4e9b\u884c\u4e3a\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u663e\u5f0f\u63a5\u53e3\u5b9e\u73b0\u6709\u9009\u62e9\u5730\u9690\u85cf\u7279\u5b9a\u884c\u4e3a\u3002\u9664\u4e86\u521b\u5efa\u8bb8\u591a\u81ea\u5b9a\u4e49\u63a5\u53e3\u5916\uff0c\u60a8\u8fd8\u5c06\u5b66\u4e60\u5982\u4f55\u5b9e\u73b0 .NET \u5e73\u53f0\u4e2d\u7684\u6807\u51c6\u63a5\u53e3\u3002\u60a8\u5c06\u4f7f\u7528\u8fd9\u4e9b\u6765\u6784\u5efa\u53ef\u4ee5\u6392\u5e8f\u3001\u590d\u5236\u3001\u679a\u4e3e\u548c\u6bd4\u8f83\u7684\u5bf9\u8c61\u3002<\/p>\n<h3>Chapter 9: Understanding Object Lifetime<\/h3>\n<p>\u7b2c 9 \u7ae0\uff1a\u4e86\u89e3\u5bf9\u8c61\u751f\u5b58\u671f<\/p>\n<p>The final chapter of this part examines how the CLR manages memory using the .NET garbage collector. Here, you will come to understand the role of application roots, object generations, and the System.GC type. Once you understand the basics, you will examine the topics of disposable objects (using the IDisposable interface) and the finalization process (using the System.Object.Finalize() method). This chapter will also investigate the Lazy<T> class, which allows you to define data that will not be allocated until requested by a caller. As you will see, this feature can be helpful when you want to ensure you do not clutter the heap with objects that are not actually required by your programs.<br \/>\n\u672c\u90e8\u5206\u7684\u6700\u540e\u4e00\u7ae0\u4ecb\u7ecd CLR \u5982\u4f55\u4f7f\u7528 .NET \u5783\u573e\u56de\u6536\u5668\u7ba1\u7406\u5185\u5b58\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u4e86\u89e3\u5e94\u7528\u7a0b\u5e8f\u6839\u3001\u5bf9\u8c61\u751f\u6210\u548c System.GC \u7c7b\u578b\u7684\u4f5c\u7528\u3002\u4e86\u89e3\u57fa\u7840\u77e5\u8bc6\u540e\uff0c\u60a8\u5c06\u68c0\u67e5\u4e00\u6b21\u6027\u5bf9\u8c61\uff08\u4f7f\u7528 IDisposable \u63a5\u53e3\uff09\u548c\u5b9a\u7a3f\u8fc7\u7a0b\uff08\u4f7f\u7528 System.Object.Finalize\uff08\uff09 \u65b9\u6cd5\uff09\u7684\u4e3b\u9898\u3002\u672c\u7ae0\u5c06\u8fd8\u8981\u8c03\u67e5 Lazy<T> \u7c7b\uff0c\u8be5\u7c7b\u5141\u8bb8\u60a8\u5b9a\u4e49\u5728\u8c03\u7528\u65b9\u8bf7\u6c42\u4e4b\u524d\u4e0d\u4f1a\u5206\u914d\u7684\u6570\u636e\u3002\u5982\u60a8\u6240\u89c1\uff0c\u5f53\u60a8\u60f3\u8981\u786e\u4fdd\u4e0d\u4f1a\u7528\u7a0b\u5e8f\u5b9e\u9645\u4e0a\u4e0d\u9700\u8981\u7684\u5bf9\u8c61\u5f04\u4e71\u5806\u65f6\uff0c\u6b64\u529f\u80fd\u4f1a\u5f88\u6709\u5e2e\u52a9\u3002<\/p>\n<h2>Part IV: Advanced C# Programming<\/h2>\n<p>\u7b2c\u56db\u90e8\u5206\uff1a\u9ad8\u7ea7 C# \u7f16\u7a0b<\/p>\n<p>This part of the book will deepen your understanding of the C# language by walking you through a number of more advanced (but important) concepts. Here, you will complete your examination of the .NET type system by investigating collections and generics. You will also examine a number of more advanced features of C# (e.g., extension methods, operator overloading, anonymous types, and pointer manipulation). You will then examine delegates and lambda expressions, take a first look at Language Integrated Query, and finish the section with two chapters that focus on processes and multithreaded\/async programming.<br \/>\n\u672c\u4e66\u7684\u8fd9\u4e00\u90e8\u5206\u5c06\u901a\u8fc7\u5f15\u5bfc\u60a8\u4e86\u89e3\u4e00\u4e9b\u66f4\u9ad8\u7ea7\uff08\u4f46\u91cd\u8981\uff09\u7684\u6982\u5ff5\u6765\u52a0\u6df1\u60a8\u5bf9 C# \u8bed\u8a00\u7684\u7406\u89e3\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u901a\u8fc7\u8c03\u67e5\u96c6\u5408\u548c\u6cdb\u578b\u6765\u5b8c\u6210\u5bf9 .NET \u7c7b\u578b\u7cfb\u7edf\u7684\u68c0\u67e5\u3002\u60a8\u8fd8\u5c06\u68c0\u67e5 C# \u7684\u8bb8\u591a\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd\uff08\u4f8b\u5982\uff0c\u6269\u5c55\u65b9\u6cd5\u3001\u8fd0\u7b97\u7b26\u91cd\u8f7d\u3001\u533f\u540d\u7c7b\u578b\u548c\u6307\u9488\u64cd\u4f5c\uff09\u3002\u7136\u540e\uff0c\u60a8\u5c06\u68c0\u67e5\u59d4\u6258\u548c lambda \u8868\u8fbe\u5f0f\uff0c\u9996\u5148\u4e86\u89e3\u8bed\u8a00\u96c6\u6210\u67e5\u8be2\uff0c\u5e76\u4ee5\u4e24\u7ae0\u7ed3\u675f\u672c\u8282\uff0c\u91cd\u70b9\u4ecb\u7ecd\u8fdb\u7a0b\u548c\u591a\u7ebf\u7a0b\/\u5f02\u6b65\u7f16\u7a0b\u3002<\/p>\n<h3>Chapter 10: Collections and Generics<\/h3>\n<p>\u7b2c10\u7ae0 \u96c6\u5408\u548c\u6cdb\u578b<\/p>\n<p>This chapter explores the topic of generics. As you will see, generic programming gives you a way to create types and type members, which contain various placeholders that can be specified by the caller. In a nutshell, generics greatly enhance application performance and type safety. Not only will you explore various generic types within the System.Collections.Generic namespace, but you will also learn how to build your own generic methods and types (with and without constraints).<br \/>\n\u672c\u7ae0\u63a2\u8ba8\u6cdb\u578b\u7684\u4e3b\u9898\u3002\u5982\u60a8\u6240\u89c1\uff0c\u6cdb\u578b\u7f16\u7a0b\u4e3a\u60a8\u63d0\u4f9b\u4e86\u4e00\u79cd\u521b\u5efa\u7c7b\u578b\u548c\u7c7b\u578b\u6210\u5458\u7684\u65b9\u6cd5\uff0c\u5176\u4e2d\u5305\u542b\u53ef\u7531\u8c03\u7528\u65b9\u6307\u5b9a\u7684\u5404\u79cd\u5360\u4f4d\u7b26\u3002\u7b80\u800c\u8a00\u4e4b\uff0c\u6cdb\u578b\u6781\u5927\u5730\u589e\u5f3a\u4e86\u5e94\u7528\u7a0b\u5e8f\u6027\u80fd\u548c\u7c7b\u578b\u5b89\u5168\u6027\u3002\u60a8\u4e0d\u4ec5\u5c06\u63a2\u7d22 System.Collections.Generic \u547d\u540d\u7a7a\u95f4\u4e2d\u7684\u5404\u79cd\u6cdb\u578b\u7c7b\u578b\uff0c\u8fd8\u5c06\u5b66\u4e60\u5982\u4f55\u6784\u5efa\u81ea\u5df1\u7684\u6cdb\u578b\u65b9\u6cd5\u548c\u7c7b\u578b\uff08\u6709\u548c\u6ca1\u6709\u7ea6\u675f\uff09\u3002<\/p>\n<h3>Chapter 11: Advanced C# Language Features<\/h3>\n<p>\u7b2c 11 \u7ae0\uff1a\u9ad8\u7ea7 C# \u8bed\u8a00\u529f\u80fd<\/p>\n<p>This chapter deepens your understanding of the C# programming language by introducing you to a number of advanced programming techniques. Here, you will learn how to overload operators and create custom conversion routines (both implicit and explicit) for your types. You will also learn how to build and interact with type indexers, as well as work with extension methods, anonymous types, partial methods, and C# pointers using an unsafe code context.<br \/>\n\u672c\u7ae0\u901a\u8fc7\u5411\u60a8\u4ecb\u7ecd\u8bb8\u591a\u9ad8\u7ea7\u7f16\u7a0b\u6280\u672f\uff0c\u52a0\u6df1\u60a8\u5bf9 C# \u7f16\u7a0b\u8bed\u8a00\u7684\u7406\u89e3\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u91cd\u8f7d\u8fd0\u7b97\u7b26\u5e76\u4e3a\u7c7b\u578b\u521b\u5efa\u81ea\u5b9a\u4e49\u8f6c\u6362\u4f8b\u7a0b\uff08\u9690\u5f0f\u548c\u663e\u5f0f\uff09\u3002\u60a8\u8fd8\u5c06\u5b66\u4e60\u5982\u4f55\u751f\u6210\u7c7b\u578b\u7d22\u5f15\u5668\u5e76\u4e0e\u4e4b\u4ea4\u4e92\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u4e0d\u5b89\u5168\u7684\u4ee3\u7801\u4e0a\u4e0b\u6587\u4f7f\u7528\u6269\u5c55\u65b9\u6cd5\u3001\u533f\u540d\u7c7b\u578b\u3001\u5206\u90e8\u65b9\u6cd5\u548c C# \u6307\u9488\u3002<\/p>\n<h3>Chapter 12: Delegates, Events, and Lambda Expressions<\/h3>\n<p>\u7b2c 12 \u7ae0\uff1a\u59d4\u6258\u3001\u4e8b\u4ef6\u548c Lambda \u8868\u8fbe\u5f0f<\/p>\n<p>The purpose of this chapter is to demystify the delegate type. Simply put, a .NET delegate is an object that points to other methods in your application. Using this type, you can build systems that allow multiple objects to engage in a two-way conversation. After you have examined the use of .NET delegates, you will then be introduced to the C# event keyword, which you can use to simplify the manipulation of raw delegate programming. You will wrap up this chapter by investigating the role of the C# lambda operator (=&gt;) and exploring the connection between delegates, anonymous methods, and lambda expressions.<br \/>\n\u672c\u7ae0\u7684\u76ee\u7684\u662f\u63ed\u5f00\u59d4\u6258\u7c7b\u578b\u7684\u795e\u79d8\u9762\u7eb1\u3002\u7b80\u800c\u8a00\u4e4b\uff0c.NET \u59d4\u6258\u662f\u6307\u5411\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5176\u4ed6\u65b9\u6cd5\u7684\u5bf9\u8c61\u3002\u4f7f\u7528\u6b64\u7c7b\u578b\uff0c\u60a8\u53ef\u4ee5\u6784\u5efa\u5141\u8bb8\u591a\u4e2a\u5bf9\u8c61\u8fdb\u884c\u53cc\u5411\u5bf9\u8bdd\u7684\u7cfb\u7edf\u3002\u68c0\u67e5 .NET \u59d4\u6258\u7684\u7528\u6cd5\u540e\uff0c\u5c06\u5411\u60a8\u4ecb\u7ecd C# \u4e8b\u4ef6\u5173\u952e\u5b57\uff0c\u8be5\u5173\u952e\u5b57\u53ef\u7528\u4e8e\u7b80\u5316\u539f\u59cb\u59d4\u6258\u7f16\u7a0b\u7684\u64cd\u4f5c\u3002\u60a8\u5c06\u901a\u8fc7\u7814\u7a76 C# lambda \u8fd0\u7b97\u7b26 \uff08=&gt;\uff09 \u7684\u89d2\u8272\u5e76\u63a2\u7d22\u59d4\u6258\u3001\u533f\u540d\u65b9\u6cd5\u548c lambda \u8868\u8fbe\u5f0f\u4e4b\u95f4\u7684\u8054\u7cfb\u6765\u7ed3\u675f\u672c\u7ae0\u3002<\/p>\n<h3>Chapter 13: LINQ to Objects<\/h3>\n<p>\u7b2c 13 \u7ae0\uff1aLINQ to \u5bf9\u8c61<\/p>\n<p>This chapter begins your examination of Language Integrated Query (LINQ). LINQ allows you to build strongly typed query expressions that can be applied to a number of LINQ targets to manipulate data in the broadest sense of the word. Here, you will learn about LINQ to Objects, which allows you to apply LINQ expressions to containers of data (e.g., arrays, collections, and custom types). This information will serve you well as you encounter a number of additional LINQ APIs throughout the remainder of this book.<br \/>\n\u672c\u7ae0\u5f00\u59cb\u7814\u7a76\u8bed\u8a00\u96c6\u6210\u67e5\u8be2 \uff08LINQ\uff09\u3002LINQ \u5141\u8bb8\u60a8\u751f\u6210\u5f3a\u7c7b\u578b\u67e5\u8be2\u8868\u8fbe\u5f0f\uff0c\u8fd9\u4e9b\u8868\u8fbe\u5f0f\u53ef\u5e94\u7528\u4e8e\u591a\u4e2a LINQ \u76ee\u6807\uff0c\u4ee5\u6700\u5e7f\u6cdb\u7684\u610f\u4e49\u4e0a\u64cd\u4f5c\u6570\u636e\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u4e86\u89e3 LINQ to Objects\uff0c\u5b83\u5141\u8bb8\u60a8\u5c06 LINQ \u8868\u8fbe\u5f0f\u5e94\u7528\u4e8e\u6570\u636e\u5bb9\u5668\uff08\u4f8b\u5982\uff0c\u6570\u7ec4\u3001\u96c6\u5408\u548c\u81ea\u5b9a\u4e49\u7c7b\u578b\uff09\u3002\u6b64\u4fe1\u606f\u5c06\u5f88\u597d\u5730\u5e2e\u52a9\u60a8\u5728\u672c\u4e66\u7684\u5176\u4f59\u90e8\u5206\u4e2d\u9047\u5230\u8bb8\u591a\u5176\u4ed6 LINQ API\u3002<\/p>\n<h3>Chapter 14: Processes, AppDomains, and Load Contexts<\/h3>\n<p>\u7b2c 14 \u7ae0\uff1a\u8fdb\u7a0b\u3001\u5e94\u7528\u7a0b\u5e8f\u57df\u548c\u52a0\u8f7d\u4e0a\u4e0b\u6587<\/p>\n<p>Now that you have a solid understanding of assemblies, this chapter dives deeper into the composition of a loaded .NET Core executable. The goal of this chapter is to illustrate the relationship between processes,application domains, and contextual boundaries. These topics provide the proper foundation for Chapter 15, where you will examine the construction of multithreaded applications.<br \/>\n\u73b0\u5728\uff0c\u4f60\u5df2\u5bf9\u7a0b\u5e8f\u96c6\u6709\u4e86\u6df1\u5165\u7684\u4e86\u89e3\uff0c\u672c\u7ae0\u5c06\u66f4\u6df1\u5165\u5730\u4ecb\u7ecd\u52a0\u8f7d\u7684 .NET Core \u53ef\u6267\u884c\u6587\u4ef6\u7684\u7ec4\u5408\u3002\u672c\u7ae0\u7684\u76ee\u6807\u662f\u8bf4\u660e\u8fc7\u7a0b\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u5e94\u7528\u7a0b\u5e8f\u57df\u548c\u4e0a\u4e0b\u6587\u8fb9\u754c\u3002\u8fd9\u4e9b\u4e3b\u9898\u4e3a\u7b2c 15 \u7ae0\u63d0\u4f9b\u4e86\u9002\u5f53\u7684\u57fa\u7840\uff0c\u60a8\u5c06\u5728\u5176\u4e2d\u7814\u7a76\u591a\u7ebf\u7a0b\u5e94\u7528\u7a0b\u5e8f\u7684\u6784\u9020\u3002<\/p>\n<h3>Chapter 15: Multithreaded, Parallel, and Async Programming<\/h3>\n<p>\u7b2c15\u7ae0 \u591a\u7ebf\u7a0b\u3001\u5e76\u884c\u548c\u5f02\u6b65\u7f16\u7a0b<\/p>\n<p>This chapter examines how to build multithreaded applications and illustrates a number of techniques you can use to author thread-safe code. The chapter opens by revisiting the .NET delegate type to ensure explaining a delegate\u2019s intrinsic support for asynchronous method invocations. Next, you will investigate the types within the System.Threading namespace. The next section covers the Task Parallel Library (TPL). Using the TPL, .NET developers can build applications that distribute their workload across all available CPUs in a wickedly simple manner. At this point, you will also learn about the role of Parallel LINQ, which provides a way to create LINQ queries that scale across multiple machine cores. The remainder of the chapter covers creating nonblocking calls using the async\/await keywords, local functions and generalized async return types, and asynchronous streams, and the ForEachAsync() method.<br \/>\n\u672c\u7ae0\u4ecb\u7ecd\u5982\u4f55\u6784\u5efa\u591a\u7ebf\u7a0b\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u8bf4\u660e\u4e86\u53ef\u7528\u4e8e\u7f16\u5199\u7ebf\u7a0b\u5b89\u5168\u4ee3\u7801\u7684\u8bb8\u591a\u6280\u672f\u3002\u672c\u7ae0\u9996\u5148\u91cd\u65b0\u8bbf\u95ee .NET \u59d4\u6258\u7c7b\u578b\uff0c\u4ee5\u786e\u4fdd\u89e3\u91ca\u59d4\u6258\u5bf9\u5f02\u6b65\u65b9\u6cd5\u8c03\u7528\u7684\u56fa\u6709\u652f\u6301\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u5c06\u8c03\u67e5<br \/>\n\u547d\u540d\u7a7a\u95f4\u4e2d\u7684\u7c7b\u578b\u3002\u4e0b\u4e00\u8282\u5c06\u4ecb\u7ecd\u4efb\u52a1\u5e76\u884c\u5e93 \uff08TPL\uff09\u3002\u4f7f\u7528 TPL\uff0c.NET \u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u975e\u5e38\u7b80\u5355\u7684\u65b9\u5f0f\u5728\u6240\u6709\u53ef\u7528\u7684 CPU \u4e4b\u95f4\u5206\u914d\u5176\u5de5\u4f5c\u8d1f\u8f7d\u3002\u6b64\u65f6\uff0c\u60a8\u8fd8\u5c06\u4e86\u89e3\u5e76\u884c LINQ \u7684\u4f5c\u7528\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u521b\u5efa\u8de8\u591a\u4e2a\u8ba1\u7b97\u673a\u6838\u5fc3\u7f29\u653e\u7684 LINQ \u67e5\u8be2\u7684\u65b9\u6cd5\u3002\u672c\u7ae0\u7684\u5176\u4f59\u90e8\u5206\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 async\/await \u5173\u952e\u5b57\u3001\u672c\u5730\u51fd\u6570\u548c\u901a\u7528\u5f02\u6b65\u8fd4\u56de\u7c7b\u578b\u3001\u5f02\u6b65\u6d41\u4ee5\u53ca ForEachAsync\uff08\uff09 \u65b9\u6cd5\u521b\u5efa\u975e\u963b\u585e\u8c03\u7528\u3002<\/p>\n<h2>Part V: Programming with .NET Core Assemblies<\/h2>\n<p>\u7b2c V \u90e8\u5206\uff1a\u4f7f\u7528 .NET Core \u7a0b\u5e8f\u96c6\u8fdb\u884c\u7f16\u7a0b<br \/>\nPart V dives into the details of the .NET assembly format. Not only will you learn how to deploy and configure .NET code libraries, but you will also come to understand the internal composition of a .NET binary image. This section explains the role of .NET attributes and the role of resolving type information at runtime and the role of the Dynamic Language Runtime (DLR) and the C# dynamic keyword. The final chapter covers the syntax of Common Intermediate Language (CIL) and the role of dynamic assemblies.<br \/>\n\u7b2c V \u90e8\u5206\u6df1\u5165\u4ecb\u7ecd\u4e86 .NET \u7a0b\u5e8f\u96c6\u683c\u5f0f\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u60a8\u4e0d\u4ec5\u5c06\u5b66\u4e60\u5982\u4f55\u90e8\u7f72\u548c\u914d\u7f6e .NET \u4ee3\u7801\u5e93\uff0c\u800c\u4e14\u8fd8\u5c06\u4e86\u89e3 .NET \u4e8c\u8fdb\u5236\u6620\u50cf\u7684\u5185\u90e8\u7ec4\u5408\u3002\u672c\u8282\u4ecb\u7ecd .NET \u5c5e\u6027\u7684\u4f5c\u7528\u548c\u5728\u8fd0\u884c\u65f6\u89e3\u6790\u7c7b\u578b\u4fe1\u606f\u7684\u89d2\u8272\uff0c\u4ee5\u53ca\u52a8\u6001\u8bed\u8a00\u8fd0\u884c\u65f6 \uff08DLR\uff09 \u548c C# \u52a8\u6001\u5173\u952e\u5b57\u7684\u89d2\u8272\u3002\u6700\u540e\u4e00\u7ae0\u4ecb\u7ecd\u516c\u5171\u4e2d\u95f4\u8bed\u8a00 \uff08CIL\uff09 \u7684\u8bed\u6cd5\u548c\u52a8\u6001\u7a0b\u5e8f\u96c6\u7684\u4f5c\u7528\u3002<\/p>\n<h3>Chapter 16: Building and Configuring Class Libraries<\/h3>\n<p>\u7b2c 16 \u7ae0\uff1a\u6784\u5efa\u548c\u914d\u7f6e\u7c7b\u5e93<\/p>\n<p>At a high level, assembly is the term used to describe a binary file created with a .NET compiler. However, the true story of .NET assemblies is far richer than that. Here, you will learn how to build and deploy assemblies and learn the difference between class libraries and console applications. The final section covers the new options available in .NET, such as single file executables and ready-to-run publishing.<br \/>\n\u5728\u9ad8\u7ea7\u522b\u4e0a\uff0c\u7a0b\u5e8f\u96c6\u662f\u7528\u4e8e\u63cf\u8ff0\u4f7f\u7528 .NET \u7f16\u8bd1\u5668\u521b\u5efa\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u7684\u672f\u8bed\u3002\u4f46\u662f\uff0c.NET \u7a0b\u5e8f\u96c6\u7684\u771f\u5b9e\u6545\u4e8b\u8fdc\u4e0d\u6b62\u4e8e\u6b64\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u751f\u6210\u548c\u90e8\u7f72\u7a0b\u5e8f\u96c6\uff0c\u5e76\u4e86\u89e3\u7c7b\u5e93\u548c\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u7684\u533a\u522b\u3002\u6700\u540e\u4e00\u90e8\u5206\u4ecb\u7ecd .NET \u4e2d\u53ef\u7528\u7684\u65b0\u9009\u9879\uff0c\u4f8b\u5982\u5355\u4e2a\u6587\u4ef6\u53ef\u6267\u884c\u6587\u4ef6\u548c\u968f\u65f6\u53ef\u4ee5\u8fd0\u884c\u7684\u53d1\u5e03\u3002<\/p>\n<h3>Chapter 17: Type Reflection, Late Binding, Attribute, and Dynamic Types<\/h3>\n<p>\u7b2c 17 \u7ae0\uff1a\u7c7b\u578b\u53cd\u5c04\u3001\u540e\u671f\u7ed1\u5b9a\u3001\u5c5e\u6027\u548c\u52a8\u6001\u7c7b\u578b<\/p>\n<p>This chapter continues your examination of .NET assemblies by checking out the process of runtime type discovery using the System.Reflection namespace. Using the types of this namespace, you can build applications that can read an assembly\u2019s metadata on the fly. You will also learn how to load and create types at runtime dynamically using late binding. The next topic of this chapter will explore the role of .NET attributes (both standard and custom). To illustrate the usefulness of each of these topics, the chapter shows you how to construct an extendable application complete with snap-ins. .NET 4.0 introduced a new aspect of the .NET runtime environment called the Dynamic Language Runtime. Using the DLR and the C# dynamic keyword, you can define data that is not truly resolved until runtime. Using these features simplifies some complex .NET programming tasks dramatically. In this final topic of the chapter, you will learn some practical uses of dynamic data, including how to leverage the .NET reflection APIs in a streamlined manner.<br \/>\n\u672c\u7ae0\u901a\u8fc7\u68c0\u67e5\u4f7f\u7528 System.Reflection \u547d\u540d\u7a7a\u95f4\u7684\u8fd0\u884c\u65f6\u7c7b\u578b\u53d1\u73b0\u8fc7\u7a0b\u6765\u7ee7\u7eed\u68c0\u67e5 .NET \u7a0b\u5e8f\u96c6\u3002\u4f7f\u7528\u6b64\u547d\u540d\u7a7a\u95f4\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u751f\u6210\u53ef\u4ee5\u52a8\u6001\u8bfb\u53d6\u7a0b\u5e8f\u96c6\u5143\u6570\u636e\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u60a8\u8fd8\u5c06\u5b66\u4e60\u5982\u4f55\u4f7f\u7528\u540e\u671f\u7ed1\u5b9a\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u52a0\u8f7d\u548c\u521b\u5efa\u7c7b\u578b\u3002\u672c\u7ae0\u7684\u4e0b\u4e00\u4e3b\u9898\u5c06\u63a2\u8ba8 .NET \u5c5e\u6027\uff08\u6807\u51c6\u5c5e\u6027\u548c\u81ea\u5b9a\u4e49\u5c5e\u6027\uff09\u7684\u4f5c\u7528\u3002\u4e3a\u4e86\u8bf4\u660e\u5176\u4e2d\u6bcf\u4e2a\u4e3b\u9898\u7684\u6709\u7528\u6027\uff0c\u672c\u7ae0\u4ecb\u7ecd\u5982\u4f55\u6784\u9020\u4e00\u4e2a\u5e26\u6709\u7ba1\u7406\u5355\u5143\u7684\u53ef\u6269\u5c55\u5e94\u7528\u7a0b\u5e8f\u3002.NET 4.0 \u5f15\u5165\u4e86 .NET \u8fd0\u884c\u65f6\u73af\u5883\u7684\u65b0\u65b9\u9762\uff0c\u79f0\u4e3a\u52a8\u6001\u8bed\u8a00\u8fd0\u884c\u65f6\u3002\u4f7f\u7528 DLR \u548c C#<br \/>\n\u52a8\u6001\u5173\u952e\u5b57\uff0c\u60a8\u53ef\u4ee5\u5b9a\u4e49\u76f4\u5230\u8fd0\u884c\u65f6\u624d\u771f\u6b63\u89e3\u6790\u7684\u6570\u636e\u3002\u4f7f\u7528\u8fd9\u4e9b\u529f\u80fd\u53ef\u4ee5\u5927\u5927\u7b80\u5316\u4e00\u4e9b\u590d\u6742\u7684 .NET \u7f16\u7a0b\u4efb\u52a1\u3002\u5728\u672c\u7ae0\u7684\u6700\u540e\u4e00\u4e2a\u4e3b\u9898\u4e2d\uff0c\u60a8\u5c06\u5b66\u4e60\u52a8\u6001\u6570\u636e\u7684\u4e00\u4e9b\u5b9e\u9645\u7528\u6cd5\uff0c\u5305\u62ec\u5982\u4f55\u4ee5\u7b80\u5316\u7684\u65b9\u5f0f\u5229\u7528 .NET \u53cd\u5c04 API\u3002<\/p>\n<h3>Chapter 18: Understanding CIL and the Role of Dynamic Assemblies<\/h3>\n<p>\u7b2c18\u7ae0 \u4e86\u89e3CIL\u548c\u52a8\u6001\u88c5\u914d\u4f53\u7684\u4f5c\u7528<br \/>\nThe goal of the final chapter in this section is twofold. The first part examines the syntax and semantics of CIL in much greater detail than in previous chapters. The remainder of this chapter will cover the role of the System.Reflection.Emit namespace. You can use these types to build software that can generate .NET Core assemblies in memory at runtime. Formally speaking, assemblies defined and executed in memory are termed dynamic assemblies.<br \/>\n\u672c\u8282\u6700\u540e\u4e00\u7ae0\u7684\u76ee\u6807\u662f\u53cc\u91cd\u7684\u3002\u7b2c\u4e00\u90e8\u5206\u6bd4\u524d\u51e0\u7ae0\u66f4\u8be6\u7ec6\u5730\u68c0\u67e5\u4e86 CIL \u7684\u8bed\u6cd5\u548c\u8bed\u4e49\u3002\u672c\u7ae0\u7684\u5176\u4f59\u90e8\u5206\u5c06\u4ecb\u7ecd System.Reflection.Emit \u547d\u540d\u7a7a\u95f4\u7684\u89d2\u8272\u3002\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u7c7b\u578b\u6765\u751f\u6210\u53ef\u751f\u6210 .NET \u7684\u8f6f\u4ef6\u8fd0\u884c\u65f6\u5185\u5b58\u4e2d\u7684\u6838\u5fc3\u7a0b\u5e8f\u96c6\u3002\u4ece\u5f62\u5f0f\u4e0a\u8bb2\uff0c\u5728\u5185\u5b58\u4e2d\u5b9a\u4e49\u548c\u6267\u884c\u7684\u7a0b\u5e8f\u96c6\u79f0\u4e3a\u52a8\u6001\u7a0b\u5e8f\u96c6\u3002<\/p>\n<h2>Part VI: File Handling, Object Serialization, and Data Access<\/h2>\n<p>\u7b2c VI \u90e8\u5206\uff1a\u6587\u4ef6\u5904\u7406\u3001\u5bf9\u8c61\u5e8f\u5217\u5316\u548c\u6570\u636e\u8bbf\u95ee<\/p>\n<p>By this point in the text, you have a solid handle on the C# language and the details of the .NET assembly format. Part VI leverages your newfound knowledge by exploring a number of commonly used services found within the base class libraries, including file I\/O, object serialization, and database access using ADO.NET.<br \/>\n\u5230\u6587\u672c\u4e2d\u7684\u8fd9\u4e00\u70b9\uff0c\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86 C# \u8bed\u8a00\u548c .NET \u7a0b\u5e8f\u96c6\u683c\u5f0f\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u7b2c VI \u90e8\u5206\u901a\u8fc7\u63a2\u7d22\u57fa\u7c7b\u5e93\u4e2d\u7684\u8bb8\u591a\u5e38\u7528\u670d\u52a1\uff08\u5305\u62ec\u6587\u4ef6 I\/O\u3001\u5bf9\u8c61\u5e8f\u5217\u5316\u548c\u4f7f\u7528 ADO.NET \u8bbf\u95ee\u6570\u636e\u5e93\uff09\u6765\u5229\u7528\u60a8\u65b0\u53d1\u73b0\u7684\u77e5\u8bc6\u3002<\/p>\n<h3>Chapter 19: File I\/O and Object Serialization<\/h3>\n<p>\u7b2c 19 \u7ae0\uff1a\u6587\u4ef6 I\/O \u548c\u5bf9\u8c61\u5e8f\u5217\u5316<\/p>\n<p>The System.IO namespace allows you to interact with a machine\u2019s file and directory structure. Over the course of this chapter, you will learn how to create (and destroy) a directory system programmatically. You will also learn how to move data into and out of various streams (e.g., file based, string based, and memory based). The latter part of this chapter will examine the XML and JSON object serialization services of the .NET platform. Simply put, serialization allows you to persist the public state of an object (or a set of related objects) into a stream for later use. Deserialization (as you might expect) is the process of plucking an object from the stream into memory for consumption by your application.<br \/>\nSystem.IO \u547d\u540d\u7a7a\u95f4\u5141\u8bb8\u60a8\u4e0e\u8ba1\u7b97\u673a\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u7ed3\u6784\u8fdb\u884c\u4ea4\u4e92\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u4ee5\u7f16\u7a0b\u65b9\u5f0f\u521b\u5efa\uff08\u548c\u9500\u6bc1\uff09\u76ee\u5f55\u7cfb\u7edf\u3002\u60a8\u8fd8\u5c06\u5b66\u4e60\u5982\u4f55\u5c06\u6570\u636e\u79fb\u5165\u548c\u79fb\u51fa\u5404\u79cd\u6d41\uff08\u4f8b\u5982\uff0c\u57fa\u4e8e\u6587\u4ef6\u3001\u57fa\u4e8e\u5b57\u7b26\u4e32\u548c\u57fa\u4e8e\u5185\u5b58\uff09\u3002\u672c\u7ae0\u7684\u540e\u534a\u90e8\u5206\u5c06\u7814\u7a76.NET \u5e73\u53f0\u3002\u7b80\u800c\u8a00\u4e4b\uff0c\u5e8f\u5217\u5316\u5141\u8bb8\u60a8\u5c06\u4e00\u4e2a\u5bf9\u8c61\uff08\u6216\u4e00\u7ec4\u76f8\u5173\u5bf9\u8c61\uff09\u7684\u516c\u5171\u72b6\u6001\u4fdd\u5b58\u5230\u6d41\u4e2d\u4ee5\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u53cd\u5e8f\u5217\u5316\uff08\u5982\u60a8\u6240\u6599\uff09\u662f\u5c06\u5bf9\u8c61\u4ece\u6d41\u4e2d\u63d0\u53d6\u5230\u5185\u5b58\u4ee5\u4f9b\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528\u7684\u8fc7\u7a0b\u3002<\/p>\n<h3>Chapter 20: Data Access with ADO.NET<\/h3>\n<p>\u7b2c 20 \u7ae0\uff1aADO.NET \u6570\u636e\u8bbf\u95ee<\/p>\n<p>This chapter covers database access using ADO.NET, the database API for .NET applications. Specifically, this chapter will introduce you to the role of .NET data providers and how to communicate with a relational database using ADO.NET, which is represented by connection objects, command objects, transaction objects, and data reader objects. This chapter also begins the creation of the AutoLot database, which will be enhanced in Part VII.<br \/>\n\u672c\u7ae0\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 ADO.NET\uff08\u9002\u7528\u4e8e .NET \u5e94\u7528\u7a0b\u5e8f\u7684\u6570\u636e\u5e93 API\uff09\u8fdb\u884c\u6570\u636e\u5e93\u8bbf\u95ee\u3002\u5177\u4f53\u800c\u8a00\uff0c\u672c\u7ae0\u5c06\u4ecb\u7ecd .NET \u6570\u636e\u63d0\u4f9b\u7a0b\u5e8f\u7684\u89d2\u8272\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528 ADO.NET\uff08\u7531\u8fde\u63a5\u5bf9\u8c61\u3001\u547d\u4ee4\u5bf9\u8c61\u3001\u4e8b\u52a1\u5bf9\u8c61\u548c\u6570\u636e\u8bfb\u53d6\u5668\u5bf9\u8c61\u8868\u793a\uff09\u4e0e\u5173\u7cfb\u6570\u636e\u5e93\u8fdb\u884c\u901a\u4fe1\u3002\u672c\u7ae0\u8fd8\u5f00\u59cb\u521b\u5efa AutoLot \u6570\u636e\u5e93\uff0c\u8be5\u6570\u636e\u5e93\u5c06\u5728\u7b2c\u4e03\u90e8\u5206\u4e2d\u5f97\u5230\u589e\u5f3a\u3002<\/p>\n<h2>Part VII: Entity Framework Core<\/h2>\n<p>\u7b2c\u4e03\u90e8\u5206\uff1a\u5b9e\u4f53\u6846\u67b6\u6838\u5fc3<\/p>\n<p>By this point in the text, you have a solid handle on the C# language and the details of the .NET assembly format. Part VI leverages your newfound knowledge by exploring a number of commonly used services found within the base class libraries, including file I\/O, database access using ADO.NET, and database access using Entity Framework Core.<br \/>\n\u5230\u6587\u672c\u4e2d\u7684\u8fd9\u4e00\u70b9\uff0c\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86 C# \u8bed\u8a00\u548c .NET \u7a0b\u5e8f\u96c6\u683c\u5f0f\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u7b2c VI \u90e8\u5206\u901a\u8fc7\u63a2\u7d22\u57fa\u7c7b\u5e93\u4e2d\u627e\u5230\u7684\u8bb8\u591a\u5e38\u7528\u670d\u52a1\uff08\u5305\u62ec\u6587\u4ef6 I\/O\u3001\u4f7f\u7528 ADO.NET \u7684\u6570\u636e\u5e93\u8bbf\u95ee\u548c\u4f7f\u7528\u5b9e\u4f53\u6846\u67b6\u6838\u5fc3\u7684\u6570\u636e\u5e93\u8bbf\u95ee\uff09\u6765\u5229\u7528\u60a8\u65b0\u53d1\u73b0\u7684\u77e5\u8bc6\u3002<\/p>\n<h3>Chapter 21: Introducing Entity Framework Core<\/h3>\n<p>\u7b2c 21 \u7ae0\uff1a\u5b9e\u4f53\u6846\u67b6\u6838\u5fc3\u7b80\u4ecb<\/p>\n<p>This chapter introduces Entity Framework (EF) Core. EF Core is an object-relational mapping (ORM) framework built on top of ADO.NET. EF Core provides a way to author data access code using strongly typed classes that directly map to your business model. Here, you will come to understand the building blocks of EF Core, including DbContext, entities, the specialized collection class DbSet<T>, and the DbChangeTracker. Next, you will learn about building your data model understanding EF Core conventions, data annotations, and the Fluent API. The next sections cover query execution and tracking versus non-tracking queries. The final piece of this chapter is the EF Core global tool for the .NET Core command-line interface (CLI).<br \/>\n\u672c\u7ae0\u4ecb\u7ecd\u5b9e\u4f53\u6846\u67b6 \uff08EF\uff09 \u6838\u5fc3\u3002EF Core \u662f\u4e00\u4e2a\u57fa\u4e8e ADO.NET \u6784\u5efa\u7684\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04 \uff08ORM\uff09 \u6846\u67b6\u3002EF Core \u63d0\u4f9b\u4e86\u4e00\u79cd\u4f7f\u7528\u76f4\u63a5\u6620\u5c04\u5230\u4e1a\u52a1\u6a21\u578b\u7684\u5f3a\u7c7b\u578b\u7c7b\u521b\u4f5c\u6570\u636e\u8bbf\u95ee\u4ee3\u7801\u7684\u65b9\u6cd5\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u5c06\u4e86\u89e3 EF Core \u7684\u6784\u5efa\u57fa\u5757\uff0c\u5305\u62ec DbContext\u3001\u5b9e\u4f53\u3001\u4e13\u7528\u96c6\u5408\u7c7b DbSet<T> \u548c DbChangeTracker\u3002\u63a5\u4e0b\u6765\uff0c\u4f60\u5c06\u4e86\u89e3\u5982\u4f55\u6784\u5efa\u6570\u636e\u6a21\u578b\uff0c\u4e86\u89e3 EF Core \u7ea6\u5b9a\u3001\u6570\u636e\u6279\u6ce8\u548c Fluent API\u3002\u63a5\u4e0b\u6765\u7684\u90e8\u5206\u4ecb\u7ecd\u67e5\u8be2\u6267\u884c\u548c\u8ddf\u8e2a\u4e0e\u975e\u8ddf\u8e2a\u67e5\u8be2\u3002\u672c\u7ae0\u7684\u6700\u540e\u4e00\u90e8\u5206\u662f\u7528\u4e8e .NET Core \u547d\u4ee4\u884c\u754c\u9762 \uff08CLI\uff09 \u7684 EF Core \u5168\u5c40\u5de5\u5177\u3002<\/p>\n<h3>Chapter 22: Exploring Entity Framework Core<\/h3>\n<p>\u7b2c 22 \u7ae0\uff1a\u63a2\u7d22\u5b9e\u4f53\u6846\u67b6\u6838\u5fc3<\/p>\n<p>This chapter continues exploring EF Core. The chapter begins by diving deep into create, read, update, and delete (CRUD) operations. The rest of the chapter covers some of the more notable features of EF Core, including global query filters, raw SQL queries with LINQ, projections, database generated values, concurrency checking, connection resiliency, database function mapping, batching of statements, value converters, and shadow properties. The final section covers SQL Server temporal table support, the newest feature in EF Core 6.<br \/>\n\u672c\u7ae0\u7ee7\u7eed\u63a2\u8ba8 EF Core\u3002\u672c\u7ae0\u9996\u5148\u6df1\u5165\u63a2\u8ba8\u521b\u5efa\u3001\u8bfb\u53d6\u3001\u66f4\u65b0\u548c\u5220\u9664 \uff08CRUD\uff09 \u64cd\u4f5c\u3002\u672c\u7ae0\u7684\u5176\u4f59\u90e8\u5206\u4ecb\u7ecd EF Core \u7684\u4e00\u4e9b\u66f4\u503c\u5f97\u6ce8\u610f\u7684\u529f\u80fd\uff0c\u5305\u62ec\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668\u3001\u4f7f\u7528 LINQ \u7684\u539f\u59cb SQL \u67e5\u8be2\u3001\u6295\u5f71\u3001\u6570\u636e\u5e93\u751f\u6210\u7684\u503c\u3001\u5e76\u53d1\u68c0\u67e5\u3001\u8fde\u63a5\u590d\u539f\u3001\u6570\u636e\u5e93\u51fd\u6570\u6620\u5c04\u3001\u8bed\u53e5\u6279\u5904\u7406\u3001\u503c\u8f6c\u6362\u5668\u548c\u5f71\u5b50\u5c5e\u6027\u3002\u6700\u540e\u4e00\u90e8\u5206\u4ecb\u7ecd SQL Server \u4e34\u65f6\u8868\u652f\u6301\uff0c\u8fd9\u662f EF Core 6 \u4e2d\u7684\u6700\u65b0\u529f\u80fd\u3002<\/p>\n<h3>Chapter 23: Build a Data Access Layer with Entity Framework Core<\/h3>\n<p>\u7b2c 23 \u7ae0\uff1a\u4f7f\u7528\u5b9e\u4f53\u6846\u67b6\u6838\u5fc3\u6784\u5efa\u6570\u636e\u8bbf\u95ee\u5c42<\/p>\n<p>This chapter builds the AutoLot data access layer. It begins with scaffolding the AutoLot database from Chapter 20 into a derived DbContext and entity classes. Then the project and database are updated to change to a code first approach. The entities are updated to their final version, and migration are used to update the database tables and add SQL Server objects. The final database change is to create a migration for the stored procedure from Chapter 21 and a new database view. The next section builds a rich set of repositories for code encapsulation, and the final update is to add data initialization code.<br \/>\n\u672c\u7ae0\u6784\u5efa AutoLot \u6570\u636e\u8bbf\u95ee\u5c42\u3002\u5b83\u9996\u5148\u5c06\u7b2c 20 \u7ae0\u4e2d\u7684 AutoLot \u6570\u636e\u5e93\u57fa\u67b6\u6784\u5efa \u4e3a\u6d3e\u751f\u7684 DbContext \u548c\u5b9e\u4f53\u7c7b\u3002\u7136\u540e\u66f4\u65b0\u9879\u76ee\u548c\u6570\u636e\u5e93\u4ee5\u66f4\u6539\u4e3a\u4ee3\u7801\u4f18\u5148\u65b9\u6cd5\u3002\u5b9e\u4f53\u5c06\u66f4\u65b0\u5230\u5176\u6700\u7ec8\u7248\u672c\uff0c\u8fc1\u79fb\u7528\u4e8e\u66f4\u65b0\u6570\u636e\u5e93\u8868\u548c\u6dfb\u52a0 SQL Server \u5bf9\u8c61\u3002\u6700\u540e\u4e00\u4e2a\u6570\u636e\u5e93\u66f4\u6539\u662f\u4ece\u7b2c 21 \u7ae0\u4e3a\u5b58\u50a8\u8fc7\u7a0b\u521b\u5efa\u4e00\u4e2a\u8fc1\u79fb \u548c\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u89c6\u56fe\u3002\u4e0b\u4e00\u8282\u4e3a\u4ee3\u7801\u5c01\u88c5\u6784\u5efa\u4e00\u7ec4\u4e30\u5bcc\u7684\u5b58\u50a8\u5e93\uff0c\u6700\u7ec8\u66f4\u65b0\u662f\u6dfb\u52a0\u6570\u636e\u521d\u59cb\u5316\u4ee3\u7801\u3002<\/p>\n<h3>Chapter 24: Test Driving the AutoLot<\/h3>\n<p>\u7b2c24\u7ae0 Test Driving the AutoLot<\/p>\n<p>Chapter 24 uses the xUnit testing framework to build automated integration tests for the AutoLot data access layer. In this chapter over 60 tests are used to explore querying, creating, updating, and deleting records.<br \/>\n\u7b2c24\u7ae0\u4f7f\u7528xUnit\u6d4b\u8bd5\u6846\u67b6\u4e3aAutoLot\u6570\u636e\u8bbf\u95ee\u5c42\u6784\u5efa\u81ea\u52a8\u5316\u96c6\u6210\u6d4b\u8bd5\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u4f7f\u7528\u4e86 60 \u591a\u4e2a\u6d4b\u8bd5\u6765\u63a2\u7d22\u67e5\u8be2\u3001\u521b\u5efa\u3001\u66f4\u65b0\u548c\u5220\u9664\u8bb0\u5f55\u3002<\/p>\n<h2>Part VIII: Windows Presentation Foundation<\/h2>\n<p>\u7b2c\u516b\u90e8\u5206\uff1aWPF\u57fa\u7840<\/p>\n<p>The initial desktop GUI API supported by the .NET platform was termed Windows Forms. While this API is still fully supported, .NET 3.0 introduced programmers to an API called Windows Presentation Foundation (WPF). Unlike Windows Forms, this framework integrates a number of key services, including data binding, 2D and 3D graphics, animations, and rich documents, into a single, unified object model. This is all accomplished using a declarative markup grammar called Extensible Application Markup Language (XAML). Furthermore,the WPF control architecture provides a trivial way to restyle the look and feel of a typical control radically using little more than some well-formed XAML.<br \/>\n.NET \u5e73\u53f0\u652f\u6301\u7684\u521d\u59cb\u684c\u9762 GUI API \u79f0\u4e3a Windows Forms\u3002\u867d\u7136\u6b64 API \u4ecd\u5b8c\u5168\u53d7\u652f\u6301\uff0c\u4f46 .NET 3.0 \u5411\u7a0b\u5e8f\u5458\u4ecb\u7ecd\u4e86\u4e00\u4e2a\u540d\u4e3a Windows Presentation Foundation \uff08WPF\uff09 \u7684 API\u3002\u4e0e Windows \u7a97\u4f53\u4e0d\u540c\uff0c\u6b64\u6846\u67b6\u5c06\u8bb8\u591a\u5173\u952e\u670d\u52a1\uff08\u5305\u62ec\u6570\u636e\u7ed1\u5b9a\u3001\u4e8c\u7ef4\u548c\u4e09\u7ef4\u56fe\u5f62\u3001\u52a8\u753b\u548c\u4e30\u5bcc\u6587\u6863\uff09\u96c6\u6210\u5230\u5355\u4e2a\u7edf\u4e00\u7684\u5bf9\u8c61\u6a21\u578b\u4e2d\u3002\u8fd9\u4e00\u5207\u90fd\u662f\u4f7f\u7528\u79f0\u4e3a\u53ef\u6269\u5c55\u5e94\u7528\u7a0b\u5e8f\u6807\u8bb0\u8bed\u8a00 \uff08XAML\uff09 \u7684\u58f0\u660e\u6027\u6807\u8bb0\u8bed\u6cd5\u5b8c\u6210\u7684\u3002\u6b64\u5916WPF \u63a7\u4ef6\u4f53\u7cfb\u7ed3\u6784\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u91cd\u65b0\u8bbe\u8ba1\u5178\u578b\u63a7\u4ef6\u7684\u5916\u89c2\uff0c\u4ece\u6839\u672c\u4e0a\u53ea\u4f7f\u7528\u4e00\u4e9b\u683c\u5f0f\u826f\u597d\u7684 XAML\u3002<\/p>\n<h3>Chapter 25: Introducing Windows Presentation Foundation and XAML<\/h3>\n<p>\u7b2c 25 \u7ae0\uff1a\u4ecb\u7ecd Windows Presentation Foundation \u548c XAML<\/p>\n<p>In this chapter, you will begin by examining the motivation behind the creation of WPF (when there was already a desktop development framework in .NET). Then, you will learn about the syntax of XAML and, finally, take a look at the Visual Studio support for building WPF applications.<br \/>\n\u5728\u672c\u7ae0\u4e2d\uff0c\u60a8\u5c06\u9996\u5148\u68c0\u67e5\u521b\u5efa WPF \u80cc\u540e\u7684\u52a8\u673a\uff08\u5f53\u65f6 .NET \u4e2d\u5df2\u7ecf\u6709\u4e00\u4e2a\u684c\u9762\u5f00\u53d1\u6846\u67b6\uff09\u3002\u7136\u540e\uff0c\u60a8\u5c06\u4e86\u89e3 XAML \u7684\u8bed\u6cd5\uff0c\u6700\u540e\uff0c\u4e86\u89e3 Visual Studio \u5bf9\u751f\u6210 WPF \u5e94\u7528\u7a0b\u5e8f\u7684\u652f\u6301\u3002<\/p>\n<h3>Chapter 26: WPF Controls, Layouts, Events, and Data Binding<\/h3>\n<p>\u7b2c 26 \u7ae0\uff1aWPF \u63a7\u4ef6\u3001\u5e03\u5c40\u3001\u4e8b\u4ef6\u548c\u6570\u636e\u7ed1\u5b9a<br \/>\nThis chapter will expose you to the process of using intrinsic WPF controls and layout managers. For example, you will learn to build menu systems, splitter windows, toolbars, and status bars. This chapter will also introduce you to a number of WPF APIs (and their related controls), including the Ink API, commands, routed events, the data-binding model, and dependency properties.<br \/>\n\u672c\u7ae0\u5c06\u5411\u60a8\u4ecb\u7ecd\u4f7f\u7528\u5185\u90e8 WPF \u63a7\u4ef6\u548c\u5e03\u5c40\u7ba1\u7406\u5668\u7684\u8fc7\u7a0b\u3002\u4f8b\u5982\uff0c\u60a8\u5c06\u5b66\u4e60\u6784\u5efa\u83dc\u5355\u7cfb\u7edf\u3001\u62c6\u5206\u5668\u7a97\u53e3\u3001\u5de5\u5177\u680f\u548c\u72b6\u6001\u680f\u3002\u672c\u7ae0\u8fd8\u5c06\u4ecb\u7ecd\u8bb8\u591a WPF API\uff08\u53ca\u5176\u76f8\u5173\u63a7\u4ef6\uff09\uff0c\u5305\u62ec Ink API\u3001\u547d\u4ee4\u3001\u8def\u7531\u4e8b\u4ef6\u3001\u6570\u636e\u7ed1\u5b9a\u6a21\u578b\u548c\u4f9d\u8d56\u9879\u5c5e\u6027\u3002<\/p>\n<h3>Chapter 27: WPF Graphics Rendering Services<\/h3>\n<p>\u7b2c 27 \u7ae0\uff1aWPF \u56fe\u5f62\u5448\u73b0\u670d\u52a1<\/p>\n<p>WPF is a graphically intensive API; given this fact, WPF provides three ways to render graphics: shapes, drawings and geometrics, and visuals. In this chapter, you will evaluate each option and learn about a number of important graphics primitives (e.g., brushes, pens, and transformations) along the way. This chapter will also examine ways to incorporate vector images into your WPF graphics, as well as how to perform hit-testing operations against graphical data.<br \/>\nWPF \u662f\u4e00\u4e2a\u56fe\u5f62\u5bc6\u96c6\u578b API;\u9274\u4e8e\u8fd9\u4e00\u4e8b\u5b9e\uff0cWPF \u63d0\u4f9b\u4e86\u4e09\u79cd\u5448\u73b0\u56fe\u5f62\u7684\u65b9\u6cd5\uff1a\u5f62\u72b6\u3001\u7ed8\u56fe\u548c\u51e0\u4f55\u4ee5\u53ca\u89c6\u89c9\u5bf9\u8c61\u3002\u5728\u672c\u7ae0\u4e2d\uff0c\u60a8\u5c06\u8bc4\u4f30\u6bcf\u4e2a\u9009\u9879\uff0c\u5e76\u5728\u6b64\u8fc7\u7a0b\u4e2d\u4e86\u89e3\u8bb8\u591a\u91cd\u8981\u7684\u56fe\u5f62\u57fa\u5143\uff08\u4f8b\u5982\uff0c\u753b\u7b14\u3001\u7b14\u548c\u53d8\u6362\uff09\u3002\u672c\u7ae0\u8fd8\u5c06\u7814\u7a76\u5c06\u77e2\u91cf\u56fe\u50cf\u5408\u5e76\u5230 WPF \u56fe\u5f62\u4e2d\u7684\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5982\u4f55\u5bf9\u56fe\u5f62\u6570\u636e\u6267\u884c\u547d\u4e2d\u6d4b\u8bd5\u64cd\u4f5c\u3002<\/p>\n<h3>Chapter 28: WPF Resources, Animations, Styles, and Templates<\/h3>\n<p>\u7b2c 28 \u7ae0\uff1aWPF \u8d44\u6e90\u3001\u52a8\u753b\u3001\u6837\u5f0f\u548c\u6a21\u677f<\/p>\n<p>This chapter will introduce you to three important (and interrelated) topics that will deepen your understanding of the Windows Presentation Foundation API. The first order of business is to learn the role of logical resources. As you will see, the logical resource (also termed an object resource) system provides a way for you to name and refer to commonly used objects within a WPF application. Next, you will learn how to define, execute, and control an animation sequence. Despite what you might be thinking, however, WPF animations are not limited to the confines of video games or multimedia applications. You will wrap up the chapter by learning about the role of WPF styles. Similar to a web page that uses CSS or the ASP.NET theme engine, a WPF application can define a common look and feel for a set of controls.<br \/>\n\u672c\u7ae0\u5c06\u5411\u60a8\u4ecb\u7ecd\u4e09\u4e2a\u91cd\u8981\uff08\u4e14\u76f8\u4e92\u5173\u8054\uff09\u7684\u4e3b\u9898\uff0c\u8fd9\u4e9b\u4e3b\u9898\u5c06\u52a0\u6df1\u60a8\u5bf9 Windows Presentation Foundation API \u7684\u7406\u89e3\u3002\u4e1a\u52a1\u7684\u9996\u8981\u4efb\u52a1\u662f\u5b66\u4e60\u903b\u8f91\u8d44\u6e90\u7684\u4f5c\u7528\u3002\u5982\u60a8\u6240\u89c1\uff0c\u903b\u8f91\u8d44\u6e90\uff08\u4e5f\u79f0\u4e3a\u5bf9\u8c61\u8d44\u6e90\uff09\u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u79cd\u547d\u540d\u548c\u5f15\u7528 WPF \u5e94\u7528\u7a0b\u5e8f\u4e2d\u5e38\u7528\u5bf9\u8c61\u7684\u65b9\u6cd5\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u5b9a\u4e49\u3001\u6267\u884c\u548c\u63a7\u5236\u52a8\u753b\u5e8f\u5217\u3002\u4f46\u662f\uff0c\u4e0d\u7ba1\u60a8\u53ef\u80fd\u5728\u60f3\u4ec0\u4e48\uff0cWPF \u52a8\u753b\u5e76\u4e0d\u5c40\u9650\u4e8e\u89c6\u9891\u6e38\u620f\u6216\u591a\u5a92\u4f53\u5e94\u7528\u7a0b\u5e8f\u3002\u60a8\u5c06\u901a\u8fc7\u4e86\u89e3 WPF \u6837\u5f0f\u7684\u4f5c\u7528\u6765\u7ed3\u675f\u672c\u7ae0\u3002\u4e0e\u4f7f\u7528 CSS \u6216 ASP.NET \u4e3b\u9898\u5f15\u64ce\u7684\u7f51\u9875\u7c7b\u4f3c\uff0cWPF \u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u4e3a\u4e00\u7ec4\u63a7\u4ef6\u5b9a\u4e49\u901a\u7528\u5916\u89c2\u3002<\/p>\n<h3>Chapter 29: WPF Notifications, Validations, Commands, and MVVM<\/h3>\n<p>\u7b2c 29 \u7ae0\uff1aWPF \u901a\u77e5\u3001\u9a8c\u8bc1\u3001\u547d\u4ee4\u548c MVVM<\/p>\n<p>This chapter begins by examining three core WPF framework capabilities: notifications, validations, and commands. In the notifications section, you will learn about observable models and collections and how they keep your application data and UI in sync. Next, you will dig deeper into commands, building custom commands to encapsulate your code. In the validations section, you will learn how to use the several validation mechanisms available in WPF applications. The chapter closes with an examination of the Model- View-ViewModel (MVVM) pattern and ends by creating an application that demonstrates the MVVM pattern in action.<br \/>\n\u672c\u7ae0\u9996\u5148\u4ecb\u7ecd\u4e09\u4e2a\u6838\u5fc3 WPF \u6846\u67b6\u529f\u80fd\uff1a\u901a\u77e5\u3001\u9a8c\u8bc1\u548c\u547d\u4ee4\u3002\u5728\u901a\u77e5\u90e8\u5206\u4e2d\uff0c\u4f60\u5c06\u4e86\u89e3\u53ef\u89c2\u5bdf\u7684\u6a21\u578b\u548c\u96c6\u5408\uff0c\u4ee5\u53ca\u5b83\u4eec\u5982\u4f55\u4f7f\u5e94\u7528\u7a0b\u5e8f\u6570\u636e\u548c UI \u4fdd\u6301\u540c\u6b65\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u5c06\u6df1\u5165\u6316\u6398\u547d\u4ee4\uff0c\u6784\u5efa\u81ea\u5b9a\u4e49\u547d\u4ee4\u6765\u5c01\u88c5\u4ee3\u7801\u3002\u5728\u9a8c\u8bc1\u90e8\u5206\u4e2d\uff0c\u60a8\u5c06\u5b66\u4e60\u5982\u4f55\u4f7f\u7528 WPF \u5e94\u7528\u7a0b\u5e8f\u4e2d\u63d0\u4f9b\u7684\u51e0\u79cd\u9a8c\u8bc1\u673a\u5236\u3002\u672c\u7ae0\u4ee5\u5bf9\u6a21\u578b-\u89c6\u56fe-\u89c6\u56fe\u6a21\u578b \uff08MVVM\uff09 \u6a21\u5f0f\u7684\u68c0\u67e5\u7ed3\u675f\uff0c\u6700\u540e\u521b\u5efa\u4e00\u4e2a\u6f14\u793a MVVM \u6a21\u5f0f\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2>Part IX: ASP.NET Core<\/h2>\n<p>\u7b2c\u4e5d\u90e8\u5206\uff1a ASP.NET Core<\/p>\n<p>Part VIII is devoted to an examination of constructing web applications using ASP.NET Core. The chapters in this section cover ASP.NET Core fundamentals as well as build a RESTful service, a web application using the MVC pattern, and a Razor page based web application.<br \/>\n\u7b2c\u516b\u90e8\u5206\u4e13\u95e8\u7814\u7a76\u4f7f\u7528 ASP.NET \u6838\u5fc3\u6784\u5efaWeb\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u8282\u4e2d\u7684\u7ae0\u8282\u6db5\u76d6 ASP.NET \u6838\u5fc3\u57fa\u7840\u77e5\u8bc6\uff0c\u4ee5\u53ca\u6784\u5efa RESTful \u670d\u52a1\u3001\u4f7f\u7528 MVC \u6a21\u5f0f\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u548c\u57fa\u4e8e Razor \u9875\u9762\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h3>Chapter 30: Introducing ASP.NET Core<\/h3>\n<p>\u7b2c 30 \u7ae0\uff1aASP.NET Core \u7b80\u4ecb<\/p>\n<p>This chapter introduces ASP.NET Core. After describing the Model-View-Controller (MVC) pattern, the solution and the three ASP.NET Core projects are created and the multiple ways to run and debug application is explored. Next, the chapter covers many of the features from ASP.NET MVC\/ASP.NET WebAPI that were brought forward into ASP.NET Core. These include convention over configuration, controllers and actions, routing, model binding and validation, and filters.<br \/>\n\u672c\u7ae0\u4ecb\u7ecd ASP.NET Core\u3002\u5728\u63cf\u8ff0\u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668 \uff08MVC\uff09 \u6a21\u5f0f\u4e4b\u540e\uff0c\u5c06\u521b\u5efa\u89e3\u51b3\u65b9\u6848\u548c\u4e09\u4e2a ASP.NET \u6838\u5fc3\u9879\u76ee\uff0c\u4ee5\u53ca\u8fd0\u884c\u548c\u8c03\u8bd5\u7684\u591a\u79cd\u65b9\u5f0f\u63a2\u7d22\u5e94\u7528\u3002\u63a5\u4e0b\u6765\uff0c\u672c\u7ae0\u5c06\u4ecb\u7ecd MVC\/ASP.NET WebAPI \u4e2d\u7684\u8bb8\u591a\u529f\u80fd ASP.NET \u8fd9\u4e9b\u529f\u80fd\u88ab\u5f15\u5165 ASP.NET Core\u3002\u5176\u4e2d\u5305\u62ec\u914d\u7f6e\u7ea6\u5b9a\u3001\u63a7\u5236\u5668\u548c\u64cd\u4f5c\u3001\u8def\u7531\u3001\u6a21\u578b\u7ed1\u5b9a\u548c\u9a8c\u8bc1\u4ee5\u53ca\u7b5b\u9009\u5668\u3002<\/p>\n<h3>Chapter 31: Diving into ASP.NET Core<\/h3>\n<p>\u7b2c31\u7ae0 \u6f5c\u5165ASP.NET Core<\/p>\n<p>The chapter covers the many new features introduced in ASP.NET Core, including Razor pages, the environmentally aware configuration system, built-in dependency injection and the options pattern, the HTTP client factory, deployment patterns, the HTTP request pipeline, and logging.<br \/>\n\u672c\u7ae0\u4ecb\u7ecd\u4e86 ASP.NET Core \u4e2d\u5f15\u5165\u7684\u8bb8\u591a\u65b0\u529f\u80fd\uff0c\u5305\u62ec Razor \u9875\u9762\u3001\u73af\u5883\u611f\u77e5\u914d\u7f6e\u7cfb\u7edf\u3001\u5185\u7f6e\u4f9d\u8d56\u9879\u6ce8\u5165\u548c\u9009\u9879\u6a21\u5f0f\u3001HTTP \u5ba2\u6237\u7aef\u5de5\u5382\u3001\u90e8\u7f72\u6a21\u5f0f\u3001HTTP \u8bf7\u6c42\u7ba1\u9053\u548c\u65e5\u5fd7\u8bb0\u5f55\u3002<\/p>\n<h3>Chapter 32: RESTful Services with ASP.NET Core<\/h3>\n<p>\u7b2c 32 \u7ae0\uff1a ASP.NET Core  REST \u670d\u52a1<\/p>\n<p>This chapter finishes the ASP.NET Core RESTful service application. The chapter begins with a look at returning JSON from action methods and JSON configuration options. The functionality for API controllers that the ApiAttribute adds is explored. API Versioning is covered next, and the Swagger\/OpenAPI configuration is updated to support versioned APIs. A base controller to provide standard CRUD operations is created and the entity specific controllers are added. An exception filter is added and basic authentication is added to the service.<br \/>\n\u672c\u7ae0\u5b8c\u6210\u4e86 ASP.NET Core RESTful \u670d\u52a1\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u7ae0\u9996\u5148\u4ecb\u7ecd\u5982\u4f55\u4ece\u64cd\u4f5c\u65b9\u6cd5\u548c JSON \u914d\u7f6e\u9009\u9879\u8fd4\u56de JSON\u3002\u672c\u6587\u63a2\u8ba8\u4e86 ApiAttribute \u6dfb\u52a0\u7684 API \u63a7\u5236\u5668\u7684\u529f\u80fd\u3002\u63a5\u4e0b\u6765\u5c06\u4ecb\u7ecd API \u7248\u672c\u63a7\u5236\uff0c\u5e76\u66f4\u65b0 Swagger\/OpenAPI \u914d\u7f6e\u4ee5\u652f\u6301\u7248\u672c\u63a7\u5236\u7684 API\u3002\u5c06\u521b\u5efa\u7528\u4e8e\u63d0\u4f9b\u6807\u51c6 CRUD \u64cd\u4f5c\u7684\u57fa\u672c\u63a7\u5236\u5668\uff0c\u5e76\u6dfb\u52a0\u7279\u5b9a\u4e8e\u5b9e\u4f53\u7684\u63a7\u5236\u5668\u3002\u5c06\u6dfb\u52a0\u5f02\u5e38\u7b5b\u9009\u5668\uff0c\u5e76\u5c06\u57fa\u672c\u8eab\u4efd\u9a8c\u8bc1\u6dfb\u52a0\u5230\u670d\u52a1\u4e2d\u3002<\/p>\n<h3>Chapter 33: Web Applications with MVC<\/h3>\n<p>\u7b2c 33 \u7ae0\uff1a\u4f7f\u7528 MVC \u7684 Web \u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>This chapter finishes the MVC-based web application. The chapter starts with a deep look into views and the Razor View Engine, including layouts and partials. Next, managing client-side libraries and the bundling\/ minification of those libraries is covered. The base controller is built along with the derived entity specific controller. An Area is added to the application for managing Make records. Next tag helpers (another new feature in ASP.NET Core) are explored, followed by creating custom tag helpers. The application\u2019s view component is added for the dynamic menu. Two custom validation attributes and their related server and client-side code are used to provide validation to a view model. The final section covers the General Data Protection Regulation (GDPR) support in ASP.NET Core.<br \/>\n\u672c\u7ae0\u5c06\u5b8c\u6210\u57fa\u4e8e MVC \u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u7ae0\u9996\u5148\u6df1\u5165\u63a2\u8ba8\u89c6\u56fe\u548c Razor \u89c6\u56fe\u5f15\u64ce\uff0c\u5305\u62ec\u5e03\u5c40\u548c\u90e8\u5206\u3002\u63a5\u4e0b\u6765\uff0c\u4ecb\u7ecd\u7ba1\u7406\u5ba2\u6237\u7aef\u5e93\u4ee5\u53ca\u8fd9\u4e9b\u5e93\u7684\u6346\u7ed1\/\u7f29\u5c0f\u3002\u57fa\u672c\u63a7\u5236\u5668\u4e0e\u6d3e\u751f\u7684\u5b9e\u4f53\u7279\u5b9a\u63a7\u5236\u5668\u4e00\u8d77\u6784\u5efa\u3002\u533a\u57df\u5c06\u6dfb\u52a0\u5230\u7528\u4e8e\u7ba1\u7406\u521b\u5efa\u8bb0\u5f55\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002\u63a5\u4e0b\u6765\u5c06\u63a2\u7d22\u6807\u8bb0\u5e2e\u52a9\u7a0b\u5e8f\uff08ASP.NET Core \u4e2d\u7684\u53e6\u4e00\u4e2a\u65b0\u529f\u80fd\uff09\uff0c\u7136\u540e\u521b\u5efa\u81ea\u5b9a\u4e49\u6807\u8bb0\u5e2e\u52a9\u7a0b\u5e8f\u3002\u4e3a\u52a8\u6001\u83dc\u5355\u6dfb\u52a0\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u89c6\u56fe\u7ec4\u4ef6\u3002\u4e24\u4e2a\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u5c5e\u6027\u53ca\u5176\u76f8\u5173\u7684\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u4ee3\u7801\u7528\u4e8e\u4e3a\u89c6\u56fe\u6a21\u578b\u63d0\u4f9b\u9a8c\u8bc1\u3002\u6700\u540e\u4e00\u90e8\u5206\u4ecb\u7ecd\u4e86 ASP.NET Core \u4e2d\u7684\u901a\u7528\u6570\u636e\u4fdd\u62a4\u6761\u4f8b \uff08GDPR\uff09 \u652f\u6301\u3002<\/p>\n<h3>Chapter 34: Web Applications Using Razor Pages<\/h3>\n<p>\u7b2c 34 \u7ae0\uff1a\u4f7f\u7528 Razor \u9875\u9762\u7684 Web \u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>The chapter starts with a deep look into Razor pages and Razor page views and then completes the AutoLot. Web application. Many of the MVC application capabilities, like layouts, partial views, tag helpers, view components, GDPR support, and areas are supported in Razor page applications. All of the features of the AutoLot.Mvc application is replicated in the AutoLot.Web application, leveraging the similarities and highlighting the differences between MVC and Razor pages.<br \/>\n\u672c\u7ae0\u9996\u5148\u6df1\u5165\u4e86\u89e3 Razor \u9875\u9762\u548c Razor \u9875\u9762\u89c6\u56fe\uff0c\u7136\u540e\u5b8c\u6210 AutoLot\u3002\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f\u3002Razor \u9875\u9762\u5e94\u7528\u7a0b\u5e8f\u652f\u6301\u8bb8\u591a MVC \u5e94\u7528\u7a0b\u5e8f\u529f\u80fd\uff0c\u5982\u5e03\u5c40\u3001\u5206\u90e8\u89c6\u56fe\u3001\u6807\u8bb0\u5e2e\u52a9\u7a0b\u5e8f\u3001\u89c6\u56fe\u7ec4\u4ef6\u3001GDPR \u652f\u6301\u548c\u533a\u57df\u3002\u7684\u6240\u6709\u529f\u80fdAutoLot.Mvc \u5e94\u7528\u7a0b\u5e8f\u5728 AutoLot.Web \u5e94\u7528\u7a0b\u5e8f\u4e2d\u590d\u5236\uff0c\u5229\u7528 MVC \u548c Razor \u9875\u9762\u4e4b\u95f4\u7684\u76f8\u4f3c\u4e4b\u5904\u5e76\u7a81\u51fa\u663e\u793a\u5dee\u5f02\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pro C# 10 with .NET 6 Introduction Choose Your Own Adventures \u9009\u62e9\u4f60\u81ea\u5df1\u7684\u5192\u9669 From the very first editions that Andrew wrote, and the ensuing editions since I have taken over the book, the goal has been (and always will be) to help you be productive and informed software engineers. This book, like C# and the .NET [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[22],"class_list":["post-265","post","type-post","status-publish","format-standard","hentry","category-csharp","tag-pro-csharp10-with-net6"],"_links":{"self":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts\/265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265"}],"version-history":[{"count":0,"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions"}],"wp:attachment":[{"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}