mirror of
https://github.com/bitwarden/server.git
synced 2026-02-06 00:53:20 +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,38 +1,39 @@
|
||||
using Core.Models.Data;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries;
|
||||
|
||||
public class CipherOrganizationDetailsReadByIdQuery : IQuery<CipherOrganizationDetails>
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
||||
{
|
||||
private readonly Guid _cipherId;
|
||||
|
||||
public CipherOrganizationDetailsReadByIdQuery(Guid cipherId)
|
||||
public class CipherOrganizationDetailsReadByIdQuery : IQuery<CipherOrganizationDetails>
|
||||
{
|
||||
_cipherId = cipherId;
|
||||
}
|
||||
private readonly Guid _cipherId;
|
||||
|
||||
public virtual IQueryable<CipherOrganizationDetails> Run(DatabaseContext dbContext)
|
||||
{
|
||||
var query = from c in dbContext.Ciphers
|
||||
join o in dbContext.Organizations
|
||||
on c.OrganizationId equals o.Id into o_g
|
||||
from o in o_g.DefaultIfEmpty()
|
||||
where c.Id == _cipherId
|
||||
select new CipherOrganizationDetails
|
||||
{
|
||||
Id = c.Id,
|
||||
UserId = c.UserId,
|
||||
OrganizationId = c.OrganizationId,
|
||||
Type = c.Type,
|
||||
Data = c.Data,
|
||||
Favorites = c.Favorites,
|
||||
Folders = c.Folders,
|
||||
Attachments = c.Attachments,
|
||||
CreationDate = c.CreationDate,
|
||||
RevisionDate = c.RevisionDate,
|
||||
DeletedDate = c.DeletedDate,
|
||||
OrganizationUseTotp = o.UseTotp,
|
||||
};
|
||||
return query;
|
||||
public CipherOrganizationDetailsReadByIdQuery(Guid cipherId)
|
||||
{
|
||||
_cipherId = cipherId;
|
||||
}
|
||||
|
||||
public virtual IQueryable<CipherOrganizationDetails> Run(DatabaseContext dbContext)
|
||||
{
|
||||
var query = from c in dbContext.Ciphers
|
||||
join o in dbContext.Organizations
|
||||
on c.OrganizationId equals o.Id into o_g
|
||||
from o in o_g.DefaultIfEmpty()
|
||||
where c.Id == _cipherId
|
||||
select new CipherOrganizationDetails
|
||||
{
|
||||
Id = c.Id,
|
||||
UserId = c.UserId,
|
||||
OrganizationId = c.OrganizationId,
|
||||
Type = c.Type,
|
||||
Data = c.Data,
|
||||
Favorites = c.Favorites,
|
||||
Folders = c.Folders,
|
||||
Attachments = c.Attachments,
|
||||
CreationDate = c.CreationDate,
|
||||
RevisionDate = c.RevisionDate,
|
||||
DeletedDate = c.DeletedDate,
|
||||
OrganizationUseTotp = o.UseTotp,
|
||||
};
|
||||
return query;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user