GetMappedLocationsByGeofences() public method

Gets the 'IsMappedLocation' locations that are within and of the selected geofences
public GetMappedLocationsByGeofences ( List geofences ) : IQueryable
geofences List The geofences.
return IQueryable
Example #1
0
        /// <summary>
        /// Gets the family groups that are geofenced by any of the selected geofences
        /// </summary>
        /// <param name="geofences">The geofences.</param>
        /// <returns></returns>
        public IQueryable <Group> GetGeofencedFamilies(List <DbGeography> geofences)
        {
            var rockContext          = (RockContext)this.Context;
            var groupLocationService = new GroupLocationService(rockContext);

            Guid familyTypeGuid = Rock.SystemGuid.GroupType.GROUPTYPE_FAMILY.AsGuid();

            return(groupLocationService.GetMappedLocationsByGeofences(geofences)
                   .Where(l =>
                          l.Group != null &&
                          l.Group.GroupType != null &&
                          l.Group.GroupType.Guid.Equals(familyTypeGuid))
                   .Select(l => l.Group));
        }
Example #2
0
        /// <summary>
        /// Gets the family groups that are geofenced by any of the selected geofences
        /// </summary>
        /// <param name="geofences">The geofences.</param>
        /// <returns></returns>
        public IQueryable<Group> GetGeofencedFamilies( List<DbGeography> geofences )
        {
            var rockContext = (RockContext)this.Context;
            var groupLocationService = new GroupLocationService( rockContext );

            Guid familyTypeGuid = Rock.SystemGuid.GroupType.GROUPTYPE_FAMILY.AsGuid();

            return groupLocationService.GetMappedLocationsByGeofences( geofences )
                .Where( l =>
                    l.Group != null &&
                    l.Group.GroupType != null &&
                    l.Group.GroupType.Guid.Equals( familyTypeGuid ) )
                .Select( l => l.Group );
        }