using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;

using var db = new MyContext();
db.Database.EnsureDeleted();
db.Database.EnsureCreated();
db.Set<SomeData>()
	.TagWithCallSite()
	.ToList();

public class MyContext : DbContext
{
	protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
	{
		base.OnConfiguring(optionsBuilder);
		if (optionsBuilder.IsConfigured)
			return;
		optionsBuilder.UseSqlServer(@"Server=.;Database=netdd;Trusted_Connection=true;ConnectRetryCount=0");
		optionsBuilder.LogTo(Console.WriteLine, new[] { RelationalEventId.CommandExecuting });
		optionsBuilder.EnableSensitiveDataLogging();
	}

	protected override void OnModelCreating(ModelBuilder modelBuilder)
	{
		base.OnModelCreating(modelBuilder);

		modelBuilder.Entity<SomeData>();
	}
}

public record SomeData(int Id, string Foo, double Bar);
