/// <summary>
        ///
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="storeClient"></param>
        /// <param name="items"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static Task <int> BulkUpsertAsync <TEntity>(
            this ILeaderboardsStoreClient storeClient,
            IEnumerable <TEntity> items,
            CancellationToken cancellationToken)
            where TEntity : class
        {
            if (storeClient == null)
            {
                throw new ArgumentNullException(nameof(storeClient));
            }

            return(storeClient.BulkUpsertAsync(items, null, cancellationToken));
        }
Exemple #2
0
 public DailyLeaderboardsWorker(
     uint appId,
     ILeaderboardsContext db,
     ISteamClientApiClient steamClientApiClient,
     ILeaderboardsStoreClient storeClient,
     TelemetryClient telemetryClient)
 {
     this.appId           = appId;
     this.telemetryClient = telemetryClient;
     this.db = db;
     this.steamClientApiClient = steamClientApiClient;
     this.storeClient          = storeClient;
 }
Exemple #3
0
            public async Task StoreClientIsNull_ThrowsArgumentNullException()
            {
                // Arrange
                ILeaderboardsStoreClient storeClient = null;
                var items             = new List <object>();
                var cancellationToken = CancellationToken.None;

                // Act -> Assert
                await Assert.ThrowsAsync <ArgumentNullException>(() =>
                {
                    return(storeClient.BulkUpsertAsync(items, cancellationToken));
                });
            }