Ejemplo n.º 1
0
        private CreateCommitResponse CreateTypedCommit(CreateCommitRequest request, CommitType commitType)
        {
            var options  = request.ToCommitMessageOptions();
            var message  = this.factory.CreateCommitMessage(commitType, options);
            var response = new CreateCommitResponse
            {
                Message = message,
            };
            HttpRequest httpRequest = this.HttpContext.Request;

            response.Links = new[]
            {
                new LinkResponse(href: this.Url.ActionLink(nameof(this.Describe)), rel: "parent", method: "GET"),
                new LinkResponse(
                    href: $"{httpRequest.Scheme}://{httpRequest.Host}{httpRequest.Path}",
                    rel: "self",
                    method: "GET"),
            };
            return(response);
        }