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

GetGeofencingGroups() public method

Gets the groups of a selected type that have a geofence location that surrounds any of the selected points
public GetGeofencingGroups ( IQueryable points, System.Guid groupTypeGuid ) : IQueryable
points IQueryable The points.
groupTypeGuid System.Guid The group type unique identifier.
return IQueryable
        public IQueryable<Group> GetGeofencingGroups( IQueryable<DbGeography> points, Guid groupTypeGuid )
        {
            // Get the groups that have a location that intersects with any of the family's locations
            return this.Queryable()
                .Where( g =>
                    g.GroupType.Guid.Equals( groupTypeGuid ) &&
                    g.IsActive &&
                    g.GroupLocations.Any( l =>
                        l.Location.GeoFence != null &&
                        points.Any( p => p.Intersects( l.Location.GeoFence ) )
                    ) );
        }

Same methods

GroupService::GetGeofencingGroups ( IQueryable points, int groupTypeId ) : IQueryable
GroupService::GetGeofencingGroups ( int personId, System.Guid groupTypeGuid ) : IQueryable
GroupService::GetGeofencingGroups ( int personId, int groupTypeId ) : IQueryable