4.6 out of 5
4.6
180 reviews on Udemy

Learn C#: Make a Databased App with Entity Framework

Learn how to create an application in C# that can generate it's own database using Entity Framework and Code First.
Instructor:
Matt Turner
1,190 students enrolled
English [Auto-generated]
By the end of the course you will be able to define and build an SQL database using only C# code. No database development required!
Perform CRUD operations (Create, Read, Update, Delete) on entities using C# code.
Handle entity changes using Code First Migrations.
For the majority of the course, we will do absolutely no database development! However, we will show how to call custom SQL statements if you need to.

In this course you will learn how to create a simple C# application using Microsoft Visual Studio that creates and connects to an SQL Database with the Entity Framework*, with no database development required!

We will use Code First development principals to define all database tables and columns using only C# code.

All database tables and columns will be generated automatically from the C# code without the need to edit the database directly. As such we will be doing no database development (except for a section on calling SQL statements directly if you need to).

All source code is included as a Microsoft Visual Studio 2013 project so you can get up and running straight away.

Thank you for choosing this course and we look forward to viewing your positive reviews and feedback.

MPire Solutions Pty Ltd

* Note: The Entity Framework is Microsofts' newest data access technology, and Code First allows us to create database driven applications using only C# code, with no database development required!

Introduction

1
Introduction

Course introduction and contents.

2
Example Application Specification

Define a specification for the simple example sales application.

3
Entity Framework Cheat Sheet and Source Code

Download the "Entity Framework Cheat Sheet" and Source Code to the sample application.

Setup

1
Installing Visual Studio

You'll need to have Microsoft Visual Studio to do this course. If you don't already have it installed, this quick video will show you how to get the free Express Edition.

2
Project Setup

Create the example C# Windows Forms application in Microsoft Visual Studio and reference Entity Framework using NuGet.

The Models

1
Creating the Models

Create the bare-bones models (entities) as C# classes.

2
Creating a Base Model

Create a base model which all other models can inherit from. Code reuse reduces the amount of code we need to write!

3
Inactive Models

Create an interface that flags a model as being active or inactive.

4
Data Annotations

Relationships

1
One-to-One Relationships

Connect models together in one-to-one relationships.

2
One-to-Many Relationships

Connect models together in one-to-many relationships.

Data Context

1
Simple Data Context

Create a very simple Data Context to connect to the database.

2
Advanced Data Context

Add more advanced functionality to the Data Context, such as soft deletion and simple auditing.

3
Generate the Database!

After creating the Models and Data Context, we can now generate an SQL Database automatically from the code.

4
Dealing with Change

Learn how to change your Models and update your database accordingly with Migrations.

5
Seeding Data

Insert core data into the database automatically using Seeding.

C.R.U.D.

1
R: Read

Learn how to Read lists of items and single items from the database.

2
C: Create

Learn how to Create a new Sale and save it to the database.

3
U: Update

Learn how to Update an existing Sale and save it to the database.

4
D: Delete

Learn how to Delete a Sale from the database.

Extra Topics

1
Extra: Using Enumerations

How to use Enumerations in your Models.

2
Extra: Changing Table and Column Names

Customize the Table and Column names that Entity Framework will use to generate the database.

3
Extra: Entity Framework 6.1 + Index Attribute

Upgrading to Entity Framework 6.1 and a brief introduction to the Index attribute to quickly create database indexes on tables.

Conclusion

1
Conclusion

Thanks for watching! Please leave a comment and rating.

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.6
4.6 out of 5
180 Ratings

Detailed Rating

Stars 5
89
Stars 4
65
Stars 3
20
Stars 2
4
Stars 1
2
8809cf63cd72a7d72616cb6763bc2330
30-Day Money-Back Guarantee

Includes

2 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion