Rock.Model.GroupService.GetGeofencedFamilies C# (CSharp) Method

GetGeofencedFamilies() public method

Gets the family groups that are geofenced by any of the selected group's locations
public GetGeofencedFamilies ( System.Guid groupGuid ) : IQueryable
groupGuid System.Guid The group unique identifier.
return IQueryable
        public IQueryable<Group> GetGeofencedFamilies( Guid groupGuid )
        {
            // Get the geofences for the group
            var groupGeofences = this.Queryable().AsNoTracking()
                .Where( g => g.Guid.Equals( groupGuid ) )
                .SelectMany( g => g.GroupLocations )
                .Where( g => g.Location.GeoFence != null )
                .Select( g => g.Location.GeoFence )
                .ToList();

            return GetGeofencedFamilies( groupGeofences );
        }

Same methods

GroupService::GetGeofencedFamilies ( List geofences ) : IQueryable
GroupService::GetGeofencedFamilies ( int groupId ) : IQueryable