Example #1
0
 public Task <object> Initialize(dynamic obj)
 {
     _binder = new BinderCore();
     return(SyncTask(() =>
     {
         var result = _binder.Initialize(obj.path);
         return EdgeResult.Ok(result);
     }));
 }
Example #2
0
 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);
         }
     }));
 }