private Task <ResponceDataSet> Process(Dictionary <string, StringValues> parameters) { try { if (!parameters.ContainsKey(_sqlAdapter.StoredProcedureParamName) || string.IsNullOrEmpty(parameters[_sqlAdapter.StoredProcedureParamName])) { throw new ArgumentException("spname parameter is missing or empty"); } ResponceDataSet responce = new ResponceDataSet { Data = new DataSet(), }; var sw = new Stopwatch(); sw.Start(); _sqlAdapter.CallStoredProcedureAndFillDataSet(parameters, responce.Data); sw.Stop(); var message = $"============\nResult of {parameters[SqlAdapter.SpNameParam]} ({sw.ElapsedMilliseconds} ms): "; var index = 0; foreach (DataTable table in responce.Data.Tables) { message += $"Table {index} count={table.Rows.Count}; "; } message += "\nParams: "; foreach (var parameter in parameters) { message += $"{parameter.Key}={parameter.Value}; "; } Console.WriteLine(message); return(Task.FromResult(responce)); } catch (Exception ex) { _log.Info(nameof(Process), "Exception on execute request", exception: ex, context: $"params: {parameters.ToJson()}"); throw new ValidationApiException(HttpStatusCode.BadRequest, ex.Message); } }