Table of Contents

Class TenantBranchRepository

Namespace
KadicAuth.Infrastructure.Repositories
Assembly
KadicAuth.Infrastructure.dll
public class TenantBranchRepository : ITenantBranchRepository
Inheritance
object
TenantBranchRepository
Implements

Constructors

TenantBranchRepository(AuthDbContext)

public TenantBranchRepository(AuthDbContext context)

Parameters

context AuthDbContext

Methods

AddAsync(TenantBranch, CancellationToken)

public Task AddAsync(TenantBranch branch, CancellationToken cancellationToken = default)

Parameters

branch TenantBranch
cancellationToken CancellationToken

Returns

Task

DeleteAsync(TenantBranch, CancellationToken)

public Task DeleteAsync(TenantBranch branch, CancellationToken cancellationToken = default)

Parameters

branch TenantBranch
cancellationToken CancellationToken

Returns

Task

GetAllByTenantAsync(Guid, CancellationToken)

public Task<IEnumerable<TenantBranch>> GetAllByTenantAsync(Guid tenantId, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
cancellationToken CancellationToken

Returns

Task<IEnumerable<TenantBranch>>

GetByIdAsync(Guid, CancellationToken)

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

Parameters

id Guid
cancellationToken CancellationToken

Returns

Task<TenantBranch>

GetByIdIgnoringFiltersAsync(Guid, CancellationToken)

Looks up a branch by id while bypassing the global TenantId query filter. Reserved for platform-admin flows that must touch branches outside the caller's home tenant (e.g. the tenant-360 wizard creating the initial admin user in a freshly-provisioned tenant).

public Task<TenantBranch?> GetByIdIgnoringFiltersAsync(Guid id, CancellationToken cancellationToken = default)

Parameters

id Guid
cancellationToken CancellationToken

Returns

Task<TenantBranch>

GetBySlugAsync(Guid, string, CancellationToken)

public Task<TenantBranch?> GetBySlugAsync(Guid tenantId, string slug, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
slug string
cancellationToken CancellationToken

Returns

Task<TenantBranch>

GetDefaultBranchForTenantAsync(Guid, CancellationToken)

public Task<TenantBranch?> GetDefaultBranchForTenantAsync(Guid tenantId, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
cancellationToken CancellationToken

Returns

Task<TenantBranch>

GetExistingIdsAsync(IEnumerable<Guid>, CancellationToken)

public Task<HashSet<Guid>> GetExistingIdsAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default)

Parameters

ids IEnumerable<Guid>
cancellationToken CancellationToken

Returns

Task<HashSet<Guid>>

GetPagedByTenantAsync(Guid, int, int, bool?, CancellationToken)

public Task<PagedList<TenantBranch>> GetPagedByTenantAsync(Guid tenantId, int pageNumber, int pageSize, bool? isActive = null, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
pageNumber int
pageSize int
isActive bool?
cancellationToken CancellationToken

Returns

Task<PagedList<TenantBranch>>

SaveChangesAsync(CancellationToken)

public Task SaveChangesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task

SlugExistsAsync(Guid, string, Guid?, CancellationToken)

public Task<bool> SlugExistsAsync(Guid tenantId, string slug, Guid? excludeId = null, CancellationToken cancellationToken = default)

Parameters

tenantId Guid
slug string
excludeId Guid?
cancellationToken CancellationToken

Returns

Task<bool>

UpdateAsync(TenantBranch, CancellationToken)

public Task UpdateAsync(TenantBranch branch, CancellationToken cancellationToken = default)

Parameters

branch TenantBranch
cancellationToken CancellationToken

Returns

Task