万本电子书0元读

万本电子书0元读

顶部广告

Mastering Entity Framework电子书

售       价:¥

67人正在读 | 0人评论 9.8

作       者:Rahul Rajat Singh

出  版  社:Packt Publishing

出版时间:2015-02-24

字       数:211.5万

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

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
This book is for .NET developers who are developing data-driven applications using ADO.NET or other data access technologies. This book is going to give you everything you need to effectively develop and manage data-driven applications using Entity Framework.
目录展开

Mastering Entity Framework

Table of Contents

Mastering Entity Framework

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Instant updates on new Packt books

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Introduction to Entity Framework

Entity Framework modeling and persistence

Understanding the Entity Data Model

Understanding the ObjectContext class

Development styles and different Entity Framework approaches

Comparing the development styles

The Database First approach

The Model First approach

The Code First approach

Entity Framework Database First approach

Entity Framework Model First approach

Entity Framework Code First approach

Performing CRUD operations using Entity Framework

Reading a list of items

Reading a specific item

Creating a new item

Updating an existing item

Deleting an item

Choosing persistence approaches

Summary

2. Entity Framework DB First – Managing Entity Relationships

Understanding database relationships

One-to-many relationship

One-to-one relationship

Many-to-many relationship

Creating the Entity model

Modeling a one-to-many relationship

Modeling a one-to-one relationship using Entity Framework

Modeling a many-to-many relationship using Entity Framework

Using navigation properties for data access

Retrieving a specific item

Retrieving a list of items

Adding an item

Updating an item

Deleting an item

Entity Framework – behind the scenes

Summary

3. Entity Framework DB First – Performing Model Validations

Model validations using Entity Framework

Model validations using partial class methods

Understanding partial methods

Using partial methods to perform model validations

Model validations using data annotations

Specifying validation rules using data annotations

Validating the required fields

Validating the length of fields

Regular expression-based validations

Triggering validations using data annotations

Trigger validations in data binding environments

Trigger validations in non-data binding environments

Implementing custom validations using data annotations

Summary

4. Entity Framework DB First – Inheritance Relationships between Entities

Domain modeling using inheritance in Entity Framework

The Table per Type inheritance

Generating the default Entity Data Model

Deleting default relationships

Adding inheritance relationships between entities

Using the entities via the DBContext object

The Table per Class Hierarchy inheritance

Generating the default Entity Data Model

Adding concrete classes to the Entity Data Model

Mapping the concrete class properties to the respective tables and columns

Making the base class entity abstract

Using the entities via the DBContext object

The Table per Concrete Class inheritance

Generating the default Entity Data Model

Creating the abstract class

Modifying the CDSL to cater to the change

Specifying the mapping to implement the TPT inheritance

Using the entities via the DBContext object

Choosing the inheritance strategy

Summary

5. Entity Framework DB First – Using Views, Stored Procedures, and Functions

Using views, procedures, and functions

Using Entity Framework with views

Using Entity Framework with stored procedures

Defining stored procedures

Using Entity Framework with functions

Using scalar functions

Using table valued functions

Summary

6. Entity Framework Code First – Domain Modeling and Managing Entity Relationships

Understanding the Entity Framework Code First approach

Understanding the Code First conventions and configurations

Implementing Entity Framework Code First

More on domain class configurations

Managing Entity relationships using the Code First approach

Implementing one-to-many relationships

Implementing one-to-one relationships

Implementing many-to-many relationships

Inheritance with the Entity Framework Code First approach

Implementing the TPT inheritance

Implementing the TPH inheritance

Implementing the TPC inheritance

Summary

7. Entity Framework Code First – Managing Database Creation and Seeding Data

Managing database connections

Managing connections using a configuration file

Using the existing ConnectionString

Using an existing connection

Managing database initialization

Setting the initialization strategy

Seeding data

Summary

8. Querying the Entity Data Model – LINQ to Entities

Understanding LINQ to Entities

Querying data using LINQ to Entities

Using LINQ to Entities – an example-based approach

Executing simple queries

Using the navigation properties with LINQ to Entities

Filtering data using LINQ to Entities

Using LINQ projections with LINQ to Entities

Grouping using LINQ to Entities

Ordering using LINQ to Entities

Aggregate operators with LINQ to Entities

Count

Sum

Min

Max

Average

Partitioning/paging data using LINQ to Entities

Skip

Take

Implementing paging

Implementing join using LINQ to Entities

Lazy loading and eager loading

Lazy loading

Eager loading

Summary

9. Querying the Object Model – Entity SQL

Understanding Entity SQL

Understanding EntityConnection

Entity SQL with ObjectQuery

Querying data using Entity SQL with ObjectQuery

Executing parameterized Entity SQL with ObjectQuery

Navigation properties using Entity SQL with ObjectQuery

Aggregate functions with Entity SQL using ObjectQuery

Count

Sum

Min

Max

Average

Ordering data with Entity SQL using ObjectQuery

Grouping data using Entity SQL with ObjectQuery

Partitioning/paging data using Entity SQL ObjectQuery

Skip

Limit

Implementing paging

Using Entity SQL with EntityCommand

Querying data using Entity SQL with EntityCommand

Parameterized Entity SQL with EntityCommand

Summary

10. Managing Concurrency Using Entity Framework

Understanding concurrency

Understanding optimistic concurrency

Ignore the conflict/forcing updates

Partial updates

Warn/ask the user

Reject the changes

Understanding pessimistic concurrency

Implementing optimistic concurrency using Entity Framework

Entity Framework's default concurrency

Designing applications to handle field level concurrency

Implementing field level concurrency

Implementing RowVersion for concurrency

Entity Framework and pessimistic concurrency

Summary

11. Managing Transactions Using Entity Framework

Understanding transactions

Setting up the test environment

Entity Framework's default transaction handling

Using TransactionScope to handle transactions

Managing transactions using Entity Framework 6

Using an existing transaction

Choosing the appropriate transaction management

Summary

12. Implementing a Small Blogging Platform Using Entity Framework

Understanding the application requirements

Visualizing our database design

Creating the Entity Data Model

Creating the entity classes

The User entity

The Role entity

The Category entity

The Blog entity

The Comment entity

Creating relationships and navigation properties

The User entity

The Role entity

The Category entity

The Blog entity

The Comment entity

Implementing the DbContext class

Performing data access

Understanding the Repository pattern

Understanding Unit of Work

Managing categories

Listing categories

Adding a category

Updating a category

Deleting a category

Managing blogs

Adding a new blog

Updating a blog

Deleting a blog

Listing blogs on the home page

Showing a single blog

Managing comments

Listing categories

Adding a comment

Deleting a comment

Using other Entity Framework approaches

Summary

Index

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部