question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DependecyInjection For Migrations

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
schmitz85commented, Jun 9, 2020

Hehe, i just say what i think =) and it’s a amazing library, but comparared to fluent migration, they have lower code frequency

1reaction
jzabroskicommented, Jun 8, 2020

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found