Skip to content

Commit 83273e7

Browse files
Cleanup
1 parent 0d9625d commit 83273e7

6 files changed

Lines changed: 13 additions & 48 deletions

File tree

src/Directory.Build.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
<PackageReference Update="Azure.Storage.Blobs" Version="12.10.0" />
2222
<PackageReference Update="Microsoft.IO.RecyclableMemoryStream" Version="2.2.0" />
2323
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
24-
<PackageReference Update="MinVer" PrivateAssets="All" Version="2.3.0" />
25-
<PackageReference Update="SixLabors.ImageSharp" Version="2.0.0-alpha.0.156" />
24+
<PackageReference Update="SixLabors.ImageSharp" Version="2.0.0-alpha.0.165" />
2625
</ItemGroup>
2726

2827
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">

src/ImageSharp.Web/Caching/LegacyV1CacheKey.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Web.Caching
99
{
1010
/// <summary>
1111
/// Maintained for compatibility purposes only this cache key implementation generates the same
12-
/// out as the V1 middleware. If possible, it is recommended to use the <see cref="UriRelativeCacheKey"/>.
12+
/// out as the V1 middleware. If possible, it is recommended to use the <see cref="UriRelativeLowerInvariantCacheKey"/>.
1313
/// </summary>
1414
public class LegacyV1CacheKey : ICacheKey
1515
{

src/ImageSharp.Web/Caching/PhysicalFileSystemCache.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public PhysicalFileSystemCache(
5858
Guard.NotNullOrWhiteSpace(environment.WebRootPath, nameof(environment.WebRootPath));
5959

6060
// Allow configuration of the cache without having to register everything
61-
PhysicalFileSystemCacheOptions cacheOptions = options != null ? options.Value : new PhysicalFileSystemCacheOptions();
61+
PhysicalFileSystemCacheOptions cacheOptions = options != null ? options.Value : new();
6262
this.cacheRootPath = GetCacheRoot(cacheOptions, environment.WebRootPath, environment.ContentRootPath);
6363
this.cacheFolderDepth = (int)cacheOptions.CacheFolderDepth;
6464

@@ -72,13 +72,13 @@ public PhysicalFileSystemCache(
7272
/// <summary>
7373
/// Determine the cache root path
7474
/// </summary>
75-
/// <param name="cacheOptions">the cache options.</param>
76-
/// <param name="webRootPath">the webRootPath.</param>
77-
/// <param name="contentRootPath">the contentRootPath.</param>
78-
/// <returns>root path.</returns>
75+
/// <param name="cacheOptions">The cache options.</param>
76+
/// <param name="webRootPath">The web root path.</param>
77+
/// <param name="contentRootPath">The content root path.</param>
78+
/// <returns><see cref="string"/> representing the fully qualified cache root path.</returns>
7979
internal static string GetCacheRoot(PhysicalFileSystemCacheOptions cacheOptions, string webRootPath, string contentRootPath)
8080
{
81-
string cacheRoot = string.IsNullOrEmpty(cacheOptions.CacheRoot)
81+
string cacheRoot = string.IsNullOrWhiteSpace(cacheOptions.CacheRoot)
8282
? webRootPath
8383
: cacheOptions.CacheRoot;
8484

src/ImageSharp.Web/DependencyInjection/ImageSharpBuilderExtensions.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using Microsoft.Extensions.Configuration;
88
using Microsoft.Extensions.DependencyInjection;
99
using Microsoft.Extensions.DependencyInjection.Extensions;
10-
using SixLabors.ImageSharp.Memory;
1110
using SixLabors.ImageSharp.Web.Caching;
1211
using SixLabors.ImageSharp.Web.Commands;
1312
using SixLabors.ImageSharp.Web.Commands.Converters;
@@ -48,27 +47,6 @@ public static IImageSharpBuilder SetRequestParser(this IImageSharpBuilder builde
4847
return builder;
4948
}
5049

51-
/// <summary>
52-
/// Sets the given <see cref="MemoryAllocator"/> adding it to the service collection.
53-
/// </summary>
54-
/// <param name="builder">The core builder.</param>
55-
/// <param name="implementationFactory">The factory method for returning a <see cref="MemoryAllocator"/>.</param>
56-
/// <returns>The <see cref="IImageSharpBuilder"/>.</returns>
57-
[Obsolete("Use ImageSharp.Configuration.MemoryAllocator. This will be removed in a future version.", true)]
58-
public static IImageSharpBuilder SetMemoryAllocator(this IImageSharpBuilder builder, Func<IServiceProvider, MemoryAllocator> implementationFactory)
59-
=> builder;
60-
61-
/// <summary>
62-
/// Sets the given <see cref="MemoryAllocator"/> adding it to the service collection.
63-
/// </summary>
64-
/// <typeparam name="TMemoryAllocator">The type of class implementing <see cref="MemoryAllocator"/>to add.</typeparam>
65-
/// <param name="builder">The core builder.</param>
66-
/// <returns>The <see cref="IImageSharpBuilder"/>.</returns>
67-
[Obsolete("Use ImageSharp.Configuration.MemoryAllocator. This will be removed in a future version.", true)]
68-
public static IImageSharpBuilder SetMemoryAllocator<TMemoryAllocator>(this IImageSharpBuilder builder)
69-
where TMemoryAllocator : MemoryAllocator
70-
=> builder;
71-
7250
/// <summary>
7351
/// Sets the given <see cref="IImageCache"/> adding it to the service collection.
7452
/// </summary>

src/ImageSharp.Web/Middleware/ImageSharpMiddlewareOptions.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ public class ImageSharpMiddlewareOptions
9696
/// </summary>
9797
public Func<ImageCommandContext, Task> OnParseCommandsAsync
9898
{
99-
get
100-
{
101-
return this.onParseCommandsAsync;
102-
}
99+
get => this.onParseCommandsAsync;
103100

104101
set
105102
{
@@ -115,10 +112,7 @@ public Func<ImageCommandContext, Task> OnParseCommandsAsync
115112
/// </summary>
116113
public Func<FormattedImage, Task> OnBeforeSaveAsync
117114
{
118-
get
119-
{
120-
return this.onBeforeSaveAsync;
121-
}
115+
get => this.onBeforeSaveAsync;
122116

123117
set
124118
{
@@ -134,10 +128,7 @@ public Func<FormattedImage, Task> OnBeforeSaveAsync
134128
/// </summary>
135129
public Func<ImageProcessingContext, Task> OnProcessedAsync
136130
{
137-
get
138-
{
139-
return this.onProcessedAsync;
140-
}
131+
get => this.onProcessedAsync;
141132

142133
set
143134
{
@@ -153,10 +144,7 @@ public Func<ImageProcessingContext, Task> OnProcessedAsync
153144
/// </summary>
154145
public Func<HttpContext, Task> OnPrepareResponseAsync
155146
{
156-
get
157-
{
158-
return this.onPrepareResponseAsync;
159-
}
147+
get => this.onPrepareResponseAsync;
160148

161149
set
162150
{

tests/ImageSharp.Web.Tests/Caching/PhysicialFileSystemCacheTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void CacheRootFromOptions(string cacheFolder, string cacheRoot, string we
4343
CacheRoot = cacheRoot
4444
};
4545

46-
var cacheRootResult = PhysicalFileSystemCache.GetCacheRoot(cacheOptions, webRootPath, contentRootPath);
46+
string cacheRootResult = PhysicalFileSystemCache.GetCacheRoot(cacheOptions, webRootPath, contentRootPath);
4747

4848
Assert.Equal(expected, cacheRootResult);
4949
}

0 commit comments

Comments
 (0)