/// <summary>
        /// Queries the database for all ids with context.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <returns></returns>
        private static List <string> QueryDbForAllIds(RockContext rockContext)
        {
            var service = new PersonalLinkSectionService(rockContext);

            return(service.Queryable()
                   .Where(a => a.IsShared)
                   .Select(i => i.Id)
                   .ToList()
                   .ConvertAll(i => i.ToString()));
        }
Exemple #2
0
        /// <summary>
        /// Get the personal link section
        /// </summary>
        /// <returns></returns>
        private PersonalLinkSection GetPersonalLinkSection(RockContext rockContext = null)
        {
            rockContext = rockContext ?? new RockContext();
            var personalLinkSectionService = new PersonalLinkSectionService(rockContext);

            var sectionId = PageParameter(PageParameterKey.SectionId).AsIntegerOrNull();

            if (!sectionId.HasValue)
            {
                return(null);
            }

            return(personalLinkSectionService.Queryable().FirstOrDefault(a => a.Id == sectionId.Value));
        }