Entity Framework Basics
Treehouse
Course Summary
In this course, you'll learn how to use Microsoft's Entity Framework to persist application data to a database. By the end of the course, you'll have learned how to use the Code First workflow, create entity classes, write LINQ queries, perform CRUD operations, and more.
-
+
Course Description
About this Course In this course, you'll learn how to use Microsoft's Entity Framework to persist application data to a database. By the end of the course, you'll have learned how to use the Code First workflow, create entity classes, write LINQ queries, perform CRUD operations, and more. What you'll learn
- Code First Workflow
- Creating Entity Classes
- Defining Relationships Between Entities
- Writing Queries Using LINQ
- Performing CRUD Operations Using the Context
About the Teacher
Before joining the Treehouse team, James worked as a consultant for over 10 years doing web development using .NET and variety of open source technologies. James enjoys participating in the developer community, presenting at and attending meetups, code camps, and conferences. When not working, James enjoys learning, skiing, playing music, and watching movies. Find him on Twitter @SmashDev.
-
+
Course Syllabus
Introducing Entity Framework
We'll start with an introduction of Entity Framework, including an overview of the Database First and Model First workflows. Then we'll use the Code First workflow to add our first entity class and database context class. We'll also see how to use the context to add an entity to the database and retrieve a list of entities from the database. 11 steps- Welcome to Entity Framework Basics 2:37
- What is Entity Framework? 4:19
- Entity Framework Review 5 questions
- Workflows: Database First 6:19
- Workflows: Model First 5:50
- Adding Our First Entity Using the Code First Workflow 6:02
- Adding an Entity 2 objectives
- Adding Our Context 3:03
- Adding a Context 2 objectives
- Using the Context 5:03
- Section Review 10 questions
Entity Framework and Databases
We'll see how to confirm that SQL Server LocalDB is installed and configured correctly for Entity Framework. We'll also locate and review the database that EF generated for us in the previous section, customize the database name, and configure EF's database initializer. 8 stepsExtending Our Entity Data Model
We'll extend our model by adding entities and defining relationships between our entities. Then we'll see how to refine our model using data annotation attributes on our entities or by using the fluent API. We'll also see how to use a custom database initializer to seed our database with data. 14 stepsLINQ Queries
We'll see how to write LINQ to Entities queries including how to filter and sort data. Then we'll see the options that EF gives us for loading related data and how they compare to one another. We'll also see the options that EF provides for retrieving a single entity from the context. 10 stepsCRUD Operations
We'll take a look at a console application that was built on top of our comic book model. We'll also learn how to perform CRUD operations with the database context. As we do that, we'll implement various Repository class methods in the console application. 9 steps