private bool ShouldCreateCollection()
{
if (this.CollectionLinks.Count == 0)
{
return true;
}
string lastCollectionLink = this.CollectionLinks.Last();
if (this.LastCheckTimeUtc == null || DateTime.UtcNow >= this.LastCheckTimeUtc.Add(this.CheckInterval))
{
ResourceResponse<DocumentCollection> response = this.Client.ReadDocumentCollectionAsync(lastCollectionLink).Result;
this.LastCheckTimeUtc = DateTime.UtcNow;
if (response.CollectionSizeUsage >= response.CollectionSizeQuota * this.FillFactor)
{
return true;
}
}
return false;
}