Example #1
0
        private static MongoDbOptions <TContext> MongoDbOptionsFactory <TContext>(
            IComponentContext componentContext,
            Action <IComponentContext, MongoDbOptionBuilder> optionsAction)
            where TContext : MongoDbContext
        {
            var builder = new MongoDbOptionBuilder <TContext>();

            optionsAction.Invoke(componentContext, builder);

            return((MongoDbOptions <TContext>)builder.Options);
        }
Example #2
0
        private static MongoDbOptions <TContext> MongoDbOptionsFactory <TContext>(
            IKernel kernel,
            Action <IKernel, MongoDbOptionBuilder> optionsAction)
            where TContext : MongoDbContext
        {
            var builder = new MongoDbOptionBuilder <TContext>();

            optionsAction.Invoke(kernel, builder);

            return((MongoDbOptions <TContext>)builder.Options);
        }
Example #3
0
        private static MongoDbOptions <TContext> MongoDbOptionsFactory <TContext>(
            IServiceProvider applicationServiceProvider,
            Action <IServiceProvider, MongoDbOptionBuilder> optionsAction)
            where TContext : MongoDbContext
        {
            var builder = new MongoDbOptionBuilder <TContext>();

            optionsAction.Invoke(applicationServiceProvider, builder);

            return((MongoDbOptions <TContext>)builder.Options);
        }