< Summary

Information
Class: Elsa.Alterations.Core.Filters.AlterationPlanFilter
Assembly: Elsa.Alterations.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations.Core/Filters/AlterationPlanFilter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 25
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
get_Id()100%210%
Apply(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations.Core/Filters/AlterationPlanFilter.cs

#LineLine coverage
 1using Elsa.Alterations.Core.Entities;
 2
 3namespace Elsa.Alterations.Core.Filters;
 4
 5/// <summary>
 6/// A filter for querying alteration plans.
 7/// </summary>
 8public class AlterationPlanFilter
 9{
 10    /// <summary>
 11    /// The ID of the plan.
 12    /// </summary>
 013    public string? Id { get; set; }
 14
 15    /// <summary>
 16    /// Applies the filter to the specified query.
 17    /// </summary>
 18    public IQueryable<AlterationPlan> Apply(IQueryable<AlterationPlan> query)
 19    {
 020        if (!string.IsNullOrWhiteSpace(Id))
 021            query = query.Where(x => x.Id == Id);
 22
 023        return query;
 24    }
 25}