Skip to content

Commit 0e49068

Browse files
author
Kleber Bernardo
committed
Upgrade to dotnet core 2.0
1 parent e06ef73 commit 0e49068

File tree

5 files changed

+50
-64
lines changed

5 files changed

+50
-64
lines changed

ServiceStackRedisCache.sln

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 14
3-
VisualStudioVersion = 14.0.25420.1
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.27130.2010
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5A04042D-438D-407B-B239-0CAD6A2BD8C2}"
66
EndProject
7-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.Caching.ServiceStackRedis", "src\Microsoft.Extensions.Caching.ServiceStackRedis\Microsoft.Extensions.Caching.ServiceStackRedis.xproj", "{5694BC38-B266-447E-A743-DA1139FCB257}"
7+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Caching.ServiceStackRedis", "src\Microsoft.Extensions.Caching.ServiceStackRedis\Microsoft.Extensions.Caching.ServiceStackRedis.csproj", "{5694BC38-B266-447E-A743-DA1139FCB257}"
88
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,4 +23,7 @@ Global
2323
GlobalSection(NestedProjects) = preSolution
2424
{5694BC38-B266-447E-A743-DA1139FCB257} = {5A04042D-438D-407B-B239-0CAD6A2BD8C2}
2525
EndGlobalSection
26+
GlobalSection(ExtensibilityGlobals) = postSolution
27+
SolutionGuid = {101BFF2A-6CDA-4ED7-A483-7186847DF520}
28+
EndGlobalSection
2629
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<Description>Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using ServiceStack.Redis.Core</Description>
5+
<VersionPrefix>2.0.0.0</VersionPrefix>
6+
<Authors>cnblogs.com</Authors>
7+
<TargetFramework>netstandard2.0</TargetFramework>
8+
<AssemblyName>ServiceStackRedisCache</AssemblyName>
9+
<PackageId>Microsoft.Extensions.Caching.ServiceStackRedis</PackageId>
10+
<PackageTags>cache;redis;distributedcache</PackageTags>
11+
<PackageProjectUrl>https://github.com/cnblogs/ServiceStackRedisCache</PackageProjectUrl>
12+
<RepositoryType>git</RepositoryType>
13+
<RepositoryUrl>https://github.com/cnblogs/ServiceStackRedisCache</RepositoryUrl>
14+
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
15+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
16+
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
17+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18+
<Version>2.0.0.0</Version>
19+
<AssemblyVersion>2.0.0.0</AssemblyVersion>
20+
<FileVersion>2.0.0.0</FileVersion>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.0.0" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
26+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.0" />
27+
<PackageReference Include="Microsoft.Extensions.Options" Version="2.0.0" />
28+
<PackageReference Include="ServiceStack.Redis.Core" Version="1.0.44" />
29+
</ItemGroup>
30+
31+
</Project>

src/Microsoft.Extensions.Caching.ServiceStackRedis/Microsoft.Extensions.Caching.ServiceStackRedis.xproj

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Microsoft.Extensions.Caching.ServiceStackRedis/ServiceStackRedisCache.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using System;
2-
using System.Text;
3-
using System.Threading.Tasks;
41
using Microsoft.Extensions.Caching.Distributed;
52
using Microsoft.Extensions.Options;
63
using ServiceStack.Redis;
7-
using ServiceStack.Redis.Generic;
8-
using System.IO;
4+
using System;
5+
using System.Text;
6+
using System.Threading;
7+
using System.Threading.Tasks;
98

109
namespace Microsoft.Extensions.Caching.ServiceStackRedis
1110
{
@@ -45,9 +44,9 @@ public byte[] Get(string key)
4544
return null;
4645
}
4746

48-
public async Task<byte[]> GetAsync(string key)
47+
public Task<byte[]> GetAsync(string key, CancellationToken token = default(CancellationToken))
4948
{
50-
return Get(key);
49+
return Task.FromResult(Get(key));
5150
}
5251

5352
public void Set(string key, byte[] value, DistributedCacheEntryOptions options)
@@ -82,9 +81,9 @@ public void Set(string key, byte[] value, DistributedCacheEntryOptions options)
8281
}
8382
}
8483

85-
public async Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options)
84+
public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken))
8685
{
87-
Set(key, value, options);
86+
return Task.Run(() => Set(key, value, options));
8887
}
8988

9089
public void Refresh(string key)
@@ -111,14 +110,14 @@ public void Refresh(string key)
111110
}
112111
}
113112

114-
public async Task RefreshAsync(string key)
113+
public Task RefreshAsync(string key, CancellationToken token = default(CancellationToken))
115114
{
116115
if (key == null)
117116
{
118117
throw new ArgumentNullException(nameof(key));
119118
}
120119

121-
Refresh(key);
120+
return Task.Run(() => Refresh(key));
122121
}
123122

124123
public void Remove(string key)
@@ -134,10 +133,10 @@ public void Remove(string key)
134133
}
135134
}
136135

137-
public async Task RemoveAsync(string key)
136+
public Task RemoveAsync(string key, CancellationToken token = default(CancellationToken))
138137
{
139-
Remove(key);
140-
}
138+
return Task.Run(() => Remove(key));
139+
}
141140

142141
private int GetExpireInSeconds(DistributedCacheEntryOptions options)
143142
{

src/Microsoft.Extensions.Caching.ServiceStackRedis/project.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)