Reputation: 5027
New to Raven. I have an MVC page that saves data to a Raven document. I am able to save all fields as expected. I have noticed the Id (field/attribute of the table/class structure in my project) is null and it does not get saved into the document. There is a Raven system generated Id in the title of the document (like DocName/123 etc...). How can I get that DocName/123 or 123 or some other auto generated Id field save into the raven document? Please help..Thank you
Upvotes: 2
Views: 281
Reputation: 5916
Raven will Automatically generate the Id if it is not specified. If you don't want Raven to generate this key then you need to specify public string Id {get; set;}
property in your class.`
Upvotes: 2