Interface IProjectMembershipRepository
- Namespace
- Builvero.Application.Interfaces.Repositories
- Assembly
- Builvero.Application.dll
Defines the contract for project membership data access operations including retrieval, creation, updates, and deletion.
public interface IProjectMembershipRepository
Remarks
This repository interface provides methods for managing project membership entities, which represent the relationship between users and projects. Memberships track the user's role in the project (Owner or Member) and their membership status (Active, Inactive).
Methods
CreateAsync(ProjectMembership, CancellationToken)
Creates a new project membership entity in the database.
Task<ProjectMembership> CreateAsync(ProjectMembership membership, CancellationToken cancellationToken = default)
Parameters
membershipProjectMembershipThe project membership entity to create.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectMembership>
The created project membership entity with generated ID and timestamps.
DeleteAsync(ProjectMembership, CancellationToken)
Deletes a project membership entity from the database.
Task DeleteAsync(ProjectMembership membership, CancellationToken cancellationToken = default)
Parameters
membershipProjectMembershipThe project membership entity to delete.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task
A task representing the asynchronous operation.
GetByProjectAndUserAsync(Guid, Guid, CancellationToken)
Retrieves a project membership by project ID and user ID.
Task<ProjectMembership?> GetByProjectAndUserAsync(Guid projectId, Guid userId, CancellationToken cancellationToken = default)
Parameters
projectIdGuidThe unique identifier of the project.
userIdGuidThe unique identifier of the user.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectMembership>
The project membership entity if found; otherwise, null.
GetByProjectIdAsync(Guid, CancellationToken)
Retrieves all project memberships for a specific project.
Task<List<ProjectMembership>> GetByProjectIdAsync(Guid projectId, CancellationToken cancellationToken = default)
Parameters
projectIdGuidThe unique identifier of the project.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<List<ProjectMembership>>
A list of project memberships for the project.
UpdateAsync(ProjectMembership, CancellationToken)
Updates an existing project membership entity in the database.
Task<ProjectMembership> UpdateAsync(ProjectMembership membership, CancellationToken cancellationToken = default)
Parameters
membershipProjectMembershipThe project membership entity with updated values.
cancellationTokenCancellationTokenCancellation token to cancel the operation.
Returns
- Task<ProjectMembership>
The updated project membership entity.