Example #1
0
        // Invalidate Altered Stored Procedures from DerivedParametersCache
        internal int InvalidateAlteredSpFromCache(string spDetectDdlChanges, TimeSpan elapsedTime)
        {
            string commaDelimitedString = string.Join(",", AccessChannel.ListCachedStoredProcedures().OrderBy(sp => sp));

            if (string.IsNullOrEmpty(commaDelimitedString))
            {
                return(0);
            }

            var parameters = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);

            parameters.Add(DbWebApiOptions.DetectDdlChangesContract.CommaDelimitedSpListParameterName, commaDelimitedString);
            parameters.Add(DbWebApiOptions.DetectDdlChangesContract.ElapsedTimeParameterName, (int)elapsedTime.TotalMinutes);

            StoredProcedureResponse results = AccessChannel.ExecuteStoredProcedure(new StoredProcedureRequest(spDetectDdlChanges, parameters));

            if (results.ResultSets.Count == 0 || results.ResultSets[0].Count == 0)
            {
                return(0);
            }
            else
            {
                return(AccessChannel.RemoveCachedStoredProcedures(results.ResultSets[0].Select(item => item.First().Value as string)));
            }
        }
Example #2
0
 public object ExecuteDbApi(string sp, IDictionary <string, object> parameters, Action <int> exportResultSetStartTag, Action <DbDataReader> exportHeader, Action <DbDataReader> exportRow, Action <int> exportResultSetEndTag, IDictionary <string, object> outputParametersContainer, int[] resultSetChoices = null, bool bulkRead = false)
 {
     return(AccessChannel.ExecuteStoredProcedure(new StoredProcedureRequest(sp, parameters.PretreatInputDictionary()), exportResultSetStartTag, exportHeader, exportRow, exportResultSetEndTag, outputParametersContainer, resultSetChoices, bulkRead));
 }
Example #3
0
 public string ResolvePropertyName(string columnName)
 {
     return(AccessChannel.DynamicPropertyNamingResolver(columnName));
 }