Beispiel #1
0
        async Task <PreflightConcepts> GetByIdAsync(SqlConnection cn, Guid conceptId)
        {
            var grid = await cn.QueryMultipleAsync(
                ConceptPreflightSql.singleId,
                new { id = conceptId, user = user.UUID, groups = GroupMembership.From(user), admin = user.IsAdmin },
                commandTimeout : opts.DefaultTimeout,
                commandType : CommandType.StoredProcedure
                );

            return(PreflightReader.ReadConcepts(grid));
        }
Beispiel #2
0
        async Task <PreflightConcepts> GetByUIdsAsync(SqlConnection cn, HashSet <string> conceptUids)
        {
            var grid = await cn.QueryMultipleAsync(
                ConceptPreflightSql.manyUIds,
                new { uids = ResourceUniversalIdTable.From(conceptUids), user = user.UUID, groups = GroupMembership.From(user), admin = user.IsAdmin },
                commandTimeout : opts.DefaultTimeout,
                commandType : CommandType.StoredProcedure
                );

            return(PreflightReader.ReadConcepts(grid));
        }
Beispiel #3
0
        async Task <PreflightConcepts> GetAsync(SqlConnection cn, HashSet <Guid> ids)
        {
            var grid = await cn.QueryMultipleAsync(
                queryManyIds,
                new { ids = ResourceIdTable.From(ids), user = user.UUID, groups = GroupMembership.From(user), admin = user.IsAdmin },
                commandTimeout : opts.DefaultTimeout,
                commandType : CommandType.StoredProcedure
                );

            return(PreflightReader.ReadConcepts(grid));
        }
Beispiel #4
0
        async Task <PreflightResources> GetByUIdsAsync(SqlConnection cn, ResourceRefs refs)
        {
            var quids = refs.Queries.Select(q => q.UniversalId.ToString()).ToHashSet();
            var cuids = refs.Concepts.Select(q => q.UniversalId.ToString()).ToHashSet();
            var grid  = await cn.QueryMultipleAsync(
                ResourcePreflightSql.byUIds,
                new { quids = ResourceUniversalIdTable.From(quids), cuids = ResourceUniversalIdTable.From(cuids), user = user.UUID, groups = GroupMembership.From(user), admin = user.IsAdmin },
                commandTimeout : opts.DefaultTimeout,
                commandType : CommandType.StoredProcedure
                );

            return(PreflightReader.ReadResourcesByUId(grid, refs.Queries));
        }