contracts/{contractID}/orders/{HiLoOrder}contracts/1241-A/orders/12-A--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/b35dc992-8497-4e39-ace2-c1a898020f35%40googlegroups.com.
![]()  | Oren Eini CEO / Hibernating Rhinos LTD 
 
  | 
Hi,Yes, you can do that in one of two ways.
The simplest is to save the document using the key: "contracts/{contractID}/orders/"
That will cause the server to generate the rest of the value, appropriatelyAlternatively, you can use the hi lo directly.AsyncHiLoIdGenerator is the class you want. Make sure that it has the same lifecyle as the document store (and you dispose it before you dispose the doc store)You can use that to generate ids by calling GenerateDocumentIdAsync and overriding GetDocumentIdFromId.Just be sure to also use the ServerTag as well
On Thu, Dec 12, 2019 at 3:02 PM Ivan Montilla <goo...@ivanmontilla.es> wrote:
Hello,--Can be used HiLo combined with semantic ID?My idea is use the ID to perform a relationship, in my example, an order is part of a contract, so my idea is generate ID for Order like this:contracts/{contractID}/orders/{HiLoOrder}
Example:contracts/1241-A/orders/12-A
The idea is mark on the order ID that the order 12-A is part of the contract 1241-A.How can I do it? I'm using C# client.
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 rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/b35dc992-8497-4e39-ace2-c1a898020f35%40googlegroups.com.
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/5fda112d-b312-487c-9ec0-85078a7a2942%40googlegroups.com.
Hi,Yes, you can do that in one of two ways.
The simplest is to save the document using the key: "contracts/{contractID}/orders/"
That will cause the server to generate the rest of the value, appropriatelyAlternatively, you can use the hi lo directly.AsyncHiLoIdGenerator is the class you want. Make sure that it has the same lifecyle as the document store (and you dispose it before you dispose the doc store)You can use that to generate ids by calling GenerateDocumentIdAsync and overriding GetDocumentIdFromId.Just be sure to also use the ServerTag as well
On Thu, Dec 12, 2019 at 3:02 PM Ivan Montilla <goo...@ivanmontilla.es> wrote:
Hello,--Can be used HiLo combined with semantic ID?My idea is use the ID to perform a relationship, in my example, an order is part of a contract, so my idea is generate ID for Order like this:contracts/{contractID}/orders/{HiLoOrder}
Example:contracts/1241-A/orders/12-A
The idea is mark on the order ID that the order 12-A is part of the contract 1241-A.How can I do it? I'm using C# client.
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 rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/b35dc992-8497-4e39-ace2-c1a898020f35%40googlegroups.com.
enum IdGeneratorStrategy
{
  None, Server-Side, HiLo, Identity
}await session.StoreAsync(entity, $"orders/{customerId}/", IdGeneratorStrategy.HiLo, cancellationToken);To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/5fda112d-b312-487c-9ec0-85078a7a2942%40googlegroups.com.
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/6857fbe4-bb82-4d29-af04-fe59db2cd6d3%40googlegroups.com.
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/5d5a4c7b-ba51-4cce-82c3-28b67a28a612%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAJvo4-%3D3G1TNp%3D8HvGv3ZLJM%2BJmtpBgcUtsW9N18x_zL_zsTPw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/CAF0G-ZgsXbTi0TShxWXXHE-jHPKdJ9rWRCa_KJpt6EoQPj0GdQ%40mail.gmail.com.