Skip to content

ICoordinateRepo

Namespace: Database.Repository.CoordinateRepo

Repository interface for sccessing and managing locations.

public interface ICoordinateRepo

Methods

ExistsPostalCode(Int32)

Checks if there is an entry for that opstal code in the database.

Task<Boolean> ExistsPostalCode(int postalcode)

Parameters

postalcode Int32

Defines which entry will be checked.

Returns

Returns a boolean values for the existence of an entry in the database associated with the postalcode.

GetAllLocations()

Gets all postalcodes that are saved in the database.

Task<List<Tuple<Int32, String>>> GetAllLocations()

Returns

List with all postalcodes.

GetLocation()

Retrieves the coordinates of the postalcode that was inserted last.

Task<CoordinateMapping> GetLocation()

Returns

Returns coordinates of the location that was last chosen by the User.

GetUnlockedLocation()

Gets the next unlocked entry in CoordinateMappings and locks it for the next minute.

Task<CoordinateMapping> GetUnlockedLocation()

Returns

Task<CoordinateMapping>

InsertNewPostalCode(CoordinateMapping)

Inserts a new combination of postalcode and coordinates.

Task InsertNewPostalCode(CoordinateMapping postalCodeLocation)

Parameters

postalCodeLocation CoordinateMapping

A CoordinateMapping instance that will be saved in the database.

Returns

Task

UpdateTime(Int32, DateTime)

Updates the timestamp of an entry in the Coordinates Database.

Task UpdateTime(int postalcode, DateTime newTime)

Parameters

postalcode Int32

Defines which entry will be updated.

newTime DateTime

Defines the new time for that entry.

Returns

Task