Class EventCategoryRepository
Inheritance
EventCategoryRepository
Assembly: OEMS.Core.dll
Syntax
public class EventCategoryRepository : IEventCategoryRepository
Constructors
EventCategoryRepository(IDbContextFactory<OEMSDBContext>)
Declaration
public EventCategoryRepository(IDbContextFactory<OEMSDBContext> contextFactory)
Parameters
Methods
AddAsync(EventCategory)
Declaration
public Task AddAsync(EventCategory category)
Parameters
Returns
CheckCategoryNamesForDuplicates(string)
Checks if category name already exists for the given organization.
Declaration
public Task<bool> CheckCategoryNamesForDuplicates(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
CheckIfEventWithCategory(Guid, Guid)
Checks if any event is already assigned to the category. 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>)> CheckIfEventWithCategory(Guid orgId, Guid categoryId)
Parameters
Type |
Name |
Description |
Guid |
orgId |
|
Guid |
categoryId |
|
Returns
DeleteAsync(Guid)
Kategorie per Id löschen.
Declaration
public Task DeleteAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
GetAllAsync()
Alle Kategorien zurückliefern.
Declaration
public Task<IEnumerable<EventCategory>> GetAllAsync()
Returns
GetAllByOrganizationAsync(Guid)
Alle Kategorien einer Organisation zurückliefern.
Declaration
public Task<IEnumerable<EventCategory>> GetAllByOrganizationAsync(Guid organizationId)
Parameters
Type |
Name |
Description |
Guid |
organizationId |
|
Returns
GetByIdAsync(Guid)
Eine Kategorie per Id zurückliefern.
Declaration
public Task<EventCategory> GetByIdAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
UpdateAsync(EventCategory)
Bestehende Kategorie aktualisieren.
Declaration
public Task UpdateAsync(EventCategory category)
Parameters
Returns
Implements