Beginning Entity Framework Core 5 : From Novice to Professional
معرفی کتاب «Beginning Entity Framework Core 5 : From Novice to Professional» نوشتهٔ Eric Vogel (auth.)، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2021. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Use the code-driven approach of Entity Framework Core 5 to build a functional web application that accesses a database on the backend server. This book covers the common use cases of Entity Framework that a developer needs to master in order to begin building applications that run against a database. Throughout the book you will be shown how to use Entity Framework Core 5 by implementing a simple ASP.NET Core Razor Pages line-of-business application. This example application will be similar to those you might write yourself and deploy to your users on a web or intranet site via a browser. This book takes a code-first approach in which your database will be created and seeded programmatically. You won't need to create the database through your database engine's interface. Instead, you will be shown how to define your data model in Entity Framework, and then let Entity Framework do the work of creating your database and schema for you. From there you will learn how to seed your database with example data, then to implement the common, so-called CRUD operations consisting of creating, retrieving, updating, and deleting rows of data. By the end of the book you will have built a well-designed application that you can use as the basis for future applications that you create in your job. What You Will Learn Download and install Entity Framework Core 5 Perform create, read, update, and delete (CRUD) operations Create and seed a database with example data using Entity Framework Core 5 Incrementally add new database functionality through Entity Framework Core 5 migrations Recognize when to take advantage of new features introduced in Entity Framework Core 5 Deliver line-of-business applications using ASP.NET Core that run in a browser Who This Books Is For Developers who are familiar with C# and the .NET Framework who want to learn database access using Entity Framework Core 5. For developers creating web-based, line-of-business applications who want to create those applications more quickly and efficiently when databases are involved. Table of Contents About the Author About the Technical Reviewer Introduction Part I: Getting Started Chapter 1: Installation Install Visual Studio Create a Project Install Entity Framework Install the Core Tools Package SQL Server Database Summary Chapter 2: Project Structure Core Project Unit Testing Overview Data Access Layer Project Main Project References Summary Part II: Core Features Chapter 3: Entities Person Entity Address Entity Simple Navigation Property Entity Property Constraints Entity Schema Attributes More Entity Schema Attributes Mapping of the Primary Key Column Enum Mapping Entity Inheritance Mapping Table-per-Hierarchy Table-per-Type Summary Chapter 4: Database Context Creating a Simple Database Context Connecting to Our Database Accessing Entities in a Database Context Saving Entity Changes Configuring a Database Context Set a Database Schema for All Entities Composite Key Constraint Primary Key Constraint Default Property Value Hardcoded Default Value SQL Computer Default Value Foreign Key Relationships Summary Chapter 5: Creating a Database from Code Setting the Connection String Creating the Initial Migration Creating the Database from the Migration Connect to the New Database from Visual Studio Summary Chapter 6: Seeding Data Populating Lookup Data Seeding Test Persons Seeding Addresses Summary Chapter 7: Getting Data LINQ Queries Select Anonymous Types Select Object Transformation Joins in LINQ Select the Navigation Property Sorting Data Method Syntax Queries Testing Our Data Summary Chapter 8: Inserting Data Inserting the Root Entity Inserting Child Records Primary Key Values Identity Seeded Primary Key Guid Primary Key Non-computed Primary Key Foreign Key Values Default Values Record Insertion Integration Tests Summary Chapter 9: Updating Data Updating the Root Entity Updating a Child Entity Integration Test Summary Chapter 10: Deleting Data Deleting the Root Entity Deleting a Child Entity Cascade Delete Client Set Null Delete Behavior Restrict Delete Behavior Set Null Delete Behavior Integration Test Summary Chapter 11: Navigation Properties Mapping a Parent Entity in a One-to-Many Relationship Mapping a Related Entity to Parent One-to-Many Integration Test Many-to-Many Relationships Map a Relationship Through Navigation Properties Create and Run Migration Many-to-Many Integration Test Summary Part III: Advanced Features Chapter 12: Aggregations Unit Test Setup Count Adding Age to Person Min Max Average Average Unit Test Sum Group By Direct Group By Group By with Count Group By with Min Group By with Max Group By with Average Group By with Sum Summary Chapter 13: Stored Procedures Add Stored Procedures to a Database Set Up Unit Tests Test the GetPersonsByState Stored Procedure Test the AddLookUpItem Stored Procedure Summary Chapter 14: Migrations What Is a Migration? How to Add a Migration? The Migration API Common Schema Commands Add a Column to a Table Change a Column in a Table Common Data Commands Inserting Data Deleting Data Delete a Single Row Delete Multiple Rows of Data Update Data in a Migration How to Run Migrations Update to the Most Recent Migration Migrate to a Specific Migration Run Migration from Code Automatic Data Migrations Summary Part IV: A Model Web Application Chapter 15: Authentication on the Web Install Identity NuGet Packages Initialize Identity on App Startup Scaffold UI Update Database Updating UI Summary Chapter 16: Displaying Data on the Web Scaffolding UI Generated List View and Model Generated Details View and Model Adding Addresses to the Details View Adding Contacts to Navigation Testing the App Adding Some Polish Summary Chapter 17: Inserting Data on the Web Generated Create Razor Page Generated View Generated Model Person Model Validation Adding Addresses Address Model Validation Enforce Address Validation in Database Updating UI Update the Razor Page Model Running the App Adding Some Polish Update the Model Update the UI Summary Chapter 18: Updating Data on the Web Generated Edit Razor Page View Generated Edit Razor Model Add a Friendly Address Update Update the Model Update the UI Running the App Summary Chapter 19: Deleting Data on the Web Generated Delete Razor Page View Generated Model Updating Page Controller Code to Delete Addresses Running the App Showing a Person’s Address on the Delete Form Update the Page Controller Update the UI Summary Chapter 20: Reporting on the Web Creating the Razor Page Updating the Razor Model Updating the Razor View Add a Link to Navigation Running the Report Adding Pagination Adding Sample Data Adding Pagination Support Updating the Model for Pagination Add Pagination to the Razor View Running the Finished Report Summary Chapter 21: Authorization on the Web Enable Roles Add Test Users Add and Assign Roles on Startup Enforce Authorization Authorize the Contacts Menu Item Secure Razor Pages Page Access Roles Base Secured Page Model Secure the Contacts Index Page Secure the Contact Details Page Secure the Create Contact Page Secured Contact Edit Page Secured Contact Delete Page Summary Part V: Learning More Chapter 22: Delving Deeper Chapter 23: Conclusion Index
دانلود کتاب Beginning Entity Framework Core 5 : From Novice to Professional