React to UsePerRequestServices
This commit is contained in:
parent
c87de5a0fc
commit
b6bd7f5d78
|
|
@ -31,7 +31,7 @@ namespace MvcSample.Web
|
|||
{
|
||||
app.UseMiddleware<MonitoringMiddlware>();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc();
|
||||
services.AddSingleton<PassThroughAttribute>();
|
||||
|
|
@ -72,7 +72,7 @@ namespace MvcSample.Web
|
|||
else
|
||||
#endif
|
||||
{
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc();
|
||||
services.AddSingleton<PassThroughAttribute>();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.Internal
|
|||
{
|
||||
throw new InvalidOperationException(Resources.FormatUnableToFindServices(
|
||||
"IServiceCollection.AddMvc()",
|
||||
"IApplicationBuilder.UseServices(...)",
|
||||
"IApplicationBuilder.UsePerRequestServices(...)",
|
||||
"IApplicationBuilder.UseMvc(...)"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc
|
|||
= new ResourceManager("Microsoft.AspNet.Mvc.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
||||
|
||||
/// <summary>
|
||||
/// Unable to find the required services. Please add all the required services by calling AddMvc() before calling UseMvc()/UseServices() in the Application Startup.
|
||||
/// Unable to find the required services. Please add all the required services by calling AddMvc() before calling UseMvc()/UsePerRequestServices() in the Application Startup.
|
||||
/// </summary>
|
||||
internal static string UnableToFindServices
|
||||
{
|
||||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unable to find the required services. Please add all the required services by calling AddMvc() before calling UseMvc()/UseServices() in the Application Startup.
|
||||
/// Unable to find the required services. Please add all the required services by calling AddMvc() before calling UseMvc()/UsePerRequestServices() in the Application Startup.
|
||||
/// </summary>
|
||||
internal static string FormatUnableToFindServices()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc
|
|||
services.Setup(o => o.GetService(typeof(IEnumerable<MvcMarkerService>)))
|
||||
.Returns(new List<MvcMarkerService>());
|
||||
var expectedMessage = "Unable to find the required services. Please add all the required " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UseServices(...)' " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UsePerRequestServices(...)' " +
|
||||
"or 'IApplicationBuilder.UseMvc(...)' in the application startup code.";
|
||||
|
||||
// Act & Assert
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
{
|
||||
// Arrange
|
||||
var expectedMessage = "Unable to find the required services. Please add all the required " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UseServices(...)' " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UsePerRequestServices(...)' " +
|
||||
"or 'IApplicationBuilder.UseMvc(...)' in the application startup code.";
|
||||
|
||||
// Act & Assert
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ActivatorWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace AntiForgeryWebSite
|
|||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ApiExplorer
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
services.AddSingleton<ApiExplorerDataFilter>();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace ApplicationModelWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace AutofacWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services => {
|
||||
app.UsePerRequestServices(services => {
|
||||
services.AddMvc(configuration);
|
||||
services.AddTransient<HelloWorldBuilder>();
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace BasicWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace CompositeViewEngine
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add a view engine as the first one in the list.
|
||||
services.AddMvc(configuration)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ConnegWebsite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace FilesWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace FiltersWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace FormatterWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace InlineConstraints
|
|||
}
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace ModelBindingWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace RazorInstrumentationWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace RazorWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace RoutingWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace UrlHelperWebSite
|
|||
configuration.AddJsonFile("config.json");
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.ConfigureOptions<AppOptions>(optionsSetup =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace ValueProvidersSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace VersioningWebSite
|
|||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
services.AddMvc(configuration);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace XmlSerializerWebSite
|
|||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
// Set up application services
|
||||
app.UseServices(services =>
|
||||
app.UsePerRequestServices(services =>
|
||||
{
|
||||
// Add MVC services to the services container
|
||||
services.AddMvc(configuration);
|
||||
|
|
|
|||
Loading…
Reference in New Issue