GetByCategoryIds() public method

Returns a collection of active PrayerRequests that are in a specified Rock.Model.Category or any of its subcategories.
public GetByCategoryIds ( List categoryIds, bool onlyApproved = true, bool onlyUnexpired = true ) : IEnumerable
categoryIds List A of /// the IDs to retrieve PrayerRequests for.
onlyApproved bool set false to include un-approved requests.
onlyUnexpired bool set false to include expired requests.
return IEnumerable
        /// <summary>
        /// Finds all approved prayer requests for the given selected categories and orders them by least prayed-for.
        /// Also updates the prayer count for the first item in the list.
        /// </summary>
        /// <param name="categoriesList"></param>
        private void SetAndDisplayPrayerRequests( RockCheckBoxList categoriesList )
        {
            RockContext rockContext = new RockContext();
            PrayerRequestService service = new PrayerRequestService( rockContext );
            var prayerRequests = service.GetByCategoryIds( categoriesList.SelectedValuesAsInt ).OrderByDescending( p => p.IsUrgent ).ThenBy( p => p.PrayerCount );
            List<int> list = prayerRequests.Select( p => p.Id ).ToList<int>();

            Session[_sessionKey] = list;
            if ( list.Count > 0 )
            {
                UpdateSessionCountLabel( 1, list.Count );
                hfPrayerIndex.Value = "0";
                PrayerRequest request = prayerRequests.First();
                ShowPrayerRequest( request, rockContext );
            }
        }