mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
cleanup services
This commit is contained in:
parent
08b0df764d
commit
b2fca09b81
1 changed files with 9 additions and 13 deletions
|
|
@ -1,8 +1,8 @@
|
|||
using System.IO;
|
||||
using Microsoft.ApplicationInsights.Extensibility.Implementation;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Newtonsoft.Json;
|
||||
using Swashbuckle.AspNetCore.Swagger;
|
||||
|
||||
namespace FilterLists.Api.DependencyInjection.Extensions
|
||||
|
|
@ -16,23 +16,19 @@ public static void AddFilterListsApi(this IServiceCollection services)
|
|||
services.AddResponseCaching();
|
||||
services.AddMemoryCache();
|
||||
services.AddSwaggerGenCustom();
|
||||
Microsoft.ApplicationInsights.Extensibility.Implementation.TelemetryDebugWriter.IsTracingDisabled = true;
|
||||
TelemetryDebugWriter.IsTracingDisabled = true;
|
||||
}
|
||||
|
||||
private static void AddMvcCustom(this IServiceCollection services)
|
||||
{
|
||||
services.AddMvc(options =>
|
||||
{
|
||||
options.CacheProfiles.Add("Long-Lived",
|
||||
new CacheProfile
|
||||
{
|
||||
Duration = 86400
|
||||
});
|
||||
})
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
||||
});
|
||||
{
|
||||
options.CacheProfiles.Add("Long-Lived",
|
||||
new CacheProfile
|
||||
{
|
||||
Duration = 86400
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private static void AddSwaggerGenCustom(this IServiceCollection services)
|
||||
|
|
|
|||
Loading…
Reference in a new issue