public ActionResult RegisterByGoogle(UserFromSocial userFromSocial) { var userExistsByEmail = _authService.UserExistsByEmail(userFromSocial.Email); var userExistsById = _authService.UserExistsById(userFromSocial.Id); if (!userExistsByEmail.Success) { return(BadRequest(userExistsByEmail.Message)); } if (!userExistsById.Success) { return(BadRequest(userExistsById.Message)); } var registerResult = _authService.RegisterByGoogle(userFromSocial); if (registerResult.Success) { return(Ok(registerResult)); } return(BadRequest(registerResult.Message)); }
public IDataResult <UserFromSocial> RegisterByGoogle(UserFromSocial userFromSocial) { var user = new UserFromSocial { Id = userFromSocial.Id, Email = userFromSocial.Email, FirstName = userFromSocial.FirstName, LastName = userFromSocial.LastName }; _userFromSocialService.Add(user); return(new SuccessDataResult <UserFromSocial>(user, "Google hesabınız ile üyelik işleminiz gerçekleşti.")); }
public IResult Update(UserFromSocial user) { throw new NotImplementedException(); }
public IDataResult <List <OperationClaim> > GetClaims(UserFromSocial user) { return(new SuccessDataResult <List <OperationClaim> >(_userFromSocialDal.GetClaims(user))); }
public IResult Delete(UserFromSocial user) { _userFromSocialDal.Delete(user); return(new SuccessResult()); }
public IResult Add(UserFromSocial user) { _userFromSocialDal.Add(user); return(new SuccessResult()); }