public static IUserService Factory(string connString)
 {
     var db = new DefaultMembershipRebootDatabase(connString);
     var repo = new DefaultUserAccountRepository(db);
     var userAccountService = new UserAccountService(config, repo);
     var userSvc = new MembershipRebootUserService<UserAccount>(userAccountService, db);
     return userSvc;
 }
        public IIdentityManagerService Create()
        {
            var db = new DefaultMembershipRebootDatabase(this.connString);
            var userrepo = new DefaultUserAccountRepository(db);
            var usersvc = new UserAccountService<RelationalUserAccount>(config, userrepo);

            var grprepo = new DefaultGroupRepository(db);
            var grpsvc = new GroupService<RelationalGroup>(config.DefaultTenant, grprepo);

            var svc = new MembershipRebootIdentityManagerService<RelationalUserAccount, RelationalGroup>(usersvc, userrepo, grpsvc, grprepo);
            return new DisposableIdentityManagerService(svc, db);
        }
Exemplo n.º 3
0
        public IdentityRepository()
        {
            var ctx = new DefaultMembershipRebootDatabase();
              var settings = SecuritySettings.FromConfiguration();
              settings.RequireAccountVerification = false;
              settings.PasswordHashingIterationCount = 50000;
              var config = new MembershipRebootConfiguration(settings);
              var uarepo = new DefaultUserAccountRepository(ctx);
              this.userSvc = new UserAccountService(config, uarepo);
              this.userQuery = uarepo;

              var grpRepo = new BrockAllen.MembershipReboot.Ef.DefaultGroupRepository(ctx);
              this.groupSvc = new GroupService(config.DefaultTenant, grpRepo);
              this.groupQuery = grpRepo;
        }
        public AdminModule()
            : base("/Admin")
        {
            this.Get[""] = ctx =>
                {
                    var db = new DefaultMembershipRebootDatabase();
                    var names =
                        from a in db.Users
                        select a;
                    return View["Index", names.ToArray()];
                };
            
            this.Get["Detail/{id}"] = ctx =>
            {
                var id = ctx.id;
                var userAccountService = this.Context.GetUserAccountService();
                var account = userAccountService.GetByID(Guid.Parse(id));

                return View["Detail", new { account }];
            };
        }