1
0
mirror of https://github.com/bitwarden/server synced 2026-01-16 15:33:19 +00:00

Changed all C# control flow block statements to include space between keyword and open paren

This commit is contained in:
Chad Scharf
2020-03-27 14:36:37 -04:00
parent 943aea9a12
commit 9800b752c0
243 changed files with 2258 additions and 2258 deletions

View File

@@ -19,7 +19,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<ICollection<TableModel.Organization>> GetManyByEnabledAsync()
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var organizations = await GetDbSet(dbContext).Where(e => e.Enabled).ToListAsync();
@@ -36,7 +36,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<ICollection<TableModel.Organization>> SearchAsync(string name, string userEmail, bool? paid,
int skip, int take)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
// TODO: more filters
@@ -51,7 +51,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task UpdateStorageAsync(Guid id)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var ciphers = await dbContext.Ciphers
@@ -75,7 +75,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<ICollection<DataModel.OrganizationAbility>> GetManyAbilitiesAsync()
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext)

View File

@@ -22,7 +22,7 @@ namespace Bit.Core.Repositories.EntityFramework
public virtual async Task<T> GetByIdAsync(TId id)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var entity = await GetDbSet(dbContext).FindAsync(id);
@@ -32,7 +32,7 @@ namespace Bit.Core.Repositories.EntityFramework
public virtual async Task CreateAsync(T obj)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var entity = Mapper.Map<TEntity>(obj);
@@ -44,11 +44,11 @@ namespace Bit.Core.Repositories.EntityFramework
public virtual async Task ReplaceAsync(T obj)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var entity = await GetDbSet(dbContext).FindAsync(obj.Id);
if(entity != null)
if (entity != null)
{
var mappedEntity = Mapper.Map<TEntity>(obj);
dbContext.Entry(entity).CurrentValues.SetValues(mappedEntity);
@@ -59,7 +59,7 @@ namespace Bit.Core.Repositories.EntityFramework
public virtual async Task UpsertAsync(T obj)
{
if(obj.Id.Equals(default(T)))
if (obj.Id.Equals(default(T)))
{
await CreateAsync(obj);
}
@@ -71,7 +71,7 @@ namespace Bit.Core.Repositories.EntityFramework
public virtual async Task DeleteAsync(T obj)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var entity = Mapper.Map<TEntity>(obj);

View File

@@ -19,7 +19,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<TableModel.User> GetByEmailAsync(string email)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).FirstOrDefaultAsync(e => e.Email == email);
@@ -28,7 +28,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<DataModel.UserKdfInformation> GetKdfInformationByEmailAsync(string email)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).Where(e => e.Email == email)
@@ -42,7 +42,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<ICollection<TableModel.User>> SearchAsync(string email, int skip, int take)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var users = await GetDbSet(dbContext)
@@ -56,7 +56,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<ICollection<TableModel.User>> GetManyByPremiumAsync(bool premium)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var users = await GetDbSet(dbContext).Where(e => e.Premium == premium).ToListAsync();
@@ -66,7 +66,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<string> GetPublicKeyAsync(Guid id)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).Where(e => e.Id == id).Select(e => e.PublicKey).SingleOrDefaultAsync();
@@ -75,7 +75,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task<DateTime> GetAccountRevisionDateAsync(Guid id)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).Where(e => e.Id == id).Select(e => e.AccountRevisionDate)
@@ -85,7 +85,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task UpdateStorageAsync(Guid id)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var ciphers = await dbContext.Ciphers.Where(e => e.UserId == id).ToListAsync();
@@ -108,7 +108,7 @@ namespace Bit.Core.Repositories.EntityFramework
public async Task UpdateRenewalReminderDateAsync(Guid id, DateTime renewalReminderDate)
{
using(var scope = ServiceScopeFactory.CreateScope())
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var user = new EFModel.User