forked from CommunityToolkit/Datasync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSynchronizationEventArgs.cs
More file actions
54 lines (46 loc) · 1.77 KB
/
SynchronizationEventArgs.cs
File metadata and controls
54 lines (46 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace CommunityToolkit.Datasync.Client.Offline;
/// <summary>
/// The list of synchronization events that we support.
/// </summary>
public enum SynchronizationEventType
{
/// <summary>
/// Occurs when items have been successfully fetches from the server.
/// </summary>
/// <remarks>This event is raised after a page of entities was succesfully fetched from the server, ready to be commited to the data store.</remarks>
ItemsFetched,
/// <summary>
/// Occurs when items have been successfully committed to the underlying data store.
/// </summary>
/// <remarks>This event is raised after a page of entities was succesfully commited to the database</remarks>
ItemsCommitted,
}
/// <summary>
/// The event arguments sent when a synchronization event occurs.
/// </summary>
public class SynchronizationEventArgs
{
/// <summary>
/// The type of event.
/// </summary>
public required SynchronizationEventType EventType { get; init; }
/// <summary>
/// The EntityType that is being processed.
/// </summary>
public required Type EntityType { get; init; }
/// <summary>
/// When pulling records, the number of items that have been processed in the current pull request.
/// </summary>
public long ItemsProcessed { get; init; } = -1;
/// <summary>
/// The total number of items in the current pull request.
/// </summary>
public long TotalNrItems { get; init; }
/// <summary>
/// The query ID that is being processed
/// </summary>
public required string QueryId { get; init; }
}