Closed rok7 closed 2 years ago
Possibly a dupe of https://github.com/aspnet/EntityFramework/issues/4522
@rok7 can you provide a code listing (or project) we can run to reproduce this issue. In general, the scenario is supported, so there must be something specific in your model.
Hello Rowan
Here's a minimal project to reproduce the issue. Please contact me if you need more information.
Thank you Roland
Am 08.03.2016 um 19:33 schrieb Rowan Miller:
Possibly a dupe of #4522 https://github.com/aspnet/EntityFramework/issues/4522
@rok7 https://github.com/rok7 can you provide a code listing (or project) we can run to reproduce this issue. In general, the scenario is supported, so there must be something specific in your model.
— Reply to this email directly or view it on GitHub https://github.com/aspnet/EntityFramework/issues/4703#issuecomment-193904945.
@rok7 think you forgot to attach it?
Sorry, here's another try. WebApplication2.zip
This doesn't repro with the latest bits, so it was probably fixed.
Hello
I'm struggling with the problem which has been described (and solved) for EF6 at http://entityframework.codeplex.com/workitem/583
When creating a migration I get the exception "Element with the same key has already been added" (full stack below). Is there a workaround other than moving all shared properties to the base class or multiply the properties with sligtly different names?
Regards rok
PM> dnx ef migrations add MySchema System.ArgumentException: Ein Element mit dem gleichen Schlssel wurde bereits hinzugefgt. bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) bei System.Collections.Generic.Dictionaryb__0()
bei Microsoft.Data.Entity.Commands.Program.Executor.Execute(Action action)
Ein Element mit dem gleichen Schlssel wurde bereits hinzugefgt.
2.Insert(TKey key, TValue value, Boolean add) bei Microsoft.Data.Entity.Migrations.Design.CSharpMigrationOperationGenerator.Generate(CreateTableOperation operation, IndentedStringBuilder builder) bei CallSite.Target(Closure , CallSite , CSharpMigrationOperationGenerator , Object , IndentedStringBuilder ) bei Microsoft.Data.Entity.Migrations.Design.CSharpMigrationOperationGenerator.Generate(String builderName, IReadOnlyList
1 operations, IndentedStringBuilder builder) bei Microsoft.Data.Entity.Migrations.Design.CSharpMigrationsGenerator.GenerateMigration(String migrationNamespace, String migrationName, IReadOnlyList1 upOperations, IReadOnlyList
1 downOperations) bei Microsoft.Data.Entity.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace) bei Microsoft.Data.Entity.Design.MigrationsOperations.AddMigration(String name, String outputDir, String contextType) bei Microsoft.Data.Entity.Commands.Program.Executor.<>c__DisplayClass6_0.