< Summary

Information
Class: Elsa.Tenants.Endpoints.Tenants.Delete.Endpoint
Assembly: Elsa.Tenants
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Endpoints/Tenants/Delete/Endpoint.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 28
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Configure()100%210%
HandleAsync()0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Endpoints/Tenants/Delete/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Common.Multitenancy;
 3
 4namespace Elsa.Tenants.Endpoints.Tenants.Delete;
 5
 06public class Endpoint(ITenantService tenantService, ITenantStore store) : ElsaEndpointWithoutRequest<Tenant>
 7{
 8    public override void Configure()
 9    {
 010        Delete("/tenants/{id}");
 011        ConfigurePermissions("delete:tenants");
 012    }
 13
 14    public override async Task HandleAsync(CancellationToken ct)
 15    {
 016        var id = Route<string>("id")!;
 017        var found = await store.DeleteAsync(id, ct);
 18
 019        if (!found)
 20        {
 021            await Send.NotFoundAsync(ct);
 022            return;
 23        }
 24
 025        await tenantService.RefreshAsync(ct);
 026        await Send.OkAsync(ct);
 027    }
 28}