From 28f96bf83293d2947bc5e6d4244dbae7ea496433 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 30 Aug 2018 08:16:57 +1200 Subject: [PATCH] Fix obsolete build warning (#8358) --- .../Internal/AttributeRoutingTest.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/AttributeRoutingTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/AttributeRoutingTest.cs index c9d281b80d..4c475cadad 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/AttributeRoutingTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Internal/AttributeRoutingTest.cs @@ -175,8 +175,12 @@ namespace Microsoft.AspNetCore.Mvc.Internal .SetupGet(o => o.Value) .Returns(new RouteOptions()); +#pragma warning disable CS0618 // Type or member is obsolete + var inlineConstraintResolver = new DefaultInlineConstraintResolver(routeOptions.Object); +#pragma warning restore CS0618 // Type or member is obsolete + var services = new ServiceCollection() - .AddSingleton(new DefaultInlineConstraintResolver(routeOptions.Object)) + .AddSingleton(inlineConstraintResolver) .AddSingleton(); services.AddSingleton();