Book description
Leverage the full potential of Entity Framework with this collection of powerful and easy-to-follow recipes
About 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 Framework
Who This Book Is For
This 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 Core
In Detail
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.
Style and approach
Filled 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.
Table of contents
-
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
- Preface
- 1. Improving Entity Framework in the Real World
- 2. Mapping Entities
-
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
- 4. Transactions and Concurrency Control
- 5. Querying
- 6. Advanced Scenarios
- 7. Performance and Scalability
-
A. Pitfalls
- Introduction
- GroupBy executes on the client side
- Table per class hierarchy requires nullable columns for derived classes
- References not eagerly fetched are lost
- Date/time operations are not supported
- Paging in SQL Server earlier than 2012
- Database null semantics
- Migrations and contexts with parameterized constructors
- Migrations with contexts in different projects
- Accessing the service provider too soon
- Setting the maximum string length
- Mapping discriminator columns
- Composite primary keys
- Refreshing entities
- Cascading entity deletes
- Index
Product information
- Title: Entity Framework Core Cookbook - Second Edition
- Author(s):
- Release date: November 2016
- Publisher(s): Packt Publishing
- ISBN: 9781785883309
You might also like
book
Entity Framework 6 Recipes, Second Edition
Entity Framework 6 Recipes provides an exhaustive collection of ready-to-use code solutions for Entity Framework, Microsoft's …
book
Mastering Entity Framework Core 2.0
Learn how to leverage the features of the new Entity Framework Core APIs and use them …
book
Beginning Entity Framework Core 2.0: Database Access from .NET
Use the valuable Entity Framework Core 2.0 tool in ASP.NET and the .NET Framework to eliminate …
book
Programming Entity Framework: Code First
Take advantage of the Code First data modeling approach in ADO.NET Entity Framework, and learn how …