Exemple #1
0
        private QueryAdapter(
            AsyncQueryableOptions options,
            ImmutableDictionary <Type, IEnumerable> entries) : base(Microsoft.Extensions.Options.Options.Create(options))
        {
            Debug.Assert(entries is not null);

            _entries = entries;
        }
Exemple #2
0
        public static async ValueTask <QueryAdapter> CreateAsync(
            AsyncQueryableOptions options,
            Func <ISeedHelper, CancellationToken, ValueTask> seed)
        {
            var entriesBuilder = new QueryAdapterEntriesBuilder();

            await seed(entriesBuilder, CancellationToken.None).ConfigureAwait(false);

            var entries = entriesBuilder.GetEntries();

            return(new QueryAdapter(options, entries));
        }
Exemple #3
0
 protected override async ValueTask <QueryAdapterBase> GetQueryAdapterAsync(
     AsyncQueryableOptions options,
     Func <ISeedHelper, CancellationToken, ValueTask> seed)
 {
     return(await QueryAdapter.CreateAsync(options, seed));
 }
Exemple #4
0
 private ValueTask <QueryAdapterBase> GetQueryAdapterAsync(AsyncQueryableOptions options)
 {
     return(GetQueryAdapterAsync(options, SeedAsync));
 }
Exemple #5
0
 protected abstract ValueTask <QueryAdapterBase> GetQueryAdapterAsync(
     AsyncQueryableOptions options,
     Func <ISeedHelper, CancellationToken, ValueTask> seed);