Elfocrash / Cosmonaut

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

CosmosStore remove sealed from class and add virtual to methods #47

Closed fileman closed 5 years ago

fileman commented 5 years ago

hi, in my project I need to add some audit property (CreatedBy, CreatedAt, etc...), is possible to remove sealed from CosmosStore class and add virtual to its methods? If you agree I can do a PR for these changes, otherwise I create a custom version in my project. Thanks

Elfocrash commented 5 years ago

I won't be changing the seal and virtual tags but I'm wondering. What is the problem with adding those in a base class DTO and have your POCOs extend that class?

fileman commented 5 years ago

Those properties are in class, but I set their value in repository when entity is added, modified, soft-deleted o removed... maybe this isn't the better way to do it

Elfocrash commented 5 years ago

It sounds like you can still do it in the repository. CosmosDB also supports triggers so there's that too.

fileman commented 5 years ago

My bad design... I have replaced repository with cosmonaut, but is better if I use it inside the repository, thanks for the help