Beispiel #1
0
        public AffiliateCategoryMongoDbRepository(IMongoWrapper wrapper)
        {
            Wrapper = wrapper ?? throw new ArgumentNullException(nameof(wrapper));

            Wrapper.CreateCollectionIfNotExistsAsync <AffiliateCategory>(CollectinoName);
            Wrapper.CreateIndexIfNotExistsAsync <AffiliateCategory>(CollectinoName, "categoryId", null, e => e.CategoryId);
        }
Beispiel #2
0
        public CouponMongoDbRepository(AdvertiserMongoSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            Wrapper = settings.CreateWrapper();
            Wrapper.CreateCollectionIfNotExistsAsync <Coupon>(CollectinoName);
        }
Beispiel #3
0
        public FailedEventsToSubmitMongoDbRepository(LogMongoSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            Wrapper = settings.CreateWrapper();
            Wrapper.CreateCollectionIfNotExistsAsync <FailedEvent>(CollectinoName);
        }
Beispiel #4
0
        public StoreMongoDbRepository(AdvertiserMongoSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            Wrapper = settings.CreateWrapper();
            Wrapper.CreateCollectionIfNotExistsAsync <Store>(CollectinoName);
            SaveAsync(Store.GetDefaultStore()).ConfigureAwait(false).GetAwaiter().GetResult();
        }
Beispiel #5
0
        public AffiliateStoreMatchesMongoDbRepository(AdvertiserMongoSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            Wrapper = settings.CreateWrapper();
            Wrapper.CreateCollectionIfNotExistsAsync <AffiliateStoreMatch>(CollectinoName);
            Wrapper.CreateIndexIfNotExistsAsync <AffiliateStoreMatch>(CollectinoName, "AdvertiseStoreId",
                                                                      null,
                                                                      advertiseStoreId => advertiseStoreId.AdvertiseStoreId,
                                                                      program => program.AffiliateProgram,
                                                                      storeId => storeId.AffiliateStoreId);
        }