private async Task <IHttpActionResult> GetResultFromMethodFeedbackAsync(UnsafeMethod method, ResourceBody body)
        {
            IRestEndpoint endpoint = GetEndpoint();

            if (!endpoint.EvaluatePreconditions(GetPreconditions()))
            {
                return(StatusCode(HttpStatusCode.PreconditionFailed));
            }

            Feedback feedback = await endpoint.CommandAsync(method, body);

            return(GetResultFromFeedback(feedback));
        }
        public async Task <object> GetAsync()
        {
            IRestEndpoint endpoint = GetEndpoint();

            if (!endpoint.EvaluatePreconditions(GetPreconditions()))
            {
                return(StatusCode(HttpStatusCode.NotModified));
            }

            ResourceBody resourceBody = await endpoint.GetAsync(GetQuery());

            ResponseBuilder.AddResource(resourceBody);
            return(Response.ResourceBody); // TODO headers?
        }