Open
Description
Hi,
I am getting different output for migration files when I include [NotMapped] property to one of the DbSets.
When I call migration I get:
migrationBuilder.CreateTable(
name: "Defects",
columns: table => new
{
Id = table.Column<string>(type: "varchar(36)", nullable: false),
LastModifiedDateUtc = table.Column<long>(type: "bigint", nullable: false),
LastClientModifiedDateUtc = table.Column<long>(type: "bigint", nullable: true),
WorkStepId = table.Column<string>(type: "varchar(36)", nullable: true)
},
When I add not mapped entity to one of the DbSets,:
[NotMapped]
public IEnumerable<EntryEf> Entries => Defects.Cast<EntryEf>().Concat(Expenses);
Then when I delete migration and create new one the output of the new migration is:
migrationBuilder.CreateTable(
name: "Defects",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
LastModifiedDateUtc = table.Column<DateTime>(type: "TEXT", nullable: false),
LastClientModifiedDateUtc = table.Column<DateTime>(type: "TEXT", nullable: true),
WorkStepId = table.Column<string>(type: "varchar(36)", nullable: true)
},
Which is completely different, and I added only [NotMapped] property.
In order to fully reproduce bug I created repo:
https://github.com/mhenkrich-wh/EntityFrameworkCore_Bug_11_27_24
Steps to reproduce:
- Build -> Add migration "Add-migration test1" -> inspect migration.
- In file WorkStep.cs comment out lines 22 and 23 (this mapped property)
- Delete current migration
- Build -> Add migration "Add-migration test2" -> inspect migration.
You can see that test1 migration output doesn't match test2 migration output.
To me it seems like custom configuration is not applied.