cleanup services

This commit is contained in:
Collin M. Barrett 2018-01-23 19:55:26 -06:00
parent 79b6c55fd4
commit deff680952

View file

@ -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)