Hagglehaul  1.0
Hagglehaul - book and bid on rides
Loading...
Searching...
No Matches
hagglehaul.Server.Services.TripService Class Reference

See ITripService. More...

Inheritance diagram for hagglehaul.Server.Services.TripService:
hagglehaul.Server.Services.ITripService

Public Member Functions

 TripService (IMongoDatabase database)
 
async Task< List< Trip > > GetAllTripsAsync ()
 Gets all trips in the database. Useful for trip discovery.
 
async Task< List< Trip > > GetRiderTripsAsync (string email)
 Gets all trips which the rider has created. Found through the riderEmail field of the trip.
 
async Task< List< Trip > > GetDriverTripsAsync (string email)
 Gets all trips which the driver has created. Found through the driverEmail field of the trip.
 
async Task< TripGetTripByIdAsync (string id)
 Gets a trip by its ID.
 
async Task< TripCreateAsync (Trip trip)
 Creates a new trip.
 
async Task DeleteAsync (string id)
 Deletes a trip by its ID.
 
async Task UpdateAsync (string id, Trip tripIn)
 Updates a Trip object.
 

Public Attributes

readonly IMongoCollection< Trip_tripCollection
 

Detailed Description

See ITripService.

Member Function Documentation

◆ CreateAsync()

async Task< Trip > hagglehaul.Server.Services.TripService.CreateAsync ( Trip trip)

Creates a new trip.

Parameters
tripThe Trip object to insert. Note that we do not check the object for correctness.
Returns

Implements hagglehaul.Server.Services.ITripService.

◆ DeleteAsync()

async Task hagglehaul.Server.Services.TripService.DeleteAsync ( string id)

Deletes a trip by its ID.

Parameters
idThe Trip ID to delete.
Returns

Implements hagglehaul.Server.Services.ITripService.

◆ GetAllTripsAsync()

async Task< List< Trip > > hagglehaul.Server.Services.TripService.GetAllTripsAsync ( )

Gets all trips in the database. Useful for trip discovery.

Returns

Implements hagglehaul.Server.Services.ITripService.

◆ GetDriverTripsAsync()

async Task< List< Trip > > hagglehaul.Server.Services.TripService.GetDriverTripsAsync ( string email)

Gets all trips which the driver has created. Found through the driverEmail field of the trip.

Parameters
emailThe valid email address of the driver.
Returns

Implements hagglehaul.Server.Services.ITripService.

◆ GetRiderTripsAsync()

async Task< List< Trip > > hagglehaul.Server.Services.TripService.GetRiderTripsAsync ( string email)

Gets all trips which the rider has created. Found through the riderEmail field of the trip.

Parameters
emailThe valid email address of the rider.
Returns

Implements hagglehaul.Server.Services.ITripService.

◆ GetTripByIdAsync()

async Task< Trip > hagglehaul.Server.Services.TripService.GetTripByIdAsync ( string id)

Gets a trip by its ID.

Parameters
idThe Trip ID of the desired trip.
Returns

Implements hagglehaul.Server.Services.ITripService.

◆ UpdateAsync()

async Task hagglehaul.Server.Services.TripService.UpdateAsync ( string id,
Trip tripIn )

Updates a Trip object.

Parameters
idThe Trip ID to update.
tripInThe Trip object to update. Note that we do not check the object for correctness.
Returns

Implements hagglehaul.Server.Services.ITripService.


The documentation for this class was generated from the following file: