Getting Started with EF6 Code First and MVC
Upcoming SlideShare
Loading in...5
×
 

Getting Started with EF6 Code First and MVC

on

  • 239 views

This presentation starts on with the basics of code-first and then moves on to configure one-to-one, one-to-many and many-to-many relationship with Data Annotation as well as Fluent API.

This presentation starts on with the basics of code-first and then moves on to configure one-to-one, one-to-many and many-to-many relationship with Data Annotation as well as Fluent API.

Statistics

Views

Total Views
239
Views on SlideShare
232
Embed Views
7

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 7

http://www.slideee.com 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Getting Started with EF6 Code First and MVC Getting Started with EF6 Code First and MVC Presentation Transcript

  • Getting Started with EF6, Code First and MVC Presenter: Tanveer Singh, Mindfire Solutions
  • Topic 1. Entity Framework CF First Approach 2. Basics of Code First 3. Fluent Api 4. Data Annotations 5. Migrations
  • What is Code First ? Code First development with Entity Framework 6.0 New approaches to modeling for Entity Framework 6.0. 1. Model First 2. Code First 3. Database first
  • Approaches Model First - Using the Model First approach a developer can start working with the model of the database and creating entities which make logical sense irrelevant of how they will actually be stored in the database in terms of tables.
  • Approaches Code First - The Code first approach is the most recent approach provided by Microsoft as part of the Entity Framework 4.0. Its a more developer oriented approach where a developer can literally code the entities required within the system as if they were regular classes and objects and then create the database schema from these classes by defining special relationships and mappings within these entities. The main advantages in utilizing the Code First approach is that the developer has complete control on the relations between the entities Using the code first approach the developer can also provide restrictions and annotations on specific properties in the domain models (classes) which will serve as validations both on the database and also within the code itself.
  • Approaches Database First - The Database First Approach provides an alternative to the Code First and Model First approaches to the Entity Data Model and it creates model codes (classes, properties, DbContext etc.) from the database in the project and those classes become the link between the database and controller
  • One important thing to understand is that there are - Two new types introduced for Code First approach DbContext and DbSet. DbContext is a simplified alternative to ObjectContext and is the primary object for interacting with a database using a specific model. DbSet(Of TEntity) is a simplified alternative to ObjectSet(Of TEntity) and is used to perform CRUD operations against a specific type from the model in Code First approach.
  • Let’s Start with Sample Apps.
  • Questions and Answers
  • Thank You