public string[] RecoveryPassword(PasswordRecoveryInput input) { using (IDbConnection db = new SqlConnection(Global.Connection)) { var answer = db.Query <PasswordRecoveryResponse>("sp_RecoveryPassword", new { Phone = input.Phone, Cust_ID_Main = input.Cust_ID_Main }, commandType: CommandType.StoredProcedure).FirstOrDefault(); var res = new string[] { answer.Response, answer.Password, answer.SiteTxt }; return(res); } }
public async Task <IActionResult> Post([FromBody] PasswordRecoveryInput model) { var res = repo.RecoveryPassword(model); if (string.IsNullOrEmpty(res[0])) { return(Ok(new { Message = res[2], Founded = false })); } else { await service.SendEmailAsync(res[0], "Востановление пароля Головинский", res[1]); return(Ok(new { Message = res[2], Founded = true })); } }