Reading-Notes

Entity Framework and APIs

This topic is important to me because I want to learn how to create my own Apis

Retrospective 12

References

MVC with EF

Entity Framework Core

Data Seeding

Entity Framework Core

User Secrets

Intro to APIs

Introduction to Entity Framework in ASP.NET Core MVC

This tutorial introduces Entity Framework (EF) in the context of ASP.NET Core MVC. Entity Framework is an object-relational mapper that simplifies database operations by allowing developers to work with databases using C# or VB.NET code, instead of writing SQL queries.

Steps Covered

  1. Create a Model:
    • Define C# classes to represent your database tables (entities).
  2. Create a DbContext:
    • Create a subclass of DbContext to establish a connection to the database and provide an interface to interact with it.
  3. Configure Entities:
    • Use data annotations or fluent API to configure relationships, data types, and other attributes of your entities.
  4. Querying Data:
    • Use LINQ to query data from the database using the DbContext.
  5. Updating Data:
    • Add, modify, and delete data using methods provided by the DbContext.
  6. Database Migrations:
    • Use migrations to manage changes to the database schema over time.

Benefits

Practical Use Cases

Things I want to know more about

I want to learn more about the databse relationships.

I want to learn more about framework migrations.