Пример #1
0
        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));
        }
Пример #2
0
        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."));
        }
Пример #3
0
 public IResult Update(UserFromSocial user)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public IDataResult <List <OperationClaim> > GetClaims(UserFromSocial user)
 {
     return(new SuccessDataResult <List <OperationClaim> >(_userFromSocialDal.GetClaims(user)));
 }
Пример #5
0
 public IResult Delete(UserFromSocial user)
 {
     _userFromSocialDal.Delete(user);
     return(new SuccessResult());
 }
Пример #6
0
 public IResult Add(UserFromSocial user)
 {
     _userFromSocialDal.Add(user);
     return(new SuccessResult());
 }