public async Task <IActionResult> SelectData([FromRoute] string key, [FromBody] GetFilter filter) { try { if (_keyValidator.Validate(key)) { using (var db = _dbConnectionFactory.CreateCompanyConnection()) { var result = await db.QueryAsync(_queryGenerator.SelectQuery(filter)); return(Ok(result)); } } return(Unauthorized()); } catch (Exception ex) { return(StatusCode(400, new { ex.Message, ex.StackTrace })); } }