public async Task <List <SellPolicyLinkDetails> > GetPolicyLinkByDetails(SellPolicyLinkDetails details) { List <SellPolicyLinkDetails> detailsResponse = null; using (IDbConnection dbConnection = this.GetConnection()) { try { dbConnection.Open(); var result = await dbConnection.QueryMultipleAsync("GetPolicyLinkByDetails", new { details.BusinessTypeId, details.PolicyTypeId, details.RTO_Id, details.SegmentId, } , commandType : CommandType.StoredProcedure); var entities = await result.ReadAsync <SellPolicyLinkDetails>(); detailsResponse = entities.ToList(); } catch (Exception ex) { throw ex; } finally { dbConnection.Close(); } } return(detailsResponse); }
public async Task <SellPolicyLinkDetails> CreatePolicyLink(SellPolicyLinkDetails details) { SellPolicyLinkDetails detailsResponse = new SellPolicyLinkDetails(); using (IDbConnection dbConnection = this.GetConnection()) { try { dbConnection.Open(); var result = await dbConnection.QueryMultipleAsync("CreatePolicyLink", new { details.BusinessTypeId, details.PolicyTypeId, details.RTO_Id, details.SegmentId, details.URL, }, commandType : CommandType.StoredProcedure); //var entities = await result.ReadAsync<SellPolicyLinkDetails>(); //detailsResponse = entities.FirstOrDefault(); } catch (Exception ex) { detailsResponse.Error = ex.Message; return(detailsResponse); } finally { dbConnection.Close(); } } return(detailsResponse); }
public async Task <IActionResult> CreatePolicyLink([FromBody] SellPolicyLinkDetails details) { dynamic resp = null; try { resp = await _sellPolicyManager.CreatePolicyLink(details); } catch (Exception e) { return(Ok(new { error = e.Message })); } return(Ok(resp)); }
public async Task <IActionResult> GetPolicyLinkByDetails([FromBody] SellPolicyLinkDetails data) { var d = await _sellPolicyManager.GetPolicyLinkByDetails(data); return(Ok(d)); }
public Task <List <SellPolicyLinkDetails> > GetPolicyLinkByDetails(SellPolicyLinkDetails details) { return(_sellPolicyRepository.GetPolicyLinkByDetails(details)); }
public Task <SellPolicyLinkDetails> CreatePolicyLink(SellPolicyLinkDetails details) { return(_sellPolicyRepository.CreatePolicyLink(details)); }