/// <summary> /// This method fetches a 'List<State>' object. /// This method uses the 'States_FetchAll' procedure. /// </summary> /// <returns>A 'List<State>'</returns> /// </summary> public List <State> FetchAllStates(FetchAllStatesStoredProcedure fetchAllStatesProc, DataConnector databaseConnector) { // Initial Value List <State> stateCollection = null; // Verify database connection is connected if ((databaseConnector != null) && (databaseConnector.Connected)) { // First Get Dataset DataSet allStatesDataSet = this.DataHelper.LoadDataSet(fetchAllStatesProc, databaseConnector); // Verify DataSet Exists if (allStatesDataSet != null) { // Get DataTable From DataSet DataTable table = this.DataHelper.ReturnFirstTable(allStatesDataSet); // if table exists if (table != null) { // Load Collection stateCollection = StateReader.LoadCollection(table); } } } // return value return(stateCollection); }