コード例 #1
0
        private async Task <object> DeserializeAsync(object value)
        {
            var context = new SerializeWorkflowValueContext(value);
            await _workflowValueSerializers.Resolve().InvokeAsync(x => x.DeserializeValueAsync(context), _logger);

            return(context.Output);
        }
コード例 #2
0
        public async Task DeserializeValueAsync(SerializeWorkflowValueContext context)
        {
            if (context.Input is JObject jObject)
            {
                var type = jObject.Value <string>("Type");

                if (type == "Content")
                {
                    var contentId = jObject.Value <string>("ContentId");
                    context.Output = contentId != null ? await _contentManager.GetAsync(contentId, VersionOptions.Latest) : default(IContent);
                }
            }
        }
コード例 #3
0
        public Task SerializeValueAsync(SerializeWorkflowValueContext context)
        {
            if (context.Input is IContent content)
            {
                context.Output = JObject.FromObject(new
                {
                    Type      = "Content",
                    ContentId = content.ContentItem.ContentItemId
                });
            }

            return(Task.CompletedTask);
        }
 public Task RehydrateValueAsync(SerializeWorkflowValueContext context)
 {
     return(Task.CompletedTask);
 }