示例#1
0
        public static IContextManager GetContextManager()
        {
            var sender = GetSender();
            var bucket = new BucketExtension(sender);

            return(new ContextManager(bucket));
        }
示例#2
0
        public static IChatbotFlowService GetFlowService()
        {
            var sender            = GetSender();
            var owlFilter         = new OWLFilter(GetClient());
            var carouselBuilder   = new CarouselBuilder(owlFilter);
            var quickReplyBuilder = new QuickReplyBuilder();
            var broadcast         = new BroadcastExtension(sender);
            var bucket            = new BucketExtension(sender);
            var contextManager    = new ContextManager(bucket);

            return(new ChatbotFlowService
                   (
                       carouselBuilder,
                       quickReplyBuilder,
                       broadcast,
                       contextManager,
                       owlFilter,
                       sender
                   ));
        }
示例#3
0
 /// <summary>
 /// Deletes the document with the given <paramref name="id"/> from the Bucket
 /// </summary>
 /// <param name="id"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public async Task DeleteAsync(string id, CancellationToken cancellationToken = new CancellationToken())
 {
     var bucketExtension = new BucketExtension(_sender);
     await bucketExtension.DeleteAsync(id, cancellationToken);
 }
示例#4
0
 /// <summary>
 /// Stores a <paramref name="document"/> on the bucket
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="id"></param>
 /// <param name="document"></param>
 /// <param name="expiration"></param>
 /// <param name="cancellationToken"></param>
 /// <returns></returns>
 public async Task SetAsync <T>(string id, T document, TimeSpan expiration = new TimeSpan(), CancellationToken cancellationToken = new CancellationToken()) where T : Document
 {
     var bucketExtension = new BucketExtension(_sender);
     await bucketExtension.SetAsync(id, document, expiration, cancellationToken);
 }
示例#5
0
        /// <summary>
        /// Gets the bucket documents IDs from index <paramref name="skip"/> to <paramref name="take"/>
        /// </summary>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <param name="cancellationToken"></param>
        /// <returns>A <c>DocumentCollection</c> of the recovered IDs</returns>
        public async Task <DocumentCollection> GetIdsAsync(int skip = 0, int take = 100, CancellationToken cancellationToken = new CancellationToken())
        {
            var bucketExtension = new BucketExtension(_sender);

            return(await bucketExtension.GetIdsAsync(skip, take, cancellationToken));
        }
示例#6
0
        /// <summary>
        /// Gets a document from the bucket using the given <paramref name="id"/>
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id"></param>
        /// <param name="cancellationToken"></param>
        /// <returns>Lime <c>Document</c> of the sub-type set on <c>T</c></returns>
        public async Task <T> GetAsync <T>(string id, CancellationToken cancellationToken = new CancellationToken()) where T : Document
        {
            var bucketExtension = new BucketExtension(_sender);

            return(await bucketExtension.GetAsync <T>(id, cancellationToken));
        }