diff --git a/samples/IdentitySample.Mvc/Controllers/AccountController.cs b/samples/IdentitySample.Mvc/Controllers/AccountController.cs index 9b4d655489..5e29092042 100644 --- a/samples/IdentitySample.Mvc/Controllers/AccountController.cs +++ b/samples/IdentitySample.Mvc/Controllers/AccountController.cs @@ -10,12 +10,18 @@ using System.Threading.Tasks; namespace IdentitySample.Models { [Authorize] - public class AccountController(UserManager userManager, SignInManager signInManager) - : Controller + public class AccountController : Controller { - public UserManager UserManager { get; } = userManager; + public AccountController(UserManager userManager, SignInManager signInManager) + { + UserManager = UserManager; + SignInManager = signInManager; + } + + public UserManager UserManager { get; private set; } + + public SignInManager SignInManager { get; private set; } - public SignInManager SignInManager { get; } = signInManager; // // GET: /Account/Login @@ -129,7 +135,7 @@ namespace IdentitySample.Models } // Sign in the user with this external login provider if the user already has a login - var result = await SignInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, + var result = await SignInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); switch (result) { diff --git a/samples/IdentitySample.Mvc/Controllers/ManageController.cs b/samples/IdentitySample.Mvc/Controllers/ManageController.cs index 1f2ee76450..f7c801903f 100644 --- a/samples/IdentitySample.Mvc/Controllers/ManageController.cs +++ b/samples/IdentitySample.Mvc/Controllers/ManageController.cs @@ -9,12 +9,17 @@ using System.Threading.Tasks; namespace IdentitySample { [Authorize] - public class ManageController(UserManager userManager, SignInManager signInManager) - : Controller + public class ManageController : Controller { - public UserManager UserManager { get; } = userManager; + public ManageController(UserManager userManager, SignInManager signInManager) + { + UserManager = UserManager; + SignInManager = signInManager; + } - public SignInManager SignInManager { get; } = signInManager; + public UserManager UserManager { get; private set; } + + public SignInManager SignInManager { get; private set; } // // GET: /Account/Index diff --git a/samples/IdentitySample.Mvc/Startup.cs b/samples/IdentitySample.Mvc/Startup.cs index 916969aa4e..eb6228948b 100644 --- a/samples/IdentitySample.Mvc/Startup.cs +++ b/samples/IdentitySample.Mvc/Startup.cs @@ -15,7 +15,8 @@ using IdentitySample.Models; namespace IdentitySamples { - public static class UseExt { + public static class UseExt + { /** * TODO: Middleware constructors need to take IOptionsAccessor @@ -73,8 +74,9 @@ namespace IdentitySamples } } - public partial class Startup() + public partial class Startup { + public Startup() { /* * Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources, diff --git a/samples/IdentitySample.Mvc/project.json b/samples/IdentitySample.Mvc/project.json index 5614632180..d9340de6c6 100644 --- a/samples/IdentitySample.Mvc/project.json +++ b/samples/IdentitySample.Mvc/project.json @@ -5,13 +5,8 @@ "description": "Identity sample MVC application on K", "version": "1.0.0-*", "dependencies": { - "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Mvc.Core": "6.0.0-*", - "Microsoft.AspNet.Mvc.ModelBinding": "6.0.0-*", - "Microsoft.AspNet.Mvc.Razor": "6.0.0-*", - "Microsoft.AspNet.Routing": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.Identity.SqlServer": "3.0.0-*", diff --git a/src/Microsoft.AspNet.Identity.SqlServer/IdentityDbContext.cs b/src/Microsoft.AspNet.Identity.SqlServer/IdentityDbContext.cs index b7cc4123c7..0a3a38e89f 100644 --- a/src/Microsoft.AspNet.Identity.SqlServer/IdentityDbContext.cs +++ b/src/Microsoft.AspNet.Identity.SqlServer/IdentityDbContext.cs @@ -79,17 +79,17 @@ namespace Microsoft.AspNet.Identity.SqlServer //var urfk2 = userRoleType.GetOrAddForeignKey(roleType.GetPrimaryKey(), new[] { userRoleType.GetProperty("RoleId") }); //roleType.AddNavigation(new Navigation(urfk2, "Users", false)); - var rcfk = roleClaimType.GetOrAddForeignKey(roleType.GetPrimaryKey(), new[] { roleClaimType.GetProperty("RoleId") }); - roleType.AddNavigation(new Navigation(rcfk, "Claims", false)); + var rcfk = roleClaimType.GetOrAddForeignKey(new[] { roleClaimType.GetProperty("RoleId") }, roleType.GetPrimaryKey()); + roleType.AddNavigation("Claims", rcfk, false); builder.Entity>(b => { b.Key(r => new { r.UserId, r.RoleId }); b.ToTable("AspNetUserRoles"); }); - // Blocks delete currently without cascade - //.ForeignKeys(fk => fk.ForeignKey(f => f.UserId)) - //.ForeignKeys(fk => fk.ForeignKey(f => f.RoleId)); + // Blocks delete currently without cascade + //.ForeignKeys(fk => fk.ForeignKey(f => f.UserId)) + //.ForeignKeys(fk => fk.ForeignKey(f => f.RoleId)); builder.Entity>(b => {