gottscj / Hangfire.Mongo

Mongo DB support for Hangfire
MIT License
262 stars 84 forks source link

Return IGlobalConfiguration<MongoStorage> instead of MongoStorage in all UseMongoStorage #317

Closed Ghaiath closed 1 year ago

Ghaiath commented 2 years ago

Hi,

I believe that all UseMongoStorage(this ...) should return IGlobalConfiguration<MongoStorage> instead of MongoStorage object. In case you want to attach more extensions after initializing the MongoDb storage.

Trying to attach extensions before will case an exception JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.

'MongoStorage' does not contain a definition for '' and the best extension method overload '' requires a receiver of type 'IGlobalConfiguration'

Thanks

gottscj commented 2 years ago

@Ghaiath,

Thank you for the suggestion. I will try to add it for next release. Thanks!

gottscj commented 1 year ago

fixed