public MongoDbQuerySagaRepository( IMongoDatabase database, ICollectionNameFormatter collectionNameFormatter ) { _collection = database.GetCollection <TSaga>(collectionNameFormatter); }
public MongoDbSagaRepository(IMongoDatabase database, IMongoDbSagaConsumeContextFactory mongoDbSagaConsumeContextFactory, ICollectionNameFormatter collectionNameFormatter) { _mongoDbSagaConsumeContextFactory = mongoDbSagaConsumeContextFactory; _collection = database.GetCollection <TSaga>(collectionNameFormatter); }
public MongoDbSagaRepository(IMongoDatabase database, ICollectionNameFormatter collectionNameFormatter) { var mongoDbSagaConsumeContextFactory = new MongoDbSagaConsumeContextFactory <TSaga>(); _repositoryContextFactory = new MongoDbSagaRepositoryContextFactory <TSaga>(database.GetCollection <TSaga>(collectionNameFormatter), mongoDbSagaConsumeContextFactory); _repository = new SagaRepository <TSaga>(_repositoryContextFactory); }
public static ISagaRepository <TSaga> Create(IMongoDatabase database, ICollectionNameFormatter collectionNameFormatter) { var mongoDbSagaConsumeContextFactory = new SagaConsumeContextFactory <IMongoCollection <TSaga>, TSaga>(); var repositoryContextFactory = new MongoDbSagaRepositoryContextFactory <TSaga>(database.GetCollection <TSaga>(collectionNameFormatter), mongoDbSagaConsumeContextFactory); return(new SagaRepository <TSaga>(repositoryContextFactory)); }
/// <summary> /// Sets the collection name formatter instance <see cref="ICollectionNameFormatter"/> /// </summary> /// <param name="configurator"></param> /// <param name="collectionNameFormatter"></param> public static void CollectionNameFormatter(this IMongoDbSagaRepositoryConfigurator configurator, ICollectionNameFormatter collectionNameFormatter) { if (configurator == null) { throw new ArgumentNullException(nameof(configurator)); } if (collectionNameFormatter == null) { throw new ArgumentNullException(nameof(collectionNameFormatter)); } configurator.CollectionNameFormatter(_ => collectionNameFormatter); }
public static IMongoCollection <TSaga> GetCollection <TSaga>(this IMongoDatabase database, ICollectionNameFormatter collectionNameFormatter) where TSaga : class, ISaga => database.GetCollection <TSaga>(collectionNameFormatter.Saga <TSaga>());
public DotCollectionNameFormatter_Specs() { _collectionNameFormatter = new DotCaseCollectionNameFormatter(); }
/// <summary> /// Sets the collection name formatter instance <see cref="ICollectionNameFormatter"/> /// </summary> /// <param name="configurator"></param> /// <param name="collectionNameFormatter"></param> public static void CollectionNameFormatter(this IMongoDbSagaRepositoryConfigurator configurator, ICollectionNameFormatter collectionNameFormatter) { configurator.CollectionNameFormatter(_ => collectionNameFormatter); }