Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
341 stars 44 forks source link

"auto"-updates in store oncreate, onchange #58

Open MatsJakobsson opened 5 years ago

MatsJakobsson commented 5 years ago

Hi!

We would love to have a property LastUpdatedDate being set on the entity on every Create and Update configured directly in the store.

Down the road, this type of configuration capability would also be helpful if we were to implement soft deletes etc.

Is this possible today without wrapping the store?

Many thanks for all the great work on the client!

Elfocrash commented 5 years ago

Hey @MatsJakobsson,

I don't know if I want to add such a feature for multiple reasons.

The way I see it, I wouldn't want to add something like that at this point unless there is a more general need for it. I think, it should be fine for the client side to set those value before add/update. I know it sucks to wrap the store if you didn't do it already but maybe it's the best solution at least for now.

I might, however, consider adding an action delegate that can mutate the document right before the action.

Does this make sense?

Thanks, Nick

MatsJakobsson commented 5 years ago

Hi Nick!

Thank you for you reply.

An action delegate with the possibility to mutate the document before the action would be really nice.

/Mats