I have a weird behavior happening in my code.
I've created a Place entity and a SubCategory entity.
Because it is a many to many relationship, I created a PlaceSubCategory entity with a composite key.
Now, here's what its creation looks like in the DbContext:
public DbSet<PlaceSubCategory> PlaceSubCategories { get; set; }

And here's what it creates in the migration file:
migrationBuilder.CreateTable(
    name: "PlaceSubCategories",
    columns: table => new
    {
        PlaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
        SubCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
        CreatedDateTime = table.Column<DateTime>(type: "datetime2", nullable: false, defaultValueSql: "getutcdate()")
    },
    constraints: table =>
    {
        table.PrimaryKey("PK_PlaceSubCategories", x => new { x.PlaceId, x.SubCategoryId });
        table.ForeignKey(
            name: "FK_PlaceSubCategories_Places_PlaceId",
            column: x => x.PlaceId,
            principalTable: "Places",
            principalColumn: "PlaceId");
        table.ForeignKey(
            name: "FK_PlaceSubCategories_SubCategories_SubCategoryId",
            column: x => x.SubCategoryId,
            principalTable: "SubCategories",
            principalColumn: "SubCategoryId");
    });

migrationBuilder.CreateTable(
    name: "PlaceSubCategory",
    columns: table => new
    {
        PlacesPlaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
        SubCategoriesSubCategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
    },
    constraints: table =>
    {
        table.PrimaryKey("PK_PlaceSubCategory", x => new { x.PlacesPlaceId, x.SubCategoriesSubCategoryId });
        table.ForeignKey(
            name: "FK_PlaceSubCategory_Places_PlacesPlaceId",
            column: x => x.PlacesPlaceId,
            principalTable: "Places",
            principalColumn: "PlaceId",
            onDelete: ReferentialAction.Cascade);
        table.ForeignKey(
            name: "FK_PlaceSubCategory_SubCategories_SubCategoriesSubCategoryId",
            column: x => x.SubCategoriesSubCategoryId,
            principalTable: "SubCategories",
            principalColumn: "SubCategoryId",
            onDelete: ReferentialAction.Cascade);
    });

It creates the table twice, which I thought was the default behaviour in EF Core to create a background linking table and so it shows in the migration file, but I'm not sure if that's the case.
Also, here's the configuration file for PlaceSubCategory (and not PlaceSubCategories):
public class PlaceSubCategoryConfiguration : IEntityTypeConfiguration<PlaceSubCategory>
{
    public void Configure(EntityTypeBuilder<PlaceSubCategory> builder)
    {
        // define the composite key for PlaceSubCategory table
        builder.HasKey(x => new { x.PlaceId, x.SubCategoryId });

        builder.HasOne<Place>(d => d.Place)
            .WithMany(d => d.SubCategoriesLink)
            .HasForeignKey(d => d.PlaceId)
            .OnDelete(DeleteBehavior.NoAction)
            .IsRequired();

        builder.HasOne<SubCategory>(d => d.SubCategory)
            .WithMany(d => d.PlacesLink)
            .HasForeignKey(d => d.SubCategoryId)
            .OnDelete(DeleteBehavior.NoAction)
            .IsRequired();

        builder.Property(p => p.CreatedDateTime)
            .HasConversion(AppDbContext.utcConverter)
            .HasDefaultValueSql("getutcdate()");
    }
}

But it isn't taking it into account, as you can see by the delete behavior being non-existent in the PlaceSubCategories creation, but there's an automatically set delete behavior for
PlaceSubCategory that's not what I set in the configuration file.
And of course the configuration has been set:
modelBuilder.ApplyConfiguration(new PlaceSubCategoryConfiguration());


Weird behavior in linking table creation in EF Core, adding it in the DbContext but shows two versions in the migration file
The reason was that by creating this linking entity I was doing what EF Core would do anyway which is to create a linking entity in the background that would be showing in the migration file. So my entity got created and EF Core's as well without warning.
I deleted my entity and the EF Core's automatically created linking entity got added to the migration file, which seems fine and the same thing as if I created it.
