React to options rename
This commit is contained in:
parent
6b432e4e0e
commit
3cab10cfd7
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Routing
|
|||
/// </param>
|
||||
public DefaultInlineConstraintResolver(IOptions<RouteOptions> routeOptions)
|
||||
{
|
||||
_inlineConstraintMap = routeOptions.Options.ConstraintMap;
|
||||
_inlineConstraintMap = routeOptions.Value.ConstraintMap;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -6,11 +6,8 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Routing.Logging;
|
||||
using Microsoft.AspNet.Routing.Logging.Internal;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.Internal;
|
||||
using Microsoft.Framework.Logging;
|
||||
using Microsoft.Framework.OptionsModel;
|
||||
|
||||
namespace Microsoft.AspNet.Routing
|
||||
|
|
@ -238,7 +235,7 @@ namespace Microsoft.AspNet.Routing
|
|||
{
|
||||
if (_options == null)
|
||||
{
|
||||
_options = context.RequestServices.GetRequiredService<IOptions<RouteOptions>>().Options;
|
||||
_options = context.RequestServices.GetRequiredService<IOptions<RouteOptions>>().Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
|||
private IInlineConstraintResolver GetInlineConstraintResolver(RouteOptions routeOptions)
|
||||
{
|
||||
var optionsAccessor = new Mock<IOptions<RouteOptions>>();
|
||||
optionsAccessor.SetupGet(o => o.Options).Returns(routeOptions);
|
||||
optionsAccessor.SetupGet(o => o.Value).Returns(routeOptions);
|
||||
return new DefaultInlineConstraintResolver(optionsAccessor.Object);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -805,7 +805,7 @@ namespace Microsoft.AspNet.Routing
|
|||
var request = new Mock<HttpRequest>(MockBehavior.Strict);
|
||||
|
||||
var optionsAccessor = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict);
|
||||
optionsAccessor.SetupGet(o => o.Options).Returns(options);
|
||||
optionsAccessor.SetupGet(o => o.Value).Returns(options);
|
||||
|
||||
var context = new Mock<HttpContext>(MockBehavior.Strict);
|
||||
context.Setup(m => m.RequestServices.GetService(typeof(ILoggerFactory)))
|
||||
|
|
@ -823,7 +823,7 @@ namespace Microsoft.AspNet.Routing
|
|||
string routeName = null)
|
||||
{
|
||||
var optionsAccessor = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict);
|
||||
optionsAccessor.SetupGet(o => o.Options).Returns(options);
|
||||
optionsAccessor.SetupGet(o => o.Value).Returns(options);
|
||||
|
||||
var context = new Mock<HttpContext>(MockBehavior.Strict);
|
||||
context.Setup(m => m.RequestServices.GetService(typeof(IOptions<RouteOptions>)))
|
||||
|
|
@ -857,7 +857,7 @@ namespace Microsoft.AspNet.Routing
|
|||
request.SetupGet(r => r.Path).Returns(new PathString(requestPath));
|
||||
|
||||
var optionsAccessor = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict);
|
||||
optionsAccessor.SetupGet(o => o.Options).Returns(options);
|
||||
optionsAccessor.SetupGet(o => o.Value).Returns(options);
|
||||
|
||||
var context = new Mock<HttpContext>(MockBehavior.Strict);
|
||||
context.Setup(m => m.RequestServices.GetService(typeof(ILoggerFactory)))
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ namespace Microsoft.AspNet.Routing
|
|||
{
|
||||
var options = new Mock<IOptions<RouteOptions>>(MockBehavior.Strict);
|
||||
options
|
||||
.SetupGet(o => o.Options)
|
||||
.SetupGet(o => o.Value)
|
||||
.Returns(new RouteOptions());
|
||||
|
||||
var inlineConstraintResolver = new DefaultInlineConstraintResolver(options.Object);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Routing.Tests
|
|||
|
||||
// Assert
|
||||
var accessor = serviceProvider.GetRequiredService<IOptions<RouteOptions>>();
|
||||
Assert.Equal("TestRouteConstraint", accessor.Options.ConstraintMap["foo"].Name);
|
||||
Assert.Equal("TestRouteConstraint", accessor.Value.ConstraintMap["foo"].Name);
|
||||
}
|
||||
|
||||
private class TestRouteConstraint : IRouteConstraint
|
||||
|
|
|
|||
Loading…
Reference in New Issue