Skip to content

Commit a310428

Browse files
Generate XML comment documentation for Core distributed caches
Fixes some erroneous comments by the way. Handle cls non compliant cases one by one instead of globally disabling the warning. To be squashed, like all other commits of this PR.
1 parent 7c0e58d commit a310428

File tree

13 files changed

+24
-26
lines changed

13 files changed

+24
-26
lines changed

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Memcached/MemcachedFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private static string SanitizeKey(string key)
6868
public CacheConstraints Constraints { get; }
6969

7070
/// <inheritdoc />
71+
[CLSCompliant(false)]
7172
public IDistributedCache BuildCache()
7273
{
7374
return _cache;

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Memcached/NHibernate.Caches.CoreDistributedCache.Memcached.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Description>Memcached cache provider for NHibernate using .Net Core IDistributedCache (EnyimMemcachedCore).</Description>
77
<!-- Targeting net461 explicitly in order to avoid https://github.com/dotnet/standard/issues/506 for net461 consumers-->
88
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
9-
<NoWarn>$(NoWarn);3001;3002</NoWarn>
109
<SignAssembly>False</SignAssembly>
10+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1111
<PackageReleaseNotes>* New feature
1212
* #28 - Add a .Net Core DistributedCache</PackageReleaseNotes>
1313
</PropertyGroup>

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Memory/MemoryFactory.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public MemoryFactory() : this(null)
2828
/// <summary>
2929
/// Constructor with explicit configuration properties.
3030
/// </summary>
31-
/// <param name="expirationScanFrequency">See <see cref="MemoryDistributedCacheOptions.ExpirationScanFrequency" />.</param>
32-
/// <param name="sizeLimit">See <see cref="MemoryDistributedCacheOptions.SizeLimit" />.</param>
31+
/// <param name="expirationScanFrequency">See <see cref="MemoryCacheOptions.ExpirationScanFrequency" />.</param>
32+
/// <param name="sizeLimit">See <see cref="MemoryCacheOptions.SizeLimit" />.</param>
3333
public MemoryFactory(TimeSpan? expirationScanFrequency, long? sizeLimit)
3434
{
3535
var options = new Options();
@@ -43,8 +43,8 @@ public MemoryFactory(TimeSpan? expirationScanFrequency, long? sizeLimit)
4343

4444
/// <summary>
4545
/// Constructor with configuration properties. It supports <c>expiration-scan-frequency</c> and
46-
/// <c>size-limit</c> properties. See <see cref="MemoryDistributedCacheOptions.ExpirationScanFrequency" /> and
47-
/// <see cref="MemoryDistributedCacheOptions.SizeLimit" />.
46+
/// <c>size-limit</c> properties. See <see cref="MemoryCacheOptions.ExpirationScanFrequency" /> and
47+
/// <see cref="MemoryCacheOptions.SizeLimit" />.
4848
/// </summary>
4949
/// <param name="properties">The configurations properties.</param>
5050
/// <remarks>
@@ -101,6 +101,7 @@ public MemoryFactory(IDictionary<string, string> properties)
101101
}
102102

103103
/// <inheritdoc />
104+
[CLSCompliant(false)]
104105
public IDistributedCache BuildCache()
105106
{
106107
// Always yields the same instance: its underlying implementation is a MemoryCache which regularly spawn

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Memory/NHibernate.Caches.CoreDistributedCache.Memory.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
Meant for testing purpose, consider NHibernate.Caches.CoreMemoryCache for other usages.</Description>
88
<!-- Targeting net461 explicitly in order to avoid https://github.com/dotnet/standard/issues/506 for net461 consumers-->
99
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
10-
<NoWarn>$(NoWarn);3001;3002</NoWarn>
1110
<SignAssembly>True</SignAssembly>
1211
<AssemblyOriginatorKeyFile>..\..\NHibernate.Caches.snk</AssemblyOriginatorKeyFile>
12+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1313
<PackageReleaseNotes>* New feature
1414
* #28 - Add a .Net Core DistributedCache</PackageReleaseNotes>
1515
</PropertyGroup>

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Redis/NHibernate.Caches.CoreDistributedCache.Redis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<Description>Redis cache provider for NHibernate using .Net Core IDistributedCache (Microsoft.Extensions.Caching.Redis).</Description>
77
<!-- Targeting net461 explicitly in order to avoid https://github.com/dotnet/standard/issues/506 for net461 consumers-->
88
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
9-
<NoWarn>$(NoWarn);3001;3002</NoWarn>
109
<SignAssembly>True</SignAssembly>
1110
<AssemblyOriginatorKeyFile>..\..\NHibernate.Caches.snk</AssemblyOriginatorKeyFile>
11+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
<PackageReleaseNotes>* New feature
1313
* #28 - Add a .Net Core DistributedCache</PackageReleaseNotes>
1414
</PropertyGroup>

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Redis/RedisFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using Microsoft.Extensions.Caching.Distributed;
34
using Microsoft.Extensions.Caching.Redis;
45

@@ -66,6 +67,7 @@ public RedisFactory(IDictionary<string, string> properties)
6667
public CacheConstraints Constraints => null;
6768

6869
/// <inheritdoc />
70+
[CLSCompliant(false)]
6971
public IDistributedCache BuildCache()
7072
{
7173
// According to https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed#the-idistributedcache-interface

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.SqlServer/NHibernate.Caches.CoreDistributedCache.SqlServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<Description>SQL Server cache provider for NHibernate using .Net Core IDistributedCache (Microsoft.Extensions.Caching.SqlServer).</Description>
77
<!-- Targeting net461 explicitly in order to avoid https://github.com/dotnet/standard/issues/506 for net461 consumers-->
88
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
9-
<NoWarn>$(NoWarn);3001;3002</NoWarn>
109
<SignAssembly>True</SignAssembly>
1110
<AssemblyOriginatorKeyFile>..\..\NHibernate.Caches.snk</AssemblyOriginatorKeyFile>
11+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
<PackageReleaseNotes>* New feature
1313
* #28 - Add a .Net Core DistributedCache</PackageReleaseNotes>
1414
</PropertyGroup>

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.SqlServer/SqlServerFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public SqlServerFactory(IDictionary<string, string> properties)
102102
public CacheConstraints Constraints { get; } = new CacheConstraints { MaxKeySize = 449 };
103103

104104
/// <inheritdoc />
105+
[CLSCompliant(false)]
105106
public IDistributedCache BuildCache()
106107
{
107108
// According to https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed#the-idistributedcache-interface

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache/CoreDistributedCache.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@
3333
namespace NHibernate.Caches.CoreDistributedCache
3434
{
3535
/// <summary>
36-
/// Pluggable cache implementation using the Microsoft.Extensions.Caching.Memory classes.
36+
/// Pluggable cache implementation using <see cref="IDistributedCache"/> implementations.
3737
/// </summary>
38-
/// <remarks>
39-
/// Priority is not configurable because it is un-usable: the compaction on memory pressure feature has been
40-
/// removed from MemoryCache, only explicit compaction or size limit compaction may use priorities. But
41-
/// <see cref="ICache" /> API does not have a suitable method for triggering compaction, and size of each
42-
/// cached entry has to be user provided, which <see cref="ICache" /> API does not support.
43-
/// </remarks>
4438
public partial class CoreDistributedCache : ICache
4539
{
4640
private static readonly INHibernateLogger Log = NHibernateLogger.For(typeof(CoreDistributedCache));
@@ -74,6 +68,7 @@ public partial class CoreDistributedCache : ICache
7468
/// All parameters are optional. The defaults are an expiration of 300 seconds, no sliding expiration and no prefix.
7569
/// </remarks>
7670
/// <exception cref="ArgumentException">The "expiration" property could not be parsed.</exception>
71+
[CLSCompliant(false)]
7772
public CoreDistributedCache(
7873
IDistributedCache cache, CacheConstraints constraints, string region, IDictionary<string, string> properties)
7974
{

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache/CoreDistributedCacheProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
namespace NHibernate.Caches.CoreDistributedCache
3232
{
3333
/// <summary>
34-
/// Cache provider using the System.Runtime.Caching classes
34+
/// Cache provider using <see cref="IDistributedCache"/> implementations.
3535
/// </summary>
3636
public class CoreDistributedCacheProvider : ICacheProvider
3737
{
@@ -47,6 +47,7 @@ public class CoreDistributedCacheProvider : ICacheProvider
4747
/// <remarks>
4848
/// Changes to this property affect only caches built after the change.
4949
/// </remarks>
50+
[CLSCompliant(false)]
5051
public static IDistributedCacheFactory CacheFactory { get; set; }
5152

5253
static CoreDistributedCacheProvider()

0 commit comments

Comments
 (0)