private static JObject SerializeAction(ServiceAction action) { var jAction = new JObject { ["Name"] = action.Name, ["Body"] = action.Body, ["MediaType"] = action.MediaType, ["Method"] = action.Method, ["UriPath"] = action.UriPath }; return jAction; }
private async Task InvokeRestActionAsync(ServiceAction action) { try { var response = await _invokerFactory.CreateInvoker(action).InvokeRestActionAsync(); Messenger.Default.Send(new NotificationMessage<HttpResponse>(response, "Service Action Result")); } catch (Exception ex) { //TODO: Move dialog call to somewhere else await new MessageDialog($"Something bad happended: {ex.Message}").ShowAsync(); } }
public ActionInvokerActionInvoker(ServiceAction action) { _action = action; }
public IActionInvoker CreateInvoker(ServiceAction action) { return new ActionInvokerActionInvoker(action); }