コード例 #1
0
ファイル: BaseBatch.cs プロジェクト: iscifoni/SharpBatch
        /// <summary>
        /// Save the value of content into message section of a <see cref="ISharpBatchTracking"/>
        /// </summary>
        /// <param name="content">The content to save</param>
        /// <returns></returns>
        public Task ToTracking(string content)
        {
            ISharpBatchTrackingFactory trackingFactory = (ISharpBatchTrackingFactory)BatchContext.RequestServices.GetService(typeof(ISharpBatchTrackingFactory));
            var responseToTracking = new ResponseToTrackingManager(trackingFactory, SessionId);

            return(responseToTracking.ToTracking(content));
        }
コード例 #2
0
ファイル: BaseBatch.cs プロジェクト: iscifoni/SharpBatch
        /// <summary>
        /// Save the serialized value of content into message section of a <see cref="ISharpBatchTracking"/>,
        /// </summary>
        /// <param name="data">The content to save</param>
        /// <param name="serializer">The <see cref="IModelSerializer"/> to use to serialize data.</param>
        /// <returns></returns>
        public Task ToTracking(object data, IModelSerializer serializer)
        {
            ISharpBatchTrackingFactory trackingFactory = (ISharpBatchTrackingFactory)BatchContext.RequestServices.GetService(typeof(ISharpBatchTrackingFactory));
            var responseToTracking = new ResponseToTrackingManager(trackingFactory, SessionId);

            return(responseToTracking.ToTracking(data, serializer));
        }
コード例 #3
0
        public override void onExecuted(BatchExecutionContext context)
        {
            var response                  = context.ShareMessage.Get <IResponseObject>();
            var sharpBatchTracking        = (ISharpBatchTrackingFactory)context.RequestServices.GetService(typeof(ISharpBatchTrackingFactory));
            var modelSerializer           = (IModelSerializer)context.RequestServices.GetService(typeof(IModelSerializer));
            var responseToTrackingManager = new ResponseToTrackingManager(sharpBatchTracking, modelSerializer, context.SessionId);

            responseToTrackingManager.ToTracking(response.Response);
        }