< Summary

Information
Class: Elsa.Workflows.Api.Endpoints.WorkflowInstances.Get.WorkflowInstanceMapper
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Get/Mappers.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 32
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FromEntity(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Get/Mappers.cs

#LineLine coverage
 1using Elsa.Workflows.Api.Models;
 2using Elsa.Workflows.Management.Entities;
 3using FastEndpoints;
 4
 5namespace Elsa.Workflows.Api.Endpoints.WorkflowInstances.Get;
 6
 7/// <summary>
 8/// Maps a <see cref="WorkflowInstance"/> to <see cref="WorkflowInstanceModel"/>.
 9/// </summary>
 10internal class WorkflowInstanceMapper : ResponseMapper<WorkflowInstanceModel, WorkflowInstance>, IRequestMapper
 11{
 12    /// <inheritdoc />
 013    public override WorkflowInstanceModel FromEntity(WorkflowInstance e) => new()
 014    {
 015        Id = e.Id,
 016        DefinitionId = e.DefinitionId,
 017        DefinitionVersionId = e.DefinitionVersionId,
 018        Version = e.Version,
 019        ParentWorkflowInstanceId = e.ParentWorkflowInstanceId,
 020        WorkflowState = e.WorkflowState,
 021        Status = e.Status,
 022        SubStatus = e.SubStatus,
 023        IsExecuting = e.IsExecuting,
 024        CorrelationId = e.CorrelationId,
 025        Name = e.Name,
 026        IncidentCount = e.IncidentCount,
 027        IsSystem = e.IsSystem,
 028        CreatedAt = e.CreatedAt,
 029        FinishedAt = e.FinishedAt,
 030        UpdatedAt = e.UpdatedAt
 031    };
 32}