零度框架升级到 Aspire 13.0 版本
This commit is contained in:
1 parent
41f6c147d5
commit
b11ba4f6a5
50 files changed
+336
-446
No files matched your search
@@ -12,12 +12,12 @@ namespace HelloShop.DistributedLock.Dapr
|
||||
{
|
||||
expiryInSeconds = expiryInSeconds == default ? 60 : expiryInSeconds;
|
||||
|
||||
// The CallerMemberNameAttribute is used to get the name of the calling method.
|
||||
string? lockOwner = new StackTrace().GetFrame(1)?.GetMethod()?.DeclaringType?.Name;
|
||||
lockOwner ??= Guid.NewGuid().ToString();
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable DAPR_DISTRIBUTEDLOCK // 类型仅用于评估,在将来的更新中可能会被更改或删除。取消此诊断以继续。
|
||||
TryLockResponse response = await daprClient.Lock("lockstore", resourceId, lockOwner, expiryInSeconds, cancellationToken);
|
||||
#pragma warning restore CS0618
|
||||
#pragma warning restore DAPR_DISTRIBUTEDLOCK // 类型仅用于评估,在将来的更新中可能会被更改或删除。取消此诊断以继续。
|
||||
|
||||
return new DaprDistributedLockResult(response);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ using Dapr.Client;
|
||||
|
||||
namespace HelloShop.DistributedLock.Dapr
|
||||
{
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable DAPR_DISTRIBUTEDLOCK // 类型仅用于评估,在将来的更新中可能会被更改或删除。取消此诊断以继续。
|
||||
public class DaprDistributedLockResult(TryLockResponse tryLockResponse) : IDistributedLockResult
|
||||
#pragma warning restore CS0618
|
||||
#pragma warning restore DAPR_DISTRIBUTEDLOCK // 类型仅用于评估,在将来的更新中可能会被更改或删除。取消此诊断以继续。
|
||||
{
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in new issue
Block a user