Class LocationRepository
Inheritance
LocationRepository
Assembly: OEMS.Core.dll
Syntax
public class LocationRepository : ILocationRepository
Constructors
LocationRepository(IDbContextFactory<OEMSDBContext>)
Declaration
public LocationRepository(IDbContextFactory<OEMSDBContext> contextFactory)
Parameters
Methods
AddAsync(Location)
Legt eine neue Location an.
Declaration
public Task AddAsync(Location location)
Parameters
Returns
CheckIfEventAtLocation(Guid, Guid)
Checks if any event is already assigned to the location. OrgId to connect the two objects since both have them.
Returns a tuple with a boolean indicating if any event is found and a list of event names, to enable checking which events are assigned.
Declaration
public Task<(bool, List<string>)> CheckIfEventAtLocation(Guid orgId, Guid locationId)
Parameters
Type |
Name |
Description |
Guid |
orgId |
|
Guid |
locationId |
|
Returns
CheckLocationNamesForDuplicates(string)
Checks if location name already exists for the given organization.
Declaration
public Task<bool> CheckLocationNamesForDuplicates(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
DeleteAsync(Guid)
Löscht eine Location per Id.
Declaration
public Task DeleteAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
GetAllAsync()
Liefert alle Locations zurück.
Declaration
public Task<IEnumerable<Location>> GetAllAsync()
Returns
GetAllByOrganizationAsync(Guid)
Liefert alle Locations einer Organisation zurück.
Declaration
public Task<IEnumerable<Location>> GetAllByOrganizationAsync(Guid organizationId)
Parameters
Type |
Name |
Description |
Guid |
organizationId |
|
Returns
GetByIdAsync(Guid)
Liefert eine Location per Id oder null.
Declaration
public Task<Location> GetByIdAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
UpdateAsync(Location)
Aktualisiert eine bestehende Location.
Declaration
public Task UpdateAsync(Location location)
Parameters
Returns
Implements