Skip to content

Commit

Permalink
Upgrade to NH 5.2.0 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericDelaporte committed Dec 5, 2018
1 parent 70d527c commit 024bac4
Show file tree
Hide file tree
Showing 46 changed files with 1,282 additions and 1,752 deletions.
253 changes: 0 additions & 253 deletions AsyncGenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,259 +28,6 @@
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: CoreMemoryCache\NHibernate.Caches.CoreMemoryCache\NHibernate.Caches.CoreMemoryCache.csproj
targetFramework: net461
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: EnyimMemcached\NHibernate.Caches.EnyimMemcached\NHibernate.Caches.EnyimMemcached.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: MemCache\NHibernate.Caches.MemCache\NHibernate.Caches.MemCache.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: Prevalence\NHibernate.Caches.Prevalence\NHibernate.Caches.Prevalence.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: RtMemoryCache\NHibernate.Caches.RtMemoryCache\NHibernate.Caches.RtMemoryCache.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: SharedCache\NHibernate.Caches.SharedCache\NHibernate.Caches.SharedCache.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: SysCache\NHibernate.Caches.SysCache\NHibernate.Caches.SysCache.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: SysCache2\NHibernate.Caches.SysCache2\NHibernate.Caches.SysCache2.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: Velocity\NHibernate.Caches.Velocity\NHibernate.Caches.Velocity.csproj
concurrentRun: true
applyChanges: true
analyzation:
methodConversion:
- conversion: Ignore
hasAttributeName: ObsoleteAttribute
callForwarding: true
cancellationTokens:
guards: true
methodParameter:
- anyInterfaceRule: PubliclyExposedType
parameter: Optional
- parameter: Optional
rule: PubliclyExposedType
- parameter: Required
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
transformation:
configureAwaitArgument: false
localFunctions: true
asyncLock:
type: NHibernate.Util.AsyncLock
methodName: LockAsync
registerPlugin:
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: NHibernate.Caches.Common.Tests\NHibernate.Caches.Common.Tests.csproj
targetFramework: net461
concurrentRun: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Distributed;
using NHibernate.Caches.Util;
using NHibernate.Util;

namespace NHibernate.Caches.CoreDistributedCache
{
using System.Threading.Tasks;
using System.Threading;
public partial class CoreDistributedCache : ICache

public abstract partial class CoreDistributedCacheBase : CacheBase
{

/// <inheritdoc />
public async Task<object> GetAsync(object key, CancellationToken cancellationToken)
public override async Task<object> GetAsync(object key, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
if (key == null)
Expand All @@ -49,7 +50,7 @@ public async Task<object> GetAsync(object key, CancellationToken cancellationTok
}

/// <inheritdoc />
public Task PutAsync(object key, object value, CancellationToken cancellationToken)
public override Task PutAsync(object key, object value, CancellationToken cancellationToken)
{
if (key == null)
{
Expand Down Expand Up @@ -93,7 +94,7 @@ public Task PutAsync(object key, object value, CancellationToken cancellationTok
}

/// <inheritdoc />
public Task RemoveAsync(object key, CancellationToken cancellationToken)
public override Task RemoveAsync(object key, CancellationToken cancellationToken)
{
if (key == null)
{
Expand All @@ -117,7 +118,7 @@ public Task RemoveAsync(object key, CancellationToken cancellationToken)
}

/// <inheritdoc />
public Task ClearAsync(CancellationToken cancellationToken)
public override Task ClearAsync(CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
Expand All @@ -135,16 +136,15 @@ public Task ClearAsync(CancellationToken cancellationToken)
}

/// <inheritdoc />
public Task LockAsync(object key, CancellationToken cancellationToken)
public override Task<object> LockAsync(object key, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return Task.FromCanceled<object>(cancellationToken);
}
try
{
Lock(key);
return Task.CompletedTask;
return Task.FromResult<object>(Lock(key));
}
catch (Exception ex)
{
Expand All @@ -153,15 +153,15 @@ public Task LockAsync(object key, CancellationToken cancellationToken)
}

/// <inheritdoc />
public Task UnlockAsync(object key, CancellationToken cancellationToken)
public override Task UnlockAsync(object key, object lockValue, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return Task.FromCanceled<object>(cancellationToken);
}
try
{
Unlock(key);
Unlock(key, lockValue);
return Task.CompletedTask;
}
catch (Exception ex)
Expand Down
Loading

0 comments on commit 024bac4

Please sign in to comment.