mirror of
https://github.com/bitwarden/server.git
synced 2026-02-05 00:23:24 +08:00
Turn on file scoped namespaces (#2225)
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user