public override async Task <IEnumerable <T> > PerformQueryAsync(GetTenantEntities <T> request, CancellationToken cancellationToken)
        {
            var dbSet = dbContextProvider.GetTenantDBSet <T>();
            var query = dbSet.GetSearchQuery(request.SearchTerm);

            return(await dbSet.QueryAsync(request.TenantId, query, cancellationToken));
        }
        public async override Task <T> HandleAsync(CreateTenantEntityCommand <T> request, CancellationToken cancellationToken)
        {
            var tenantDBContext = dbContextProvider.GetTenantDBSet <T>();

            request.Model.Id = Guid.NewGuid();
            await tenantDBContext.InsertAsync(request.TenantId, request.AccountId, cancellationToken, request.Model);

            return(await tenantDBContext.QueryByIdAsync(request.TenantId, request.Model.Id, cancellationToken));
        }
        public override async Task <T> HandleAsync(UpdateTenantEntityCommand <T> request, CancellationToken cancellationToken)
        {
            var tenantDBSet = dbContextProvider.GetTenantDBSet <T>();

            request.Model.Id = request.Id;
            await tenantDBSet.UpdateAsync(request.TenantId, request.AccountId, cancellationToken, request.Model);

            return(await tenantDBSet.QueryByIdAsync(request.TenantId, request.Id, cancellationToken));
        }
        public override async Task <T> PerformQueryAsync(GetTenantEntity <T> request, CancellationToken cancellationToken)
        {
            var dbSet = dbContextProvider.GetTenantDBSet <T>();

            return(await dbSet.QueryByIdAsync(request.TenantId, request.Id, cancellationToken));
        }