@@ -30,50 +30,44 @@ public class Startup
3030 /// </summary>
3131 /// <param name="services">The collection of service descriptors.</param>
3232 public void ConfigureServices ( IServiceCollection services )
33- {
34- services . AddImageSharp ( )
35- . SetRequestParser < QueryCollectionRequestParser > ( )
36- . Configure < PhysicalFileSystemCacheOptions > ( options =>
37- {
38- options . CacheRootPath = null ;
39- options . CacheFolder = "is-cache" ;
40- options . CacheFolderDepth = 8 ;
41- } )
42- . SetCache < PhysicalFileSystemCache > ( )
43- . SetCacheKey < UriRelativeLowerInvariantCacheKey > ( )
44- . SetCacheHash < SHA256CacheHash > ( )
45- . Configure < PhysicalFileSystemProviderOptions > ( options =>
46- {
47- options . ProviderRootPath = null ;
48- } )
49- . AddProvider < PhysicalFileSystemProvider > ( )
50- . AddProcessor < ResizeWebProcessor > ( )
51- . AddProcessor < FormatWebProcessor > ( )
52- . AddProcessor < BackgroundColorWebProcessor > ( )
53- . AddProcessor < QualityWebProcessor > ( )
54- . AddProcessor < AutoOrientWebProcessor > ( ) ;
33+ => services . AddImageSharp ( )
34+ . SetRequestParser < QueryCollectionRequestParser > ( )
35+ . Configure < PhysicalFileSystemCacheOptions > ( options =>
36+ {
37+ options . CacheRootPath = null ;
38+ options . CacheFolder = "is-cache" ;
39+ options . CacheFolderDepth = 8 ;
40+ } )
41+ . SetCache < PhysicalFileSystemCache > ( )
42+ . SetCacheKey < UriRelativeLowerInvariantCacheKey > ( )
43+ . SetCacheHash < SHA256CacheHash > ( )
44+ . Configure < PhysicalFileSystemProviderOptions > ( options => options . ProviderRootPath = null )
45+ . AddProvider < PhysicalFileSystemProvider > ( )
46+ . AddProcessor < ResizeWebProcessor > ( )
47+ . AddProcessor < FormatWebProcessor > ( )
48+ . AddProcessor < BackgroundColorWebProcessor > ( )
49+ . AddProcessor < QualityWebProcessor > ( )
50+ . AddProcessor < AutoOrientWebProcessor > ( ) ;
5551
56- // Add the default service and options.
57- //
58- // services.AddImageSharp();
52+ // Add the default service and options.
53+ //
54+ // services.AddImageSharp();
5955
60- // Or add the default service and custom options.
61- //
62- // this.ConfigureDefaultServicesAndCustomOptions(services);
56+ // Or add the default service and custom options.
57+ //
58+ // this.ConfigureDefaultServicesAndCustomOptions(services);
6359
64- // Or we can fine-grain control adding the default options and configure all other services.
65- //
66- // this.ConfigureCustomServicesAndDefaultOptions(services);
60+ // Or we can fine-grain control adding the default options and configure all other services.
61+ //
62+ // this.ConfigureCustomServicesAndDefaultOptions(services);
6763
68- // Or we can fine-grain control adding custom options and configure all other services
69- // There are also factory methods for each builder that will allow building from configuration files.
70- //
71- // this.ConfigureCustomServicesAndCustomOptions(services);
72- }
64+ // Or we can fine-grain control adding custom options and configure all other services
65+ // There are also factory methods for each builder that will allow building from configuration files.
66+ //
67+ // this.ConfigureCustomServicesAndCustomOptions(services);
7368
7469 private void ConfigureDefaultServicesAndCustomOptions ( IServiceCollection services )
75- {
76- services . AddImageSharp ( options =>
70+ => services . AddImageSharp ( options =>
7771 {
7872 options . Configuration = Configuration . Default ;
7973 options . BrowserMaxAge = TimeSpan . FromDays ( 7 ) ;
@@ -84,18 +78,14 @@ private void ConfigureDefaultServicesAndCustomOptions(IServiceCollection service
8478 options . OnProcessedAsync = _ => Task . CompletedTask ;
8579 options . OnPrepareResponseAsync = _ => Task . CompletedTask ;
8680 } ) ;
87- }
8881
8982 private void ConfigureCustomServicesAndDefaultOptions ( IServiceCollection services )
90- {
91- services . AddImageSharp ( )
92- . RemoveProcessor < FormatWebProcessor > ( )
93- . RemoveProcessor < BackgroundColorWebProcessor > ( ) ;
94- }
83+ => services . AddImageSharp ( )
84+ . RemoveProcessor < FormatWebProcessor > ( )
85+ . RemoveProcessor < BackgroundColorWebProcessor > ( ) ;
9586
9687 private void ConfigureCustomServicesAndCustomOptions ( IServiceCollection services )
97- {
98- services . AddImageSharp ( options =>
88+ => services . AddImageSharp ( options =>
9989 {
10090 options . Configuration = Configuration . Default ;
10191 options . BrowserMaxAge = TimeSpan . FromDays ( 7 ) ;
@@ -107,10 +97,7 @@ private void ConfigureCustomServicesAndCustomOptions(IServiceCollection services
10797 options . OnPrepareResponseAsync = _ => Task . CompletedTask ;
10898 } )
10999 . SetRequestParser < QueryCollectionRequestParser > ( )
110- . Configure < PhysicalFileSystemCacheOptions > ( options =>
111- {
112- options . CacheFolder = "different-cache" ;
113- } )
100+ . Configure < PhysicalFileSystemCacheOptions > ( options => options . CacheFolder = "different-cache" )
114101 . SetCache < PhysicalFileSystemCache > ( )
115102 . SetCacheKey < UriRelativeLowerInvariantCacheKey > ( )
116103 . SetCacheHash < SHA256CacheHash > ( )
@@ -121,7 +108,6 @@ private void ConfigureCustomServicesAndCustomOptions(IServiceCollection services
121108 . AddProcessor < FormatWebProcessor > ( )
122109 . AddProcessor < BackgroundColorWebProcessor > ( )
123110 . AddProcessor < QualityWebProcessor > ( ) ;
124- }
125111
126112 /// <summary>
127113 /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
0 commit comments