mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 22:23:18 +08: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:
@@ -1,34 +1,35 @@
|
||||
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries;
|
||||
|
||||
public class OrganizationUserUserDetailsViewQuery : IQuery<OrganizationUserUserDetails>
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
||||
{
|
||||
public IQueryable<OrganizationUserUserDetails> Run(DatabaseContext dbContext)
|
||||
public class OrganizationUserUserDetailsViewQuery : IQuery<OrganizationUserUserDetails>
|
||||
{
|
||||
var query = from ou in dbContext.OrganizationUsers
|
||||
join u in dbContext.Users on ou.UserId equals u.Id into u_g
|
||||
from u in u_g.DefaultIfEmpty()
|
||||
join su in dbContext.SsoUsers on u.Id equals su.UserId into su_g
|
||||
from su in su_g.DefaultIfEmpty()
|
||||
select new { ou, u, su };
|
||||
return query.Select(x => new OrganizationUserUserDetails
|
||||
public IQueryable<OrganizationUserUserDetails> Run(DatabaseContext dbContext)
|
||||
{
|
||||
Id = x.ou.Id,
|
||||
OrganizationId = x.ou.OrganizationId,
|
||||
UserId = x.ou.UserId,
|
||||
Name = x.u.Name,
|
||||
Email = x.u.Email ?? x.ou.Email,
|
||||
TwoFactorProviders = x.u.TwoFactorProviders,
|
||||
Premium = x.u.Premium,
|
||||
Status = x.ou.Status,
|
||||
Type = x.ou.Type,
|
||||
AccessAll = x.ou.AccessAll,
|
||||
ExternalId = x.ou.ExternalId,
|
||||
SsoExternalId = x.su.ExternalId,
|
||||
Permissions = x.ou.Permissions,
|
||||
ResetPasswordKey = x.ou.ResetPasswordKey,
|
||||
UsesKeyConnector = x.u != null && x.u.UsesKeyConnector,
|
||||
});
|
||||
var query = from ou in dbContext.OrganizationUsers
|
||||
join u in dbContext.Users on ou.UserId equals u.Id into u_g
|
||||
from u in u_g.DefaultIfEmpty()
|
||||
join su in dbContext.SsoUsers on u.Id equals su.UserId into su_g
|
||||
from su in su_g.DefaultIfEmpty()
|
||||
select new { ou, u, su };
|
||||
return query.Select(x => new OrganizationUserUserDetails
|
||||
{
|
||||
Id = x.ou.Id,
|
||||
OrganizationId = x.ou.OrganizationId,
|
||||
UserId = x.ou.UserId,
|
||||
Name = x.u.Name,
|
||||
Email = x.u.Email ?? x.ou.Email,
|
||||
TwoFactorProviders = x.u.TwoFactorProviders,
|
||||
Premium = x.u.Premium,
|
||||
Status = x.ou.Status,
|
||||
Type = x.ou.Type,
|
||||
AccessAll = x.ou.AccessAll,
|
||||
ExternalId = x.ou.ExternalId,
|
||||
SsoExternalId = x.su.ExternalId,
|
||||
Permissions = x.ou.Permissions,
|
||||
ResetPasswordKey = x.ou.ResetPasswordKey,
|
||||
UsesKeyConnector = x.u != null && x.u.UsesKeyConnector,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user