C# Class Rock.Model.LocationService

Data access and service class for Rock.Model.Location entities.
Mostrar archivo Open project: SparkDevNetwork/Rock Class Usage Examples

Public Methods

Method Description
Get ( string street1, string street2, string city, string state, string postalCode, string country, bool verifyLocation = true ) : Location

Returns the first Rock.Model.Location where the address matches the provided address. If no address is found with the provided values, the address will be standardized. If there is still not a match, the address will be saved as a new location.

GetAllAncestorIds ( int locationId ) : IEnumerable

Gets all ancestor ids.

GetAllAncestors ( int locationId ) : IEnumerable

Gets all ancestors.

GetAllDescendentIds ( int parentLocationId ) : IEnumerable

Gets all descendent ids.

GetAllDescendents ( int parentLocationId ) : IEnumerable

Returns an enumerable collection of Rock.Model.Location">Locations that are descendants of a

GetByDevice ( int deviceId, bool includeChildLocations = true ) : IEnumerable

Gets the locations associated to a device and optionally any child locaitons

GetByGeoFence ( System.Data.Entity.Spatial.DbGeography fence ) : Location

Returns the first Rock.Model.Location with a GeoFence that matches the specified GeoFence.

GetByGeoPoint ( System.Data.Entity.Spatial.DbGeography point ) : Location

Returns a Rock.Model.Location by GeoPoint. If a match is not found, a new Location will be added based on the Geopoint.

GetCampusIdForLocation ( int locationId ) : int?

Gets the CampusID associated with the Location from the location or from the location's parent path

GetPath ( int locationId ) : string

Gets the path.

Verify ( Location location, bool reVerify ) : bool

Performs Address Verification on the provided Rock.Model.Location.

Method Details

Get() public method

Returns the first Rock.Model.Location where the address matches the provided address. If no address is found with the provided values, the address will be standardized. If there is still not a match, the address will be saved as a new location.
public Get ( string street1, string street2, string city, string state, string postalCode, string country, bool verifyLocation = true ) : Location
street1 string A representing the Address Line 1 to search by.
street2 string A representing the Address Line 2 to search by.
city string A representing the City to search by.
state string A representing the State to search by.
postalCode string A representing the Zip/Postal code to search by
country string The country.
verifyLocation bool if set to true [verify location].
return Location

GetAllAncestorIds() public method

Gets all ancestor ids.
public GetAllAncestorIds ( int locationId ) : IEnumerable
locationId int The location identifier.
return IEnumerable

GetAllAncestors() public method

Gets all ancestors.
public GetAllAncestors ( int locationId ) : IEnumerable
locationId int The location identifier.
return IEnumerable

GetAllDescendentIds() public method

Gets all descendent ids.
public GetAllDescendentIds ( int parentLocationId ) : IEnumerable
parentLocationId int The parent location identifier.
return IEnumerable

GetAllDescendents() public method

Returns an enumerable collection of Rock.Model.Location">Locations that are descendants of a
public GetAllDescendents ( int parentLocationId ) : IEnumerable
parentLocationId int A representing the Id of the
return IEnumerable

GetByDevice() public method

Gets the locations associated to a device and optionally any child locaitons
public GetByDevice ( int deviceId, bool includeChildLocations = true ) : IEnumerable
deviceId int The device identifier.
includeChildLocations bool if set to true [include child locations].
return IEnumerable

GetByGeoFence() public method

Returns the first Rock.Model.Location with a GeoFence that matches the specified GeoFence.
public GetByGeoFence ( System.Data.Entity.Spatial.DbGeography fence ) : Location
fence System.Data.Entity.Spatial.DbGeography A object that /// represents the GeoFence of the location to retrieve.
return Location

GetByGeoPoint() public method

Returns a Rock.Model.Location by GeoPoint. If a match is not found, a new Location will be added based on the Geopoint.
public GetByGeoPoint ( System.Data.Entity.Spatial.DbGeography point ) : Location
point System.Data.Entity.Spatial.DbGeography A object /// representing the Geopoint for the location.
return Location

GetCampusIdForLocation() public method

Gets the CampusID associated with the Location from the location or from the location's parent path
public GetCampusIdForLocation ( int locationId ) : int?
locationId int The location identifier.
return int?

GetPath() public method

Gets the path.
public GetPath ( int locationId ) : string
locationId int The location identifier.
return string

Verify() public method

Performs Address Verification on the provided Rock.Model.Location.
public Verify ( Location location, bool reVerify ) : bool
location Location A to verify.
reVerify bool if set to true [re verify].
return bool