internal SavingAlgorithm GetSavingAlgorithm()
{
Validate();
if (CurrentVersionId == 0)
return SavingAlgorithm.CreateNewNode;
if (ExpectedVersionId == 0)
return SavingAlgorithm.CopyToNewVersionAndUpdate;
if (CurrentVersionId == ExpectedVersionId)
return SavingAlgorithm.UpdateSameVersion;
if (CurrentVersionId != ExpectedVersionId)
return SavingAlgorithm.CopyToSpecifiedVersionAndUpdate;
throw new ApplicationException("Invalid version combination.");
}
}