Skip to content

Commit

Permalink
Merge pull request #109 from dotnetcore/dev
Browse files Browse the repository at this point in the history
Upgrading dependencies
  • Loading branch information
catcherwong authored Apr 28, 2019
2 parents 60da609 + 83d9913 commit f57fcb2
Show file tree
Hide file tree
Showing 31 changed files with 142 additions and 108 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
language: csharp

solution: EasyCaching.sln

sudo: required

dotnet: 2.1.301

dist: xenial
sudo: required
dotnet: 2.2.203
mono: none

services:
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ public class Startup
//use memory cache that named default
option.UseInMemory("default");

// // use memory cache with your own configuration
// config.UseInMemory(options =>
// {
// options.DBConfig = new InMemoryCachingOptions
// {
// // scan time, default value is 60s
// ExpirationScanFrequency = 60,
// // total count of cache items, default value is 10000
// SizeLimit = 100
// };
// // the max random second will be added to cache's expiration, default value is 120
// options.MaxRdSecond = 120;
// // whether enable logging, default is false
// options.EnableLogging = false;
// // mutex key's alive time(ms), default is 5000
// options.LockMs = 5000;
// // when mutex key alive, it will sleep some time, default is 300
// options.SleepMs = 300;
// }, "m2");
//use redis cache that named redis1
option.UseRedis(config =>
{
Expand Down
40 changes: 15 additions & 25 deletions build/releasenotes.props
Original file line number Diff line number Diff line change
@@ -1,59 +1,49 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
2. IEasyCachingProviderFactory support multi redis provider instances.
3. IRedisCachingProvider add some string and keys methods.
4. Interceptor attribute add cache provider
1. Upgrading dependencies.
</EasyCachingCorePackageNotes>
<EasyCachingMemcachedPackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
1. Upgrading dependencies.
</EasyCachingMemcachedPackageNotes>
<EasyCachingRedisPackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
2. Add some string and keys methods.
1. Upgrading dependencies.
</EasyCachingRedisPackageNotes>
<EasyCachingSQLitePackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
1. Upgrading dependencies.
</EasyCachingSQLitePackageNotes>
<EasyCachingInMemoryPackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
1. Upgrading dependencies.
</EasyCachingInMemoryPackageNotes>
<EasyCachingHybridPackageNotes>
1. Add DefaultExpirationForTtlFailed for HybridCachingOptions.
2. Get distributed cached item's expiration when local cache is null.
1. Upgrading dependencies.
</EasyCachingHybridPackageNotes>
<EasyCachingAspectCorePackageNotes>
1. Update EasyCaching.Core.
2. Swich caching provider via attribute.
3. Handle exception when method return null.
1. Upgrading dependencies.
</EasyCachingAspectCorePackageNotes>
<EasyCachingCastlePackageNotes>
1. Update EasyCaching.Core.
2. Swich caching provider via attribute.
3. Handle exception when method return null.
1. Upgrading dependencies.
</EasyCachingCastlePackageNotes>
<EasyCachingResponseCachingPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingResponseCachingPackageNotes>
<EasyCachingJsonPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingJsonPackageNotes>
<EasyCachingMessagePackPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingMessagePackPackageNotes>
<EasyCachingProtobufPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingProtobufPackageNotes>
<EasyCachingCSRedisPackageNotes>
1. Add GetExpiration/GetExpirationAsync for caching provider.
2. Add some string and keys methods.
1. Upgrading dependencies.
</EasyCachingCSRedisPackageNotes>
<EasyCachingRedisBusPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingRedisBusPackageNotes>
<EasyCachingRabbitBusPackageNotes>
1. Update EasyCaching.Core.
1. Upgrading dependencies.
</EasyCachingRabbitBusPackageNotes>
</PropertyGroup>
</Project>
32 changes: 16 additions & 16 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project>
<PropertyGroup>
<EasyCachingCorePackageVersion>0.5.4.2</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.4.2</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.4.2</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.4.2</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.4.2</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.4.2</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.4.2</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.4.2</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.4.2</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.4.2</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.4.2</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.4.2</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.4.2</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.4.2</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.4.2</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.4.2</EasyCachingRabbitBusPackageVersion>
<EasyCachingCorePackageVersion>0.5.5</EasyCachingCorePackageVersion>
<EasyCachingMemcachedPackageVersion>0.5.5</EasyCachingMemcachedPackageVersion>
<EasyCachingRedisPackageVersion>0.5.5</EasyCachingRedisPackageVersion>
<EasyCachingSQLitePackageVersion>0.5.5</EasyCachingSQLitePackageVersion>
<EasyCachingInMemoryPackageVersion>0.5.5</EasyCachingInMemoryPackageVersion>
<EasyCachingHybridPackageVersion>0.5.5</EasyCachingHybridPackageVersion>
<EasyCachingAspectCorePackageVersion>0.5.5</EasyCachingAspectCorePackageVersion>
<EasyCachingCastlePackageVersion>0.5.5</EasyCachingCastlePackageVersion>
<EasyCachingResponseCachingPackageVersion>0.5.5</EasyCachingResponseCachingPackageVersion>
<EasyCachingJsonPackageVersion>0.5.5</EasyCachingJsonPackageVersion>
<EasyCachingMessagePackPackageVersion>0.5.5</EasyCachingMessagePackPackageVersion>
<EasyCachingProtobufPackageVersion>0.5.5</EasyCachingProtobufPackageVersion>
<EasyCachingCSRedisPackageVersion>0.5.5</EasyCachingCSRedisPackageVersion>
<EasyCachingRedisBusPackageVersion>0.5.5</EasyCachingRedisBusPackageVersion>
<EasyCachingCSRedisBusPackageVersion>0.5.5</EasyCachingCSRedisBusPackageVersion>
<EasyCachingRabbitBusPackageVersion>0.5.5</EasyCachingRabbitBusPackageVersion>
</PropertyGroup>
</Project>
18 changes: 18 additions & 0 deletions docs/ProviderFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ After releasing v0.4.0 of EasyCaching, we can deal with this scenario.

This usage of `EasyCachingProviderFactory` is similar with `HttpClientFactory`.

There are two types of providers(`IEasyCachingProvider` and `IRedisCachingProvider`) can use `EasyCachingProviderFactory` to create.

Here use two InMemory caching provders and two Redis caching providers to show.

## 1. Install the packages via Nuget
Expand Down Expand Up @@ -116,5 +118,21 @@ public class ValuesController : Controller
Console.WriteLine($"Type=redis2,Key=named-provider,Value={res},Time:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
return $"cached value : {res}";
}

// GET api/values/redis3
[HttpGet]
[Route("redis3")]
public string GetRedis3()
{
var redis1 = factory.GetRedisProvider("redis1");
var redis2 = factory.GetRedisProvider("redis2");

_redis1.StringSet("keyredis1", "val");

var res1 = _redis1.StringGet("keyredis1");
var res2 = _redis2.StringGet("keyredis1");

return $"redis1 cached value: {res1}, redis2 cached value : {res2}";
}
}
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sample/EasyCaching.Demo.Interceptors/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
//options.WithProtobuf();
});

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

//1.1. all default
return services.ConfigureAspectCoreInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace EasyCaching.Demo.Providers.Controllers
{
using EasyCaching.Core;
using Microsoft.AspNetCore.Mvc;

[Route("api/mredis")]
public class MultiRedisController : Controller
{
private readonly IRedisCachingProvider _redis1;
private readonly IRedisCachingProvider _redis2;

public MultiRedisController(IEasyCachingProviderFactory factory)
{
this._redis1 = factory.GetRedisProvider("redis1");
this._redis2 = factory.GetRedisProvider("redis2");
}

// GET api/mredis
[HttpGet]
public string Get()
{
_redis1.StringSet("keyredis1", "val");

var res1 = _redis1.StringGet("keyredis1");
var res2 = _redis2.StringGet("keyredis1");

return $"redis1 cached value: {res1}, redis2 cached value : {res2}";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions sample/EasyCaching.Demo.Providers/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Startup(IConfiguration configuration)

public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

//new configuration
services.AddEasyCaching(option=>
Expand Down Expand Up @@ -77,7 +77,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
app.UseDeveloperExceptionPage();
}

loggerFactory.AddConsole(Configuration.GetSection("Logging"));
//loggerFactory.AddConsole(Configuration.GetSection("Logging"));

// Important step for using Memcached Cache or SQLite Cache
app.UseEasyCaching();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sample/EasyCaching.Demo.ResponseCaching/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Startup(IConfiguration configuration)

public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

services.AddEasyCaching(x => { x.UseInMemory(); });
services.AddEasyCachingResponseCaching(EasyCachingConstValue.DefaultInMemoryName);
Expand Down
3 changes: 1 addition & 2 deletions src/EasyCaching.Bus.CSRedis/EasyCaching.Bus.CSRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSRedisCore" Version="3.0.33" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="CSRedisCore" Version="3.0.52" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
Expand Down
5 changes: 2 additions & 3 deletions src/EasyCaching.Bus.RabbitMQ/EasyCaching.Bus.RabbitMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="2.1.1" />
<PackageReference Include="RabbitMQ.Client" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Configurations\" />
Expand Down
3 changes: 1 addition & 2 deletions src/EasyCaching.Bus.Redis/EasyCaching.Bus.Redis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.0.519" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="StackExchange.Redis" Version="2.0.601" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
Expand Down
3 changes: 1 addition & 2 deletions src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSRedisCore" Version="3.0.33" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="CSRedisCore" Version="3.0.52" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
Expand Down
6 changes: 0 additions & 6 deletions src/EasyCaching.Core/Configurations/EasyCachingOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace EasyCaching.Core.Configurations
{
using System;
using System.Collections.Generic;

/// <summary>
Expand Down Expand Up @@ -32,10 +31,5 @@ public void RegisterExtension(IEasyCachingOptionsExtension extension)

Extensions.Add(extension);
}

public void UseCSRedis(Func<object, object> p, string v)
{
throw new NotImplementedException();
}
}
}
6 changes: 4 additions & 2 deletions src/EasyCaching.Core/EasyCaching.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
<Folder Include="Diagnostics\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
</ItemGroup>
</Project>
5 changes: 1 addition & 4 deletions src/EasyCaching.HybridCache/EasyCaching.HybridCache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
<ItemGroup>
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Configurations\" />
</ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/EasyCaching.InMemory/EasyCaching.InMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
<ItemGroup>
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Configurations\" />
<Folder Include="Internal\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspectCore.Core" Version="1.1.0" />
<PackageReference Include="AspectCore.Extensions.DependencyInjection" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="AspectCore.Core" Version="1.2.0" />
<PackageReference Include="AspectCore.Extensions.DependencyInjection" Version="1.2.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit f57fcb2

Please sign in to comment.