--
You received this message because you are subscribed to the Google Groups "RavenDB - an awesome database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/bb167353-7967-4505-848c-3a6686d49568n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGSmRRcvEbgeGMHfCG4c6yG-K5R0%3D%2BGXmyd0Qo%2B7WcaFA6A%40mail.gmail.com.
![]() | Oren Eini CEO / Hibernating Rhinos LTD
|
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/3c4af8ab-e49f-43f1-b9af-dd683598709bn%40googlegroups.com.
![]() | Egor Developer / Hibernating Rhinos LTD
|
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - an awesome database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/4DYvR4uwAbk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAJvo4-kZskoiYnTF%3DbRPFOhwz1n8VmEgBD7Ycg_A02%3Dg3L8TCg%40mail.gmail.com.
var doc = new Doc();
var docId = hilo.NextId(documentStore.DatabaseCommands);
docid.Id += docId;
session.Store(doc);treeOfDocs.Add(docId);session.Store(treeOfDocs);session.SaveChanges(); // saves both changes in one transaction
You don’t need to call the hilo.NextId.
Just call session.Store and it will handle that behind the scene inside the session.Store.
var doc = new Doc();
session.Store(doc);treeOfDocs.Add(docId);
session.Store(treeOfDocs);
session.SaveChanges(); // saves both changes in one transaction
--
You received this message because you are subscribed to the Google Groups "RavenDB - an awesome database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXi1DKVBWKS5pr873agXXrvUgdUJ5v44btMyCQMbM_UjgA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGSmUN5k8XL08%3DUuDGbdLROCDy83%2Bdg-S9%3D%2BD22rLi6-gKw%40mail.gmail.com.
You can get it from the id property before the SaveChanges.
var doc = new Doc();
session.Store(doc);
treeOfDocs.Add(doc.Id); // first option if your class contains id property
treeOfDocs.Add(session.Advanced.GetDocumentId(comment)); // second option if your class does not contain id property
session.Store(treeOfDocs);
session.SaveChanges(); // saves both changes in one transaction
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXgLQoCZkTpEKPpHWsa9RKazpQDaK05VPO6-5Q87He8oKA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGS%3DABqP4c96VhgqBO%3DcyZ_FQbezyMPmYBEqAM85x%2BHBY3g%40mail.gmail.com.
var doc = new Doc();
var docId = documentStore.Conventions.GenerateDocumentId(documentStore.Database, doc);
docid.Id += docId;session.Store(doc);treeOfDocs.Add(docId);session.Store(treeOfDocs);session.SaveChanges(); // saves both changes in one transaction
session.Advanced.UseOptimisticConcurrency = true;
using (var session = store.OpenSession(new SessionOptions
{
TransactionMode = TransactionMode.ClusterWide
}))
You can store, delete and edit documents and the session will track them as usual.
--
You received this message because you are subscribed to the Google Groups "RavenDB - an awesome database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXhhx3u_TUDOHi-KfTNDPNMFVSpnum3K0cUmtGwQOYgNKA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGS%3DaPbHzsXP-G%3DiJHnub4O4cD2xPTU3uucUBzkcTSY1eOA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXiqEUMbR8NeweYp%3DwSfc_GZOBBM6%3DEGYMU77DB2hS4smg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXj4-dNTqHECaAOy9hwQRYHWvN84t-rTP9sfHe93H747Eg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAADcGSnoNPS0VH%3Dw%2BwtNdfBt8tJ938WmcHnz3FAvCTOcpHi2Pg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAF0G-ZjMoMEy8O4xiDRi3V_4ZY0nyWi-aXOdt%3DP4b0B8MJ6_mA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXiBoKxE1G%2BGFiFGD1S2mRBBshKW_YXH5WELGCGeievAKA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAF0G-ZijSgp8wrLfD7_cn%3DeJVYpQRpSmte51KP1iyHaG--cSKg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CABcSOXgH4YoWK8V2km3zLPZfcsXE8iQzXHLQmoRSV9AyKcWDVw%40mail.gmail.com.