. @pwzeus . LINQPad:
var articles =
(from ch in ContentHistories
.Where(ch=> ch.CompareTag == new Guid("D3C38885-58AB-45CB-A19C-8EF48360F29D")
&& ch.AgainstTag == new Guid("5832933B-9AF9-4DEC-9D8D-DA5F211A5B53")
& ch.Created > DateTime.Now.AddDays(-3))
select ch.Content)
.Elements("Article")
.Select(article => new {
Id = Convert.ToInt32(article.Element("Id").Value),
AcessionNumber = (string)article.Element("AcessionNumber").Value,
Headline = (string)article.Element("Headline").Value,
PublicationDate = Convert.ToDateTime(article.Element("PublicationDate").Value),
ArrivalDate = Convert.ToDateTime(article.Element("ArrivalDate").Value),
Source = (string)article.Element("Source").Value,
CopyRight = (string)article.Element("CopyRight").Value,
Language = (string)article.Element("Language").Value,
WordCount = String.IsNullOrEmpty(article.Element("WordCount").Value) ? 0 : Convert.ToInt32(article.Element("WordCount").Value),
Snippet = (string)article.Element("Headline").Value,
LeadParagraph = (string)article.Element("Headline").Value,
ContentGuid = new Guid(article.Element("ContentGuid").Value)
})
.Skip(5)
.Take(5)
articles.Dump();
T-SQL:
DECLARE @p0 UniqueIdentifier = 'd3c38885-58ab-45cb-a19c-8ef48360f29d'
DECLARE @p1 UniqueIdentifier = '5832933b-9af9-4dec-9d8d-da5f211a5b53'
DECLARE @p2 DateTime = '2009-09-27 12:43:20.386'
SELECT [t0].[Content]
FROM [ContentHistory] AS [t0]
WHERE ([t0].[CompareTag] = @p0) AND ([t0].[AgainstTag] = @p1)
AND ([t0].[Created] > @p2)
, , ContentHistory Content XML- <Article>. , .Skip(5). (5) SQL, , , 50 , 5, :
Row ArticleCount
1 10
2 5
3 20
4 10
5 5
6 1
7 1
8 1
9 1
10 1