public async Task <Sandbox> GetByIdForPhaseShiftAsync(int id, UserOperation userOperation) { var sandboxQueryable = SandboxBaseQueries.SandboxForPhaseShift(_db); var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(sandboxQueryable, id, userOperation); return(sandbox); }
public async Task <Sandbox> GetByIdForReScheduleCreateAsync(int sandboxId) { var sandboxQueryable = SandboxBaseQueries.ActiveSandboxWithResourceAndOperations(_db); var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(sandboxQueryable, sandboxId, UserOperation.Study_Crud_Sandbox); return(sandbox); }
public async Task <Sandbox> GetByIdForCostAnalysisLinkAsync(int id, UserOperation userOperation) { var sandboxQueryable = SandboxBaseQueries.SandboxWithResources(_db).AsNoTracking(); var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(sandboxQueryable, id, userOperation); return(sandbox); }
public async Task <List <SandboxDataset> > GetSandboxDatasetsForPhaseShiftAsync(int sandboxId) { var queryable = SandboxBaseQueries.SandboxDatasetForPhaseShift(_db); queryable = queryable.Where(sds => sds.SandboxId == sandboxId); return(await queryable.ToListAsync()); }
public async Task <Sandbox> GetByIdAsync(int id, UserOperation userOperation, bool withIncludes = false, bool disableTracking = false) { var sandboxQueryable = (withIncludes ? SandboxBaseQueries.ActiveSandboxesWithIncludesQueryable(_db) : SandboxBaseQueries.ActiveSandboxesMinimalIncludesQueryable(_db)); var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(sandboxQueryable, id, userOperation); return(sandbox); }
public async Task <Sandbox> GetByIdForResourcesAsync(int sandboxId) { var sandboxQueryable = SandboxBaseQueries.SandboxWithStudyParticipantResourceAndOperations(_db).AsNoTracking(); var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(sandboxQueryable, sandboxId, UserOperation.Study_Read); if (sandbox.Deleted && sandbox.DeletedAt.HasValue && sandbox.DeletedAt.Value.AddMinutes(15) < DateTime.UtcNow) { throw NotFoundException.CreateForEntity("Sandbox", sandboxId); } return(sandbox); }
public async Task <Sandbox> GetWithResourcesNoPermissionCheckAsync(int sandboxId) { var queryable = SandboxBaseQueries.SandboxWithResourceAndOperations(_db); return(await GetSandboxFromQueryableThrowIfNotFound(queryable, sandboxId)); }
public async Task <Sandbox> GetDetailsByIdAsync(int id) { return(await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(SandboxBaseQueries.SandboxDetailsQueryable(_db), id, UserOperation.Study_Read)); }
public async Task <string> GetRegionByIdAsync(int sandboxId, UserOperation userOperation) { var sandbox = await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(SandboxBaseQueries.ActiveSandboxesMinimalIncludesQueryable(_db).AsNoTracking(), sandboxId, userOperation); return(sandbox.Region); }
async Task <Sandbox> GetSandboxForDatasetOperationsAsync(int sandboxId, UserOperation operation, bool readOnly, bool includePhase) { return(await GetSandboxFromQueryableThrowIfNotFoundOrNoAccess(SandboxBaseQueries.SandboxForDatasetOperations(_db, includePhase), sandboxId, operation, readOnly)); }