DependecyInjection For Migrations
See original GitHub issueI Make a custom nuget to use in all my projects, inside there is some migrations and works like a charm, but then i tried to hide this migrations making then internal
Obviusly it didn’t work hehe
Searching in your source code i finded this
assemblies.SelectMany(a => a.GetExportedTypes()).Where(t => typeof(IMigration).IsAssignableFrom(t) && !t.IsAbstract);
the GetExportedTypes only get public classes and its ok.
so why not inject in AssemblyMigrationSourceItem IEnumerable<IMigration>?? because i can insert my migrations directly in the same service collection! and then mix the injected with what you find in the assemblies.Select if it is needed???
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Can I inject dependency into migration (using EF-Core ...
I tried to inject IConfiguration into the migration (in constructor), and got exception: "No parameterless constructor defined for this ...
Read more >Road to dependency injection
So, when migrating to a more recent service container implementation, like Symfony's dependency injection container, the first migration ...
Read more >.NET 6 - Perform Automatic EF Core Migrations at startup
Because we got dependency injection we can create a scope for the database service and migrate it. This is completed by calling scope....
Read more >Migration with dependency injection in a console application
I found a solution from stackoverflow how to apply migration to a console application with ef core and dependency injection as follows.
Read more >MigrationsSqlGeneratorDepende...
To create an instance with some dependent services replaced, first resolve the object from the dependency injection container, then replace selected services ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hehe, i just say what i think =) and it’s a amazing library, but comparared to fluent migration, they have lower code frequency
I don’t think Scrutor is abandoned. 😃 It literally has twice as many downloads as FluentMigrator and is one of the most popular Nuget packages not provided by Microsoft. If that is abandoned then the .NET open source community is in serious trouble lol 😃