示例#1
0
 /// <summary>
 /// Migrate an SQL database using Entity Framework Core migrations with a given <see cref="DbContext"/> type.
 /// </summary>
 /// <typeparam name="T">The type of DbContext to use for migrations.</typeparam>
 /// <param name="webHost">The host to execute the startup task on.</param>
 /// <returns>The <paramref name="webHost"/>, after the startup task finished.</returns>
 public static IWebHost MigrateSqlDatabase <T>(this IWebHost webHost)
     where T : DbContext
 => webHost.UseKrakenStartupTask <MigrateSqlDatabase <T> >();
示例#2
0
 /// <summary>
 /// Migrate an SQL database using Entity Framework Core migrations with the default <see cref="DbContext"/>.
 /// </summary>
 /// <param name="webHost">The host to execute the startup task on.</param>
 /// <returns>The <paramref name="webHost"/>, after the startup task finished.</returns>
 public static IWebHost MigrateSqlDatabase(this IWebHost webHost)
 => webHost.UseKrakenStartupTask <MigrateSqlDatabase <DbContext> >();