Browse Source

React to breaking changes in aspnet/Mvc

80b6996701

385c21fbe2
pull/66/head
Kévin Chalet 11 years ago
parent
commit
a6b85f1f15
  1. 1
      samples/Mvc.Client/Startup.cs
  2. 3
      samples/Mvc.Client/project.json
  3. 1
      samples/Mvc.Server/Startup.cs
  4. 1
      samples/Mvc.Server/project.json
  5. 22
      src/OpenIddict.Mvc/OpenIddictExtensions.cs

1
samples/Mvc.Client/Startup.cs

@ -27,6 +27,7 @@ namespace Mvc.Client {
}); });
services.AddMvc(); services.AddMvc();
services.AddMvcDnx();
} }
public void Configure(IApplicationBuilder app) { public void Configure(IApplicationBuilder app) {

3
samples/Mvc.Client/project.json

@ -1,12 +1,13 @@
{ {
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*", "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "0.1.0-*", "Microsoft.AspNetCore.Authentication.OpenIdConnect": "0.1.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*", "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.HttpOverrides": "1.0.0-*", "Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
"Microsoft.AspNetCore.Hosting": "1.0.0-*", "Microsoft.AspNetCore.Hosting": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.Dnx": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*",

1
samples/Mvc.Server/Startup.cs

@ -35,6 +35,7 @@ namespace Mvc.Server {
.Build(); .Build();
services.AddMvc(); services.AddMvc();
services.AddMvcDnx();
services.AddEntityFramework() services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()

1
samples/Mvc.Server/project.json

@ -7,6 +7,7 @@
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*", "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.HttpOverrides": "1.0.0-*", "Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.Dnx": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",

22
src/OpenIddict.Mvc/OpenIddictExtensions.cs

@ -11,6 +11,8 @@ using JetBrains.Annotations;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Razor.Compilation;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileProviders;
using OpenIddict; using OpenIddict;
@ -93,6 +95,26 @@ namespace Microsoft.AspNetCore.Builder {
.MakeGenericType(registration.UserType, registration.ApplicationType)); .MakeGenericType(registration.UserType, registration.ApplicationType));
}); });
// Register the assembly provider in the isolated container.
services.AddScoped(provider => {
var accessor = provider.GetRequiredService<IHttpContextAccessor>();
var container = (IServiceProvider) accessor.HttpContext.Items[typeof(IServiceProvider)];
Debug.Assert(container != null);
// Resolve the assembly provider from the parent container.
return container.GetRequiredService<IAssemblyProvider>();
});
// Register the compilation service in the isolated container.
services.AddScoped(provider => {
var accessor = provider.GetRequiredService<IHttpContextAccessor>();
var container = (IServiceProvider) accessor.HttpContext.Items[typeof(IServiceProvider)];
Debug.Assert(container != null);
// Resolve the compilation service from the parent container.
return container.GetRequiredService<ICompilationService>();
});
// Register the options in the isolated container. // Register the options in the isolated container.
services.AddScoped(provider => builder.Options); services.AddScoped(provider => builder.Options);
})); }));

Loading…
Cancel
Save