Run formatting (#2230)

This commit is contained in:
Justin Baur
2022-08-29 16:06:55 -04:00
committed by GitHub
parent 9b7aef0763
commit 7f5f010e1e
1205 changed files with 73813 additions and 75022 deletions

View File

@@ -1,33 +1,32 @@
using Bit.Core.Enums.Provider;
using Bit.Core.Models.Data;
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries;
public class UserReadPublicKeysByProviderUserIdsQuery : IQuery<ProviderUserPublicKey>
{
public class UserReadPublicKeysByProviderUserIdsQuery : IQuery<ProviderUserPublicKey>
private readonly Guid _providerId;
private readonly IEnumerable<Guid> _ids;
public UserReadPublicKeysByProviderUserIdsQuery(Guid providerId, IEnumerable<Guid> Ids)
{
private readonly Guid _providerId;
private readonly IEnumerable<Guid> _ids;
_providerId = providerId;
_ids = Ids;
}
public UserReadPublicKeysByProviderUserIdsQuery(Guid providerId, IEnumerable<Guid> Ids)
public virtual IQueryable<ProviderUserPublicKey> Run(DatabaseContext dbContext)
{
var query = from pu in dbContext.ProviderUsers
join u in dbContext.Users
on pu.UserId equals u.Id
where _ids.Contains(pu.Id) &&
pu.Status == ProviderUserStatusType.Accepted &&
pu.ProviderId == _providerId
select new { pu, u };
return query.Select(x => new ProviderUserPublicKey
{
_providerId = providerId;
_ids = Ids;
}
public virtual IQueryable<ProviderUserPublicKey> Run(DatabaseContext dbContext)
{
var query = from pu in dbContext.ProviderUsers
join u in dbContext.Users
on pu.UserId equals u.Id
where _ids.Contains(pu.Id) &&
pu.Status == ProviderUserStatusType.Accepted &&
pu.ProviderId == _providerId
select new { pu, u };
return query.Select(x => new ProviderUserPublicKey
{
Id = x.pu.Id,
PublicKey = x.u.PublicKey,
});
}
Id = x.pu.Id,
PublicKey = x.u.PublicKey,
});
}
}