protected override async Task <IDataSinkAdapter> CreateAsync(DocumentDbClient client, IDataItemTransformation transformation,
                                                                     IDocumentDbBulkSinkAdapterConfiguration configuration, IEnumerable <string> collectionNames, CancellationToken cancellation)
        {
            var sink = new DocumentDbBulkSinkAdapterDispatcher(client, transformation, GetInstanceConfiguration(configuration, collectionNames));
            await sink.InitializeAsync();

            return(sink);
        }
Example #2
0
        protected override async Task <IDataSinkAdapter> CreateAsync(IDataTransferContext context, IDataItemTransformation transformation,
                                                                     IDocumentDbBulkSinkAdapterConfiguration configuration, CancellationToken cancellation)
        {
            var collectionNames = ResolveCollectionNames(configuration.Collection);

            if (!collectionNames.Any())
            {
                throw Errors.CollectionNameMissing();
            }

            var sink = new DocumentDbBulkSinkAdapterDispatcher(
                CreateClient(configuration, context, collectionNames.Count() > 1, null),
                transformation, GetInstanceConfiguration(configuration, collectionNames));

            await sink.InitializeAsync(cancellation);

            return(sink);
        }