Closed DennisBaekgaard closed 5 years ago
This will work indeed but you can simplify this to just:
Yeah if you need to have a Guid as the Id you deal with in the code then what you pasted will work. The Id by default will be initialized as a string representation of a Guid anyway so if you don't set it will get initialized with Guid.NewGuid()
Awesome, thank you!
I tried searching around a little and couldn't find any information. I understand that CosmosDB enforces a string id property (for reasons unknown), but what is the recommended practice then? Was considering something like this:
But that will get proper confusing with queries I'd suppose. I do kind a want the type security though.