예제 #1
0
        public async Task <IActionResult> NewUser(RegisterAppUserDto model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var result = await _userService.RegisterByApp(model);

            if (result == null)
            {
                return(BadRequest());
            }
            return(Ok(result));
        }
예제 #2
0
        /// <summary>
        /// Create user and save its details by App,
        /// sign it and assign User role to him/her.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <SuccessDto> RegisterByApp(RegisterAppUserDto model)
        {
            SuccessDto obj = new SuccessDto();

            try
            {
                if (!string.IsNullOrEmpty(model.Name) && !string.IsNullOrEmpty(model.EmailID))
                {
                    obj.Success = await _sendEmailService.SendingEmailAsync(model.Name, model.EmailID);
                }
                return(obj);
            }
            catch (Exception)
            {
                obj.Success = false;
                return(obj);
            }
        }