/// <summary> /// Deserialize the child workflow completion result in to TType. It supports the the deserialization in primitive and complex (JSON) type. /// </summary> /// <typeparam name="TType"></typeparam> /// <param name="event"></param> /// <returns></returns> public static TType Result <TType>(this ChildWorkflowCompletedEvent @event) { try { if (typeof(TType).Primitive()) { return((TType)Convert.ChangeType(@event.Result, typeof(TType))); } } catch (FormatException exception) { throw new InvalidCastException(string.Format(Resources.Can_not_deserialize_json_data_into_type, @event.Result, typeof(TType)), exception); } return(@event.Result.As <TType>()); }
public WorkflowAction CompletedAction(ChildWorkflowCompletedEvent completedEvent) { return(_completedAction(completedEvent)); }
/// <summary> /// Deserializet the child workflow completion result in to dynamic object. /// </summary> /// <param name="event"></param> /// <returns></returns> public static dynamic Result(this ChildWorkflowCompletedEvent @event) => @event.Result.AsDynamic();
WorkflowAction IWorkflow.WorkflowAction(ChildWorkflowCompletedEvent completedEvent) { var childWorkflowItem = _allWorkflowItems.ChildWorkflowItem(completedEvent); return(childWorkflowItem.CompletedAction(completedEvent)); }