Entity Framework Core Cookbook - Second Edition
eBook - ePub

Entity Framework Core Cookbook - Second Edition

  1. 324 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Entity Framework Core Cookbook - Second Edition

About this book

Leverage the full potential of Entity Framework with this collection of powerful and easy-to-follow recipesAbout This Book• Learn how to use the new features of Entity Framework Core 1• Improve your queries by leveraging some of the advanced features• Avoid common pitfalls• Make the best of your.NET APIs by integrating with Entity FrameworkWho This Book Is ForThis book is for.NET developers who work with relational databases on a daily basis and understand the basics of Entity Framework, but now want to use it in a more efficient manner. You are expected to have some prior knowledge of Entity Framework.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 CoreIn DetailEntity 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.Style and approachFilled with rich code-based examples, this book takes a recipe-based approach that will teach.NET developers to improve their understanding of Entity Framework and help them effortlessly apply this knowledge in everyday situations.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Entity Framework Core Cookbook - Second Edition by Ricardo Peres in PDF and/or ePUB format, as well as other popular books in Informatik & Microsoft-Programmierung. We have over one million books available in our catalogue for you to explore.

Information

Entity Framework Core Cookbook - Second Edition


Table of Contents

Entity Framework Core Cookbook - Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Improving Entity Framework in the Real World
Introduction
Improving Entity Framework by using a code-first approach
Getting ready
How to do it…
How it works…
There's more…
Convention over configuration
Model-View-Controller
Single Responsibility Principle
Provider Model
Testing
See also
Unit testing and mocking
Getting ready
How to do it…
How it works…
There's more…
One class under test
Integration tests
Arrange, Act, Assert
Mocking
Creating databases from code
Getting ready
How to do it…
How it works…
There's more…
See also
Creating mock database connections
How to do it…
How it works…
See also
Implementing the repository pattern
Getting ready
How to do it…
How it works…
There's more…
Dependency Inversion Principle
Repository and caching
Mocking
Where generic constraint
See also
Implementing the unit of work pattern
Getting ready
How to do it…
How it works…
There's more…
Call per change
Interface Segregation Principle
Refactoring
See also
2. Mapping Entities
Introduction
Mapping non-public members
Getting ready
How to do it…
How it works…
There's more…
See also
Mapping interfaces
Getting ready
How to do it…
How it works…
See also
Shadow properties
Getting ready
How to do it…
How it works…
See also
Creating one-to-one maps
Getting ready
How to do it…
How it works…
There's more…
See also
Creating one-to-many maps
Getting ready
How to do it…
How it works…
There's more…
See also
Creating many-to-many maps
Getting ready
How to do it…
How it works…
There's more…
See also
Creating custom conventions
Getting ready
How to do it…
How it works…
There's more…
See also
Using sequence key generators
Getting ready
How to do it…
How it works...
There's more…
See also
Using GUIDs as keys
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing inheritance – Table per Class hierarchy
Getting ready
How to do it…
How it works…
There's more…
3. Validation and Changes
Introduction
Validating simple properties
Getting ready
How to do it…
How it works…
There's more…
See also
Validating the whole entity
Getting ready
How to do it…
How it works…
See also
Validating groups of entities
How to do it…
How it works…
See also
Intercepting saving changes
Getting ready
How to do it…
How it works…
See also
Intercepting property changes
Getting ready
How to do it…
How it works…
See also
Setting the state of an entity
Getting ready
How to do it…
How it works…
There's more…
See also
Improving MVC UI with entity framework validation
Getting ready
How to do it…
How it works…
There's more…
Understanding the HTML helper
See also
Inserting, updating, and deleting entities with stored procedures
Getting ready
How to do it…
How it works…
There's more…
See also
Updating the database from model changes
Getting ready
How to do it…
How it works…
There's more…
See also
Dumping the SQL script for the database creation
Getting ready
How to do it…
How it works…
There's more…
See also
4. Transactions and Concurrency Control
Introduction
Using explicit transactions
Atomic
Consistent
Isolation
Durability
Getting ready
How to do it…
How it works…
See also
Using transactions in custom SQL operations
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing optimistic concurrency in SQL Server
Getting ready
How to do it…
How it works…
There's more…
Database wins
Client wins/last one wins
See also
Implementing optimistic concurrency in a database-agnostic way
Getting ready
How to do it…
How it works…
There's more…
See also
5. Querying
Introduction
Executing client-side functions in LINQ queries
Getting ready
How to do it…
How it works…
See also
Mixing SQL with LINQ queries
Getting ready
How to do it…
How it works…
There's more…
See also
Getting entities from the local cache
Getting ready
How to do it…
How it works…
There's more…
See also
Creating filtered collections
Getting ready
How to do it…
How it works…
There's more…
See also
Creating reusable queries
Getting ready
How to do it…
How it works…
There's more…
Extension methods
Naming conflict
See also
Querying shadow properties
Getting ready
How to do it…
How it works…
There's more…
See also
Implementing the query object pattern
Getting ready
How to do it…
How it works…
There's more…
See also
Using dynamic LINQ
Getting ready
How to do it…
How it works…
There's more…
6. Advanced Scenarios
Introduction
Generating entities from the database
Getting ready
How to do it…
How it works…
There's more…
Implementing multitenancy
Getting ready
How to do it…
How it works…
There's more…
Strongly typed bulk operations
Getting ready
How to do it…
How it works…
There's more…
Handling soft deletes
Getting ready
How to do it…
How it works…
See also
Adding logging
Getting ready
How to do it…
How it works…
There's more…
Capturing the audit data
Getting ready
How to do it…
How it works…
See also
Retrieving entity metadata
Getting ready
How to do it…
How it works…
There's more…
See also
Improving MVC applications
Getting ready
How to do it.…
See also ...

Table of contents

  1. Entity Framework Core Cookbook - Second Edition