Let's say we have a model as under
public class RSS
{
public string Id { get; set; }
public string QuestionID { get; set; }
public string QuestionTitle { get; set; }
public string QuestionDescription { get; set; }
public DateTime PublishDate { get; set; }
}
The below piece of code will read all data from from RSS model to RavenDB
public List<RSS> ReadRssFeed(IEnumerable<string> lstIDs)
{
var rssCollection = new List<RSS>();
using (var ds = new DocumentStore
{
Url = "http://localhost:8080",
DefaultDatabase = "CRUDDemo"
}.Initialize())
using (var session = ds.OpenSession())
{
foreach (var id in lstIDs)
{
rssCollection.Add(session.Load<RSS>(id));
}
}
return rssCollection;
}