Hello support team,
We're using MongoDB as the data store for one of our modules. We want to create some entities in the Domain layer ( .Core project). Is it possible that our entities can directly inherit from FullAuditedEntity?
Thank you very much.
Dzung Le
5 Answer(s)
-
0
There is no explicit support, but you can try.
https://support.aspnetzero.com/QA/Questions?Filter=Mongodb
-
0
You can use MongoDB with its own API. I think you don't have problems on inheriting from FullAuditedEntity. However, audit properties are not filled automatically and you can not inject a repository for your entity. You should go with MongoDB's capabilities, AspNet Zero has no additional service for MongoDB.
-
0
Hi hikalkan,
We want to build such a MongoDB repository that can be integrated with aspnet zero. Can you show me the best approach to do this? It's hightly appreciated if you have any sample code for that.
Thank you very much.
-
0
You can always implement your own repository.
For example, you can take this as an example:
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.MongoDB/MongoDb/Repositories/MongoDbRepositoryBase.cs
(This is an experimantel package and no official support)
Create a base repository class like this. Insted of injecting IMongoDatabaseProvider, directly use mongodb APIs. Then derive your repositories from this class and manually register to dependency injection.
Since AspNet Zero does not support MongoDb, this is out of support actually. But if you implement it and have a specific question (rather than a full implementation suggestion), we can try to help you.
Have a nice day.
-
1
Thank you very much