万本电子书0元读

万本电子书0元读

顶部广告

Entity Framework Core Cookbook - Second Edition电子书

售       价:¥

9人正在读 | 0人评论 9.8

作       者:Ricardo Peres

出  版  社:Packt Publishing

出版时间:2016-11-01

字       数:241.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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.
目录展开

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

Hooking infrastructure services

Using other databases

How to do it…

7. Performance and Scalability

Introduction

Improving the performance of queries

Getting ready

How to do it…

Modifications

Updates

Deletes

Queries

SQL

LINQ

See also

Testing and profiling queries

How to do it…

Logging

Database profiler

Real time monitoring

Testing

See also

Using asynchronous operations

Getting ready

How to do it…

Queries

Modifications

See also

Eager loading

Getting ready

How to do it…

How it works…

See also

Using the cache

Getting ready

How to do it…

How it works…

There's more…

A. Pitfalls

Introduction

GroupBy executes on the client side

Problem

How to fix it…

Table per class hierarchy requires nullable columns for derived classes

Problem

How to solve it…

References not eagerly fetched are lost

Problem

How to solve it…

Date/time operations are not supported

Problem

How to solve it…

Paging in SQL Server earlier than 2012

Problem

How to solve it…

Database null semantics

Problem

How to solve it…

Migrations and contexts with parameterized constructors

Problem

How to solve it…

Migrations with contexts in different projects

Problem

How to solve it…

Accessing the service provider too soon

Problem

How to solve it…

Setting the maximum string length

Problem

How to solve it…

Mapping discriminator columns

Problem

How to solve it…

Composite primary keys

Problem

How to solve it…

Refreshing entities

Problem

How to solve it…

Cascading entity deletes

Problem

How to solve it…

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部