Entity Framework Core Cookbook - Second Edition

Leverage the full potential of Entity Framework with this collection of powerful and easy-to-follow recipes
Preview in Mapt

Entity Framework Core Cookbook - Second Edition

Ricardo Peres

1 customer reviews
Leverage the full potential of Entity Framework with this collection of powerful and easy-to-follow recipes
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99 p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Entity Framework Core Cookbook - Second Edition Book Cover
Entity Framework Core Cookbook - Second Edition
$ 39.99
$ 28.00
Kubernetes Cookbook - Second Edition Book Cover
Kubernetes Cookbook - Second Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $40.98
Add to Cart

Book Details

ISBN 139781785883309
Paperback324 pages

Book Description

Entity Framework is a highly recommended Object Relation Mapping tool used to build complex systems. In order to survive in this growing market, the knowledge of a framework that helps provide easy access to databases, that is, Entity Framework has become a necessity. This book will provide .NET developers with this knowledge and guide them through working efficiently with data using Entity Framework Core.

You will start off by learning how to efficiently use Entity Framework in practical situations. You will gain a deep understanding of mapping properties and find out how to handle validation in Entity Framework. The book will then explain how to work with transactions and stored procedures along with improving Entity Framework using query libraries. Moving on, you will learn to improve complex query scenarios and implement transaction and concurrency control. You will then be taught to improve and develop Entity Framework in complex business scenarios. With the concluding chapter on performance and scalability, this book will get you ready to use Entity Framework proficiently.

Table of Contents

Chapter 1: Improving Entity Framework in the Real World
Introduction
Improving Entity Framework by using a code-first approach
Unit testing and mocking
Creating databases from code
Creating mock database connections
Implementing the repository pattern
Implementing the unit of work pattern
Chapter 2: Mapping Entities
Introduction
Mapping non-public members
Mapping interfaces
Shadow properties
Creating one-to-one maps
Creating one-to-many maps
Creating many-to-many maps
Creating custom conventions
Using sequence key generators
Using GUIDs as keys
Implementing inheritance – Table per Class hierarchy
Chapter 3: Validation and Changes
Introduction
Validating simple properties
Validating the whole entity
Validating groups of entities
Intercepting saving changes
Intercepting property changes
Setting the state of an entity
Improving MVC UI with entity framework validation
Inserting, updating, and deleting entities with stored procedures
Updating the database from model changes
Dumping the SQL script for the database creation
Chapter 4: Transactions and Concurrency Control
Introduction
Using explicit transactions
Using transactions in custom SQL operations
Implementing optimistic concurrency in SQL Server
Implementing optimistic concurrency in a database-agnostic way
Chapter 5: Querying
Introduction
Executing client-side functions in LINQ queries
Mixing SQL with LINQ queries
Getting entities from the local cache
Creating filtered collections
Creating reusable queries
Querying shadow properties
Implementing the query object pattern
Using dynamic LINQ
Chapter 6: Advanced Scenarios
Introduction
Generating entities from the database
Implementing multitenancy
Strongly typed bulk operations
Handling soft deletes
Adding logging
Capturing the audit data
Retrieving entity metadata
Improving MVC applications
Hooking infrastructure services
Using other databases
Chapter 7: Performance and Scalability
Introduction
Improving the performance of queries
Testing and profiling queries
Using asynchronous operations
Eager loading
Using the cache

What You Will Learn

  • Master the technique of using sequence key generators
  • Validate groups of entities that are to be saved / updated
  • Improve MVC applications that cover applications developed using ASP.NET MVC Core 1
  • Retrieve database information (table, column names, and so on) for entities
  • Discover optimistic concurrency control and pessimistic concurrency control.
  • Implement Multilatency on the data side of things.
  • Enhance the performance and/or scalability of Entity Framework Core
  • Explore and overcome the pitfalls of Entity Framework Core

Authors

Table of Contents

Chapter 1: Improving Entity Framework in the Real World
Introduction
Improving Entity Framework by using a code-first approach
Unit testing and mocking
Creating databases from code
Creating mock database connections
Implementing the repository pattern
Implementing the unit of work pattern
Chapter 2: Mapping Entities
Introduction
Mapping non-public members
Mapping interfaces
Shadow properties
Creating one-to-one maps
Creating one-to-many maps
Creating many-to-many maps
Creating custom conventions
Using sequence key generators
Using GUIDs as keys
Implementing inheritance – Table per Class hierarchy
Chapter 3: Validation and Changes
Introduction
Validating simple properties
Validating the whole entity
Validating groups of entities
Intercepting saving changes
Intercepting property changes
Setting the state of an entity
Improving MVC UI with entity framework validation
Inserting, updating, and deleting entities with stored procedures
Updating the database from model changes
Dumping the SQL script for the database creation
Chapter 4: Transactions and Concurrency Control
Introduction
Using explicit transactions
Using transactions in custom SQL operations
Implementing optimistic concurrency in SQL Server
Implementing optimistic concurrency in a database-agnostic way
Chapter 5: Querying
Introduction
Executing client-side functions in LINQ queries
Mixing SQL with LINQ queries
Getting entities from the local cache
Creating filtered collections
Creating reusable queries
Querying shadow properties
Implementing the query object pattern
Using dynamic LINQ
Chapter 6: Advanced Scenarios
Introduction
Generating entities from the database
Implementing multitenancy
Strongly typed bulk operations
Handling soft deletes
Adding logging
Capturing the audit data
Retrieving entity metadata
Improving MVC applications
Hooking infrastructure services
Using other databases
Chapter 7: Performance and Scalability
Introduction
Improving the performance of queries
Testing and profiling queries
Using asynchronous operations
Eager loading
Using the cache

Book Details

ISBN 139781785883309
Paperback324 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Learning ASP.NET Core MVC Programming Book Cover
Learning ASP.NET Core MVC Programming
$ 35.99
$ 25.20
ASP.NET Core and Angular 2 Book Cover
ASP.NET Core and Angular 2
$ 35.99
$ 25.20
Mastering C# and .NET Framework Book Cover
Mastering C# and .NET Framework
$ 35.99
$ 25.20
ASP.NET Core Essentials Book Cover
ASP.NET Core Essentials
$ 27.99
$ 19.60
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition Book Cover
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition
$ 39.99
$ 28.00
Bootstrap for ASP.NET MVC - Second Edition Book Cover
Bootstrap for ASP.NET MVC - Second Edition
$ 31.99
$ 22.40