public async Task <List <TaxData> > GetTaxRate(string countryCode) { using (IDbConnection db = new SqlConnection(_connectionStringConfig.GetConnectionString())) { const string taxRateStoredProcedure = "GetTaxRateByCountryCode"; var countryCodeParameter = new DynamicParameters(); countryCodeParameter.Add("@CountryCode", countryCode); return((await db.QueryAsync <TaxData>(taxRateStoredProcedure, countryCodeParameter, commandType: CommandType.StoredProcedure)).ToList()); } }
public bool CheckConnection() { try { IDbConnection db = new SqlConnection(_connectionStringConfig.GetConnectionString()); db.Open(); return(true); } catch (DbException dataException) { Console.WriteLine(dataException); return(false); } }