The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified
Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners
https://goalkicker.com/
章節目錄
1-1
Content list
1-2
About
1-3
Chapter 1: Getting started with Entity Framework
1-4
Section 1.1: Installing the Entity Framework NuGet Package
1-5
Section 1.2: Using Entity Framework from C# (Code First)
1-6
Section 1.3: What is Entity Framework?
1-7
Chapter 2: Code First Conventions
1-8
Section 2.1: Removing Conventions
1-9
Section 2.2: Primary Key Convention
1-10
Section 2.3: Type Discovery
1-11
Section 2.4: DecimalPropertyConvention
1-12
Section 2.5: Relationship Convention
1-13
Section 2.6: Foreign Key Convention
1-14
Chapter 3: Code First DataAnnotations
1-15
Section 3.1: [Column] attribute
1-16
Section 3.2: [DatabaseGenerated] attribute
1-17
Section 3.3: [Required] attribute
1-18
Section 3.4: [MaxLength] and [MinLength] attributes
1-19
Section 3.5: [InverseProperty(string)] attribute
1-20
Section 3.6: [ComplexType] attribute
1-21
Section 3.7: [ForeignKey(string)] attribute
1-22
Section 3.8: [Range(min,max)] attribute
1-23
Section 3.9: [NotMapped] attribute
1-24
Section 3.10: [Table] attribute
1-25
Section 3.11: [Index] attribute
1-26
Section 3.12: [Key] attribute
1-27
Section 3.13: [StringLength(int)] attribute
1-28
Section 3.14: [Timestamp] attribute
1-29
Section 3.15: [ConcurrencyCheck] Attribute
1-30
Chapter 4: Entity Framework Code First
1-31
Section 4.1: Connect to an existing database
1-32
Chapter 5: Entity framework Code First Migrations
1-33
Section 5.1: Enable Migrations
1-34
Section 5.2: Add your first migration
1-35
Section 5.3: Doing "Update-Database" within your code
1-36
Section 5.4: Seeding Data during migrations
1-37
Section 5.5: Initial Entity Framework Code First Migration Step by Step
1-38
Section 5.6: Using Sql() during migrations
1-39
Chapter 6: Inheritance with EntityFramework (Code First)
1-40
Section 6.1: Table per hierarchy
1-41
Section 6.2: Table per type
1-42
Chapter 7: Code First - Fluent API
1-43
Section 7.1: Mapping models
1-44
Section 7.2: Composite Primary Key
1-45
Section 7.3: Maximum Length
1-46
Section 7.4: Primary Key
1-47
Section 7.5: Required properties (NOT NULL)
1-48
Section 7.6: Explict Foreign Key naming
1-49
Chapter 8: Mapping relationship with Entity Framework Code First: One-to-one and variations
1-50
Section 8.1: Mapping one-to-zero or one
1-51
Section 8.2: Mapping one-to-one
1-52
Section 8.3: Mapping one or zero-to-one or zero
1-53
Chapter 9: Mapping relationship with Entity Framework Code First: One-to-many and Many-to-many
1-54
Section 9.1: Mapping one-to-many
1-55
Section 9.2: Mapping one-to-many: against the convention
1-56
Section 9.3: Mapping zero or one-to-many
1-57
Section 9.4: Many-to-many
1-58
Section 9.5: Many-to-many: customizing the join table
1-59
Section 9.6: Many-to-many: custom join entity
1-60
Chapter 10: Database first model generation
1-61
Section 10.1: Generating model from database
1-62
Section 10.2: Adding data annotations to the generated model
1-63
Chapter 11: Complex Types
1-64
Section 11.1: Code First Complex Types
1-65
Chapter 12: Database Initialisers
1-66
Section 12.1: CreateDatabaseIfNotExists
1-67
Section 12.2: DropCreateDatabaseIfModelChanges
1-68
Section 12.3: DropCreateDatabaseAlways
1-69
Section 12.4: Custom database initializer
1-70
Section 12.5: MigrateDatabaseToLatestVersion
1-71
Chapter 13: Tracking vs. No-Tracking
1-72
Section 13.1: No-tracking queries
1-73
Section 13.2: Tracking queries
1-74
Section 13.3: Tracking and projections
1-75
Chapter 14: Transactions
1-76
Section 14.1: Database.BeginTransaction()
1-77
Chapter 15: Managing entity state
1-78
Section 15.1: Setting state Added of a single entity
1-79
Section 15.2: Setting state Added of an object graph
1-80
Chapter 16: Loading related entities
1-81
Section 16.1: Eager loading
1-82
Section 16.2: Explicit loading
1-83
Section 16.3: Lazy loading
1-84
Section 16.4: Projection Queries
1-85
Chapter 17: Model Restraints
1-86
Section 17.1: One-to-many relationships
1-87
Chapter 18: Entity Framework with PostgreSQL
1-88
Section 18.1: Pre-Steps needed in order to use Entity Framework 6.1.3 with PostgresSql using Npgsqlddexprovider
1-89
Chapter 19: Entity Framework with SQLite
1-90
Section 19.1: Setting up a project to use Entity Framework with an SQLite provider
1-91
Chapter 20: .t4 templates in entity framework
1-92
Section 20.1: Dynamically adding Interfaces to model
1-93
Section 20.2: Adding XML Documentation to Entity Classes