Table of Contents

Class BuilderTagRepository

Namespace
Builvero.Infrastructure.Repositories
Assembly
Builvero.Infrastructure.dll

Repository implementation for builder tag data access operations using Entity Framework Core.

public class BuilderTagRepository : IBuilderTagRepository
Inheritance
BuilderTagRepository
Implements
Inherited Members

Remarks

Builder tags represent skills, roles, or categories that can be associated with users and projects.

Constructors

BuilderTagRepository(ApplicationDbContext)

Initializes a new instance of the BuilderTagRepository class.

public BuilderTagRepository(ApplicationDbContext context)

Parameters

context ApplicationDbContext

The Entity Framework database context for data access.

Methods

CreateAsync(BuilderTag, CancellationToken)

Creates a new builder tag in the database.

public Task<BuilderTag> CreateAsync(BuilderTag tag, CancellationToken cancellationToken = default)

Parameters

tag BuilderTag

The builder tag entity to create.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<BuilderTag>

The created builder tag entity with its generated ID.

GetAllAsync(CancellationToken)

Retrieves all builder tags ordered by name.

public Task<List<BuilderTag>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<List<BuilderTag>>

A list of all builder tags, ordered alphabetically by name.

GetByIdAsync(Guid, CancellationToken)

Retrieves a builder tag by its unique identifier.

public Task<BuilderTag?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)

Parameters

id Guid

The unique identifier of the builder tag to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<BuilderTag>

The builder tag if found; otherwise, null.

GetByNameAsync(string, CancellationToken)

Retrieves a builder tag by its name.

public Task<BuilderTag?> GetByNameAsync(string name, CancellationToken cancellationToken = default)

Parameters

name string

The name of the builder tag to retrieve.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<BuilderTag>

The builder tag if found; otherwise, null.