Example #1
0
        public bool UpdateSnippet(string hash, UpdateSnippetRequest updateSnippetRequest)
        {
            Snippet snippet = _snippetRepository.GetSnippetByHash(hash);

            if (snippet != null)
            {
                snippet.Content      = updateSnippetRequest.NewContent;
                snippet.LastModified = _dateTime.Now.ToString("g");
                _snippetRepository.UpdateSnippet(snippet);
                return(true);
            }

            return(false);
        }
Example #2
0
 public bool UpdateSnippet(string hash, Snippet snippet) =>
 _snippetRepository.GetSnippetByHash(hash) != null && _snippetRepository.UpdateSnippet(snippet);