Skip to content

Commit 024bac4

Browse files
Upgrade to NH 5.2.0 (#56)
1 parent 70d527c commit 024bac4

File tree

46 files changed

+1282
-1752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1282
-1752
lines changed

AsyncGenerator.yml

Lines changed: 0 additions & 253 deletions
Original file line numberDiff line numberDiff line change
@@ -28,259 +28,6 @@
2828
registerPlugin:
2929
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
3030
assemblyName: AsyncGenerator.Core
31-
- filePath: CoreMemoryCache\NHibernate.Caches.CoreMemoryCache\NHibernate.Caches.CoreMemoryCache.csproj
32-
targetFramework: net461
33-
concurrentRun: true
34-
applyChanges: true
35-
analyzation:
36-
methodConversion:
37-
- conversion: Ignore
38-
hasAttributeName: ObsoleteAttribute
39-
callForwarding: true
40-
cancellationTokens:
41-
guards: true
42-
methodParameter:
43-
- anyInterfaceRule: PubliclyExposedType
44-
parameter: Optional
45-
- parameter: Optional
46-
rule: PubliclyExposedType
47-
- parameter: Required
48-
scanMethodBody: true
49-
scanForMissingAsyncMembers:
50-
- all: true
51-
transformation:
52-
configureAwaitArgument: false
53-
localFunctions: true
54-
asyncLock:
55-
type: NHibernate.Util.AsyncLock
56-
methodName: LockAsync
57-
registerPlugin:
58-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
59-
assemblyName: AsyncGenerator.Core
60-
- filePath: EnyimMemcached\NHibernate.Caches.EnyimMemcached\NHibernate.Caches.EnyimMemcached.csproj
61-
concurrentRun: true
62-
applyChanges: true
63-
analyzation:
64-
methodConversion:
65-
- conversion: Ignore
66-
hasAttributeName: ObsoleteAttribute
67-
callForwarding: true
68-
cancellationTokens:
69-
guards: true
70-
methodParameter:
71-
- anyInterfaceRule: PubliclyExposedType
72-
parameter: Optional
73-
- parameter: Optional
74-
rule: PubliclyExposedType
75-
- parameter: Required
76-
scanMethodBody: true
77-
scanForMissingAsyncMembers:
78-
- all: true
79-
transformation:
80-
configureAwaitArgument: false
81-
localFunctions: true
82-
asyncLock:
83-
type: NHibernate.Util.AsyncLock
84-
methodName: LockAsync
85-
registerPlugin:
86-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
87-
assemblyName: AsyncGenerator.Core
88-
- filePath: MemCache\NHibernate.Caches.MemCache\NHibernate.Caches.MemCache.csproj
89-
concurrentRun: true
90-
applyChanges: true
91-
analyzation:
92-
methodConversion:
93-
- conversion: Ignore
94-
hasAttributeName: ObsoleteAttribute
95-
callForwarding: true
96-
cancellationTokens:
97-
guards: true
98-
methodParameter:
99-
- anyInterfaceRule: PubliclyExposedType
100-
parameter: Optional
101-
- parameter: Optional
102-
rule: PubliclyExposedType
103-
- parameter: Required
104-
scanMethodBody: true
105-
scanForMissingAsyncMembers:
106-
- all: true
107-
transformation:
108-
configureAwaitArgument: false
109-
localFunctions: true
110-
asyncLock:
111-
type: NHibernate.Util.AsyncLock
112-
methodName: LockAsync
113-
registerPlugin:
114-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
115-
assemblyName: AsyncGenerator.Core
116-
- filePath: Prevalence\NHibernate.Caches.Prevalence\NHibernate.Caches.Prevalence.csproj
117-
concurrentRun: true
118-
applyChanges: true
119-
analyzation:
120-
methodConversion:
121-
- conversion: Ignore
122-
hasAttributeName: ObsoleteAttribute
123-
callForwarding: true
124-
cancellationTokens:
125-
guards: true
126-
methodParameter:
127-
- anyInterfaceRule: PubliclyExposedType
128-
parameter: Optional
129-
- parameter: Optional
130-
rule: PubliclyExposedType
131-
- parameter: Required
132-
scanMethodBody: true
133-
scanForMissingAsyncMembers:
134-
- all: true
135-
transformation:
136-
configureAwaitArgument: false
137-
localFunctions: true
138-
asyncLock:
139-
type: NHibernate.Util.AsyncLock
140-
methodName: LockAsync
141-
registerPlugin:
142-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
143-
assemblyName: AsyncGenerator.Core
144-
- filePath: RtMemoryCache\NHibernate.Caches.RtMemoryCache\NHibernate.Caches.RtMemoryCache.csproj
145-
concurrentRun: true
146-
applyChanges: true
147-
analyzation:
148-
methodConversion:
149-
- conversion: Ignore
150-
hasAttributeName: ObsoleteAttribute
151-
callForwarding: true
152-
cancellationTokens:
153-
guards: true
154-
methodParameter:
155-
- anyInterfaceRule: PubliclyExposedType
156-
parameter: Optional
157-
- parameter: Optional
158-
rule: PubliclyExposedType
159-
- parameter: Required
160-
scanMethodBody: true
161-
scanForMissingAsyncMembers:
162-
- all: true
163-
transformation:
164-
configureAwaitArgument: false
165-
localFunctions: true
166-
asyncLock:
167-
type: NHibernate.Util.AsyncLock
168-
methodName: LockAsync
169-
registerPlugin:
170-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
171-
assemblyName: AsyncGenerator.Core
172-
- filePath: SharedCache\NHibernate.Caches.SharedCache\NHibernate.Caches.SharedCache.csproj
173-
concurrentRun: true
174-
applyChanges: true
175-
analyzation:
176-
methodConversion:
177-
- conversion: Ignore
178-
hasAttributeName: ObsoleteAttribute
179-
callForwarding: true
180-
cancellationTokens:
181-
guards: true
182-
methodParameter:
183-
- anyInterfaceRule: PubliclyExposedType
184-
parameter: Optional
185-
- parameter: Optional
186-
rule: PubliclyExposedType
187-
- parameter: Required
188-
scanMethodBody: true
189-
scanForMissingAsyncMembers:
190-
- all: true
191-
transformation:
192-
configureAwaitArgument: false
193-
localFunctions: true
194-
asyncLock:
195-
type: NHibernate.Util.AsyncLock
196-
methodName: LockAsync
197-
registerPlugin:
198-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
199-
assemblyName: AsyncGenerator.Core
200-
- filePath: SysCache\NHibernate.Caches.SysCache\NHibernate.Caches.SysCache.csproj
201-
concurrentRun: true
202-
applyChanges: true
203-
analyzation:
204-
methodConversion:
205-
- conversion: Ignore
206-
hasAttributeName: ObsoleteAttribute
207-
callForwarding: true
208-
cancellationTokens:
209-
guards: true
210-
methodParameter:
211-
- anyInterfaceRule: PubliclyExposedType
212-
parameter: Optional
213-
- parameter: Optional
214-
rule: PubliclyExposedType
215-
- parameter: Required
216-
scanMethodBody: true
217-
scanForMissingAsyncMembers:
218-
- all: true
219-
transformation:
220-
configureAwaitArgument: false
221-
localFunctions: true
222-
asyncLock:
223-
type: NHibernate.Util.AsyncLock
224-
methodName: LockAsync
225-
registerPlugin:
226-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
227-
assemblyName: AsyncGenerator.Core
228-
- filePath: SysCache2\NHibernate.Caches.SysCache2\NHibernate.Caches.SysCache2.csproj
229-
concurrentRun: true
230-
applyChanges: true
231-
analyzation:
232-
methodConversion:
233-
- conversion: Ignore
234-
hasAttributeName: ObsoleteAttribute
235-
callForwarding: true
236-
cancellationTokens:
237-
guards: true
238-
methodParameter:
239-
- anyInterfaceRule: PubliclyExposedType
240-
parameter: Optional
241-
- parameter: Optional
242-
rule: PubliclyExposedType
243-
- parameter: Required
244-
scanMethodBody: true
245-
scanForMissingAsyncMembers:
246-
- all: true
247-
transformation:
248-
configureAwaitArgument: false
249-
localFunctions: true
250-
asyncLock:
251-
type: NHibernate.Util.AsyncLock
252-
methodName: LockAsync
253-
registerPlugin:
254-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
255-
assemblyName: AsyncGenerator.Core
256-
- filePath: Velocity\NHibernate.Caches.Velocity\NHibernate.Caches.Velocity.csproj
257-
concurrentRun: true
258-
applyChanges: true
259-
analyzation:
260-
methodConversion:
261-
- conversion: Ignore
262-
hasAttributeName: ObsoleteAttribute
263-
callForwarding: true
264-
cancellationTokens:
265-
guards: true
266-
methodParameter:
267-
- anyInterfaceRule: PubliclyExposedType
268-
parameter: Optional
269-
- parameter: Optional
270-
rule: PubliclyExposedType
271-
- parameter: Required
272-
scanMethodBody: true
273-
scanForMissingAsyncMembers:
274-
- all: true
275-
transformation:
276-
configureAwaitArgument: false
277-
localFunctions: true
278-
asyncLock:
279-
type: NHibernate.Util.AsyncLock
280-
methodName: LockAsync
281-
registerPlugin:
282-
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
283-
assemblyName: AsyncGenerator.Core
28431
- filePath: NHibernate.Caches.Common.Tests\NHibernate.Caches.Common.Tests.csproj
28532
targetFramework: net461
28633
concurrentRun: true

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache/Async/CoreDistributedCache.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@
1313
using System.Collections.Generic;
1414
using System.IO;
1515
using System.Runtime.Serialization.Formatters.Binary;
16+
using System.Threading;
17+
using System.Threading.Tasks;
1618
using Microsoft.Extensions.Caching.Distributed;
1719
using NHibernate.Caches.Util;
1820
using NHibernate.Util;
1921

2022
namespace NHibernate.Caches.CoreDistributedCache
2123
{
22-
using System.Threading.Tasks;
23-
using System.Threading;
24-
public partial class CoreDistributedCache : ICache
24+
25+
public abstract partial class CoreDistributedCacheBase : CacheBase
2526
{
2627

2728
/// <inheritdoc />
28-
public async Task<object> GetAsync(object key, CancellationToken cancellationToken)
29+
public override async Task<object> GetAsync(object key, CancellationToken cancellationToken)
2930
{
3031
cancellationToken.ThrowIfCancellationRequested();
3132
if (key == null)
@@ -49,7 +50,7 @@ public async Task<object> GetAsync(object key, CancellationToken cancellationTok
4950
}
5051

5152
/// <inheritdoc />
52-
public Task PutAsync(object key, object value, CancellationToken cancellationToken)
53+
public override Task PutAsync(object key, object value, CancellationToken cancellationToken)
5354
{
5455
if (key == null)
5556
{
@@ -93,7 +94,7 @@ public Task PutAsync(object key, object value, CancellationToken cancellationTok
9394
}
9495

9596
/// <inheritdoc />
96-
public Task RemoveAsync(object key, CancellationToken cancellationToken)
97+
public override Task RemoveAsync(object key, CancellationToken cancellationToken)
9798
{
9899
if (key == null)
99100
{
@@ -117,7 +118,7 @@ public Task RemoveAsync(object key, CancellationToken cancellationToken)
117118
}
118119

119120
/// <inheritdoc />
120-
public Task ClearAsync(CancellationToken cancellationToken)
121+
public override Task ClearAsync(CancellationToken cancellationToken)
121122
{
122123
if (cancellationToken.IsCancellationRequested)
123124
{
@@ -135,16 +136,15 @@ public Task ClearAsync(CancellationToken cancellationToken)
135136
}
136137

137138
/// <inheritdoc />
138-
public Task LockAsync(object key, CancellationToken cancellationToken)
139+
public override Task<object> LockAsync(object key, CancellationToken cancellationToken)
139140
{
140141
if (cancellationToken.IsCancellationRequested)
141142
{
142143
return Task.FromCanceled<object>(cancellationToken);
143144
}
144145
try
145146
{
146-
Lock(key);
147-
return Task.CompletedTask;
147+
return Task.FromResult<object>(Lock(key));
148148
}
149149
catch (Exception ex)
150150
{
@@ -153,15 +153,15 @@ public Task LockAsync(object key, CancellationToken cancellationToken)
153153
}
154154

155155
/// <inheritdoc />
156-
public Task UnlockAsync(object key, CancellationToken cancellationToken)
156+
public override Task UnlockAsync(object key, object lockValue, CancellationToken cancellationToken)
157157
{
158158
if (cancellationToken.IsCancellationRequested)
159159
{
160160
return Task.FromCanceled<object>(cancellationToken);
161161
}
162162
try
163163
{
164-
Unlock(key);
164+
Unlock(key, lockValue);
165165
return Task.CompletedTask;
166166
}
167167
catch (Exception ex)

0 commit comments

Comments
 (0)