< Summary

Information
Class: Elsa.Models.ListResponse<T>
Assembly: Elsa.Api.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Api.Common/Models/ListResponse.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 33
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
.ctor()100%210%
.ctor(...)100%210%
get_Items()100%210%
get_Count()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Api.Common/Models/ListResponse.cs

#LineLine coverage
 1namespace Elsa.Models;
 2
 3/// <summary>
 4/// Represents a generic list response that offers a unified format for returning list of things from API endpoints.
 5/// </summary>
 6public class ListResponse<T>
 7{
 8    /// <summary>
 9    /// Default constructor.
 10    /// </summary>
 011    public ListResponse()
 12    {
 013    }
 14
 15    /// <summary>
 16    /// Constructor accepting a list of items.
 17    /// </summary>
 018    public ListResponse(ICollection<T> items)
 19    {
 020        Items = items;
 021        Count = items.Count;
 022    }
 23
 24    /// <summary>
 25    /// A list of items.
 26    /// </summary>
 027    public ICollection<T> Items { get; set; } = default!;
 28
 29    /// <summary>
 30    /// The number of items in the list.
 31    /// </summary>
 032    public long Count { get; set; }
 33}