Skip to content

ILibraryService

Eric Singleton Jr edited this page Aug 9, 2018 · 1 revision

This service provides access to queries on the Library entities via dependency injection. All methods are GET where they will return a single or IEnumerable type of Library.

public IEnumerable<Library> GetAllLibraries();
public async Task<IEnumerable<Library>> GetAllLibrariesWithLawyers();
public async Task<IEnumerable<Library>> GetAllLibrariesForVeteranAsync(string veteranId);
public async Task<IEnumerable<Library>> GetAllLibrariesWithLawyers();
public async Task<Library> FindLibraryByIdAsync(long id);
public Task<IEnumerable<Library>> FindLibrariesByNameAsync(string name);

GetAllLibraries()

Returns all libraries as a IEnumerable within the Library Entity.

GetAllLibariesWithLawyers()

Returns all libraries where at least one Lawyer has associated themselves with as a IEnumerable. This is accomplished by getting a distinct List of Library IDs that is in the LawyerLibraryJunction and joining it to Libraries on ids.

GetAllLibrariesForVeteranAsync(string veteranId)

Returns IEnumerable for all libraries that a Veteran has chosen. It intakes the veteran ID to check the VeteranLibraryJunction.

GetAllLibrariesForLawyerAsync(string veteranId)

Returns IEnumerable for all libraries that a Lawyer has chosen. It intakes the lawyerID to check the LawyerLibraryJunction.

FindLibraryByIdAsync(long id)

Returns a single Library that was found by the given ID of a library.

FindLibrariesByNameAsync(string name)

Currently yet implemented