Beispiel #1
0
        public IEnumerable <TResultTable> GetDataFromStoredProcedureAccessor(Database database, object[] param, IRowMapper <TResultTable> mapper)
        {
            IParameterMapper paramMapper = new SimpleParameterMapper();

            DataAccessor <TResultTable> accessor =
                database.CreateSprocAccessor(storedProcedureName, paramMapper, mapper);

            return(accessor.Execute(param));
        }
Beispiel #2
0
        public void RunAsync(Database database, object[] param, IRowMapper <TResultTable> rowMapper)
        {
            try
            {
                IParameterMapper paramMapper = new SimpleParameterMapper();

                DataAccessor <TResultTable> accessor =
                    database.CreateSprocAccessor(StoredProcedureName, paramMapper, rowMapper);

                // Execute the accessor asynchronously, passing in the callback handler,
                // the existing accessor as the AsyncState, and the parameter values.
                IAsyncResult async = accessor.BeginExecute(MyEndExecuteCallback, accessor, param);
            }
            catch
            {
                // handle any execution initiation errors here
            }
        }