< Summary

Information
Class: Elsa.Tenants.Endpoints.Tenants.Get.Endpoint
Assembly: Elsa.Tenants
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Endpoints/Tenants/Get/Endpoint.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
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/Get/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Common.Multitenancy;
 3using Elsa.Models;
 4
 5namespace Elsa.Tenants.Endpoints.Tenants.Get;
 6
 07public class Endpoint(ITenantService tenantService) : ElsaEndpointWithoutRequest<Tenant>
 8{
 9    public override void Configure()
 10    {
 011        Get("/tenants/{id}");
 012        ConfigurePermissions("read:tenants");
 013    }
 14
 15    public override async Task HandleAsync(CancellationToken ct)
 16    {
 017        var id = Route<string>("id")!;
 018        var tenant = await tenantService.FindAsync(id, ct);
 19
 020        if (tenant == null)
 21        {
 022            await Send.NotFoundAsync(ct);
 023            return;
 24        }
 25
 026        await Send.OkAsync(tenant, ct);
 027    }
 28}