From 6d15dcf1ca4a9f34d7d70dd6de08fde11b0a6cdd Mon Sep 17 00:00:00 2001 From: "Chris Ross (ASP.NET)" Date: Fri, 26 Jan 2018 12:16:25 -0800 Subject: [PATCH] Use TryAdd for ISessionStore service #2755 --- .../SessionServiceCollectionExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs index 48424e48cd..628390fbe3 100644 --- a/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Session; +using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection { @@ -24,7 +25,7 @@ namespace Microsoft.Extensions.DependencyInjection throw new ArgumentNullException(nameof(services)); } - services.AddTransient(); + services.TryAddTransient(); services.AddDataProtection(); return services; }