mongo-extensions
mongo-extensions copied to clipboard
Simpler ways to configure collections
Current collection configuration needs always a separate configuration class per collection At the moment the collections can only be configured in the way, that we have to create a configuration class (for each collection), which is inherited from the IMongoCollectionConfiguration<TDocument> interface. In this configuration class, we have to implement the OnConfiguring method. Afterwards, the configuration class has to be registered at the IMongoDatabaseBuilder.ConfigureCollection(...);
This is quite complex configuration process, especially if you have a simple case.... for example if you only want to set the name of the collection.
Feature request What we would like to have, is the IMongoDatabaseBuilder.ConfigureCollection(...) method with the two overloads:
- With a string parameter for only to configure the name of the collection.
- With the IMongoCollectionBuilder<TDocument> directly injected here. (Then we would not have to create an extra configuration class, if we dont want/need.