예제 #1
0
        public IDocumentDescriptor LoadDocument(string url)
        {
            var cmd = connection.CreateCommand();

            cmd.CommandText = string.Format("select content from {0} where url='{1}'", this.tableName, url);
            var reader = cmd.ExecuteReader();

            if (reader.Read())
            {
                HtmlContentDescriptor content = new HtmlContentDescriptor();
                content.Content = reader["content"] as string;
                content.Title   = reader["title"] as string;
                content.Url     = url;
                return(content);
            }
            return(null);
        }
예제 #2
0
        public bool SaveDocument(string title, string document)
        {
            IDocumentDescriptor doc = new HtmlContentDescriptor();

            return(this.SaveDocument(doc.Title, doc.Content));
        }