public void Import(WindowsIdentity identity) { var service = new EFMembershipService(); if (service.GetUser(identity.Name) == null) { service.CreateUser(identity.Name, "imported", identity.Name, "None", "None"); if (!String.Equals(ConfigurationManager.AppSettings["ShouldImportWindowsUserAsAdministrator"], "true", StringComparison.InvariantCultureIgnoreCase)) return; var roleProvider = new EFRoleProvider(); roleProvider.AddUsersToRoles(new[] { identity.Name }, new[] { Definitions.Roles.Administrator }); } }
private UserModel AddUser() { EFMembershipService memberService = new EFMembershipService { CreateContext = GetContext }; memberService.CreateUser("fred", "letmein", "Fred", "FredBlogs", "fred@aol"); return memberService.GetUserModel("fred"); }
protected override UserModel AddUserFred() { IMembershipService memberService = new EFMembershipService { CreateContext = GetContext }; memberService.CreateUser("fred", "letmein", "Fred", "Blogs", "fred@aol"); return memberService.GetUserModel("fred"); }