Support subtracting two ByteSize objects
omar opened this issue · comments
Omar Khudeira commented
Support subtracting two ByteSize
objects to allow for the following use case:
var quota = ByteSize.FromMegaBytes(20);
var usage = ByteSize.FromMegaBytes(19);
var newFile = ByteSize.FromMegaBytes(2);
if (usage + newFile > quota) {
var overage = usage + newFile - quota;
throw new InvalidOperationException($"This file would put you above your quota of { quota } by { overage }");
}