Skip to content

Can I use ListMigrations to show a list of Migrations on an MVC Page? #1439

Answered by jzabroski
asifshakir asked this question in Q&A
Discussion options

You must be logged in to vote

@asifshakir MigrationRunner has a public constructor that takes an ILogger instance:

[NotNull] ILogger<MigrationRunner> logger,

I could envision a "logger" component that has a public property which is the data structure for your ASP.NET MVC view.

However, a cleaner solution would probably be to modularize MigrationRunner. I would start with just what you need modularized, e.g.,

public void ListMigrations()
{
var currentVersionInfo = VersionLoader.VersionInfo;
var currentVersion =

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jzabroski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants