-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathDataEnvelope.cs
32 lines (29 loc) · 1.13 KB
/
DataEnvelope.cs
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
using System;
using System.Collections.Generic;
using System.Text;
using Telerik.DataSource;
namespace CustomSerializer.Shared
{
/// <summary>
/// An evenlope for the DataSourceResult serialization back to the client.
/// Needed because the framework cannot otherwise deserialize the IEnumerable collection
/// that the Telerik DataSource package produces - it requires an explicit type -
/// System.Text.Json cannot successfully deserialize interface properties.
/// </summary>
/// <typeparam name="T">The model type that is sent from the server</typeparam>
public class DataEnvelope<T>
{
/// <summary>
/// Use this when there is data grouping
/// </summary>
public List<AggregateFunctionsGroup> GroupedData { get; set; }
/// <summary>
/// Use this when there is no data grouping and the response is flat data, like in the common case.
/// </summary>
public List<T> CurrentPageData { get; set; }
/// <summary>
/// Always set this to the total number of records.
/// </summary>
public int TotalItemCount { get; set; }
}
}