public static CassiniTaskResult Execute(ICommand command) { var task = Task.Factory.StartNew(() => command.Execute()); try { task.Wait(); } catch (AggregateException aggregateException) { command.SetException(aggregateException.GetBaseException()); } return(command.GetResult()); }
public static CassiniTaskResult Execute(ICommand command) { var task = Task.Factory.StartNew(() => command.Execute()); try { task.Wait(); } catch (AggregateException aggregateException) { command.SetException(aggregateException.GetBaseException()); } return command.GetResult(); }