Skip to content

Commit c9de37a

Browse files
committed
Update documentation for breaking change
1 parent ab6577f commit c9de37a

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

Extensions.Caching.PostgreSql/Community.Microsoft.Extensions.Caching.PostgreSql.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AssemblyName>Community.Microsoft.Extensions.Caching.PostgreSql</AssemblyName>
55
<RootNamespace>Community.Microsoft.Extensions.Caching.PostgreSql</RootNamespace>
66
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
7-
<Version>2.0.0</Version>
7+
<Version>3.0.0</Version>
88
<Authors>Ashley Marques</Authors>
99
<Company />
1010
<Description>DistributedCache using postgres</Description>

Extensions.Caching.PostgreSql/PostgreSqlCache.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal sealed class PostgreSqlCache : IDistributedCache
1111
private readonly IDatabaseOperations _dbOperations;
1212
private readonly TimeSpan _defaultSlidingExpiration;
1313

14+
[Obsolete("Do not use constructor directly instead pull IDistributedCache from DI. For this add 'services.AddDistributedPostgreSqlCache'")]
1415
public PostgreSqlCache(
1516
IOptions<PostgreSqlCacheOptions> options,
1617
IDatabaseOperations databaseOperations,

PostgresSqlCacheSolution.sln

+21
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.Microsoft.Extensi
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PostgreSqlCacheSample", "PostgreSqlCacheSample\PostgreSqlCacheSample.csproj", "{248946AE-B9BF-4E27-BB8B-B8967C703981}"
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSample", "WebSample\WebSample.csproj", "{CA8FFB11-C327-48C1-94BA-24B9D61021FD}"
13+
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{548EB70F-C803-4B22-A992-131B9A5E1446}"
15+
ProjectSection(SolutionItems) = preProject
16+
README.md = README.md
17+
sample_project.gif = sample_project.gif
18+
EndProjectSection
19+
EndProject
1220
Global
1321
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1422
Debug|Any CPU = Debug|Any CPU
@@ -43,12 +51,25 @@ Global
4351
{248946AE-B9BF-4E27-BB8B-B8967C703981}.Release|x64.Build.0 = Release|Any CPU
4452
{248946AE-B9BF-4E27-BB8B-B8967C703981}.Release|x86.ActiveCfg = Release|Any CPU
4553
{248946AE-B9BF-4E27-BB8B-B8967C703981}.Release|x86.Build.0 = Release|Any CPU
54+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|x64.ActiveCfg = Debug|Any CPU
57+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|x64.Build.0 = Debug|Any CPU
58+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|x86.ActiveCfg = Debug|Any CPU
59+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Debug|x86.Build.0 = Debug|Any CPU
60+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|Any CPU.Build.0 = Release|Any CPU
62+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|x64.ActiveCfg = Release|Any CPU
63+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|x64.Build.0 = Release|Any CPU
64+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|x86.ActiveCfg = Release|Any CPU
65+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD}.Release|x86.Build.0 = Release|Any CPU
4666
EndGlobalSection
4767
GlobalSection(SolutionProperties) = preSolution
4868
HideSolutionNode = FALSE
4969
EndGlobalSection
5070
GlobalSection(NestedProjects) = preSolution
5171
{248946AE-B9BF-4E27-BB8B-B8967C703981} = {306A63CC-5797-4D63-86A1-94025CF8C98A}
72+
{CA8FFB11-C327-48C1-94BA-24B9D61021FD} = {306A63CC-5797-4D63-86A1-94025CF8C98A}
5273
EndGlobalSection
5374
GlobalSection(ExtensibilityGlobals) = postSolution
5475
SolutionGuid = {D00EB11C-F086-49F7-B7EC-21CC98017753}

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ services.AddDistributedPostgreSqlCache(setup =>
2222
// This means que every time starts the application the
2323
// creation of table and database functions will be verified.
2424
})
25+
```
26+
3. Then pull from DI like any other service
27+
28+
```c#
29+
private readonly IDistributedCache _cache;
30+
31+
public WeatherForecastController(IDistributedCache cache)
32+
{
33+
_cache = cache;
34+
}
35+
2536
```
2637
## What it does to my database:
2738

@@ -36,7 +47,7 @@ Creates a table and six functions, see scripts folder for more details.
3647
3748
```
3849

39-
## Runing the sample
50+
## Runing the console sample
4051
You will need a local postgresql server with this configuration:
4152
1. Server listening to port 5432 at localhost
4253
1. The password of your `postgres` account, if not attached already to your user.
@@ -54,6 +65,9 @@ Then you can delete the database with:
5465
prepare-database.cmd -erase
5566
```
5667
## Change Log
68+
1. v3.0
69+
1. [BREAKING CHANGE] - Direct instantiation not preferred
70+
2. Single thread loop remover
5771
1. v2.0.x - Update everything to net5.0, more detailed sample project.
5872
1. v1.0.8 - Update to latest dependencies -
5973

0 commit comments

Comments
 (0)