Muutke küpsiste eelistusi

E-raamat: Entity Framework 6 Recipes

  • Formaat: PDF+DRM
  • Ilmumisaeg: 29-Nov-2013
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781430257899
Teised raamatud teemal:
  • Formaat - PDF+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: PDF+DRM
  • Ilmumisaeg: 29-Nov-2013
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781430257899
Teised raamatud teemal:

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Entity Framework 6 Recipes provides an exhaustive collection of ready-to-use code solutions for Entity Framework, Microsoft's model-centric, data-access platform for the .NET Framework and ASP.NET development. With this book, you will learn the core concepts of Entity Framework through a broad range of clear and concise solutions to everyday data access tasks. Armed with this experience, you will be ready to dive deep into Entity Framework, experiment with new approaches, and develop ways to solve even the most difficult data access challenges. If you are a developer who likes to learn by example, then this is the right book for you.





Gives ready-to-use, real-world recipes to help you with everyday tasks Places strong focus on DbContext and the Code First approach Covers new features such as Asynch Query and Save, Codebased Configuration, Connection Resiliency, Dependency Resolution, and much more
About the Authors xxvii
About the Technical Reviewer xxix
Preface xxxi
Chapter 1 Getting Started with Entity Framework
1(10)
1-1 A Brief Tour of the Entity Framework World
2(4)
The History
2(1)
The Model
3(1)
The Layers
4(1)
The Terminology
4(1)
The Code
5(1)
Visual Studio
6(1)
1-2 Using Entity Framework
6(5)
Chapter 2 Entity Data Modeling Fundamentals
11(44)
2-1 Creating a Simple Model
11(7)
Problem
11(1)
Solution
11(5)
How It Works
16(1)
Best Practice
17(1)
2-2 Creating a Model from an Existing Database
18(5)
Problem
18(1)
Solution
18(2)
How It Works
20(3)
2-3 Modeling a Many-to-Many Relationship with No Payload
23(3)
Problem
23(1)
Solution
23(1)
How It Works
24(2)
2-4 Modeling a Many-to-Many Relationship with a Payload
26(3)
Problem
26(1)
Solution
26(1)
How It Works
27(1)
Best Practice
28(1)
2-5 Modeling a Self-Referencing Relationship with a Code-First Approach
29(3)
Problem
29(1)
Solution
29(1)
How It Works
30(2)
2-6 Splitting an Entity Among Multiple Tables
32(3)
Problem
32(1)
Solution
32(1)
How It Works
33(2)
2-7 Splitting a Table Among Multiple Entities
35(3)
Problem
35(1)
Solution
35(2)
How It Works
37(1)
2-8 Modeling Table per Type Inheritance
38(3)
Problem
38(1)
Solution
38(1)
How It Works
39(2)
2-9 Using Conditions to Filter an ObjectSet
41(4)
Problem
41(1)
Solution
41(2)
How It Works
43(2)
2-10 Modeling Table per Hierarchy Inheritance
45(4)
Problem
45(1)
Solution
45(2)
How It Works
47(1)
Best Practice
48(1)
2-11 Modeling Is-a and Has-a Relationships Between Two Entities
49(2)
Problem
49(1)
Solution
49(1)
How It Works
50(1)
2-12 Creating, Modifying, and Mapping Complex Types
51(4)
Problem
51(1)
Solution
51(2)
How It Works
53(2)
Chapter 3 Querying an Entity Data Model
55(52)
3-1 Querying Asynchronously
55(6)
Solution
55(5)
How It Works
60(1)
3-2 Updating with Native SQL Statements
61(3)
Problem
61(1)
Solution
61(1)
How It Works
62(1)
Best Practice
63(1)
3-3 Fetching Objects with Native SQL Statements
64(2)
Problem
64(1)
Solution
64(2)
How It Works
66(1)
3-4 Querying a Model with Entity SQL
66(4)
Problem
66(1)
Solution
66(2)
How It Works
68(2)
3-5 Finding a Master That Has Detail in a Master-Detail Relationship
70(2)
Problem
70(1)
Solution
70(2)
How It Works
72(1)
3-6 Setting Default Values in a Query
72(3)
Problem
72(1)
Solution
72(2)
How It Works
74(1)
3-7 Returning Multiple Result Sets from a Stored Procedure
75(2)
Problem
75(1)
Solution
75(1)
How It Works
76(1)
3-8 Comparing Against a List of Values
77(3)
Problem
77(1)
Solution
77(2)
How It Works
79(1)
3-9 Filtering Related Entities
80(3)
Problem
80(1)
Solution
80(2)
How It Works
82(1)
3-10 Applying a Left-Outer Join
83(3)
Problem
83(1)
Solution
83(2)
How It Works
85(1)
3-11 Ordering by Derived Types
86(3)
Problem
86(1)
Solution
86(3)
How It Works
89(1)
3-12 Paging and Filtering
89(2)
Problem
89(1)
Solution
89(2)
How It Works
91(1)
3-13 Grouping by Date
91(3)
Problem
91(1)
Solution
92(2)
How It Works
94(1)
3-14 Flattening Query Results
94(2)
Problem
94(1)
Solution
94(2)
How It Works
96(1)
3-15 Grouping by Multiple Properties
96(4)
Problem
96(1)
Solution
96(3)
How It Works
99(1)
3-16 Using Bitwise Operators in a Filter
100(2)
Problem
100(1)
Solution
100(2)
How It Works
102(1)
3-17 Joining on Multiple Columns
102(5)
Problem
102(1)
Solution
102(3)
How It Works
105(2)
Chapter 4 Using Entity Framework in ASP.NET MVC
107(22)
4.1 Building CRUD Operations in an ASP.NET MVC Page
107(14)
Problem
107(1)
Solution
107(14)
How It Works
121(1)
4-2 Building a Search Query
121(4)
Problem
121(1)
Solution
122(3)
How It Works
125(1)
4-3 Filtering with ASP.NET's URL Routing
125(4)
Problem
125(1)
Solution
126(2)
How It Works
128(1)
Chapter 5 Loading Entities and Navigation Properties
129(54)
5-1 Lazy Loading Related Entities
129(3)
Problem
129(1)
Solution
129(2)
How It Works
131(1)
5-2 Eager Loading Related Entities
132(4)
Problem
132(1)
Solution
132(2)
How It Works
134(2)
5-3 Finding Single Entities Quickly
136(4)
Problem
136(1)
Solution
136(2)
How It Works
138(2)
5-4 Querying In-Memory Entities
140(6)
Problem
140(1)
Solution
140(4)
How It Works
144(2)
5-5 Loading a Complete Object Graph
146(4)
Problem
146(1)
Solution
147(3)
How It Works
150(1)
5-6 Loading Navigation Properties on Derived Types
150(3)
Problem
150(1)
Solution
150(2)
How It Works
152(1)
5-7 Using Include() with Other LINQ Query Operators
153(3)
Problem
153(1)
Solution
153(3)
How It Works
156(1)
5-8 Deferred Loading of Related Entities
156(4)
Problem
156(1)
Solution
156(4)
How It Works
160(1)
5-9 Filtering and Ordering Related Entities
160(3)
Problem
160(1)
Solution
160(3)
How It Works
163(1)
5-10 Executing Aggregate Operations on Related Entities
163(3)
Problem
163(1)
Solution
163(3)
How It Works
166(1)
5-11 Testing Whether an Entity Reference or Entity Collection Is Loaded
166(4)
Problem
166(1)
Solution
166(4)
How It Works
170(1)
5-12 Loading Related Entities Explicitly
170(4)
Problem
170(1)
Solution
170(3)
How It Works
173(1)
5-13 Filtering an Eagerly Loaded Entity Collection
174(4)
Problem
174(1)
Solution
175(2)
How It Works
177(1)
5-14 Modifying Foreign Key Associations
178(5)
Problem
178(1)
Solution
178(2)
How It Works
180(3)
Chapter 6 Beyond the Basics with Modeling and Inheritance
183(52)
6-1 Retrieving the Link Table in a Many-to-Many Association
183(2)
Problem
183(1)
Solution
183(2)
How It Works
185(1)
6-2 Exposing a Link Table as an Entity
185(3)
Problem
185(1)
Solution
185(2)
How It Works
187(1)
6-3 Modeling a Many-to-Many, Self-Referencing Relationship
188(4)
Problem
188(1)
Solution
188(1)
How It Works
189(3)
6-4 Modeling a Self-Referencing Relationship Using Table per Hierarchy Inheritance
192(3)
Problem
192(1)
Solution
192(2)
How It Works
194(1)
6-5 Modeling a Self-Referencing Relationship and Retrieving a Complete Hierarchy
195(3)
Problem
195(1)
Solution
195(3)
How It Works
198(1)
6-6 Mapping Null Conditions in Derived Entities
198(3)
Problem
198(1)
Solution
199(1)
How It Works
200(1)
6-7 Modeling Table per Type Inheritance Using a Nonprimary Key Column
201(5)
Problem
201(1)
Solution
202(3)
How It Works
205(1)
6-8 Modeling Nested Table per Hierarchy Inheritance
206(3)
Problem
206(1)
Solution
206(2)
How It Works
208(1)
6-9 Applying Conditions in Table per Type Inheritance
209(2)
Problem
209(1)
Solution
209(1)
How It Works
210(1)
6-10 Creating a Filter on Multiple Criteria
211(5)
Problem
211(1)
Solution
211(3)
How It Works
214(2)
6-11 Using Complex Conditions with Table per Hierarchy Inheritance
216(6)
Problem
216(1)
Solution
217(2)
How It Works
219(3)
6-12 Modeling Table per Concrete Type Inheritance
222(4)
Problem
222(1)
Solution
222(2)
How It Works
224(2)
6-13 Applying Conditions on a Base Entity
226(4)
Problem
226(1)
Solution
226(3)
How It Works
229(1)
6-14 Creating Independent and Foreign Key Associations
230(1)
Problem
230(1)
Solution
230(1)
How It Works
231(1)
6-15 Changing an Independent Association into a Foreign Key Association
231(4)
Problem
231(1)
Solution
232(2)
How It Works
234(1)
Chapter 7 Working with Object Services
235(22)
7-1 Dynamically Building a Connection String
235(1)
Problem
235(1)
Solution
235(1)
How It Works
236(1)
7-2 Reading a Model from a Database
236(4)
Problem
236(1)
Solution
236(4)
How It Works
240(1)
7-3 Deploying a Model
240(1)
Problem
240(1)
Solution
240(1)
How It Works
241(1)
7-4 Using the Pluralization Service
241(3)
Problem
241(1)
Solution
241(2)
How It Works
243(1)
7-5 Retrieving Entities from the Change Tracker
244(2)
Problem
244(1)
Solution
244(2)
How It Works
246(1)
7-6 Generating a Model from the Command Line
246(1)
Problem
246(1)
Solution
246(1)
How It Works
246(1)
7-7 Working with Dependent Entities in an Identifying Relationship
247(3)
Problem
247(1)
Solution
247(2)
How It Works
249(1)
7-8 Inserting Entities Using a Database Context
250(2)
Problem
250(1)
Solution
250(1)
How It Works
251(1)
7-9 Querying and Saving Asynchronously
252(5)
Problem
252(1)
Solution
252(4)
How It Works
256(1)
Chapter 8 Plain Old CLR Objects
257(38)
8-1 Using POCO
257(5)
Problem
257(1)
Solution
257(5)
How It Works
262(1)
8-2 Loading Related Entities with POCO
262(3)
Problem
262(1)
Solution
262(3)
How It Works
265(1)
8-3 Lazy Loading with POCO
265(3)
Problem
265(1)
Solution
265(3)
How It Works
268(1)
8-4 POCO with Complex Type Properties
268(4)
Problem
268(1)
Solution
268(3)
How It Works
271(1)
8-5 Notifying Entity Framework About Object Changes
272(3)
Problem
272(1)
Solution
272(3)
How It Works
275(1)
8-6 Retrieving the Original (POCO) Object
275(3)
Problem
275(1)
Solution
275(2)
How It Works
277(1)
8-7 Manually Synchronizing the Object Graph and the Change Tracker
278(4)
Problem
278(1)
Solution
279(2)
How It Works
281(1)
8-8 Testing Domain Objects
282(8)
Problem
282(1)
Solution
282(8)
How It Works
290(1)
8-9 Testing a Repository Against a Database
290(5)
Problem
290(1)
Solution
290(3)
How It Works
293(2)
Chapter 9 Using the Entity Framework in N-Tier Applications
295(46)
9-1 Updating Single Disconnected Entities with the Web API
295(7)
Problem
295(1)
Solution
296(5)
How It Works
301(1)
9-2 Updating Disconnected Entities with WCF
302(6)
Problem
302(1)
Solution
302(5)
How It Works
307(1)
9-3 Finding Out What Has Changed with Web API
308(9)
Problem
308(8)
How It Works
316(1)
9-4 Implementing Client-Side Change Tracking with Web API
317(11)
Problem
317(1)
Solution
317(10)
How It Works
327(1)
9-5 Deleting an Entity When Disconnected
328(3)
Problem
328(1)
Solution
328(2)
How It Works
330(1)
9-6 Managing Concurrency When Disconnected
331(4)
Problem
331(1)
Solution
331(3)
How It Works
334(1)
9-7 Serializing Proxies in a WCF Service
335(6)
Problem
335(1)
Solution
335(3)
How It Works
338(3)
Chapter 10 Stored Procedures
341(34)
10-1 Returning an Entity Collection with Code Second
341(4)
Problem
341(1)
Solution
341(4)
How It Works
345(1)
10-2 Returning Output Parameters
345(2)
Problem
345(1)
Solution
345(2)
How It Works
347(1)
10-3 Returning a Scalar Value Result Set
347(2)
Problem
347(1)
Solution
347(2)
How It Works
349(1)
10-4 Returning a Complex Type from a Stored Procedure
349(3)
Problem
349(1)
Solution
349(2)
How It Works
351(1)
10-5 Defining a Custom Function in the Storage Model
352(3)
Problem
352(1)
Solution
352(2)
How It Works
354(1)
10-6 Populating Entities in a Table per Type Inheritance Model
355(3)
Problem
355(1)
Solution
355(2)
How It Works
357(1)
10-7 Populating Entities in a Table per Hierarchy Inheritance Model
358(2)
Problem
358(1)
Solution
358(2)
How It Works
360(1)
10-8 Mapping the Insert, Update, and Delete Actions to Stored Procedures
360(4)
Problem
360(1)
Solution
361(2)
How It Works
363(1)
10-9 Using Stored Procedures for the Insert and Delete Actions in a Many-to-Many Association
364(4)
Problem
364(1)
Solution
364(4)
How It Works
368(1)
10-10 Mapping the Insert, Update, and Delete Actions to Stored Procedures for Table per Hierarchy Inheritance
368(7)
Problems
368(1)
Solution
368(4)
How It Works
372(3)
Chapter 11 Functions
375(38)
11-1 Returning a Scalar Value from a Model-Defined Function
375(5)
Problem
375(1)
Solution
375(3)
How It Works
378(1)
Best Practice
379(1)
11-2 Filtering an Entity Collection Using a Model-Defined Function
380(3)
Problem
380(1)
Solution
380(3)
How It Works
383(1)
11-3 Returning a Computed Column from a Model-Defined Function
383(4)
Problem
383(1)
Solution
384(2)
How It Works
386(1)
11-4 Calling a Model-Defined Function from a Model-Defined Function
387(3)
Problem
387(1)
Solution
387(3)
How It Works
390(1)
11-5 Returning an Anonymous Type from a Model-Defined Function
390(4)
Problem
390(1)
Solution
390(3)
How It Works
393(1)
11-6 Returning a Complex Type from a Model-Defined Function
394(3)
Problem
394(1)
Solution
394(2)
How It Works
396(1)
11-7 Returning a Collection of Entity References from a Model-Defined Function
397(2)
Problem
397(1)
Solution
397(2)
How It Works
399(1)
11-8 Using Canonical Functions in eSQL
399(2)
Problem
399(1)
Solution
400(1)
How It Works
401(1)
11-9 Using Canonical Functions in LINQ
401(3)
Problem
401(1)
Solution
401(2)
How It Works
403(1)
Best Practice
403(1)
11-10 Calling Database Functions in eSQL
404(2)
Problem
404(1)
Solution
404(2)
How It Works
406(1)
11-11 Calling Database Functions in LINQ
406(2)
Problem
406(1)
Solution
406(2)
How It Works
408(1)
11-12 Defining Built-in Functions
408(5)
Problem
408(1)
Solution
408(3)
How It Works
411(2)
Chapter 12 Customizing Entity Framework Objects
413(38)
12-1 Executing Code When SaveChanges() Is Called
413(3)
Problem
413(1)
Solution
413(2)
How It Works
415(1)
12-2 Validating Property Changes
416(2)
Problem
416(1)
Solution
416(2)
How It Works
418(1)
12-3 Logging Database Connections
418(3)
Problem
418(1)
Solution
418(2)
How It Works
420(1)
12-4 Recalculating a Property Value When an Entity Collection Changes
421(3)
Problem
421(1)
Solution
421(2)
How It Works
423(1)
12-5 Automatically Deleting Related Entities
424(3)
Problem
424(1)
Solution
424(3)
How It Works
427(1)
Best Practice
427(1)
12-6 Deleting All Related Entities
427(3)
Problem
427(1)
Solution
427(3)
How It Works
430(1)
12-7 Assigning Default Values
430(4)
Problem
430(1)
Solution
430(3)
How It Works
433(1)
12-8 Retrieving the Original Value of a Property
434(2)
Problem
434(1)
Solution
434(2)
How It Works
436(1)
12-9 Retrieving the Original Association for Independent Associations
436(3)
Problem
436(1)
Solution
436(3)
How It Works
439(1)
12-10 Retrieving XML
439(3)
Problem
439(1)
Solution
439(3)
How It Works
442(1)
12-11 Applying Server-Generated Values to Properties
442(3)
Problem
442(1)
Solution
442(3)
How It Works
445(1)
12-12 Validating Entities on Saving Changes
445(6)
Problem
445(1)
Solution
445(5)
How It Works
450(1)
Best Practice
450(1)
Chapter 13 Improving Performance
451(32)
13-1 Optimizing Queries in a Table per Type Inheritance Model
451(2)
Problem
451(1)
Solution
451(1)
How It Works
452(1)
13-2 Retrieving a Single Entity Using an Entity Key
453(3)
Problem
453(1)
Solution
453(2)
How It Works
455(1)
13-3 Retrieving Entities for Read-Only Access
456(4)
Problem
456(1)
Solution
456(3)
How It Works
459(1)
13-4 Efficiently Building a Search Query
460(3)
Problem
460(1)
Solution
460(2)
How It Works
462(1)
13-5 Making Change Tracking with POCO Faster
463(4)
Problem
463(1)
Solution
463(3)
How It Works
466(1)
13-6 Auto-Compiling LINQ Queries
467(3)
Problem
467(1)
Solution
467(2)
How It Works
469(1)
13-7 Returning Partially Filled Entities
470(1)
Problem
470(1)
Solution
470(1)
How It Works
471(1)
13-8 Moving an Expensive Property to Another Entity
471(4)
Problem
471(1)
Solution
472(3)
How It Works
475(1)
13-9 Avoiding Include
475(4)
Problem
475(1)
Solution
475(4)
How It Works
479(1)
13-10 Generating Proxies Explicitly
479(4)
Problem
479(1)
Solution
479(2)
How It Works
481(2)
Chapter 14 Concurrency
483(20)
14-1 Applying Optimistic Concurrency
483(3)
Problem
483(1)
Solution
483(2)
How It Works
485(1)
14-2 Managing Concurrency When Using Stored Procedures
486(4)
Problem
486(1)
Solution
486(3)
How It Works
489(1)
14-3 Reading Uncommitted Data
490(2)
Problem
490(1)
Solution
490(1)
How It Works
491(1)
14-4 Implementing the "Last Record Wins" Strategy
492(2)
Problem
492(1)
Solution
492(1)
How It Works
493(1)
14-5 Getting Affected Rows from a Stored Procedure
494(4)
Problem
494(1)
Solution
494(3)
How It Works
497(1)
14-6 Optimistic Concurrency with Table Per Type Inheritance
498(2)
Problem
498(1)
Solution
498(2)
How It Works
500(1)
14-7 Generating a Timestamp Column with Model First
500(3)
Problem
500(1)
Solution
501(1)
How It Works
501(2)
Index 503
Zeeshan Hirani actively uses Entity framework in the development of an e-commerce web site for a top-300 ecommerce retailer. He has written several articles and maintains and active and influential Entity framework blog at http://weblogs.asp.net/zeeshanhirani.