public SyncResultEntity(SyncResultModel model)
 {
     RowKey            = model.Id;
     CreatedUtc        = model.CreatedUtc;
     SyncType          = model.SyncType;
     SyncStatus        = model.SyncStatus;
     SyncedRecords     = model.SyncedRecords;
     SyncNotes         = model.SyncNotes;
     PEXBusinessAcctId = model.PEXBusinessAcctId;
 }
 public async Task CreateAsync(SyncResultModel model, CancellationToken cancellationToken)
 {
     var entity = new SyncResultEntity(model)
     {
         PartitionKey = PartitionKey, //<----- We should probably use Business Id here....
         RowKey       = $"{model.PEXBusinessAcctId}-{model.SyncType}-{model.CreatedUtc.Ticks}"
     };
     var operation = TableOperation.Insert(entity);
     await Table.ExecuteAsync(operation, cancellationToken);
 }
        public async Task DeleteSyncResult(SyncResultModel model, CancellationToken cancellationToken)
        {
            var operation = TableOperation.Retrieve <SyncResultEntity>(PartitionKey, model.Id);
            var result    = await Table.ExecuteAsync(operation, cancellationToken);

            var entity = (SyncResultEntity)result?.Result;

            if (entity != null)
            {
                operation = TableOperation.Delete(entity);
                await Table.ExecuteAsync(operation, cancellationToken);
            }
        }