Revert filescoped (#2227)

* Revert "Add git blame entry (#2226)"

This reverts commit 239286737d.

* Revert "Turn on file scoped namespaces (#2225)"

This reverts commit 34fb4cca2a.
This commit is contained in:
Justin Baur
2022-08-29 15:53:48 -04:00
committed by GitHub
parent 239286737d
commit bae03feffe
1208 changed files with 74317 additions and 73126 deletions

View File

@@ -4,73 +4,74 @@ using Bit.Core.Repositories;
using Bit.Core.Settings;
using Dapper;
namespace Bit.Infrastructure.Dapper.Repositories;
public class MaintenanceRepository : BaseRepository, IMaintenanceRepository
namespace Bit.Infrastructure.Dapper.Repositories
{
public MaintenanceRepository(GlobalSettings globalSettings)
: this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString)
{ }
public MaintenanceRepository(string connectionString, string readOnlyConnectionString)
: base(connectionString, readOnlyConnectionString)
{ }
public async Task UpdateStatisticsAsync()
public class MaintenanceRepository : BaseRepository, IMaintenanceRepository
{
using (var connection = new SqlConnection(ConnectionString))
public MaintenanceRepository(GlobalSettings globalSettings)
: this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString)
{ }
public MaintenanceRepository(string connectionString, string readOnlyConnectionString)
: base(connectionString, readOnlyConnectionString)
{ }
public async Task UpdateStatisticsAsync()
{
await connection.ExecuteAsync(
"[dbo].[AzureSQLMaintenance]",
new { operation = "statistics", mode = "smart", LogToTable = true },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
using (var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
"[dbo].[AzureSQLMaintenance]",
new { operation = "statistics", mode = "smart", LogToTable = true },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
}
}
}
public async Task DisableCipherAutoStatsAsync()
{
using (var connection = new SqlConnection(ConnectionString))
public async Task DisableCipherAutoStatsAsync()
{
await connection.ExecuteAsync(
"sp_autostats",
new { tblname = "[dbo].[Cipher]", flagc = "OFF" },
commandType: CommandType.StoredProcedure);
using (var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
"sp_autostats",
new { tblname = "[dbo].[Cipher]", flagc = "OFF" },
commandType: CommandType.StoredProcedure);
}
}
}
public async Task RebuildIndexesAsync()
{
using (var connection = new SqlConnection(ConnectionString))
public async Task RebuildIndexesAsync()
{
await connection.ExecuteAsync(
"[dbo].[AzureSQLMaintenance]",
new { operation = "index", mode = "smart", LogToTable = true },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
using (var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
"[dbo].[AzureSQLMaintenance]",
new { operation = "index", mode = "smart", LogToTable = true },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
}
}
}
public async Task DeleteExpiredGrantsAsync()
{
using (var connection = new SqlConnection(ConnectionString))
public async Task DeleteExpiredGrantsAsync()
{
await connection.ExecuteAsync(
"[dbo].[Grant_DeleteExpired]",
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
using (var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
"[dbo].[Grant_DeleteExpired]",
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
}
}
}
public async Task DeleteExpiredSponsorshipsAsync(DateTime validUntilBeforeDate)
{
using (var connection = new SqlConnection(ConnectionString))
public async Task DeleteExpiredSponsorshipsAsync(DateTime validUntilBeforeDate)
{
await connection.ExecuteAsync(
"[dbo].[OrganizationSponsorship_DeleteExpired]",
new { ValidUntilBeforeDate = validUntilBeforeDate },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
using (var connection = new SqlConnection(ConnectionString))
{
await connection.ExecuteAsync(
"[dbo].[OrganizationSponsorship_DeleteExpired]",
new { ValidUntilBeforeDate = validUntilBeforeDate },
commandType: CommandType.StoredProcedure,
commandTimeout: 172800);
}
}
}
}