Class SkillRepository
- Namespace
- Builvero.Infrastructure.Repositories
- Assembly
- Builvero.Infrastructure.dll
Repository implementation for skill data access operations using Entity Framework Core.
public class SkillRepository : ISkillRepository
- Inheritance
-
SkillRepository
- Implements
- Inherited Members
Remarks
Skills represent technical competencies that can be associated with users and projects. Only active skills are returned by default.
Constructors
SkillRepository(ApplicationDbContext)
Initializes a new instance of the SkillRepository class.
public SkillRepository(ApplicationDbContext context)
Parameters
contextApplicationDbContextThe Entity Framework database context for data access.
Methods
GetByCategoryAsync(SkillCategory?, CancellationToken)
Retrieves skills by category, or all active skills if no category is specified.
public Task<List<Skill>> GetByCategoryAsync(SkillCategory? category, CancellationToken cancellationToken = default)
Parameters
categorySkillCategory?Optional skill category filter. If null, returns all active skills.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<List<Skill>>
A list of active skills, optionally filtered by category, ordered by display name.
GetByIdAsync(Guid, CancellationToken)
Retrieves a skill by its unique identifier.
public Task<Skill?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
Parameters
idGuidThe unique identifier of the skill to retrieve.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetByIdsAsync(List<Guid>, CancellationToken)
Retrieves multiple skills by their unique identifiers.
public Task<List<Skill>> GetByIdsAsync(List<Guid> ids, CancellationToken cancellationToken = default)
Parameters
idsList<Guid>The list of unique identifiers of the skills to retrieve.
cancellationTokenCancellationTokenCancellation token to cancel the operation.