Browse Source

Enable nullable annotations for Volo.Abp.DistributedLocking.Abstractions

pull/17303/head
liangshiwei 3 years ago
parent
commit
1ee1f1b12b
  1. 2
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj
  2. 3
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs
  3. 2
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

2
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net7.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.DistributedLocking.Abstractions</AssemblyName>
<PackageId>Volo.Abp.DistributedLocking.Abstractions</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

3
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs

@ -16,8 +16,7 @@ public interface IAbpDistributedLock
/// <param name="name">The name of the lock</param>
/// <param name="timeout">How long to wait before giving up on the acquisition attempt. Defaults to 0</param>
/// <param name="cancellationToken">Cancellation token</param>
[ItemCanBeNull]
Task<IAbpDistributedLockHandle> TryAcquireAsync(
Task<IAbpDistributedLockHandle?> TryAcquireAsync(
[NotNull] string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default

2
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

@ -22,7 +22,7 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async Task<IAbpDistributedLockHandle> TryAcquireAsync(
public async Task<IAbpDistributedLockHandle?> TryAcquireAsync(
string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default)

Loading…
Cancel
Save