public Task <object> Initialize(dynamic obj) { _binder = new BinderCore(); return(SyncTask(() => { var result = _binder.Initialize(obj.path); return EdgeResult.Ok(result); })); }
static Task <object> AsyncTask(Func <object> function) { return(Task.Factory.StartNew(() => { try { var result = function.Invoke(); return EdgeResult.Ok(result); } catch (Exception ex) { return EdgeResult.NotOk(ex.Message); } })); }