EF Core
Getting started with EF Core
Getting started with EF Core
  • Introduction
    • What is an ORM
    • Entity Framework Core
    • EF Core architecture
    • EF Core Approaches
  • Basics of EF Core
    • Create the project
      • Create the model & context
    • Create migration
    • CRUD using EF
      • Creating many entities
      • Update & Delete
    • Adding a property
      • Add migration
  • Entity Relationships
    • Add related entity
      • Add Vehicle
      • Modify Student
      • Modify context
      • Add migration
    • Manipulate related data
  • Entity Configuration
    • Fluent APIs
      • Frequently used APIs
    • Data Annotations
      • Frequently used annotations
Powered by GitBook
On this page
  1. Basics of EF Core

Create the project

PreviousEF Core ApproachesNextCreate the model & context

Last updated 1 year ago

Creating and setting up the project

1) Change to the directory of your choice and create a project called EFGetStarted

dotnet new console -o EFGetStarted
cd EFGetStarted

2) Install dotnet ef the global CLI tool for working with entity framework tool set

Refer link for details

3) Install entity framework core SQL Server package for the current project, the command is documented if you need to refer to it

dotnet add package Microsoft.EntityFrameworkCore.SqlServer

4) Install entity framework core design library package for the current project, we will need this later

dotnet add package Microsoft.EntityFrameworkCore.Design

5) verify the installations by listing the packages in the project

dotnet list package

output

Project 'EFGetStarted' has the following package references
   [net7.0]:
   Top-level Package                              Requested   Resolved
   > Microsoft.EntityFrameworkCore.Design         7.0.1       7.0.1
   > Microsoft.EntityFrameworkCore.SqlServer      7.0.1       7.0.1

We are now good to go to the next step!

here
this