mirror of
https://github.com/bitwarden/server
synced 2025-12-25 04:33:26 +00:00
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)" This reverts commit239286737d. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a.
This commit is contained in:
@@ -5,64 +5,65 @@ using Bit.Core.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
using Dapper;
|
||||
|
||||
namespace Bit.Infrastructure.Dapper.Repositories;
|
||||
|
||||
public class TaxRateRepository : Repository<TaxRate, string>, ITaxRateRepository
|
||||
namespace Bit.Infrastructure.Dapper.Repositories
|
||||
{
|
||||
public TaxRateRepository(GlobalSettings globalSettings)
|
||||
: this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString)
|
||||
{ }
|
||||
|
||||
public TaxRateRepository(string connectionString, string readOnlyConnectionString)
|
||||
: base(connectionString, readOnlyConnectionString)
|
||||
{ }
|
||||
|
||||
public async Task<ICollection<TaxRate>> SearchAsync(int skip, int count)
|
||||
public class TaxRateRepository : Repository<TaxRate, string>, ITaxRateRepository
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_Search]",
|
||||
new { Skip = skip, Count = count },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
public TaxRateRepository(GlobalSettings globalSettings)
|
||||
: this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString)
|
||||
{ }
|
||||
|
||||
return results.ToList();
|
||||
public TaxRateRepository(string connectionString, string readOnlyConnectionString)
|
||||
: base(connectionString, readOnlyConnectionString)
|
||||
{ }
|
||||
|
||||
public async Task<ICollection<TaxRate>> SearchAsync(int skip, int count)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_Search]",
|
||||
new { Skip = skip, Count = count },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<TaxRate>> GetAllActiveAsync()
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
public async Task<ICollection<TaxRate>> GetAllActiveAsync()
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_ReadAllActive]",
|
||||
commandType: CommandType.StoredProcedure);
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_ReadAllActive]",
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToList();
|
||||
return results.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ArchiveAsync(TaxRate model)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
public async Task ArchiveAsync(TaxRate model)
|
||||
{
|
||||
var results = await connection.ExecuteAsync(
|
||||
$"[{Schema}].[TaxRate_Archive]",
|
||||
new { Id = model.Id },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.ExecuteAsync(
|
||||
$"[{Schema}].[TaxRate_Archive]",
|
||||
new { Id = model.Id },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ICollection<TaxRate>> GetByLocationAsync(TaxRate model)
|
||||
{
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
public async Task<ICollection<TaxRate>> GetByLocationAsync(TaxRate model)
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_ReadByLocation]",
|
||||
new { Country = model.Country, PostalCode = model.PostalCode },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
using (var connection = new SqlConnection(ConnectionString))
|
||||
{
|
||||
var results = await connection.QueryAsync<TaxRate>(
|
||||
$"[{Schema}].[TaxRate_ReadByLocation]",
|
||||
new { Country = model.Country, PostalCode = model.PostalCode },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
|
||||
return results.ToList();
|
||||
return results.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user