Skip to content

Commit e3bfc78

Browse files
author
Chris Young
committed
Updated nuget packages
1 parent a882994 commit e3bfc78

File tree

14 files changed

+256
-189
lines changed

14 files changed

+256
-189
lines changed
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4-
<Authors>ArchitectNow</Authors>
5-
<Company>ArchitectNow</Company>
6-
<Product>ArchitectNow.Caching</Product>
7-
<PackageId>ArchitectNow.Caching</PackageId>
8-
<PackageProjectUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</PackageProjectUrl>
9-
<PackageIconUrl>https://secure.gravatar.com/avatar/83fed82c32dc5424b4245cfc03d57b39?s=32&amp;r=g&amp;d=retro</PackageIconUrl>
10-
<RepositoryUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</RepositoryUrl>
11-
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
12-
<Copyright>Copyright © 2014-2018 ArchitectNow</Copyright>
13-
<PackageLicenseUrl>https://github.com/ArchitectNow/ArchitectNow.Framework/blob/master/LICENSE</PackageLicenseUrl>
14-
<Description>ArchitectNow Framework - Models</Description>
15-
</PropertyGroup>
16-
<PropertyGroup>
17-
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
19-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
20-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
21-
</PropertyGroup>
22-
<ItemGroup>
23-
<PackageReference Include="Autofac" Version="4.8.1" />
24-
<PackageReference Include="CacheManager.Serialization.Json" Version="1.1.2" />
25-
<PackageReference Include="CacheManager.StackExchange.Redis" Version="1.1.2" />
26-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.1.0" />
27-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" />
28-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.0" />
29-
30-
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
31-
</ItemGroup>
32-
<ItemGroup>
33-
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />
34-
</ItemGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<Authors>ArchitectNow</Authors>
5+
<Company>ArchitectNow</Company>
6+
<Product>ArchitectNow.Caching</Product>
7+
<PackageId>ArchitectNow.Caching</PackageId>
8+
<PackageProjectUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</PackageProjectUrl>
9+
<PackageIconUrl>https://secure.gravatar.com/avatar/83fed82c32dc5424b4245cfc03d57b39?s=32&amp;r=g&amp;d=retro</PackageIconUrl>
10+
<RepositoryUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</RepositoryUrl>
11+
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
12+
<Copyright>Copyright © 2014-2018 ArchitectNow</Copyright>
13+
<PackageLicenseUrl>https://github.com/ArchitectNow/ArchitectNow.Framework/blob/master/LICENSE</PackageLicenseUrl>
14+
<Description>ArchitectNow Framework - Models</Description>
15+
</PropertyGroup>
16+
<PropertyGroup>
17+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
19+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
20+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<PackageReference Include="Autofac" Version="4.8.1" />
24+
<PackageReference Include="CacheManager.Serialization.Json" Version="1.1.2" />
25+
<PackageReference Include="CacheManager.StackExchange.Redis" Version="1.1.2" />
26+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.1.1" />
27+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
28+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
29+
30+
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
31+
</ItemGroup>
32+
<ItemGroup>
33+
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />
34+
</ItemGroup>
3535
</Project>

src/ArchitectNow.Caching/CachingService.cs

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public T Get<T>(string key)
2323

2424
return result;
2525
}
26-
26+
2727
public bool Add<T>(CacheItem<T> value)
2828
{
2929
var cacheManager = GetCacheManager<T>();
@@ -32,7 +32,7 @@ public bool Add<T>(CacheItem<T> value)
3232

3333
return result;
3434
}
35-
35+
3636
public bool Add<T>(string key, T value)
3737
{
3838
var cacheManager = GetCacheManager<T>();
@@ -41,25 +41,53 @@ public bool Add<T>(string key, T value)
4141

4242
return result;
4343
}
44-
44+
4545
public CacheItem<T> GetOrAdd<T>(string key, Func<string, CacheItem<T>> valueFactory)
4646
{
4747
var cacheManager = GetCacheManager<T>();
48-
48+
4949
cacheManager.TryGetOrAdd(key, _region, (k, r) => valueFactory(key), out var result);
5050

5151
return result;
5252
}
53-
53+
5454
public T GetOrAdd<T>(string key, Func<string, T> valueFactory)
5555
{
5656
var cacheManager = GetCacheManager<T>();
57-
57+
5858
cacheManager.TryGetOrAdd(key, _region, (k, r) => valueFactory(key), out var result);
5959

6060
return result;
6161
}
62-
62+
63+
public T Update<T>(string key, Func<T, T> updateValue)
64+
{
65+
var cacheManager = GetCacheManager<T>();
66+
return cacheManager.Update(key, _region, updateValue);
67+
}
68+
69+
70+
public T AddOrUpdate<T>(string key, T addValue, Func<T, T> updateValue)
71+
{
72+
var cacheManager = GetCacheManager<T>();
73+
74+
return cacheManager.AddOrUpdate(key, _region, addValue, updateValue);
75+
}
76+
77+
public void Put<T>(string key, T value)
78+
{
79+
var cacheManager = GetCacheManager<T>();
80+
81+
cacheManager.Put(key, value, _region);
82+
}
83+
84+
public void Expire<T>(string key, ExpirationMode expirationMode, TimeSpan timeout)
85+
{
86+
var cacheManager = GetCacheManager<T>();
87+
88+
cacheManager.Expire(key, _region, expirationMode, timeout);
89+
}
90+
6391
public bool Remove<T>(string key)
6492
{
6593
var cacheManager = GetCacheManager<T>();
@@ -81,26 +109,57 @@ public Task<T> GetAsync<T>(string key)
81109
{
82110
return Get<T>(key).AsResult();
83111
}
84-
112+
85113
public Task<T> GetOrAddAsync<T>(string key, Func<string, T> valueFactory)
86114
{
87115
return GetOrAdd(key, valueFactory).AsResult();
88116
}
89-
117+
90118
public Task<CacheItem<T>> GetOrAddAsync<T>(string key, Func<string, CacheItem<T>> valueFactory)
91119
{
92120
return GetOrAdd(key, valueFactory).AsResult();
93121
}
94-
122+
95123
public Task<bool> AddAsync<T>(string key, T value)
96124
{
97125
return Add(key, value).AsResult();
98126
}
99-
127+
100128
public Task<bool> RemoveAsync<T>(string key)
101129
{
102130
return Remove<T>(key).AsResult();
103131
}
132+
133+
public Task<T> UpdateAsync<T>(string key, Func<T, T> updateValue)
134+
{
135+
var cacheManager = GetCacheManager<T>();
136+
return cacheManager.Update(key, _region, updateValue).AsResult();
137+
}
138+
139+
140+
public Task<T> AddOrUpdateAsync<T>(string key, T addValue, Func<T, T> updateValue)
141+
{
142+
var cacheManager = GetCacheManager<T>();
143+
144+
return cacheManager.AddOrUpdate(key, _region, addValue, updateValue).AsResult();
145+
}
146+
147+
public Task PutAsync<T>(string key, T value)
148+
{
149+
var cacheManager = GetCacheManager<T>();
150+
151+
cacheManager.Put(key, value, _region);
152+
return Task.Run(() => { });
153+
}
154+
155+
public Task ExpireAsync<T>(string key, ExpirationMode expirationMode, TimeSpan timeout)
156+
{
157+
var cacheManager = GetCacheManager<T>();
158+
159+
cacheManager.Expire(key, _region, expirationMode, timeout);
160+
161+
return Task.Run(() => { });
162+
}
104163

105164
public Task ClearAsync(string region)
106165
{
@@ -109,7 +168,7 @@ public Task ClearAsync(string region)
109168

110169
public Task ClearAllAsync()
111170
{
112-
return Task.Run(()=> ClearAll());
171+
return Task.Run(() => ClearAll());
113172
}
114173

115174
private ICacheManager<T> GetCacheManager<T>()

src/ArchitectNow.Caching/ICachingService.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,13 @@ public interface ICachingService
2222
bool Add<T>(CacheItem<T> value);
2323
CacheItem<T> GetOrAdd<T>(string key, Func<string, CacheItem<T>> valueFactory);
2424
Task<CacheItem<T>> GetOrAddAsync<T>(string key, Func<string, CacheItem<T>> valueFactory);
25+
T Update<T>(string key, Func<T, T> updateValue);
26+
T AddOrUpdate<T>(string key, T addValue, Func<T, T> updateValue);
27+
void Put<T>(string key, T value);
28+
void Expire<T>(string key, ExpirationMode expirationMode, TimeSpan timeout);
29+
Task<T> UpdateAsync<T>(string key, Func<T, T> updateValue);
30+
Task<T> AddOrUpdateAsync<T>(string key, T addValue, Func<T, T> updateValue);
31+
Task PutAsync<T>(string key, T value);
32+
Task ExpireAsync<T>(string key, ExpirationMode expirationMode, TimeSpan timeout);
2533
}
2634
}

src/ArchitectNow.Models/ArchitectNow.Models.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
2121
</PropertyGroup>
2222
<ItemGroup>
23-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" />
24-
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.0" />
25-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.0" />
26-
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.2" />
23+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
24+
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.1" />
25+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
26+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.2.4" />
2727
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
2828
</ItemGroup>
2929
<ItemGroup>

src/ArchitectNow.Mongo/ArchitectNow.Mongo.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
</PropertyGroup>
2222
<ItemGroup>
2323
<PackageReference Include="Autofac" Version="4.8.1" />
24-
<PackageReference Include="FluentValidation" Version="7.6.0" />
25-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" />
26-
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.0" />
27-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.0" />
28-
<PackageReference Include="MongoDB.Driver" Version="2.6.1" />
24+
<PackageReference Include="FluentValidation" Version="7.6.104" />
25+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
26+
<PackageReference Include="Microsoft.Extensions.Options" Version="2.1.1" />
27+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
28+
<PackageReference Include="MongoDB.Driver" Version="2.7.0" />
2929
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
3030
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
3131
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />

src/ArchitectNow.Mongo/Db/BaseRepository.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ protected virtual async Task CreateIndex(string name, IndexKeysDefinition<TModel
189189
Name = name
190190
};
191191

192-
await GetCollection().Indexes.CreateOneAsync(keys, options);
192+
var createIndexModel = new CreateIndexModel<TModel>(keys, options);
193+
194+
await GetCollection().Indexes.CreateOneAsync(createIndexModel);
193195
}
194196

195197
/// <summary>
@@ -206,7 +208,7 @@ protected virtual async Task<IList<ValidationFailure>> ValidateObject(TModel ite
206208

207209
protected virtual async Task<long> CountAsync(Expression<Func<TModel, bool>> filter)
208210
{
209-
return await GetCollection().CountAsync(filter);
211+
return await GetCollection().CountDocumentsAsync(filter);
210212
}
211213

212214
protected async Task<List<TModel>> FindAsync(Expression<Func<TModel, bool>> filter)

src/ArchitectNow.Mongo/Db/MongoDBUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected MongoDbUtilities(string connectionString, string databaseName)
3737

3838
ConventionRegistry.Register("AN Conventions", pack, t => true);
3939
MongoDefaults.MaxConnectionIdleTime = TimeSpan.FromMinutes(1);
40-
_client = new MongoClient(connectionString);
40+
_client = new MongoClient(connectionString);
4141
}
4242

4343
public IMongoDatabase Database => _client.GetDatabase(DatabaseName);

src/ArchitectNow.Mongo/MongoModule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using ArchitectNow.Models.Options;
2-
using ArchitectNow.Mongo.Db;
32
using ArchitectNow.Mongo.Models;
43
using ArchitectNow.Mongo.Options;
54
using ArchitectNow.Mongo.Services;
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4-
<Authors>ArchitectNow</Authors>
5-
<Company>ArchitectNow</Company>
6-
<Product>ArchitectNow.Services</Product>
7-
<PackageId>ArchitectNow.Services</PackageId>
8-
<PackageProjectUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</PackageProjectUrl>
9-
<PackageIconUrl>https://secure.gravatar.com/avatar/83fed82c32dc5424b4245cfc03d57b39?s=32&amp;r=g&amp;d=retro</PackageIconUrl>
10-
<RepositoryUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</RepositoryUrl>
11-
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
12-
<Copyright>Copyright © 2014-2018 ArchitectNow</Copyright>
13-
<PackageLicenseUrl>https://github.com/ArchitectNow/ArchitectNow.Framework/blob/master/LICENSE</PackageLicenseUrl>
14-
<Description>ArchitectNow Framework - Services</Description>
15-
</PropertyGroup>
16-
<PropertyGroup>
17-
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
19-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
20-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
21-
</PropertyGroup>
22-
<ItemGroup>
23-
<PackageReference Include="Autofac" Version="4.8.1" />
24-
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.0" />
25-
26-
</ItemGroup>
27-
<ItemGroup>
28-
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />
29-
</ItemGroup>
30-
<ItemGroup>
31-
<ProjectReference Include="..\ArchitectNow.Models\ArchitectNow.Models.csproj" />
32-
</ItemGroup>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4+
<Authors>ArchitectNow</Authors>
5+
<Company>ArchitectNow</Company>
6+
<Product>ArchitectNow.Services</Product>
7+
<PackageId>ArchitectNow.Services</PackageId>
8+
<PackageProjectUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</PackageProjectUrl>
9+
<PackageIconUrl>https://secure.gravatar.com/avatar/83fed82c32dc5424b4245cfc03d57b39?s=32&amp;r=g&amp;d=retro</PackageIconUrl>
10+
<RepositoryUrl>https://github.com/ArchitectNow/ArchitectNow.Framework</RepositoryUrl>
11+
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
12+
<Copyright>Copyright © 2014-2018 ArchitectNow</Copyright>
13+
<PackageLicenseUrl>https://github.com/ArchitectNow/ArchitectNow.Framework/blob/master/LICENSE</PackageLicenseUrl>
14+
<Description>ArchitectNow Framework - Services</Description>
15+
</PropertyGroup>
16+
<PropertyGroup>
17+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
19+
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
20+
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<PackageReference Include="Autofac" Version="4.8.1" />
24+
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
25+
26+
</ItemGroup>
27+
<ItemGroup>
28+
<Compile Include="..\..\VersionAssemblyInfo.cs" Link="VersionAssemblyInfo.cs" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<ProjectReference Include="..\ArchitectNow.Models\ArchitectNow.Models.csproj" />
32+
</ItemGroup>
3333
</Project>

0 commit comments

Comments
 (0)