ValidateServiceObjectVersion static method

void ValidateServiceObjectVersion(
  1. ServiceObject serviceObject,
  2. ExchangeVersion requestVersion
)
Validates service object version against the request version. The service object. The request version.

Implementation

static void ValidateServiceObjectVersion(
    ServiceObject serviceObject, ExchangeVersion requestVersion) {
  ExchangeVersion minimumRequiredServerVersion =
      serviceObject.GetMinimumRequiredServerVersion();

  if (requestVersion.index < minimumRequiredServerVersion.index) {
    throw new ServiceVersionException("""string.Format(
                  Strings.ObjectTypeIncompatibleWithRequestVersion,
                  serviceObject.GetType().Name,
                  minimumRequiredServerVersion)""");
  }
}