public ListAccountsByBVNResp ListAccountsByBVN( [FromBody] ListAccountsByBVNReq listAccountsByBVNReq) { if (CBNController.ValidateToken(this.Request.Headers.GetValues("Authorization").First <string>().ToString().Substring("Bearer ".Length).Trim())) { ListAccountsByBVNReq listAccountsByBVNReq1 = new ListAccountsByBVNReq() { BVN = listAccountsByBVNReq.BVN }; this.logger.Info <ListAccountsByBVNReq>("Request {@value}", listAccountsByBVNReq1); CBNIntegration.Models.ListAccountsByBVN[] array = this.cBNIntegrationData.ListAccountsByBVN(listAccountsByBVNReq1).ToArray(); int length = array.Length; ListAccountsByBVNResp accountsByBvnResp = new ListAccountsByBVNResp() { Status = this.success.ResponseCode, Msg = this.success.ResponseMessage, Result = array }; this.logger.Info <ListAccountsByBVNResp>("Response {@value}", accountsByBvnResp); return(accountsByBvnResp); } ListAccountsByBVNResp accountsByBvnResp1 = new ListAccountsByBVNResp() { Status = this.failed.ResponseCode, Msg = this.failed.ResponseMessage }; this.logger.Info <ListAccountsByBVNResp>("Response {@value}", accountsByBvnResp1); return(accountsByBvnResp1); }
public List <CBNIntegration.Models.ListAccountsByBVN> ListAccountsByBVN( ListAccountsByBVNReq listAccountsByBVNReq) { try { using (OracleConnection cnn = new OracleConnection(this.connectionString)) { cnn.Open(); string sql = string.Format(File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), this.ListAccountsByBVNQry), Encoding.UTF8), (object)listAccountsByBVNReq.BVN); List <CBNIntegration.Models.ListAccountsByBVN> list = cnn.Query <CBNIntegration.Models.ListAccountsByBVN>(sql).ToList <CBNIntegration.Models.ListAccountsByBVN>(); cnn.Close(); return(list); } } catch (Exception ex) { return(new List <CBNIntegration.Models.ListAccountsByBVN>()); } }