SimonCropp/LocalDb

execute await using var db = await DbInstance.Default.FundationDb() twice error

Closed this issue · 3 comments

public class DbInstance
{
    static SqlInstance<LocalDbContext> sqlInstance;

    static DbInstance() =>
        sqlInstance = new SqlInstance<LocalDbContext>(
            builder => new (builder.Options),
            storage: new Storage("LocalDb", "E:\\LocalCache"),
            sqlOptionsBuilder: builder =>
            {
                builder.EnableRetryOnFailure(5);
                builder.CommandTimeout(5);
            });

    public static DbInstance Default = new Lazy<DbInstance>().Value;

    public Task<SqlDatabase<LocalDbContext>> FundationDb()
    {
        return sqlInstance.Build();
    }
}

can u submit a failing unit test as a pull request