public static Task UseWriter(object model, HttpResponse response, IMessageSerializer writer)
        {
            if (model == null)
            {
                response.StatusCode    = 404;
                response.ContentType   = "text/plain";
                response.ContentLength = ResourceNotFound.Length;

                return(response.WriteAsync(ResourceNotFound));
            }
            else
            {
                response.ContentType = writer.ContentType;
                return(writer.WriteToStream(model, response));
            }
        }