public class DocumentIndex : AbstractIndexCreationTask<Document>
{
public DocumentIndex()
{
this.Map = items =>
from x in items
select new Projection
{
Id = x.Id,
Foo = x.Foo,
Bar = x.Foo + "bar",
};
}
public class Projection
{
public string Id { get; set; }
public string Foo { get; set; }
public string Bar { get; set; }
}
}
string[] baz
;
var query = this.Query<DocumentIndex.Projection, DocumentIndex>().Where(x=>x.Bar.In(baz));
var query2 = query.ProjectFromIndexFieldsInto<Document>();
var items = query2.Skip(offset).Take(pageSize).ToList();
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
string[] baz
;
var query = this.Query<DocumentIndex.Projection, DocumentIndex>().Where(x=>x.Bar.In(baz));
var query2 = query.ProjectFromIndexFieldsInto<Document>();
var items = query2.Skip(offset).Take(pageSize).ToList();
foreach (var item in items)
{
this.Session.Store(item); // Do nothing
item.Id = this.Session.Advanced.GetDocumentId(item); // set Id to null
}
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.