Learning more about EF Core’s Power Tools

Continuing my series on steps I’ve recently taken to help upskill myself, I decided to go through a tutorial by Eric Ejlskov Jensen on his excellent Entity Framework Core’s Power Tools. This tutorial can be found at Add an admin CRUD web page to your ASP.NET Core web app in 5 minutes using EF Core Power Tools and CoreAdmin. I decided to create an ASP.NET MVC Core website using .NET 6. I stored my code in an Azure DevOps Services private repo. (Note: I use both Azure DevOps and GitHub, alternating between the two. I like to use both and keep my skills at writing CI/CD pipelines using both up to date. Also please note that I am using a local SQL Server Developer Edition database I have at home. Because of that I felt it best to keep this repo private.)

Following Eric’s instructions, I added Ed Andersen’s CoreAdmin NuGet package. (Eric didn’t say this, so be sure to add it.). Then I added the code lines of:

builder.Services.AddSqlServer<JobsearchContext>(builder.Configuration.GetConnectionString("Database"));

builder.Services.AddCoreAdmin();

After adding those lines and the app.MapDefaultControllerRoute() line just before app.Run(), I ran the app and got this when I went to the /CoreAdmin page:

That has all my tables in my local database for easy access!

Leave a comment