public override object GetData(ITabContext context) { var getInvocationsRequest = new GetInvocationsRequest(); var getInvocationsResult = _getInvocationsHandler.Handle(getInvocationsRequest); var data = FormatInvocations(getInvocationsResult.Invocations); return data; }
public GetInvocationsResult Handle(GetInvocationsRequest request) { var invocations = PluginSettings.GetInvocations(); if (invocations != null) invocations = invocations.OrderByDescending(i => i.StartedOn); var result = new GetInvocationsResult { Invocations = invocations }; return result; }
/// <summary> /// Executes the specified resource with the specific context. /// </summary> /// <param name="context">The context.</param> /// <returns> /// <see cref="IResourceResult" /> that can be executed when the Http response is ready to be returned. /// </returns> /// <exception cref="System.ArgumentNullException">Exception thrown if <paramref name="context"/> is <c>null</c>.</exception> public IResourceResult Execute(IResourceContext context) { if (context == null) throw new ArgumentNullException("context"); var getInvocationsHandler = new GetInvocationsHandler(); var getInvocationsRequest = new GetInvocationsRequest(); var getInvocationsResult = getInvocationsHandler.Handle(getInvocationsRequest); var data = FormatInvocations(getInvocationsResult.Invocations); return new CacheControlDecorator(0, CacheSetting.NoCache, new JsonResourceResult(data, context.Parameters.GetValueOrDefault(ResourceParameter.Callback.Name))); }
public GetInvocationsResult Handle(GetInvocationsRequest request) { var invocations = PluginSettings.GetInvocations(); if (invocations != null) { invocations = invocations.OrderByDescending(i => i.StartedOn); } var result = new GetInvocationsResult { Invocations = invocations }; return(result); }