-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIDataShapeHelper.cs
More file actions
32 lines (30 loc) · 1.77 KB
/
Copy pathIDataShapeHelper.cs
File metadata and controls
32 lines (30 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace TalentManagementAPI.Application.Interfaces
{
/// <summary>
/// Interface for data shape helper that provides methods to shape data based on provided fields.
/// </summary>
public interface IDataShapeHelper<T>
{
/// <summary>
/// Shapes the data for a collection of entities based on the provided fields string.
/// </summary>
/// <param name="entities">The collection of entities to shape.</param>
/// <param name="fieldsString">A comma-separated string representing the fields to include in the shaped data.</param>
/// <returns>An IEnumerable of Entity objects that represent the shaped data.</returns>
IEnumerable<Entity> ShapeData(IEnumerable<T> entities, string fieldsString);
/// <summary>
/// Asynchronously shapes the data for a collection of entities based on the provided fields string.
/// </summary>
/// <param name="entities">The collection of entities to shape.</param>
/// <param name="fieldsString">A comma-separated string representing the fields to include in the shaped data.</param>
/// <returns>A Task that will return an IEnumerable of Entity objects that represent the shaped data.</returns>
Task<IEnumerable<Entity>> ShapeDataAsync(IEnumerable<T> entities, string fieldsString);
/// <summary>
/// Shapes the data for a single entity based on the provided fields string.
/// </summary>
/// <param name="entity">The entity to shape.</param>
/// <param name="fieldsString">A comma-separated string representing the fields to include in the shaped data.</param>
/// <returns>An Entity object that represents the shaped data.</returns>
Entity ShapeData(T entity, string fieldsString);
}
}