protected override bool HasAdminUser() { IDbConnectionFactory factory = GetDbFactory(); var userRepository = new DapperUserRepository(factory); return(userRepository.FindAllAdmins().Count() == 1); }
public ActionResult Post([FromBody] DtoOnboarding obj) { var repo = new DapperUserRepository(); var srv = new SrvOnboardingV1(repo); if (!srv.Exec(network, obj)) { return(BadRequest(srv.Error)); } return(Ok(new { })); }
protected override bool HasEmptyTables() { IDbConnectionFactory factory = GetDbFactory(); var settingsRepository = new DapperSettingsRepository(factory); var userRepository = new DapperUserRepository(factory); var pageRepository = new DapperPageRepository(factory); return(pageRepository.AllPages().Count() == 0 && pageRepository.AllPageContents().Count() == 0 && userRepository.FindAllAdmins().Count() == 0 && userRepository.FindAllEditors().Count() == 0 && settingsRepository.GetSiteSettings() != null); }
public ActionResult <User> user(long id) { var au = GetCurrentAuthenticatedUser(); var repo = new DapperUserRepository(); var srv = new SrvUserGetV1(repo); var dto = new User(); if (!srv.Exec(network, au, id, ref dto)) { return(BadRequest(srv.Error)); } return(Ok(dto)); }
public ActionResult <DtoUserList> users(string search) { var au = GetCurrentAuthenticatedUser(); var repo = new DapperUserRepository(); var srv = new SrvUserListV1(repo); var dto = new DtoUserList(); if (!srv.Exec(network, au, search, ref dto)) { return(BadRequest(srv.Error)); } return(Ok(dto)); }
public ActionResult Post([FromBody] DtoCheckNewSocial_ID obj) { var repo = new DapperUserRepository(); var srv = new SrvCheckNewSocial_IDV1(repo) { _doNotSendEmail = this._doNotSendEmail }; if (!srv.Exec(network, obj)) { return(BadRequest(srv.Error)); } return(Ok(new { })); }
public ActionResult Post([FromBody] DtoPasswordRecovery obj) { var repo = new DapperUserRepository(); var srv = new SrvPasswordRecoveryV1(repo) { _sendEmail = this._sendEmail }; if (!srv.Exec(network, obj)) { return(BadRequest(srv.Error)); } return(Ok(new { })); }
public ActionResult Post([FromBody] DtoResendToken dto) { var repo = new DapperUserRepository(); var srv = new SrvResendTokenV1(repo) { _sendEmail = this._sendEmail }; if (!srv.Exec(network, dto)) { return(BadRequest(srv.Error)); } return(Ok(new { })); }
public ActionResult Post([FromBody] DtoLoginInformation obj) { var auth = new DtoAuthenticatedUser(); var repo = new DapperUserRepository(); var srv = new SrvAuthenticateV1(repo); if (!srv.Exec(network, obj, ref auth)) { return(BadRequest(srv.Error)); } var token = ComposeTokenForSession(auth); return(Ok(new { token, user = auth, })); }
public MyRoleStore(DapperUserRepository identityRepo) { _identityRepo = identityRepo; }
public DefaultUserStore(DapperUserRepository identityRepo) { _identityRepo = identityRepo; }