Skip to content

Commit

Permalink
Add factory method to PagedListResponse
Browse files Browse the repository at this point in the history
This update introduces a static factory method `From` in the `PagedListResponse` class. It allows for the creation of `PagedListResponse` instances directly from `Page` objects, streamlining object instantiation.
  • Loading branch information
sfmskywalker committed Sep 26, 2024
1 parent 973489c commit 7609b0e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/Elsa.Api.Common/Models/PagedListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ public PagedListResponse(Page<T> page)

public ICollection<T> Items { get; set; } = default!;
public long TotalCount { get; set; }

public static PagedListResponse<T> From(Page<T> page) => new(page);
}

0 comments on commit 7609b0e

Please sign in to comment.