Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Core Tech
Labs

Guided: Getting Started with EF Core 10

In this Code Lab, you will build a complete data access layer for a .NET 10 application from the ground up. You will gain hands-on experience with Entity Framework Core 10 by configuring a database context, modeling entities, and implementing a full suite of Create, Read, Update, and Delete (CRUD) operations. By the end, you'll have a robust, testable service ready to manage data for any application, using SQLite for a lightweight, serverless database solution.

Lab platform
Lab Info
Level
Beginner
Last updated
Feb 26, 2026
Duration
45m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Introduction

    Welcome to this Code Lab on building a data access layer with EF Core 10! In this lab, you'll create the core components needed to connect a .NET application to a database. You will define data models, configure a database context, and implement a service to handle all Create, Read, Update, and Delete (CRUD) operations.

    Use SQLite as your database. SQLite is a lightweight, serverless database engine, so you can focus on EF Core concepts without the overhead of setting up a traditional database server.

    info> If you get stuck, you can find solution files for each task in the solution folder of your filetree.

    This lab experience was developed by the Pluralsight team using Forge, an internally developed AI tool utilizing Gemini technology. All sections were verified by human experts for accuracy prior to publication. For issue reporting, please contact us.

  2. Challenge

    Step 2: Project Setup and Modeling

    Before you can work with data, you need to set up your project with the right tools and define the structure of your data. This involves adding the required EF Core libraries to your project and creating a C# class, known as an 'entity,' to represent a contact in your database.

  3. Challenge

    Step 3: Creating the DbContext

    The DbContext is a central class in EF Core. It acts as a bridge between your entity classes and the database. In this step, you will create your own DbContext and tell it which entities it should manage.

  4. Challenge

    Step 4: Implementing Create and Read Operations

    Now that your models and context are defined, it's time to bring them to life. First, register your DbContext and ContactService with the application's service container. This is a key pattern in modern .NET called Dependency Injection. Then, implement the 'C' (Create) and 'R' (Read) parts of CRUD, allowing you to add new contacts and retrieve them.

  5. Challenge

    Step 5: Implementing Update, Delete, and Querying

    In this final step, you'll complete the data service by implementing the remaining CRUD operations: Update and Delete. You will also write a more advanced query to search for contacts by name, demonstrating the power and flexibility of LINQ with EF Core.

  6. Challenge

    Step 6: Verify Your API from the Command Line

    In this step, you'll run a command-line smoke test that starts your API in the background and exercises it with real HTTP requests. This gives you an end-to-end verification that your application runs, routes correctly, and performs database operations successfully.

    1. Open scripts/api-smoke-test.sh and review what it does (start the API, wait for readiness, run Create/Read/Update/Search/Delete requests, then shut the API down).
    2. Run the script:
    bash scripts/api-smoke-test.sh
    

    If the script fails, it prints the HTTP call that failed and the API output log to help you diagnose the problem. Congratulations on completing the lab! You set up EF Core with SQLite, modeled an entity, created a DbContext, configured dependency injection, and implemented a full CRUD service with a searchable query—then validated everything end-to-end by running a live API smoke test from the command line.

About the author

Pluralsight Code Labs offer an opportunity to get hands-on learning in real-time. Be it a Challenge, Sandbox, or Guided Lab, these provide the real world experience needed to succeed in your development role.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight