Table of Contents

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

context ApplicationDbContext

The 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

category SkillCategory?

Optional skill category filter. If null, returns all active skills.

cancellationToken CancellationToken

Cancellation 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

id Guid

The unique identifier of the skill to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<Skill>

The active skill if found; otherwise, null.

GetByIdsAsync(List<Guid>, CancellationToken)

Retrieves multiple skills by their unique identifiers.

public Task<List<Skill>> GetByIdsAsync(List<Guid> ids, CancellationToken cancellationToken = default)

Parameters

ids List<Guid>

The list of unique identifiers of the skills to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<List<Skill>>

A list of active skills matching the provided IDs.