Is there a way to put an attribute on a property to tell RavenDB to use this property just like the ID-property and put an auto increment on it?
Pseudo-code:
public class MyObj {
public string Id { get; set; }
[Increment]
public int OtherProp { get; set; }
}
You can find the answer in RavenDB google groups. https://groups.google.com/forum/#!msg/ravendb/70xaVjoMidU/ssDs4mbKoxQJ
Dynamicus points to the correct solution, but I'd like to give the exact sample-code for helping other Stackoverflow-users and maybe also making the solution more searchable.
In relation to the question's example-code, here is the solution:
Then where after you initialize your
DocumentStore
you add this code to make above listener work: