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
contextApplicationDbContextThe 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
tagBuilderTagThe builder tag entity to create.
cancellationTokenCancellationTokenCancellation 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
cancellationTokenCancellationTokenCancellation 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
idGuidThe unique identifier of the builder tag to retrieve.
cancellationTokenCancellationTokenCancellation 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
namestringThe name of the builder tag to retrieve.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<BuilderTag>
The builder tag if found; otherwise, null.