Interface IProjectRepository
- Namespace
- Builvero.Application.Interfaces.Repositories
- Assembly
- Builvero.Application.dll
Defines the contract for project data access operations including retrieval, creation, updates, and search.
public interface IProjectRepository
Remarks
This repository interface provides methods for managing project entities and their associated data. It supports project lookup by ID and user, project creation and updates, and advanced search functionality with filtering by category, skills, status, builder tags, and experience level.
Methods
CreateAsync(Project, CancellationToken)
Creates a new project entity in the database.
Task<Project> CreateAsync(Project project, CancellationToken cancellationToken = default)
Parameters
projectProjectThe project entity to create.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetByIdAsync(Guid, CancellationToken)
Retrieves a project by its unique identifier.
Task<Project?> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
Parameters
idGuidThe unique identifier of the project to retrieve.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetByUserIdAsync(Guid, CancellationToken)
Retrieves all projects associated with a specific user (projects they own or are members of).
Task<List<Project>> GetByUserIdAsync(Guid userId, CancellationToken cancellationToken = default)
Parameters
userIdGuidThe unique identifier of the user.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetSearchCountAsync(string?, ProjectCategory?, Guid?, string?, CancellationToken)
Gets the total count of projects matching the specified search criteria (legacy search method).
Task<int> GetSearchCountAsync(string? searchTerm, ProjectCategory? category, Guid? builderTagId, string? experienceLevel, CancellationToken cancellationToken = default)
Parameters
searchTermstringOptional search term for filtering projects by name or description.
categoryProjectCategory?Optional project category filter.
builderTagIdGuid?Optional builder tag ID filter.
experienceLevelstringOptional experience level filter (e.g., "Beginner", "Intermediate", "Expert").
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
GetSearchProjectsCountAsync(string?, List<Guid>?, ProjectStatus?, ProjectCategory?, CancellationToken)
Gets the total count of projects matching the specified search criteria.
Task<int> GetSearchProjectsCountAsync(string? text, List<Guid>? skillIds, ProjectStatus? status, ProjectCategory? category, CancellationToken cancellationToken = default)
Parameters
textstringOptional search text for filtering projects by name or description.
skillIdsList<Guid>Optional list of skill IDs to filter projects by.
statusProjectStatus?Optional project status filter (e.g., Idea, InProgress, Completed).
categoryProjectCategory?Optional project category filter.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
SearchAsync(string?, ProjectCategory?, Guid?, string?, int, int, CancellationToken)
Searches for projects matching the specified criteria with pagination support (legacy search method).
Task<List<Project>> SearchAsync(string? searchTerm, ProjectCategory? category, Guid? builderTagId, string? experienceLevel, int page, int pageSize, CancellationToken cancellationToken = default)
Parameters
searchTermstringOptional search term for filtering projects by name or description.
categoryProjectCategory?Optional project category filter.
builderTagIdGuid?Optional builder tag ID filter.
experienceLevelstringOptional experience level filter (e.g., "Beginner", "Intermediate", "Expert").
pageintThe page number (1-based) to retrieve.
pageSizeintThe number of projects per page.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
SearchProjectsAsync(string?, List<Guid>?, ProjectStatus?, ProjectCategory?, int, int, CancellationToken)
Searches for projects matching the specified criteria with pagination support.
Task<List<Project>> SearchProjectsAsync(string? text, List<Guid>? skillIds, ProjectStatus? status, ProjectCategory? category, int page, int pageSize, CancellationToken cancellationToken = default)
Parameters
textstringOptional search text for filtering projects by name or description.
skillIdsList<Guid>Optional list of skill IDs to filter projects by.
statusProjectStatus?Optional project status filter (e.g., Idea, InProgress, Completed).
categoryProjectCategory?Optional project category filter.
pageintThe page number (1-based) to retrieve.
pageSizeintThe number of projects per page.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
UpdateAsync(Project, CancellationToken)
Updates an existing project entity in the database.
Task<Project> UpdateAsync(Project project, CancellationToken cancellationToken = default)
Parameters
projectProjectThe project entity with updated values.
cancellationTokenCancellationTokenCancellation token to cancel the operation.