mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
10a547bcf2
commit
acfd89ba9f
1 changed files with 22 additions and 21 deletions
|
|
@ -5,27 +5,28 @@
|
|||
|
||||
namespace FilterLists.Data
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FilterListsDesignTimeDbContextFactory : IDesignTimeDbContextFactory<FilterListsDbContext>
|
||||
{
|
||||
private readonly int commandTimeoutSecs = (int)TimeSpan.FromMinutes(30).TotalSeconds;
|
||||
//TODO: [BLOCKED] pass connection string https://github.com/aspnet/EntityFrameworkCore/issues/8332
|
||||
//[UsedImplicitly]
|
||||
//public class FilterListsDesignTimeDbContextFactory : IDesignTimeDbContextFactory<FilterListsDbContext>
|
||||
//{
|
||||
// private readonly int commandTimeoutSecs = (int)TimeSpan.FromMinutes(30).TotalSeconds;
|
||||
|
||||
/// <summary>
|
||||
/// increases command timeout for design time migrations
|
||||
/// </summary>
|
||||
public FilterListsDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<FilterListsDbContext>();
|
||||
optionsBuilder.UseMySql(
|
||||
@"", //BLOCKED: pass connection string https://github.com/aspnet/EntityFrameworkCore/issues/8332
|
||||
o =>
|
||||
{
|
||||
o.MigrationsAssembly("FilterLists.Api");
|
||||
o.CommandTimeout(commandTimeoutSecs);
|
||||
}
|
||||
);
|
||||
// /// <summary>
|
||||
// /// increases command timeout for design time migrations
|
||||
// /// </summary>
|
||||
// public FilterListsDbContext CreateDbContext(string[] args)
|
||||
// {
|
||||
// var optionsBuilder = new DbContextOptionsBuilder<FilterListsDbContext>();
|
||||
// optionsBuilder.UseMySql(
|
||||
// @"",
|
||||
// o =>
|
||||
// {
|
||||
// o.MigrationsAssembly("FilterLists.Api");
|
||||
// o.CommandTimeout(commandTimeoutSecs);
|
||||
// }
|
||||
// );
|
||||
|
||||
return new FilterListsDbContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
// return new FilterListsDbContext(optionsBuilder.Options);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
Loading…
Reference in a new issue