Mastering Entity Framework Core 2.0

Learn how to leverage the features of the new Entity Framework Core APIs and use them to build pure .NET Core applications.
Preview in Mapt

Mastering Entity Framework Core 2.0

Prabhakaran Anbazhagan

1 customer reviews
Learn how to leverage the features of the new Entity Framework Core APIs and use them to build pure .NET Core applications.

Quick links: > What will you learn?> Table of content> Product reviews

eBook
$5.00
RRP $39.99
Save 87%
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
$5.00
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook

Frequently bought together


Mastering Entity Framework Core 2.0 Book Cover
Mastering Entity Framework Core 2.0
$ 39.99
$ 5.00
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 5.00
Buy 2 for $10.00
Save $65.98
Add to Cart

Book Details

ISBN 139781788294133
Paperback361 pages

Book Description

Being able to create and maintain data-oriented applications has become crucial in modern programming. This is why Microsoft came up with Entity Framework so architects can optimize storage requirements while also writing efficient and maintainable application code. This book is a comprehensive guide that will show how to utilize the power of the Entity Framework to build efficient .NET Core applications. It not only teaches all the fundamentals of Entity Framework Core but also demonstrates how to use it practically so you can implement it in your software development.

The book is divided into three modules. The first module focuses on building entities and relationships. Here you will also learn about different mapping techniques, which will help you choose the one best suited to your application design. Once you have understood the fundamentals of the Entity Framework, you will move on to learn about validation and querying in the second module. It will also teach you how to execute raw SQL queries and extend the Entity Framework to leverage Query Objects using the Query Object Pattern. The final module of the book focuses on performance optimization and managing the security of your application. You will learn to implement failsafe mechanisms using concurrency tokens. The book also explores row-level security and multitenant databases in detail.

By the end of the book, you will be proficient in implementing Entity Framework on your .NET Core applications.

Table of Contents

Chapter 1: Kickstart - Introduction to Entity Framework Core
Prerequisites
Creating a new project
Installing Entity Framework
Data models
Database context
Registering the context in services (.NET Core DI)
Creating and seeding databases
CRUD operations
Summary
Chapter 2: The Other Way Around – Database First Approach
Preparing the database
Creating  new project
Reverse engineering the database
Registering context in services (.NET Core DI)
Performing CRUD operations
Summary
Chapter 3: Relationships – Terminology and Conventions
Understanding relationship terms
Conventions in a relationship
Summary
Chapter 4: Building Relationships – Understanding Mapping
Relationships
Fluent API
Summary
Chapter 5: Know the Validation – Explore Inbuilt Validations
Diving into built-in validations
Required field validation
EmailAddress field validation
Compare field validation
Url field validation
MinLength field validation
MaxLength field validation
RegularExpression field validation
Summary
Chapter 6: Save Yourself – Hack Proof Your Entities
Client-side validation
Validating data without client-side scripting
Custom validation
Remote validation
Summary
Chapter 7: Going Raw – Leveraging SQL Queries in LINQ
Basic raw SQL queries
Building parameterized queries
Composing with LINQ
Executing SQL query without a DBSet or POCO
Summary
Chapter 8: Query Is All We Need – Query Object Pattern
Introduction to query objects
Improving repositories with the query object pattern
Composing queries with commands
Enhancing queries with expression trees
Summary
Chapter 9: Fail Safe Mechanism – Transactions
Default behavior of a transaction
Creating a simple transaction
Creating a cross-context transaction
Leveraging transactions between multiple technologies
Summary
Chapter 10: Make It Real – Handling Concurrencies
Handling concurrency in EF
Introducing concurrency tokens
Non-timestamp based concurrency tokens
Timestamp-based concurrency tokens
Handling concurrency conflicts
Summary
Chapter 11: Performance – It's All About Execution Time
The AsNoTracking() method
Detecting changes
Asynchronous operations
Unnecessary volume returned
The N+1 Select problem
More data than required
Mismatched data types
Missing indexes
Summary
Chapter 12: Isolation – Building a Multi-Tenant Database
Authentication in the blogging system
Row-Level Security
Multi-tenancy
Summary

What You Will Learn

  • Create databases and perform CRUD operations on them
  • Understand and build relationships (related to entities, keys, and properties)
  • Understand in-built, custom, and remote validation (both client and server side)
  • You will learn to handle concurrency to build responsive applications
  • You will handle transactions and multi-tenancy while also improving performance

Authors

Table of Contents

Chapter 1: Kickstart - Introduction to Entity Framework Core
Prerequisites
Creating a new project
Installing Entity Framework
Data models
Database context
Registering the context in services (.NET Core DI)
Creating and seeding databases
CRUD operations
Summary
Chapter 2: The Other Way Around – Database First Approach
Preparing the database
Creating  new project
Reverse engineering the database
Registering context in services (.NET Core DI)
Performing CRUD operations
Summary
Chapter 3: Relationships – Terminology and Conventions
Understanding relationship terms
Conventions in a relationship
Summary
Chapter 4: Building Relationships – Understanding Mapping
Relationships
Fluent API
Summary
Chapter 5: Know the Validation – Explore Inbuilt Validations
Diving into built-in validations
Required field validation
EmailAddress field validation
Compare field validation
Url field validation
MinLength field validation
MaxLength field validation
RegularExpression field validation
Summary
Chapter 6: Save Yourself – Hack Proof Your Entities
Client-side validation
Validating data without client-side scripting
Custom validation
Remote validation
Summary
Chapter 7: Going Raw – Leveraging SQL Queries in LINQ
Basic raw SQL queries
Building parameterized queries
Composing with LINQ
Executing SQL query without a DBSet or POCO
Summary
Chapter 8: Query Is All We Need – Query Object Pattern
Introduction to query objects
Improving repositories with the query object pattern
Composing queries with commands
Enhancing queries with expression trees
Summary
Chapter 9: Fail Safe Mechanism – Transactions
Default behavior of a transaction
Creating a simple transaction
Creating a cross-context transaction
Leveraging transactions between multiple technologies
Summary
Chapter 10: Make It Real – Handling Concurrencies
Handling concurrency in EF
Introducing concurrency tokens
Non-timestamp based concurrency tokens
Timestamp-based concurrency tokens
Handling concurrency conflicts
Summary
Chapter 11: Performance – It's All About Execution Time
The AsNoTracking() method
Detecting changes
Asynchronous operations
Unnecessary volume returned
The N+1 Select problem
More data than required
Mismatched data types
Missing indexes
Summary
Chapter 12: Isolation – Building a Multi-Tenant Database
Authentication in the blogging system
Row-Level Security
Multi-tenancy
Summary

Book Details

ISBN 139781788294133
Paperback361 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 5.00
ASP.NET Core: Cloud-ready, Enterprise Web Application Development Book Cover
ASP.NET Core: Cloud-ready, Enterprise Web Application Development
$ 79.99
$ 5.00
ASP.NET Core 2 High Performance - Second Edition Book Cover
ASP.NET Core 2 High Performance - Second Edition
$ 39.99
$ 5.00
Mastering Machine Learning Algorithms Book Cover
Mastering Machine Learning Algorithms
$ 35.99
$ 5.00
Building Microservices with .NET Core 2.0 - Second Edition Book Cover
Building Microservices with .NET Core 2.0 - Second Edition
$ 35.99
$ 5.00
Azure for Architects Book Cover
Azure for Architects
$ 35.99
$ 5.00