示例#1
0
        public SdlWikiDocument GetDocument(string name)
        {
            SdlWikiDocument document = _repo.GetDocument(name);

            if (document == null)
            {
                if ((document = _downloader.GetDocument(name)) != null)
                {
                    _repo.UpdateDocument(document);
                }
            }

            return(document);
        }
示例#2
0
        public bool UpdateDocument(SdlWikiDocument document)
        {
            var  documentName = document.Name.ToLowerInvariant();
            bool added        = false;

            Documents.AddOrUpdate(documentName, document, (key, oldValue) =>
            {
                added = true;
                return(document);
            });

            DateUpdated = DateTime.UtcNow;
            Modified    = true;

            return(added);
        }