@@ -239,7 +239,7 @@ await sqlServerCache.SetAsync(
239239 // Assert
240240 Assert . Null ( value ) ;
241241 }
242-
242+
243243 [ IgnoreWhenNoSqlSetupFact ]
244244 public async Task DoesNotThrowException_WhenOnlyAbsoluteExpirationSupplied_AbsoluteExpirationRelativeToNow ( )
245245 {
@@ -360,24 +360,24 @@ await AssertGetCacheItemFromDatabaseAsync(
360360 absoluteExpiration : absoluteExpiration ,
361361 expectedExpirationTime : absoluteExpiration ) ;
362362 }
363-
364- [ IgnoreWhenNoSqlSetupFact ]
365- public async Task SetCacheItem_Uses_DefaultSlidingExpiration_If_NoSlidingOrAbsoluteExpirationSupplied ( )
366- {
367- // Arrange
368- var key = Guid . NewGuid ( ) . ToString ( ) ;
369- var sqlServerCache = GetCache ( ) ;
370- var expectedValue = Encoding . UTF8 . GetBytes ( "Hello, World!" ) ;
371-
372- await sqlServerCache . SetAsync (
373- key ,
374- expectedValue ,
375- new DistributedCacheEntryOptions ( ) ) ;
376-
377- var cacheItem = await GetCacheItemFromDatabaseAsync ( key ) ;
378- Assert . NotNull ( cacheItem ) ;
379- Assert . Equal ( cacheItem . SlidingExpirationInSeconds , _databaseOptionsFixture . Options . Value . DefaultSlidingExpiration ) ;
380- }
363+
364+ [ IgnoreWhenNoSqlSetupFact ]
365+ public async Task SetCacheItem_Uses_DefaultSlidingExpiration_If_NoSlidingOrAbsoluteExpirationSupplied ( )
366+ {
367+ // Arrange
368+ var key = Guid . NewGuid ( ) . ToString ( ) ;
369+ var sqlServerCache = GetCache ( ) ;
370+ var expectedValue = Encoding . UTF8 . GetBytes ( "Hello, World!" ) ;
371+
372+ await sqlServerCache . SetAsync (
373+ key ,
374+ expectedValue ,
375+ new DistributedCacheEntryOptions ( ) ) ;
376+
377+ var cacheItem = await GetCacheItemFromDatabaseAsync ( key ) ;
378+ Assert . NotNull ( cacheItem ) ;
379+ Assert . Equal ( cacheItem . SlidingExpirationInSeconds , _databaseOptionsFixture . Options . Value . DefaultSlidingExpiration ) ;
380+ }
381381
382382 [ IgnoreWhenNoSqlSetupFact ]
383383 public async Task ExtendsExpirationTime_ForSlidingExpiration ( )
@@ -711,7 +711,7 @@ public async Task Profiling(int threadCount, int outerLoop, int innerLoop)
711711 {
712712 }
713713
714- await cache . SetAsync ( key , value , options ) ;
714+ await cache . SetAsync ( key , value , options ) ;
715715 }
716716 }
717717 } ) ;
@@ -732,7 +732,7 @@ public async Task IsDuplicateKeyException()
732732 var expectedValue = Encoding . UTF8 . GetBytes ( "MyValue" ) ;
733733
734734 await cache . SetAsync ( key , expectedValue , options ) ;
735-
735+
736736 CacheItemInfo value = new CacheItemInfo
737737 {
738738 Id = key ,
@@ -751,7 +751,7 @@ public async Task IsDuplicateKeyException()
751751
752752 await cache . SetAsync ( key , expectedValue , options ) ;
753753 }
754-
754+
755755 [ IgnoreWhenNoSqlSetupFact ]
756756 public async Task DeleteExpiredCacheItems ( )
757757 {
@@ -778,8 +778,8 @@ await sqlServerCache.SetAsync(
778778 cacheItemInfo = await sqlServerCache . GetAsync ( key ) ;
779779 Assert . Null ( cacheItemInfo ) ;
780780 }
781-
782-
781+
782+
783783 private MySqlCache GetCache ( ISystemClock testClock = null )
784784 {
785785 var options = _databaseOptionsFixture . Options . Value ;
@@ -812,8 +812,8 @@ private async Task<CacheItemInfo> GetCacheItemFromDatabaseAsync(string key)
812812 using ( var connection = new MySqlConnection ( _databaseOptionsFixture . Options . Value . ReadConnectionString ) )
813813 {
814814 var command = new MySqlCommand (
815- "SELECT Id, Value, ExpiresAtTime, SlidingExpirationInSeconds, AbsoluteExpiration " +
816- $ "FROM { _databaseOptionsFixture . Options . Value . TableName } WHERE Id = @Id",
815+ "SELECT " + Columns . Names . CacheItemId + ", " + Columns . Names . CacheItemValue + ", " + Columns . Names . ExpiresAtTime + ", " + Columns . Names . SlidingExpirationInSeconds + ", " + Columns . Names . AbsoluteExpiration + " " +
816+ $ "FROM { _databaseOptionsFixture . Options . Value . TableName } WHERE " + Columns . Names . CacheItemId + " = @Id",
817817 connection ) ;
818818 command . Parameters . AddWithValue ( "Id" , key ) ;
819819
@@ -859,7 +859,7 @@ private async Task<CacheItemInfo> GetCacheItemFromDatabaseAsync(string key)
859859 {
860860 var command = new MySqlCommand (
861861 $ "INSERT INTO { _databaseOptionsFixture . Options . Value . TableName } " +
862- "(Id, Value, ExpiresAtTime, SlidingExpirationInSeconds, AbsoluteExpiration) " +
862+ "(" + Columns . Names . CacheItemId + ", " + Columns . Names . CacheItemValue + ", " + Columns . Names . ExpiresAtTime + ", " + Columns . Names . SlidingExpirationInSeconds + ", " + Columns . Names . AbsoluteExpiration + " ) " +
863863 "VALUES (@Id, @Value, @ExpiresAtTime, @SlidingExpirationInSeconds, @AbsoluteExpiration)" ,
864864 connection ) ;
865865 command . Parameters . AddWithValue ( "Id" , value . Id ) ;
0 commit comments