public static string ToJson(ExtendOperator extendOperator, bool indented = false) { var jset = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }; string json = JsonConvert.SerializeObject(extendOperator, Formatting.Indented, jset); return(json); }
public static ExtendOperator ToExtendOperator(string args) { var jset = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }; ExtendOperator extendOperator = (ExtendOperator)JsonConvert.DeserializeObject(args, jset); return(extendOperator); }
public static IObservable <IDictionary <string, object> > Extend(this IObservable <IDictionary <string, object> > source, string expression) { var extend = new ExtendOperator(expression); return(Observable.Create <IDictionary <string, object> >( observer => source.Subscribe(e => { try { var r = extend.Extend(e); observer.OnNext(r); } catch (Exception ex) { RxKqlEventSource.Log.LogException(ex.ToString()); observer.OnError(ex); } }))); }