Last active
May 2, 2017 12:09
-
-
Save pacodelacruz/a80e92d4ce70d820d943479191252be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace PacodelaCruz.PollingConsumer.FunctionApp | |
{ | |
/// <summary> | |
/// This class will help us to wrap the PollingWatermarkEntity and make it more user friendly. By using the constructor, we are naming the PartitionKey as SourceSystem, and the RowKey as Entity. Additionally, we are returning another property called NextWatermark that is to be used as the upper bound when querying the source system and when updating the Polling Watermark after we have successfully polled the source system | |
/// </summary> | |
public class PollingWatermark | |
{ | |
public string SourceSystem { get; set; } | |
public string Entity { get; set; } | |
public DateTime Watermark { get; set; } | |
public DateTime NextWatermark { get; set; } | |
public PollingWatermark() | |
{ } | |
public PollingWatermark(PollingWatermarkEntity pollingWatermarkEntity) | |
{ | |
SourceSystem = pollingWatermarkEntity.PartitionKey; | |
Entity = pollingWatermarkEntity.RowKey; | |
DateTime currentPollingDateTime = DateTime.Now.ToUniversalTime(); | |
Watermark = pollingWatermarkEntity.Watermark; | |
NextWatermark = currentPollingDateTime; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment