internal static void VerifyMetadataPropertyNotFound(ref MetadataPropertyBitMask propertiesFoundBitField, MetadataPropertyBitMask propertyFoundBitMask, string propertyName) { if ((propertiesFoundBitField & propertyFoundBitMask) != MetadataPropertyBitMask.None) { throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReaderUtils_MultipleMetadataPropertiesWithSameName(propertyName)); } propertiesFoundBitField |= propertyFoundBitMask; }
/// <summary> /// Verifies that the specified property was not yet found. /// </summary> /// <param name="propertiesFoundBitField">The bit field which stores which metadata properties were found so far.</param> /// <param name="propertyFoundBitMask">The bit mask for the property to check.</param> /// <param name="propertyName">The name of the property to check (used for error reporting).</param> internal static void VerifyMetadataPropertyNotFound(ref MetadataPropertyBitMask propertiesFoundBitField, MetadataPropertyBitMask propertyFoundBitMask, string propertyName) { DebugUtils.CheckNoExternalCallers(); Debug.Assert(((int)propertyFoundBitMask & (((int)propertyFoundBitMask) - 1)) == 0, "propertyFoundBitMask is not a power of 2."); Debug.Assert(!string.IsNullOrEmpty(propertyName), "!string.IsNullOrEmpty(propertyName)"); if ((propertiesFoundBitField & propertyFoundBitMask) != 0) { throw new ODataException(o.Strings.ODataJsonReaderUtils_MultipleMetadataPropertiesWithSameName(propertyName)); } propertiesFoundBitField |= propertyFoundBitMask; }