- Entity F - Nested Entity Types
- Entity F - Multiple DbContext
- Entity F - Code First Migration
- Entity Framework - Seed Database
- Entity Framework - Fluent API
- Entity Framework - Data Annotations
- Entity Framework - First Example
- Entity F - Code First Approach
- Entity Framework - Colored Entities
- Entity Framework - Track Changes
- Entity Framework - Validation
- Entity Framework - Explicit Loading
- Entity Framework - Lazy Loading
- Entity Framework - Eager Loading
- Entity Framework - Migration
- Entity Framework - Inheritance
- Entity Framework - Spatial Data Type
- Entity F - Command Interception
- Entity F - Command Logging
- Entity F - Projection Queries
- Entity Framework - Persistence
- Entity F - Asynchronous Query
- Entity Framework - Enum Support
- Entity Framework - Native SQL
- Entity F - Table-Valued Function
- Entity F - Disconnected Entities
- Entity F - Stored Procedures
- Entity Framework - Index
- Entity Framework - Views
- Entity Framework - Transaction
- Entity Framework - Concurrency
- Entity F - Database Operations
- Entity Framework - DEV Approaches
- Entity F - Database First Approach
- Entity F - Model First Approach
- Entity F - Code First Approach
- Entity Framework - Lifecycle
- Entity Framework - Relationships
- Entity Framework - Types
- Entity Framework - DbContext
- Entity Framework - Data Model
- Entity Framework - Database Setup
- Entity F - Environment Setup
- Entity Framework - Architecture
- Entity Framework - Overview
- Entity Framework - Home
Entity Framework Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Entity Framework - DEV Approaches
In this chapter, let us focus on building models with the Designer or Database First or just using Code First. Following are some guidepnes which will help you decide which modepng workflow to choose.
We have already seen examples of Code First modepng, Database First modepng and a Model First modepng workflow.
The Database First and Model First workflows used the Designer but one starts with the database to create a model and the other starts at the model to create a database.
For those developers who do not want to use Visual Designer plus code generation, Entity Framework has a completely different workflow called Code First.
The typical workflow for Code First is great for brand new apppcations where you don t even have a database. You define your classes and code and then let Code First figure out what your database should look pke.
It is also possible to start Code First with a database and that makes Code First a bit of a contradiction. But there s a tool to let you reverse engineer a database into classes which is a great way to get a head start on the coding.
Given these options, let s look at the Decision Tree.
If you prefer to work with a Visual Designer in generated code, then you ll want to choose one of the workflows that involves EF Designer. If your database already exists, then Database First is your path.
If you want to use a Visual Designer on a brand new project without a database, then you ll want to use Model First.
If you just want to work with code and not a Designer, then Code First is probably for you along with the option of using the tool that reverse engineers the database into classes.
If you have existing classes, then your best bet is to use them with Code First.