Using Code-First approach to an existing database

step-by-step walkthrough provide an introduction to Code First development targeting an existing database. Code First allows you to define your model using C# or VB.Net classes. Optionally additional configuration can be performed using attributes on your

To New Database

Step-by-step walkthrough provide an introduction to Code First development targeting a new database. This scenario includes targeting a database that doesn’t exist and Code First will create, or an empty database that Code First will add new tables too. C

Customizing Code First to an Existing Database

This topic covers how to customize the code that is generated when you use the Entity Framework Tools for Visual Studio to reverse engineer a model from an existing database

Conventions

Code First enables you to describe a model by using C# or Visual Basic .NET classes. The basic shape of the model is detected by using conventions. Conventions are sets of rules that are used to automatically configure a conceptual model based on class de

Custom Code First Conventions (EF6 onwards)

When using Code First your model is calculated from your classes using a set of conventions. The default Code First Conventions determine things like which property becomes the primary key of an entity, the name of the table an entity maps to, and what pr

Data Annotations

Entity Framework Code First allows you to use your own domain classes to represent the model which EF relies on to perform querying, change tracking and updating functions. Code first leverages a programming pattern referred to as convention over configur

Fluent API - Configuring/Mapping Properties & Types

When working with Entity Framework Code First the default behavior is to map your POCO classes to tables using a set of conventions baked into EF. Sometimes, however, you cannot or do not want to follow those conventions and need to map entities to someth

Fluent API - Configuring Relationships

When working with Code First, you define your model by defining your domain CLR classes. By default, the Entity Framework uses the Code First conventions to map your classes to the database schema. If you use the Code First naming conventions, in most cas

Fluent API with VB.NET

Code First allows you to define your model using C# or VB.NET classes. Additional configuration can optionally be performed using attributes on your classes and properties or by using a fluent API. This walkthrough shows how to perform fluent API configur

Code First Insert/Update/Delete Stored Procedures

By default, Code First will configure all entities to perform insert, update and delete commands using direct table access. Starting in EF6 you can configure your Code First model to use stored procedures for some or all entities in your model.

Enum Support (EF5 Onwards)

Enum support was introduced in Entity Framework 5. To use the new features like enums, spatial data types, and table-valued functions, you must target .NET Framework 4.5. Visual Studio 2012 targets .NET 4.5 by default.

Spatial Data Types (EF5 Onwards)

Spatial type support was introduced in Entity Framework 5. Note that to use the new features like spatial type, enums, and Table-valued functions, you must target .NET Framework 4.5. Visual Studio 2012 targets .NET 4.5 by default. To use spatial data typ

Spatial Data Types (EF5 Onwards)

Spatial Data Types (EF5 Onwards)

Code First Migrations

Code First Migrations

Automatic Code First Migrations

Automatic Code First Migrations

Code First Migrations with an existing database

Code First Migrations with an existing database

Customizing the Migrations History Table (Code First only)

Customizing the Migrations History Table (Code First only)

EF6: Writing Your Own Code First Migration Operations

EF6: Writing Your Own Code First Migration Operations

migrate

migrate

Defining DbSets

Defining DbSets

Model First

Model First

Database First

Database First

Complex Types - EF Designer

Complex Types - EF Designer

Relationships - EF Designer

Relationships - EF Designer

Enum Support - EF Designer (EF5 onwards)

Enum Support - EF Designer (EF5 onwards)

Spatial - EF Designer (EF5 onwards)

Spatial - EF Designer (EF5 onwards)

EF Designer TPT Inheritance

EF Designer TPT Inheritance

EF Designer TPH Inheritance

EF Designer TPH Inheritance

EF Designer Query Sprocs

EF Designer Query Sprocs

Sprocs with Multiple Result Sets

Sprocs with Multiple Result Sets

EF Designer CUD Sprocs

EF Designer CUD Sprocs

EF Designer Entity Splitting

EF Designer Entity Splitting

EF Designer Table Splitting

EF Designer Table Splitting

Table-Valued Functions (TVFs) (EF5 onwards)

Table-Valued Functions (TVFs) (EF5 onwards)

Entity Framework - Relationships

In relational databases, relationship is a situation that exists between relational database tables through foreign keys. A Foreign Key (FK) is a column or combination of columns that is used to establish and enforce a link between the data in two tables.

Comparing LINQ to SQL and Entity Framework

LINQ to SQL allow you to query and modify SQL Server database by using LINQ syntax. Entity framework is a great ORM shipped by Microsoft which allow you to query and modify RDBMS like SQL Server, Oracle, DB2 and MySQL etc. by using LINQ syntax. Today, EF