From 70eef8a0562b0084710b462ed3798a107f3bf1e0 Mon Sep 17 00:00:00 2001 From: Sam Xu Date: Thu, 12 Dec 2024 09:16:41 -0800 Subject: [PATCH] Fixes #3132 Replace using Resource files for error message (#3146) * Fixes #3132 Replace using Resource files for error message 1) Remove the old tt files 2) Convert the error messages from txt files to resx files 3) Add the Error class for helpers 4) Change the codes to use the resource error message * Remove the unused files * Fix the failing test cases * Fixes the failing tests --- .../ALinq/ALinqExpressionVisitor.cs | 4 +- .../ALinq/AddNewEndingTokenVisitor.cs | 2 +- .../ALinq/DataServiceQueryProvider.cs | 2 +- .../ALinq/ExpandOnlyPathToStringVisitor.cs | 4 +- .../ALinq/ExpressionWriter.cs | 16 +- .../ALinq/GroupByAnalyzer.cs | 2 +- .../ALinq/NewTreeBuilder.cs | 2 +- .../ALinq/ProjectionAnalyzer.cs | 68 +- .../ALinq/ProjectionRewriter.cs | 2 +- .../ALinq/QueryableResourceExpression.cs | 12 +- .../ALinq/RemoveWildcardVisitor.cs | 2 +- .../ALinq/ResourceBinder.cs | 100 +- .../ALinq/SelectExpandPathToStringVisitor.cs | 2 +- src/Microsoft.OData.Client/ALinq/UriHelper.cs | 6 +- src/Microsoft.OData.Client/ALinq/UriWriter.cs | 28 +- .../Attribute/KeyAttribute.cs | 2 +- src/Microsoft.OData.Client/BaseAsyncResult.cs | 8 +- src/Microsoft.OData.Client/BaseSaveResult.cs | 10 +- src/Microsoft.OData.Client/BatchSaveResult.cs | 16 +- .../Binding/BindingGraph.cs | 16 +- .../Binding/BindingObserver.cs | 14 +- .../Binding/BindingUtils.cs | 4 +- .../Binding/DataServiceCollectionOfT.cs | 34 +- src/Microsoft.OData.Client/BulkUpdateGraph.cs | 2 +- .../BulkUpdateSaveResult.cs | 10 +- src/Microsoft.OData.Client/ClientConvert.cs | 6 +- src/Microsoft.OData.Client/ClientEdmModel.cs | 12 +- src/Microsoft.OData.Client/Common.cs | 4 +- src/Microsoft.OData.Client/ContentTypeUtil.cs | 26 +- .../DataServiceClientException.cs | 2 +- .../DataServiceClientFormat.cs | 2 +- ...rviceClientRequestPipelineConfiguration.cs | 3 +- .../DataServiceContext.cs | 106 +- .../DataServiceQueryException.cs | 2 +- .../DataServiceQueryOfT.cs | 2 +- .../DataServiceRequest.cs | 6 +- .../DataServiceRequestException.cs | 2 +- .../DataServiceUrlKeyDelimiter.cs | 9 +- .../DeepInsertSaveResult.cs | 16 +- .../EntityDescriptor.cs | 2 +- src/Microsoft.OData.Client/EntityTracker.cs | 16 +- src/Microsoft.OData.Client/Error.cs | 8 +- .../HeaderCollection.cs | 2 +- .../LoadPropertyResult.cs | 6 +- .../CollectionValueMaterializationPolicy.cs | 12 +- .../Materialization/EntityTrackingAdapter.cs | 4 +- .../EntryValueMaterializationPolicy.cs | 18 +- .../EnumValueMaterializationPolicy.cs | 2 +- .../FeedAndEntryMaterializerAdapter.cs | 4 +- .../ODataCollectionMaterializer.cs | 4 +- .../ODataEntityMaterializer.cs | 24 +- .../ODataEntriesEntityMaterializer.cs | 2 +- .../Materialization/ODataLinksMaterializer.cs | 8 +- .../Materialization/ODataMaterializer.cs | 10 +- .../ODataMessageReaderMaterializer.cs | 5 +- .../ODataReaderEntityMaterializer.cs | 10 +- .../PrimitivePropertyConverter.cs | 2 +- .../PrimitiveValueMaterializationPolicy.cs | 2 +- .../StructuralValueMaterializationPolicy.cs | 6 +- .../MemberAssignmentAnalysis.cs | 2 +- .../Metadata/ClientPropertyAnnotation.cs | 2 +- .../Metadata/ClientTypeAnnotation.cs | 4 +- .../Metadata/ClientTypeCache.cs | 2 +- .../Metadata/ClientTypeUtil.cs | 4 +- .../Metadata/ODataTypeInfo.cs | 12 +- .../Microsoft.OData.Client.Common.txt | 303 - .../Microsoft.OData.Client.Desktop.txt | 15 - .../Microsoft.OData.Client.cs | 365 - .../Microsoft.OData.Client.csproj | 62 +- .../Microsoft.OData.Client.tt | 20 - .../Microsoft.OData.Client.txt | 317 - .../ObjectMaterializer.cs | 14 +- .../OperationParameter.cs | 2 +- .../Parameterized.Microsoft.OData.Client.cs | 2528 ------ .../Parameterized.Microsoft.OData.Client.tt | 20 - .../QueryOperationResponse.cs | 4 +- .../QueryOperationResponseOfT.cs | 2 +- src/Microsoft.OData.Client/QueryResult.cs | 2 +- src/Microsoft.OData.Client/RequestInfo.cs | 4 +- .../SRResources.Designer.cs | 2412 ++++++ src/Microsoft.OData.Client/SRResources.resx | 885 ++ src/Microsoft.OData.Client/SaveResult.cs | 10 +- .../SendingRequestEventArgs.cs | 2 +- .../Serialization/HttpClientRequestMessage.cs | 4 +- .../Serialization/ODataPropertyConverter.cs | 6 +- .../Serialization/ODataWriterWrapper.cs | 2 +- .../Serialization/Serializer.cs | 18 +- src/Microsoft.OData.Client/TypeResolver.cs | 2 +- src/Microsoft.OData.Client/UriResolver.cs | 12 +- src/Microsoft.OData.Client/Util.cs | 6 +- src/Microsoft.OData.Client/WebUtil.cs | 22 +- .../AnnotationFilterPattern.cs | 9 +- .../Batch/ODataBatchOperationHeaders.cs | 3 +- .../Batch/ODataBatchOperationMessage.cs | 3 +- .../Batch/ODataBatchReader.cs | 45 +- .../Batch/ODataBatchReaderStreamBuffer.cs | 11 +- .../Batch/ODataBatchUtils.cs | 9 +- .../Batch/ODataBatchWriter.cs | 49 +- .../Buffers/BufferUtils.cs | 4 +- .../CollectionWithoutExpectedTypeValidator.cs | 9 +- .../DerivedTypeValidator.cs | 3 +- .../DuplicatePropertyNameChecker.cs | 10 +- src/Microsoft.OData.Core/ErrorUtils.cs | 3 +- .../Evaluation/EdmValueUtils.cs | 18 +- .../Evaluation/LiteralFormatter.cs | 4 +- .../ODataConventionalIdMetadataBuilder.cs | 3 +- .../Evaluation/ODataConventionalUriBuilder.cs | 5 +- .../Evaluation/ODataMetadataContext.cs | 3 +- .../ODataResourceMetadataBuilder.cs | 5 +- .../ODataResourceMetadataContext.cs | 15 +- src/Microsoft.OData.Core/ExceptionUtils.cs | 13 +- .../HttpHeaderValueLexer.cs | 11 +- src/Microsoft.OData.Core/HttpUtils.cs | 45 +- .../Json/JsonFullMetadataLevel.cs | 3 +- .../Json/JsonInstanceAnnotationWriter.cs | 10 +- src/Microsoft.OData.Core/Json/JsonReader.cs | 123 +- .../Json/JsonReaderExtensions.cs | 23 +- .../Json/JsonValueUtils.cs | 3 +- .../Json/JsonWriterExtensions.Async.cs | 8 +- .../Json/JsonWriterExtensions.cs | 8 +- .../Json/ODataAnnotationNames.cs | 4 +- .../Json/ODataJsonBatchAtomicGroupCache.cs | 3 +- .../ODataJsonBatchBodyContentReaderStream.cs | 9 +- ...DataJsonBatchPayloadItemPropertiesCache.cs | 13 +- .../Json/ODataJsonBatchReader.cs | 17 +- .../Json/ODataJsonBatchReaderStream.cs | 3 +- .../Json/ODataJsonBatchWriter.cs | 15 +- .../Json/ODataJsonCollectionDeserializer.cs | 50 +- .../Json/ODataJsonContextUriParser.cs | 30 +- .../Json/ODataJsonDeserializer.cs | 27 +- ...DataJsonEntityReferenceLinkDeserializer.cs | 70 +- .../Json/ODataJsonErrorDeserializer.cs | 33 +- .../Json/ODataJsonInputContext.cs | 14 +- .../Json/ODataJsonOutputContext.cs | 3 +- .../Json/ODataJsonParameterDeserializer.cs | 35 +- .../ODataJsonPropertyAndValueDeserializer.cs | 153 +- .../Json/ODataJsonPropertySerializer.cs | 13 +- .../Json/ODataJsonReader.cs | 26 +- .../Json/ODataJsonReaderCoreUtils.cs | 6 +- .../Json/ODataJsonReaderUtils.cs | 7 +- .../Json/ODataJsonResourceDeserializer.cs | 126 +- .../Json/ODataJsonResourceSerializer.cs | 5 +- .../Json/ODataJsonSerializer.cs | 3 +- .../ODataJsonServiceDocumentDeserializer.cs | 53 +- .../ODataJsonServiceDocumentSerializer.cs | 5 +- .../Json/ODataJsonValidationUtils.cs | 7 +- .../Json/ODataJsonValueSerializer.cs | 18 +- .../Json/ODataJsonWriter.cs | 11 +- .../Json/ODataJsonWriterUtils.cs | 8 +- .../Json/PooledByteBufferWriter.cs | 3 +- .../Json/ReorderingJsonReader.cs | 11 +- src/Microsoft.OData.Core/MediaTypeUtils.cs | 15 +- .../MessageStreamWrapper.cs | 3 +- .../Metadata/BufferingXmlReader.cs | 5 +- .../Metadata/EdmLibraryExtensions.cs | 29 +- .../Metadata/EdmTypeWriterResolver.cs | 3 +- .../Metadata/MetadataUtils.cs | 5 +- .../Metadata/ODataXmlErrorDeserializer.cs | 5 +- .../Metadata/XmlReaderExtensions.cs | 3 +- .../Microsoft.OData.Core.cs | 936 -- .../Microsoft.OData.Core.csproj | 44 +- .../Microsoft.OData.Core.tt | 19 - .../Microsoft.OData.Core.txt | 1000 --- .../ODataMultipartMixedBatchFormat.cs | 3 +- .../ODataMultipartMixedBatchReader.cs | 29 +- .../ODataMultipartMixedBatchReaderStream.cs | 25 +- .../ODataMultipartMixedBatchWriter.cs | 7 +- .../ODataMultipartMixedBatchWriterUtils.cs | 5 +- .../ODataAsynchronousReader.cs | 35 +- .../ODataAsynchronousResponseMessage.cs | 3 +- .../ODataAsynchronousWriter.cs | 13 +- .../ODataCollectionReaderCore.cs | 9 +- .../ODataCollectionReaderCoreAsync.cs | 3 +- .../ODataCollectionWriterCore.cs | 29 +- .../ODataContentTypeException.cs | 3 +- .../ODataContextUriBuilder.cs | 15 +- .../ODataContextUrlInfo.cs | 7 +- .../ODataErrorException.cs | 5 +- src/Microsoft.OData.Core/ODataException.cs | 3 +- src/Microsoft.OData.Core/ODataInputContext.cs | 3 +- .../ODataInstanceAnnotation.cs | 9 +- src/Microsoft.OData.Core/ODataMediaType.cs | 3 +- src/Microsoft.OData.Core/ODataMessage.cs | 11 +- .../ODataMessageReader.cs | 53 +- .../ODataMessageWriter.cs | 33 +- .../ODataMetadataFormat.cs | 3 +- .../ODataMetadataInputContext.cs | 5 +- .../ODataMetadataJsonInputContext.cs | 3 +- .../ODataMetadataJsonOutputContext.cs | 5 +- .../ODataMetadataOutputContext.cs | 5 +- .../ODataOutputContext.cs | 3 +- .../ODataParameterReaderCore.cs | 27 +- .../ODataParameterReaderCoreAsync.cs | 5 +- .../ODataParameterWriterCore.cs | 45 +- .../ODataPayloadValueConverter.cs | 14 +- .../ODataRawOutputContext.cs | 5 +- .../ODataRawValueUtils.cs | 3 +- src/Microsoft.OData.Core/ODataReaderCore.cs | 23 +- .../ODataReaderCoreAsync.cs | 13 +- .../ODataRequestMessage.cs | 7 +- src/Microsoft.OData.Core/ODataResource.cs | 5 +- .../ODataResourceSetBase.cs | 6 +- .../ODataResponseMessage.cs | 5 +- src/Microsoft.OData.Core/ODataStream.cs | 3 +- src/Microsoft.OData.Core/ODataStreamItem.cs | 3 +- .../ODataStreamPropertyInfo.cs | 3 +- src/Microsoft.OData.Core/ODataUtils.cs | 9 +- .../ODataUtilsInternal.cs | 3 +- src/Microsoft.OData.Core/ODataVersionCache.cs | 3 +- src/Microsoft.OData.Core/ODataWriterCore.cs | 97 +- .../Parameterized.Microsoft.OData.Core.cs | 7519 ---------------- .../Parameterized.Microsoft.OData.Core.tt | 19 - .../PropertyAndAnnotationCollector.cs | 30 +- src/Microsoft.OData.Core/RawValueWriter.cs | 5 +- .../ReadOnlyEnumerableExtensions.cs | 3 +- .../ReaderValidationUtils.cs | 51 +- ...ResourceSetWithoutExpectedTypeValidator.cs | 5 +- .../SRResources.Designer.cs | 7573 +++++++++++++++++ src/Microsoft.OData.Core/SRResources.resx | 2597 ++++++ .../SelectedPropertiesNode.cs | 6 +- src/Microsoft.OData.Core/TypeNameOracle.cs | 11 +- src/Microsoft.OData.Core/TypeUtils.cs | 3 +- src/Microsoft.OData.Core/Uri/ODataUri.cs | 3 +- .../Uri/ODataUriConversionUtils.cs | 10 +- src/Microsoft.OData.Core/Uri/ODataUriUtils.cs | 4 +- .../AggregateTransformationNode.cs | 3 - .../UriParser/Aggregation/ApplyBinder.cs | 10 +- .../UriParser/Binders/BinaryOperatorBinder.cs | 6 +- .../UriParser/Binders/BindingState.cs | 4 +- .../UriParser/Binders/CountSegmentBinder.cs | 4 +- .../Binders/DottedIdentifierBinder.cs | 7 +- .../UriParser/Binders/EndPathBinder.cs | 10 +- .../UriParser/Binders/FilterBinder.cs | 6 +- .../UriParser/Binders/FunctionCallBinder.cs | 28 +- .../UriParser/Binders/InBinder.cs | 10 +- .../UriParser/Binders/InnerPathTokenBinder.cs | 10 +- .../UriParser/Binders/KeyBinder.cs | 8 +- .../UriParser/Binders/LambdaBinder.cs | 8 +- .../UriParser/Binders/MetadataBinder.cs | 15 +- .../UriParser/Binders/MetadataBindingUtils.cs | 8 +- .../UriParser/Binders/OrderByBinder.cs | 4 +- .../UriParser/Binders/ParameterAliasBinder.cs | 3 +- .../UriParser/Binders/RangeVariableBinder.cs | 4 +- .../UriParser/Binders/SearchBinder.cs | 2 - .../UriParser/Binders/SelectExpandBinder.cs | 40 +- .../Binders/SelectExpandPathBinder.cs | 8 +- .../Binders/SelectPathSegmentTokenBinder.cs | 11 +- .../UriParser/Binders/UnaryOperatorBinder.cs | 6 +- .../UriParser/CustomUriFunctions.cs | 5 +- .../UriParser/CustomUriLiteralPrefixes.cs | 4 +- .../UriParser/ExceptionUtil.cs | 7 +- .../UriParser/ExpressionLexer.cs | 26 +- .../ExpressionLexerLiteralExtensions.cs | 8 +- .../UriParser/ExpressionToken.cs | 3 +- .../UriParser/ODataQueryOptionParser.cs | 13 +- .../ODataUnrecognizedPathException.cs | 3 +- .../UriParser/ODataUriParser.cs | 14 +- .../UriParser/ODataUriParserSettings.cs | 16 +- .../UriParser/Parsers/CountSegmentParser.cs | 7 +- .../Parsers/CustomUriLiteralParsers.cs | 12 +- .../Parsers/ExpandDepthAndCountValidator.cs | 8 +- .../UriParser/Parsers/FunctionCallParser.cs | 8 +- .../Parsers/FunctionOverloadResolver.cs | 28 +- .../Parsers/FunctionParameterParser.cs | 6 +- .../UriParser/Parsers/IdentifierTokenizer.cs | 4 +- .../UriParser/Parsers/ODataPathParser.cs | 68 +- .../UriParser/Parsers/SearchParser.cs | 10 +- .../UriParser/Parsers/SegmentKeyHandler.cs | 4 +- .../Parsers/SelectExpandOptionParser.cs | 32 +- .../UriParser/Parsers/SelectExpandParser.cs | 8 +- .../Parsers/SelectExpandTermParser.cs | 18 +- .../UriParser/Parsers/UriParserHelper.cs | 6 +- .../UriParser/Parsers/UriPathParser.cs | 7 +- .../Parsers/UriPrimitiveTypeParser.cs | 6 +- .../Parsers/UriQueryExpressionParser.cs | 56 +- .../UriParser/QueryNodeUtils.cs | 4 +- .../UriParser/QueryOptionUtils.cs | 5 +- .../Resolver/AlternateKeysODataUriResolver.cs | 5 +- .../UriParser/Resolver/ODataUriResolver.cs | 19 +- .../Resolver/StringAsEnumResolver.cs | 3 +- .../UriParser/SearchLexer.cs | 9 +- .../AggregatedCollectionPropertyNode.cs | 6 +- .../SemanticAst/BatchReferenceSegment.cs | 6 +- .../SemanticAst/BinaryOperatorNode.cs | 1 - .../SemanticAst/CollectionComplexNode.cs | 4 +- .../SemanticAst/CollectionFunctionCallNode.cs | 4 +- .../SemanticAst/CollectionNavigationNode.cs | 4 +- .../CollectionOpenPropertyAccessNode.cs | 1 - .../CollectionPropertyAccessNode.cs | 6 +- .../CollectionResourceFunctionCallNode.cs | 4 +- .../UriParser/SemanticAst/CountNode.cs | 1 - .../UriParser/SemanticAst/InNode.cs | 4 +- .../SemanticAst/NonResourceRangeVariable.cs | 4 +- .../UriParser/SemanticAst/ODataExpandPath.cs | 8 +- .../UriParser/SemanticAst/ODataPath.cs | 1 + .../SemanticAst/ODataPathExtensions.cs | 1 + .../UriParser/SemanticAst/ODataSelectPath.cs | 10 +- .../SemanticAst/OperationImportSegment.cs | 9 +- .../UriParser/SemanticAst/OperationSegment.cs | 9 +- .../SemanticAst/SingleComplexNode.cs | 4 +- .../SemanticAst/SingleNavigationNode.cs | 6 +- .../SingleValueFunctionCallNode.cs | 4 +- .../SingleValuePropertyAccessNode.cs | 6 +- .../UriParser/SemanticAst/ValueSegment.cs | 4 +- .../UriParser/TypePromotionUtils.cs | 6 +- .../UriParser/UriEdmHelpers.cs | 7 +- src/Microsoft.OData.Core/UriUtils.cs | 5 +- .../UrlValidation/Rules/RequireSelectRules.cs | 3 +- .../ValidationEngine/ODataUrlValidator.cs | 3 +- src/Microsoft.OData.Core/ValidationUtils.cs | 55 +- .../Value/ODataPrimitiveValue.cs | 5 +- .../Value/ODataValueUtils.cs | 1 + .../WriterValidationUtils.cs | 72 +- src/Microsoft.OData.Core/WriterValidator.cs | 7 +- src/Microsoft.OData.Edm/Csdl/CsdlReader.cs | 12 +- src/Microsoft.OData.Edm/Csdl/CsdlWriter.cs | 4 +- src/Microsoft.OData.Edm/Csdl/CsdlXmlWriter.cs | 4 +- .../Csdl/EdmParseException.cs | 3 +- .../Csdl/EdmValueParser.cs | 3 +- .../Csdl/EdmValueWriter.cs | 2 +- .../Csdl/JsonElementExtensions.cs | 10 +- .../Csdl/Parsing/AnnotationJsonParser.cs | 6 +- .../Parsing/Common/EdmXmlDocumentParser.cs | 36 +- .../Csdl/Parsing/Common/XmlDocumentParser.cs | 20 +- .../Csdl/Parsing/CsdlDocumentParser.cs | 4 +- .../Csdl/Parsing/CsdlDocumentParserBase.cs | 10 +- .../Csdl/Parsing/CsdlJsonParser.cs | 6 +- .../Csdl/Parsing/CsdlParser.cs | 4 +- .../Csdl/Parsing/SchemaJsonParser.cs | 12 +- src/Microsoft.OData.Edm/Csdl/SchemaWriter.cs | 8 +- .../BadElements/UnresolvedComplexType.cs | 2 +- .../BadElements/UnresolvedEntityContainer.cs | 2 +- .../BadElements/UnresolvedEntitySet.cs | 2 +- .../BadElements/UnresolvedEntityType.cs | 2 +- .../BadElements/UnresolvedEnumMember.cs | 2 +- .../BadElements/UnresolvedEnumType.cs | 2 +- .../BadElements/UnresolvedLabeledElement.cs | 2 +- .../UnresolvedNavigationPropertyPath.cs | 2 +- .../BadElements/UnresolvedParameter.cs | 2 +- .../BadElements/UnresolvedPrimitiveType.cs | 2 +- .../BadElements/UnresolvedProperty.cs | 2 +- .../Semantics/BadElements/UnresolvedReturn.cs | 2 +- .../Semantics/BadElements/UnresolvedType.cs | 2 +- .../Semantics/CsdlSemanticsApplyExpression.cs | 6 +- .../CsdlSemanticsBinaryConstantExpression.cs | 2 +- .../CsdlSemanticsBooleanConstantExpression.cs | 2 +- .../CsdlSemanticsDateConstantExpression.cs | 2 +- ...manticsDateTimeOffsetConstantExpression.cs | 2 +- .../CsdlSemanticsDecimalConstantExpression.cs | 2 +- ...CsdlSemanticsDurationConstantExpression.cs | 2 +- .../Semantics/CsdlSemanticsEntityContainer.cs | 4 +- .../Csdl/Semantics/CsdlSemanticsEnumMember.cs | 2 +- .../CsdlSemanticsEnumMemberExpression.cs | 4 +- ...CsdlSemanticsFloatingConstantExpression.cs | 2 +- .../CsdlSemanticsGuidConstantExpression.cs | 2 +- .../CsdlSemanticsIntConstantExpression.cs | 2 +- .../Csdl/Semantics/CsdlSemanticsModel.cs | 2 +- .../CsdlSemanticsNavigationProperty.cs | 2 +- ...sdlSemanticsTimeOfDayConstantExpression.cs | 2 +- .../CsdlSemanticsVocabularyAnnotation.cs | 4 +- .../EdmModelCsdlSchemaJsonWriter.cs | 4 +- .../EdmModelCsdlSchemaXmlWriter.cs | 6 +- .../EdmModelCsdlSerializationVisitor.cs | 4 +- .../Serialization/SerializationValidator.cs | 12 +- .../Csdl/SerializationExtensionMethods.cs | 2 +- src/Microsoft.OData.Edm/EdmModelVisitor.cs | 42 +- src/Microsoft.OData.Edm/EdmUtil.cs | 6 +- .../ExtensionMethods/EdmElementComparer.cs | 2 +- .../ExtensionMethods/EdmTypeSemantics.cs | 6 +- .../ExtensionMethods/ExtensionMethods.cs | 36 +- .../ExtensionMethods/TargetPathHelper.cs | 4 +- .../Microsoft.OData.Edm.cs | 415 - .../Microsoft.OData.Edm.csproj | 39 +- .../Microsoft.OData.Edm.tt | 19 - .../Microsoft.OData.Edm.txt | 348 - .../Parameterized.Microsoft.OData.Edm.cs | 2724 ------ .../Parameterized.Microsoft.OData.Edm.tt | 19 - src/Microsoft.OData.Edm/RegistrationHelper.cs | 6 +- .../SRResources.Designer.cs | 2870 +++++++ src/Microsoft.OData.Edm/SRResources.resx | 1050 +++ .../Schema/AmbiguousBinding.cs | 2 +- .../Schema/CoreModel/EdmCoreModel.cs | 12 +- .../Schema/CyclicComplexType.cs | 2 +- .../Schema/CyclicEntityContainer.cs | 2 +- .../Schema/CyclicEntityType.cs | 2 +- src/Microsoft.OData.Edm/Schema/Date.cs | 12 +- .../Schema/EdmBinaryTypeReference.cs | 2 +- .../Schema/EdmEntityContainer.cs | 4 +- .../Schema/EdmEntityType.cs | 2 +- src/Microsoft.OData.Edm/Schema/EdmModel.cs | 4 +- .../Schema/EdmNavigationProperty.cs | 10 +- .../Schema/EdmNavigationSource.cs | 4 +- .../Schema/EdmPathExpression.cs | 2 +- .../Schema/EdmReferentialConstraint.cs | 2 +- .../Schema/EdmStringTypeReference.cs | 2 +- .../Schema/EdmStructuredType.cs | 2 +- .../Schema/EdmTargetPath.cs | 6 +- src/Microsoft.OData.Edm/Schema/TimeOfDay.cs | 10 +- .../Validation/DuplicateOperationValidator.cs | 6 +- .../Validation/ExpressionTypeChecker.cs | 58 +- .../Validation/InterfaceValidator.cs | 20 +- .../Validation/ValidationHelper.cs | 10 +- .../Validation/ValidationRuleSet.cs | 4 +- .../Validation/ValidationRules.cs | 214 +- .../Annotations/IEdmTermExtensions.cs | 28 +- .../Vocabularies/EdmExpressionEvaluator.cs | 14 +- .../Vocabularies/EdmToClrConverter.cs | 18 +- ...EdmLabeledExpressionReferenceExpression.cs | 2 +- .../Vocabularies/Values/EdmPropertyValue.cs | 2 +- .../Geography/GeoJsonObjectReader.cs | 32 +- .../Geography/GeographyPointImplementation.cs | 8 +- .../Geometry/GeometryPointImplementation.cs | 8 +- src/Microsoft.Spatial/Gml/GmlReader.cs | 32 +- src/Microsoft.Spatial/Gml/GmlWriter.cs | 2 +- src/Microsoft.Spatial/Microsoft.Spatial.cs | 147 - .../Microsoft.Spatial.csproj | 42 +- src/Microsoft.Spatial/Microsoft.Spatial.tt | 19 - src/Microsoft.Spatial/Microsoft.Spatial.txt | 59 - .../Parameterized.Microsoft.Spatial.cs | 451 - .../Parameterized.Microsoft.Spatial.tt | 19 - src/Microsoft.Spatial/SRResources.Designer.cs | 441 + src/Microsoft.Spatial/SRResources.resx | 227 + .../Spatial/SpatialImplementation.cs | 2 +- .../Spatial/SpatialTreeBuilder.cs | 2 +- .../Spatial/SpatialValidatorImplementation.cs | 44 +- .../WellKnown/WellKnownTextLexer.cs | 2 +- .../WellKnown/WellKnownTextSqlReader.cs | 10 +- src/PlatformHelper.cs | 103 +- .../ALinq/AddNewEndingTokenVisitorTests.cs | 3 +- .../ALinq/DollarApplyGroupByTests.cs | 2 +- .../ALinq/RemoveWildcardVisitorTests.cs | 2 +- .../SelectExpandPathToStringVisitorTests.cs | 2 +- .../DataServiceQueryProviderTests.cs | 2 +- .../Metadata/ClientTypeUtilTests.cs | 2 +- .../AnnotationFilterPatternTests.cs | 9 +- .../BufferUtilsTests.cs | 5 +- .../DuplicatePropertyNamesCheckerTests.cs | 14 +- .../ODataConventionalUriBuilderTests.cs | 5 +- .../ODataEntryMetadataContextTest.cs | 19 +- .../Evaluation/ODataMetadataContextTests.cs | 3 +- .../HttpHeaderValueLexerTests.cs | 33 +- .../HttpUtilsTests.cs | 9 +- .../AutoComputeETagInJsonIntegrationTests.cs | 4 +- ...tePayloadMetadataInJsonIntegrationTests.cs | 11 +- .../Json/FeedAnnotationIntegrationTests.cs | 22 +- .../ODataJsonReaderEnumIntegrationTests.cs | 9 +- .../Json/ODataJsonReaderIntegrationTests.cs | 11 +- ...pertyAndValueJsonReaderIntegrationTests.cs | 12 +- ...nstanceAnnotationWriterIntegrationTests.cs | 13 +- .../DeltaLinkJsonWriterIntegrationTests.cs | 9 +- .../ODataJsonWriterEnumIntegrationTests.cs | 5 +- .../Json/ODataJsonWriterIntegrationTests.cs | 12 +- ...DataJsonWriterShortSpanIntegrationTests.cs | 15 +- ...pertyAndValueJsonWriterIntegrationTests.cs | 2 +- .../UriParameterWriterIntegrationTests.cs | 3 +- .../Json/JsonFullMetadataLevelTests.cs | 4 +- .../JsonInstanceAnnotationWriterAsyncTests.cs | 4 +- .../Json/JsonInstanceAnnotationWriterTests.cs | 14 +- .../Json/JsonReaderTests.cs | 55 +- .../Json/ODataAnnotationNamesTests.cs | 3 +- .../Json/ODataJsonBatchReaderTests.cs | 21 +- .../Json/ODataJsonBatchWriterTests.cs | 40 +- .../ODataJsonCollectionDeserializerTests.cs | 18 +- .../Json/ODataJsonCollectionWriterTests.cs | 15 +- .../Json/ODataJsonContextUriParserTests.cs | 1 - .../Json/ODataJsonDeltaReaderTests.cs | 9 +- .../Json/ODataJsonDeltaWriterTests.cs | 55 +- .../Json/ODataJsonDeserializerTests.cs | 116 +- ...aJsonEntityReferenceLinkSerializerTests.cs | 5 +- .../ODataJsonEntryAndFeedDeserializerTests.cs | 10 +- ...EntryAndFeedDeserializerUndeclaredTests.cs | 10 +- .../ODataJsonEntryAndFeedSerializerTests.cs | 12 +- ...onEntryAndFeedSerializerUndecalredTests.cs | 3 +- .../Json/ODataJsonErrorDeserializerTests.cs | 18 +- .../Json/ODataJsonOutputContextApiTests.cs | 123 +- .../Json/ODataJsonOutputContextTests.cs | 8 +- .../ODataJsonParameterDeserializerTests.cs | 14 +- .../Json/ODataJsonParameterReaderTests.cs | 5 +- .../Json/ODataJsonParameterWriterTests.cs | 21 +- .../Json/ODataJsonPropertySerializerTests.cs | 3 +- .../Json/ODataJsonReaderTests.cs | 8 +- .../ODataJsonResourceDeserializerTests.cs | 60 +- .../Json/ODataJsonSerializerTests.cs | 7 +- ...ataJsonServiceDocumentDeserializerTests.cs | 38 +- ...ODataJsonServiceDocumentSerializerTests.cs | 11 +- .../Json/ODataJsonValidationUtilsTests.cs | 22 +- .../ODataJsonValueSerializerAsyncTests.cs | 8 +- .../Json/ODataJsonValueSerializerTests.cs | 13 +- .../Json/ODataJsonWriterTests.cs | 44 +- .../Json/PooledByteBufferWriterTests.cs | 5 +- .../Json/ReorderingJsonReaderTests.cs | 8 +- .../MediaTypeUtilsTests.cs | 6 +- .../NavigationPropertyOnComplexTests.cs | 3 +- .../ODataAsynchronousReaderTests.cs | 13 +- .../ODataAsynchronousWriterTests.cs | 7 +- .../ODataBatchReaderStreamTests.cs | 4 +- ...taCollectionStartSerializationInfoTests.cs | 3 +- .../ODataContextUriBuilderTests.cs | 15 +- .../ODataEntityReferenceLinkTests.cs | 50 +- .../ODataEntityReferenceLinksTests.cs | 6 +- .../ODataFeedTests.cs | 5 +- .../ODataInstanceAnnotationTests.cs | 9 +- .../ODataMessageReaderSettingsTests.cs | 13 +- .../ODataMessageReaderTests.cs | 4 +- .../ODataMessageWriterSettingsTests.cs | 8 +- .../ODataMessageWriterTests.cs | 7 +- ...ultipartMixedBatchOutputContextApiTests.cs | 13 +- .../ODataMultipartMixedBatchWriterTests.cs | 7 +- .../ODataOperationTests.cs | 15 +- .../ODataPreferenceHeaderTests.cs | 3 +- .../ODataPrimitiveValueTests.cs | 6 +- .../ODataPropertyTests.cs | 3 +- .../ODataRawInputContextTests.cs | 8 +- .../ODataRawOutputContextApiTests.cs | 5 +- .../ODataRawOutputContextTests.cs | 5 +- .../ODataReaderDerivedTypeConstraintTests.cs | 19 +- .../ODataRequestMessageTests.cs | 3 +- .../ODataResourceTests.cs | 5 +- .../ODataUtilsTests.cs | 3 +- .../ODataWriterCoreTests.cs | 3 +- .../ODataWriterDerivedTypeConstraintTests.cs | 21 +- .../ODataWriterValidationTests.cs | 173 +- .../Query/ODataUriUtilsTests.cs | 21 +- .../ReadOnlyEnumerableTests.cs | 14 +- .../DisablePrimitiveTypeConversionTests.cs | 4 +- .../Reader/Json/DateReaderJsonTests.cs | 4 +- .../Reader/Json/DateTimeReaderJsonTests.cs | 4 +- .../Json/ODataJsonSingletonReaderTests.cs | 3 +- .../Reader/Json/TimeOfDayReaderJsonTests.cs | 4 +- .../Reader/MetadataReaderTests.cs | 5 +- .../Roundtrip/ContextUrlWriterReaderTests.cs | 1 + .../Json/AsyncBatchRoundtripJsonTests.cs | 49 +- .../Json/ODataJsonBatchAtomicityGroupTests.cs | 14 +- .../Streaming/ODataJsonStreamReadingTests.cs | 7 +- .../Streaming/ODataJsonStreamWritingTests.cs | 13 +- .../UriParser/CountFunctionalTests.cs | 8 +- .../UriParser/CustomUriFunctionsTests.cs | 7 +- .../EntityReferenceFunctionalTests.cs | 24 +- .../UriParser/EnumFilterFunctionalTests.cs | 29 +- .../UriParser/ExpandOptionFunctionalTests.cs | 21 +- .../FilterAndOrderByFunctionalTests.cs | 110 +- .../UriParser/FullUriFunctionalTests.cs | 4 +- .../OpenPropertiesFunctionalTests.cs | 8 +- .../ParameterAliasFunctionalTests.cs | 33 +- .../UriParser/PathFunctionalTests.cs | 120 +- .../UriParser/SearchFunctionalTests.cs | 25 +- .../UriParser/SelectExpandFunctionalTests.cs | 54 +- .../UriParser/SemanticTreeFunctionalTests.cs | 12 +- .../UriParser/SetBasedOperationTests.cs | 14 +- .../UriParser/SpatialFuntionalTests.cs | 8 +- .../UriParser/TopAndSkipFunctionalTests.cs | 7 +- .../CommonWritingValidationScenarioTests.cs | 5 +- ...JsonInheritComplexCollectionWriterTests.cs | 5 +- .../SelectedPropertiesNodeTests.cs | 10 +- .../Binders/BinaryOperatorBinderTests.cs | 15 +- .../Binders/DottedIdentifierBinderTests.cs | 10 +- .../UriParser/Binders/EndPathBinderTests.cs | 11 +- .../UriParser/Binders/ExpandBinderTests.cs | 8 +- .../Binders/FunctionCallBinderTests.cs | 70 +- .../Binders/InnerPathTokenBinderTests.cs | 8 +- .../UriParser/Binders/KeyBinderTests.cs | 5 +- .../UriParser/Binders/LambdaBinderTests.cs | 7 +- .../UriParser/Binders/MetadataBindingTests.cs | 12 +- .../Binders/MetadataBindingUtilsTests.cs | 11 +- .../UriParser/Binders/SelectBinderTests.cs | 13 +- .../Binders/SelectExpandPathBinderTests.cs | 6 +- .../SelectPathSegmentTokenBinderTests.cs | 8 +- .../Binders/UnaryOperatorBinderTests.cs | 5 +- .../UriParser/ExceptionUtilTests.cs | 7 +- .../UriParser/ExpressionLexerTests.cs | 36 +- .../CaseInsensitiveBuiltinIdentifierTests.cs | 131 +- .../Metadata/CaseInsensitiveResolverTests.cs | 69 +- .../Metadata/ODataUriResolverTests.cs | 13 +- .../OpenTypeUnqualifiedExtensionTests.cs | 25 +- .../UnqualifiedODataUriResolverTests.cs | 27 +- .../UriParser/ODataQueryOptionParserTests.cs | 11 +- .../UriParser/ODataUriParserTests.cs | 60 +- .../Parsers/CustomUriLiteralParserTests.cs | 5 +- .../Parsers/CustomUriLiteralPrefixesTests.cs | 11 +- .../ExpandDepthAndCountValidatorTests.cs | 20 +- .../Parsers/FunctionCallParserTests.cs | 8 +- .../Parsers/FunctionOverloadResolverTests.cs | 14 +- .../Parsers/FunctionParameterParserTests.cs | 10 +- .../Parsers/IdentifierTokenizerTests.cs | 4 +- .../UriParser/Parsers/ODataPathParserTests.cs | 60 +- .../Parsers/ODataPathParserTypeCastTests.cs | 22 +- .../UriParser/Parsers/SearchParserTests.cs | 9 +- .../Parsers/SegmentKeyHandlerTests.cs | 4 +- .../Parsers/SelectExpandOptionParserTests.cs | 25 +- .../Parsers/SelectExpandParserTests.cs | 44 +- .../Parsers/SelectExpandTermParserTests.cs | 28 +- .../UriParser/Parsers/UriPathParserTests.cs | 5 +- .../Parsers/UriQueryExpressionParserTests.cs | 60 +- .../Parsers/UriTemplateParserTests.cs | 41 +- .../UriParser/SearchLexerTests.cs | 17 +- .../UriParser/SegmentAssertions.cs | 1 + .../SemanticAst/BatchReferenceSegmentTests.cs | 10 +- .../CollectionFunctionCallNodeTests.cs | 4 +- .../CollectionNavigationNodeTests.cs | 4 +- .../CollectionPropertyAccessNodeTests.cs | 5 +- ...CollectionResourceFunctionCallNodeTests.cs | 4 +- .../UriParser/SemanticAst/KeySegmentTests.cs | 3 +- .../NonResourceRangeVariableTests.cs | 3 +- .../SemanticAst/ODataExpandPathTests.cs | 8 +- .../SemanticAst/ODataPathExtensionsTests.cs | 4 +- .../SemanticAst/ODataSelectPathTests.cs | 14 +- .../SingleValueFunctionCallNodeTests.cs | 6 +- .../SingleValuePropertyAccessNodeTests.cs | 6 +- .../UriParser/SemanticAst/TypeSegmentTests.cs | 3 +- .../SemanticAst/ValueSegmentTests.cs | 4 +- .../UriParser/UriEdmHelpersTests.cs | 5 +- .../UrlValidation/ODataUrlValidatorTests.cs | 3 +- .../ValidationHelper.cs | 1 + .../ValidationUtilsTests.cs | 9 +- .../Csdl/CsdlReaderJsonTests.cs | 4 +- .../Csdl/CsdlReaderTests.cs | 6 +- .../Csdl/CsdlWriterTests.TargetPath.cs | 2 +- .../CsdlWriterTests.VocabularyAnnotation.cs | 2 +- .../CsdlSemanticsEntityContainerTests.cs | 4 +- .../EdmModelCsdlSchemaWriterTests.Async.cs | 2 +- .../EdmModelCsdlSchemaWriterTests.cs | 2 +- .../ExtensionMethods/ExtensionMethodTests.cs | 22 +- .../ExtensionMethods/TargetHelperTests.cs | 4 +- ...tionsRelationshipChangesAcceptanceTests.cs | 4 +- ...OasisRelationshipChangesAcceptanceTests.cs | 57 +- .../Schema/DateAndTimeOfDayTests.cs | 28 +- .../Schema/EdmReferentialConstraintTests.cs | 4 +- .../Schema/EdmTargetPathTests.cs | 6 +- .../DuplicateOperationValidatorTests.cs | 22 +- .../Validation/ValidationRulesTests.cs | 136 +- .../GeoJsonObjectReaderTests.cs | 52 +- .../GeographyBuilderImplementationTests.cs | 6 +- .../GeographyPointTests.cs | 4 +- .../Microsoft.Spatial.Tests/GmlReaderTests.cs | 24 +- .../SpatialPipelineTests.cs | 8 +- .../SpatialValidatorImplementationTests.cs | 20 +- .../SpatialValidatorTests.cs | 16 +- .../WellKnownTextSqlFormatterTests.cs | 12 +- 638 files changed, 22469 insertions(+), 21557 deletions(-) delete mode 100644 src/Microsoft.OData.Client/Microsoft.OData.Client.Common.txt delete mode 100644 src/Microsoft.OData.Client/Microsoft.OData.Client.Desktop.txt delete mode 100644 src/Microsoft.OData.Client/Microsoft.OData.Client.cs delete mode 100644 src/Microsoft.OData.Client/Microsoft.OData.Client.tt delete mode 100644 src/Microsoft.OData.Client/Microsoft.OData.Client.txt delete mode 100644 src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.cs delete mode 100644 src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.tt create mode 100644 src/Microsoft.OData.Client/SRResources.Designer.cs create mode 100644 src/Microsoft.OData.Client/SRResources.resx delete mode 100644 src/Microsoft.OData.Core/Microsoft.OData.Core.cs delete mode 100644 src/Microsoft.OData.Core/Microsoft.OData.Core.tt delete mode 100644 src/Microsoft.OData.Core/Microsoft.OData.Core.txt delete mode 100644 src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.cs delete mode 100644 src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.tt create mode 100644 src/Microsoft.OData.Core/SRResources.Designer.cs create mode 100644 src/Microsoft.OData.Core/SRResources.resx delete mode 100644 src/Microsoft.OData.Edm/Microsoft.OData.Edm.cs delete mode 100644 src/Microsoft.OData.Edm/Microsoft.OData.Edm.tt delete mode 100644 src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt delete mode 100644 src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs delete mode 100644 src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.tt create mode 100644 src/Microsoft.OData.Edm/SRResources.Designer.cs create mode 100644 src/Microsoft.OData.Edm/SRResources.resx delete mode 100644 src/Microsoft.Spatial/Microsoft.Spatial.cs delete mode 100644 src/Microsoft.Spatial/Microsoft.Spatial.tt delete mode 100644 src/Microsoft.Spatial/Microsoft.Spatial.txt delete mode 100644 src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.cs delete mode 100644 src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.tt create mode 100644 src/Microsoft.Spatial/SRResources.Designer.cs create mode 100644 src/Microsoft.Spatial/SRResources.resx diff --git a/src/Microsoft.OData.Client/ALinq/ALinqExpressionVisitor.cs b/src/Microsoft.OData.Client/ALinq/ALinqExpressionVisitor.cs index 4d0e2ac157..f956205018 100644 --- a/src/Microsoft.OData.Client/ALinq/ALinqExpressionVisitor.cs +++ b/src/Microsoft.OData.Client/ALinq/ALinqExpressionVisitor.cs @@ -97,7 +97,7 @@ internal virtual Expression Visit(Expression exp) case ExpressionType.ListInit: return this.VisitListInit((ListInitExpression)exp); default: - throw new NotSupportedException(Strings.ALinq_UnsupportedExpression(exp.NodeType.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_UnsupportedExpression, exp.NodeType.ToString())); } } @@ -117,7 +117,7 @@ internal virtual MemberBinding VisitBinding(MemberBinding binding) case MemberBindingType.ListBinding: return this.VisitMemberListBinding((MemberListBinding)binding); default: - throw new NotSupportedException(Strings.ALinq_UnsupportedExpression(binding.BindingType.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_UnsupportedExpression, binding.BindingType.ToString())); } } diff --git a/src/Microsoft.OData.Client/ALinq/AddNewEndingTokenVisitor.cs b/src/Microsoft.OData.Client/ALinq/AddNewEndingTokenVisitor.cs index 7ec7d1ae99..971add668a 100644 --- a/src/Microsoft.OData.Client/ALinq/AddNewEndingTokenVisitor.cs +++ b/src/Microsoft.OData.Client/ALinq/AddNewEndingTokenVisitor.cs @@ -34,7 +34,7 @@ public AddNewEndingTokenVisitor(PathSegmentToken newTokenToAdd) /// The system token to traverse public void Visit(SystemToken tokenIn) { - throw new NotSupportedException(Strings.ALinq_IllegalSystemQueryOption(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, tokenIn.Identifier)); } /// diff --git a/src/Microsoft.OData.Client/ALinq/DataServiceQueryProvider.cs b/src/Microsoft.OData.Client/ALinq/DataServiceQueryProvider.cs index 014d58b274..dfa0a3934d 100644 --- a/src/Microsoft.OData.Client/ALinq/DataServiceQueryProvider.cs +++ b/src/Microsoft.OData.Client/ALinq/DataServiceQueryProvider.cs @@ -343,7 +343,7 @@ private TElement ParseAggregateSingletonResult(QueryResult queryResult } // Failed to retrieve the aggregate result for whatever reason - throw new DataServiceQueryException(Strings.DataServiceRequest_FailGetValue); + throw new DataServiceQueryException(SRResources.DataServiceRequest_FailGetValue); } } } diff --git a/src/Microsoft.OData.Client/ALinq/ExpandOnlyPathToStringVisitor.cs b/src/Microsoft.OData.Client/ALinq/ExpandOnlyPathToStringVisitor.cs index 7c48d2395b..fd94f579c5 100644 --- a/src/Microsoft.OData.Client/ALinq/ExpandOnlyPathToStringVisitor.cs +++ b/src/Microsoft.OData.Client/ALinq/ExpandOnlyPathToStringVisitor.cs @@ -33,7 +33,7 @@ internal class ExpandOnlyPathToStringVisitor : IPathSegmentTokenVisitor /// Always throws, since a system token is invalid in an expand path. public string Visit(SystemToken tokenIn) { - throw new NotSupportedException(Strings.ALinq_IllegalSystemQueryOption(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, tokenIn.Identifier)); } /// @@ -51,7 +51,7 @@ public string Visit(NonSystemToken tokenIn) } else { - throw new NotSupportedException(Strings.ALinq_TypeTokenWithNoTrailingNavProp(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_TypeTokenWithNoTrailingNavProp, tokenIn.Identifier)); } } else diff --git a/src/Microsoft.OData.Client/ALinq/ExpressionWriter.cs b/src/Microsoft.OData.Client/ALinq/ExpressionWriter.cs index 9a96d58fa7..5e32868e79 100644 --- a/src/Microsoft.OData.Client/ALinq/ExpressionWriter.cs +++ b/src/Microsoft.OData.Client/ALinq/ExpressionWriter.cs @@ -116,7 +116,7 @@ internal static string ExpressionToString(DataServiceContext context, Expression WebUtil.RaiseVersion(ref uriVersion, ew.uriVersion); if (ew.cantTranslateExpression) { - throw new NotSupportedException(Strings.ALinq_CantTranslateExpression(e.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantTranslateExpression, e.ToString())); } return serialized; @@ -229,7 +229,7 @@ internal override Expression VisitInputReferenceExpression(InputReferenceExpress // because we cannot reference 'this' as a standalone expression; however // if the parent is null for any reason, we fall back to the expression itself. string expressionText = (this.parent != null) ? this.parent.ToString() : ire.ToString(); - throw new NotSupportedException(Strings.ALinq_CantTranslateExpression(expressionText)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantTranslateExpression, expressionText)); } // Write "$it" for input parameter reference inside any/all methods @@ -426,7 +426,7 @@ internal override Expression VisitMethodCall(MethodCallExpression m) string declaringType = this.context.ResolveNameFromTypeInternal(m.Method.DeclaringType); if (string.IsNullOrEmpty(declaringType)) { - throw new NotSupportedException(Strings.ALinq_CantTranslateExpression(m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantTranslateExpression, m.ToString())); } int index = declaringType.LastIndexOf('.'); @@ -472,7 +472,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) { if (m.Member is FieldInfo) { - throw new NotSupportedException(Strings.ALinq_CantReferToPublicField(m.Member.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantReferToPublicField, m.Member.Name)); } Expression e = this.Visit(m.Expression); @@ -572,7 +572,7 @@ internal override Expression VisitConstant(ConstantExpression c) return c; } - throw new NotSupportedException(Strings.ALinq_CouldNotConvert(item)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CouldNotConvert, item)); } listExpr.Append(uriLiteral); @@ -581,7 +581,7 @@ internal override Expression VisitConstant(ConstantExpression c) // Contains cannot be used with an empty static collection if (listExpr.Length == 0) { - throw new InvalidOperationException(Strings.ALinq_ContainsNotValidOnEmptyCollection); + throw new InvalidOperationException(SRResources.ALinq_ContainsNotValidOnEmptyCollection); } listExpr.Insert(0, UriHelper.LEFTPAREN); @@ -604,7 +604,7 @@ internal override Expression VisitConstant(ConstantExpression c) return c; } - throw new NotSupportedException(Strings.ALinq_CouldNotConvert(c.Value)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CouldNotConvert, c.Value)); } } @@ -666,7 +666,7 @@ internal override Expression VisitUnary(UnaryExpression u) case ExpressionType.TypeAs: if (u.Operand.NodeType == ExpressionType.TypeAs) { - throw new NotSupportedException(Strings.ALinq_CannotUseTypeFiltersMultipleTimes); + throw new NotSupportedException(SRResources.ALinq_CannotUseTypeFiltersMultipleTimes); } this.Visit(u.Operand); diff --git a/src/Microsoft.OData.Client/ALinq/GroupByAnalyzer.cs b/src/Microsoft.OData.Client/ALinq/GroupByAnalyzer.cs index efbe1d6b50..e57b6a9173 100644 --- a/src/Microsoft.OData.Client/ALinq/GroupByAnalyzer.cs +++ b/src/Microsoft.OData.Client/ALinq/GroupByAnalyzer.cs @@ -218,7 +218,7 @@ internal override NewExpression VisitNew(NewExpression nex) else if (nex.Arguments.Count > 0 && nex.Constructor.GetParameters().Length > 0) { // Constructor initialization in key selector not supported - throw new NotSupportedException(Strings.ALinq_InvalidGroupByKeySelector(nex)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidGroupByKeySelector, nex)); } return base.VisitNew(nex); diff --git a/src/Microsoft.OData.Client/ALinq/NewTreeBuilder.cs b/src/Microsoft.OData.Client/ALinq/NewTreeBuilder.cs index bd10daf172..90084e44d5 100644 --- a/src/Microsoft.OData.Client/ALinq/NewTreeBuilder.cs +++ b/src/Microsoft.OData.Client/ALinq/NewTreeBuilder.cs @@ -21,7 +21,7 @@ internal class NewTreeBuilder : IPathSegmentTokenVisitor /// Always throws, since a SystemToken is illegal in a select or expand path. public PathSegmentToken Visit(SystemToken tokenIn) { - throw new NotSupportedException(Strings.ALinq_IllegalSystemQueryOption(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, tokenIn.Identifier)); } /// diff --git a/src/Microsoft.OData.Client/ALinq/ProjectionAnalyzer.cs b/src/Microsoft.OData.Client/ALinq/ProjectionAnalyzer.cs index 35d221a9cf..5f46ac90f8 100644 --- a/src/Microsoft.OData.Client/ALinq/ProjectionAnalyzer.cs +++ b/src/Microsoft.OData.Client/ALinq/ProjectionAnalyzer.cs @@ -49,7 +49,7 @@ internal static bool Analyze(LambdaExpression le, ResourceExpression re, bool ma { if (ClientTypeUtil.TypeOrElementTypeIsEntity(le.Body.Type)) { - throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity); + throw new NotSupportedException(SRResources.ALinq_CannotCreateConstantEntity); } re.Projection = new ProjectionQueryOptionExpression(le.Body.Type, le, new List()); @@ -98,9 +98,9 @@ private static void Analyze(LambdaExpression e, SelectExpandPathBuilder pb, Data EntityProjectionAnalyzer.Analyze((MemberInitExpression)e.Body, pb, context); break; case ExpressionType.New: - throw new NotSupportedException(Strings.ALinq_CannotConstructKnownEntityTypes); + throw new NotSupportedException(SRResources.ALinq_CannotConstructKnownEntityTypes); case ExpressionType.Constant: - throw new NotSupportedException(Strings.ALinq_CannotCreateConstantEntity); + throw new NotSupportedException(SRResources.ALinq_CannotCreateConstantEntity); default: // ExpressionType.MemberAccess as a top-level expression is correctly // processed here, as the lambda isn't being member-initialized. @@ -145,7 +145,7 @@ internal static void CheckChainedSequence(MethodCallExpression call, Type type) MethodCallExpression insideCall = ResourceBinder.StripTo(call.Arguments[0]); if (insideCall != null && (ReflectionUtil.IsSequenceSelectMethod(insideCall.Method))) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(type, call.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, type, call.ToString())); } } } @@ -342,7 +342,7 @@ internal static void Analyze(MemberInitExpression mie, SelectExpandPathBuilder p Expression[] lastExpressions = analysis.GetExpressionsBeyondTargetEntity(); if (lastExpressions.Length == 0) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(targetType, ma.Expression)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, targetType, ma.Expression)); } MemberExpression lastExpression = lastExpressions[lastExpressions.Length - 1] as MemberExpression; @@ -362,7 +362,7 @@ internal static void Analyze(MemberInitExpression mie, SelectExpandPathBuilder p { if (lastExpression.Member.Name != ma.Member.Name) { - throw new NotSupportedException(Strings.ALinq_PropertyNamesMustMatchInProjections(lastExpression.Member.Name, ma.Member.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_PropertyNamesMustMatchInProjections, lastExpression.Member.Name, ma.Member.Name)); } // Unless we're initializing an entity, we should not traverse into the parameter in scope. @@ -370,7 +370,7 @@ internal static void Analyze(MemberInitExpression mie, SelectExpandPathBuilder p bool sourceIsEntity = ClientTypeUtil.TypeOrElementTypeIsEntity(lastExpression.Type); if (sourceIsEntity && !targetIsEntity) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(targetType, ma.Expression)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, targetType, ma.Expression)); } } } @@ -403,17 +403,17 @@ internal override Expression VisitUnary(UnaryExpression u) // In V3 while we support TypeAs conversions, we only support TypeAs before a MemberAccess and not TypeAs as the last operation // i.e. we support "Manager = (p as Employee).Manager" (see VisitMemberAccess for detail), but we don't support "Manager = (p as Manager)" // Note that the server also doesn't support a property path which ends with a type identifier. - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, u.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, u.ToString())); } internal override Expression VisitBinary(BinaryExpression b) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, b.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, b.ToString())); } internal override Expression VisitTypeIs(TypeBinaryExpression b) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, b.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, b.ToString())); } internal override Expression VisitConditional(ConditionalExpression c) @@ -425,12 +425,12 @@ internal override Expression VisitConditional(ConditionalExpression c) return c; } - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, c.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, c.ToString())); } internal override Expression VisitConstant(ConstantExpression c) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, c.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, c.ToString())); } internal override Expression VisitMemberAccess(MemberExpression m) @@ -443,7 +443,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) if (!ClientTypeUtil.TypeOrElementTypeIsEntity(m.Expression.Type) || IsCollectionProducingExpression(m.Expression)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, m.ToString())); } PropertyInfo pi; @@ -459,7 +459,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) return e; } - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, m.ToString())); } internal override Expression VisitMethodCall(MethodCallExpression m) @@ -470,7 +470,7 @@ internal override Expression VisitMethodCall(MethodCallExpression m) || m.Arguments.Any(a => IsDisallowedExpressionForMethodCall(a, this.context.Model)) || (m.Object == null && !ClientTypeUtil.TypeOrElementTypeIsEntity(m.Arguments[0].Type))) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, m.ToString())); } if (ProjectionAnalyzer.IsMethodCallAllowedEntitySequence(m)) @@ -482,12 +482,12 @@ internal override Expression VisitMethodCall(MethodCallExpression m) return base.VisitMethodCall(m); } - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, m.ToString())); } internal override Expression VisitInvocation(InvocationExpression iv) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, iv.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, iv.ToString())); } internal override Expression VisitLambda(LambdaExpression lambda) @@ -498,12 +498,12 @@ internal override Expression VisitLambda(LambdaExpression lambda) internal override Expression VisitListInit(ListInitExpression init) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, init.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, init.ToString())); } internal override Expression VisitNewArray(NewArrayExpression na) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, na.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, na.ToString())); } internal override Expression VisitMemberInit(MemberInitExpression init) @@ -511,7 +511,7 @@ internal override Expression VisitMemberInit(MemberInitExpression init) if (!ClientTypeUtil.TypeOrElementTypeIsEntity(init.Type)) { // MemberInit to a complex type is not supported on entity types. - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, init.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, init.ToString())); } ProjectionAnalyzer.Analyze(init, this.builder, this.context); @@ -557,14 +557,14 @@ internal override NewExpression VisitNew(NewExpression nex) } } - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjectionToEntity(this.type, nex.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjectionToEntity, this.type, nex.ToString())); } internal override Expression VisitParameter(ParameterExpression p) { if (p != this.builder.ParamExpressionInScope) { - throw new NotSupportedException(Strings.ALinq_CanOnlyProjectTheLeaf); + throw new NotSupportedException(SRResources.ALinq_CanOnlyProjectTheLeaf); } this.builder.StartNewPath(); @@ -633,7 +633,7 @@ internal override Expression VisitUnary(UnaryExpression u) if (ClientTypeUtil.TypeOrElementTypeIsEntity(u.Operand.Type)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, u.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, u.ToString())); } } @@ -646,7 +646,7 @@ internal override Expression VisitBinary(BinaryExpression b) ClientTypeUtil.TypeOrElementTypeIsEntity(b.Right.Type) || IsCollectionProducingExpression(b.Left) || IsCollectionProducingExpression(b.Right)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, b.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, b.ToString())); } return base.VisitBinary(b); @@ -656,7 +656,7 @@ internal override Expression VisitTypeIs(TypeBinaryExpression b) { if (ClientTypeUtil.TypeOrElementTypeIsEntity(b.Expression.Type) || IsCollectionProducingExpression(b.Expression)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, b.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, b.ToString())); } return base.VisitTypeIs(b); @@ -676,7 +676,7 @@ internal override Expression VisitConditional(ConditionalExpression c) ClientTypeUtil.TypeOrElementTypeIsEntity(c.IfFalse.Type) || IsCollectionProducingExpression(c.Test) || IsCollectionProducingExpression(c.IfTrue) || IsCollectionProducingExpression(c.IfFalse)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, c.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, c.ToString())); } return base.VisitConditional(c); @@ -718,7 +718,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) // and changing IsCollectionProducingExpression seems risky at this point as it's used in a lot of places. if (IsCollectionProducingExpression(m.Expression)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, m.ToString())); } PropertyInfo pi; @@ -737,7 +737,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) return e; } - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, m.ToString())); } internal override Expression VisitMethodCall(MethodCallExpression m) @@ -745,7 +745,7 @@ internal override Expression VisitMethodCall(MethodCallExpression m) if ((m.Object != null && IsDisallowedExpressionForMethodCall(m.Object, this.context.Model)) || m.Arguments.Any(a => IsDisallowedExpressionForMethodCall(a, this.context.Model))) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, m.ToString())); } CheckChainedSequence(m, this.type); @@ -758,7 +758,7 @@ internal override Expression VisitMethodCall(MethodCallExpression m) if ((m.Object != null ? ClientTypeUtil.TypeOrElementTypeIsEntity(m.Object.Type) : false) || m.Arguments.Any(a => ClientTypeUtil.TypeOrElementTypeIsEntity(a.Type))) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, m.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, m.ToString())); } return base.VisitMethodCall(m); @@ -770,7 +770,7 @@ internal override Expression VisitInvocation(InvocationExpression iv) IsCollectionProducingExpression(iv.Expression) || iv.Arguments.Any(a => ClientTypeUtil.TypeOrElementTypeIsEntity(a.Type) || IsCollectionProducingExpression(a))) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, iv.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, iv.ToString())); } return base.VisitInvocation(iv); @@ -794,7 +794,7 @@ internal override NewExpression VisitNew(NewExpression nex) if (ClientTypeUtil.TypeOrElementTypeIsEntity(nex.Type) && !ResourceBinder.PatternRules.MatchNewDataServiceCollectionOfT(nex)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, nex.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, nex.ToString())); } return base.VisitNew(nex); @@ -806,7 +806,7 @@ internal override Expression VisitParameter(ParameterExpression p) { if (p != this.builder.ParamExpressionInScope) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, p.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, p.ToString())); } this.builder.StartNewPath(); @@ -818,7 +818,7 @@ internal override Expression VisitConstant(ConstantExpression c) { if (ClientTypeUtil.TypeOrElementTypeIsEntity(c.Type)) { - throw new NotSupportedException(Strings.ALinq_ExpressionNotSupportedInProjection(this.type, c.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionNotSupportedInProjection, this.type, c.ToString())); } return base.VisitConstant(c); diff --git a/src/Microsoft.OData.Client/ALinq/ProjectionRewriter.cs b/src/Microsoft.OData.Client/ALinq/ProjectionRewriter.cs index 46492afc0d..34f0fe9f7a 100644 --- a/src/Microsoft.OData.Client/ALinq/ProjectionRewriter.cs +++ b/src/Microsoft.OData.Client/ALinq/ProjectionRewriter.cs @@ -70,7 +70,7 @@ internal LambdaExpression Rebind(LambdaExpression lambda, ResourceExpression sou } else { - throw new NotSupportedException(Strings.ALinq_CanOnlyProjectTheLeaf); + throw new NotSupportedException(SRResources.ALinq_CanOnlyProjectTheLeaf); } } diff --git a/src/Microsoft.OData.Client/ALinq/QueryableResourceExpression.cs b/src/Microsoft.OData.Client/ALinq/QueryableResourceExpression.cs index c2333e9d94..57338cf11d 100644 --- a/src/Microsoft.OData.Client/ALinq/QueryableResourceExpression.cs +++ b/src/Microsoft.OData.Client/ALinq/QueryableResourceExpression.cs @@ -351,15 +351,15 @@ internal void AddFilter(IEnumerable predicateConjuncts) { if (this.Skip != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "skip")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "skip")); } else if (this.Take != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "top")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "top")); } else if (this.Projection != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "select")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "select")); } if (this.Filter == null) @@ -392,7 +392,7 @@ internal void AddAggregation(Expression aggregationExpr, AggregationMethod aggre if (this.OrderBy != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("apply", "orderby")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "apply", "orderby")); } else if (this.Skip != null) { @@ -400,11 +400,11 @@ internal void AddAggregation(Expression aggregationExpr, AggregationMethod aggre // However, support for rollup is currently not implemented in OData WebApi // If $skip and/or $top appears before $apply, its currently ignored. // Makes sense to throw an exception to avoid giving a false impression. - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("apply", "skip")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "apply", "skip")); } else if (this.Take != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("apply", "top")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "apply", "top")); } if (this.Apply == null) diff --git a/src/Microsoft.OData.Client/ALinq/RemoveWildcardVisitor.cs b/src/Microsoft.OData.Client/ALinq/RemoveWildcardVisitor.cs index 08526c71f4..efe5aa977e 100644 --- a/src/Microsoft.OData.Client/ALinq/RemoveWildcardVisitor.cs +++ b/src/Microsoft.OData.Client/ALinq/RemoveWildcardVisitor.cs @@ -26,7 +26,7 @@ internal class RemoveWildcardVisitor : IPathSegmentTokenVisitor /// The SystemToken to translate. public void Visit(SystemToken tokenIn) { - throw new NotSupportedException(Strings.ALinq_IllegalSystemQueryOption(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, tokenIn.Identifier)); } /// diff --git a/src/Microsoft.OData.Client/ALinq/ResourceBinder.cs b/src/Microsoft.OData.Client/ALinq/ResourceBinder.cs index 2393e989b9..74f16ad0dd 100644 --- a/src/Microsoft.OData.Client/ALinq/ResourceBinder.cs +++ b/src/Microsoft.OData.Client/ALinq/ResourceBinder.cs @@ -120,7 +120,7 @@ internal static void VerifyKeyPredicates(Expression e) { if (IsMissingKeyPredicates(e)) { - throw new NotSupportedException(Strings.ALinq_CantNavigateWithoutKeyPredicate); + throw new NotSupportedException(SRResources.ALinq_CantNavigateWithoutKeyPredicate); } } @@ -143,12 +143,12 @@ internal static void VerifyNotSelectManyProjection(Expression expression) MethodCallExpression call = StripTo(projection.Selector.Body); if (call != null && call.Method.Name == "SelectMany") { - throw new NotSupportedException(Strings.ALinq_UnsupportedExpression(call)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_UnsupportedExpression, call)); } } else if (resourceExpression.HasTransparentScope) { - throw new NotSupportedException(Strings.ALinq_UnsupportedExpression(resourceExpression)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_UnsupportedExpression, resourceExpression)); } } } @@ -353,7 +353,7 @@ private static List ExtractKeyPredicate( { // UNSUPPORTED: = AND = are multiple key predicates and // cannot be represented as a resource path. - throw Error.NotSupported(Strings.ALinq_CanOnlyApplyOneKeyPredicate); + throw Error.NotSupported(SRResources.ALinq_CanOnlyApplyOneKeyPredicate); } keyValuesFromPredicates.Add(property, constantValue); @@ -1021,7 +1021,7 @@ private static Expression AnalyzeOfType(MethodCallExpression mce) if (filteredType == null) { - throw new InvalidOperationException(Strings.ALinq_OfTypeArgumentNotAvailable); + throw new InvalidOperationException(SRResources.ALinq_OfTypeArgumentNotAvailable); } if (filteredType.IsAssignableFrom(rse.ResourceType)) @@ -1032,7 +1032,7 @@ private static Expression AnalyzeOfType(MethodCallExpression mce) { if (rse.ResourceTypeAs != null) { - throw new NotSupportedException(Strings.ALinq_CannotUseTypeFiltersMultipleTimes); + throw new NotSupportedException(SRResources.ALinq_CannotUseTypeFiltersMultipleTimes); } // only apply the OfType filter if it is not redundant @@ -1396,7 +1396,7 @@ internal static T StripTo(Expression expression, out Type convertedType) wher // Note 1: this also means that we do not support multiple downcasts as these are redundant, // e.g., ((p as Employee) as Manager) // from e in p.OfType() select e as Manager - throw new NotSupportedException(Strings.ALinq_CannotUseTypeFiltersMultipleTimes); + throw new NotSupportedException(SRResources.ALinq_CannotUseTypeFiltersMultipleTimes); } else { @@ -1503,35 +1503,35 @@ internal static void AddSequenceQueryOption(ResourceExpression target, QueryOpti case (ExpressionType)ResourceExpressionType.FilterQueryOption: if (rse.Skip != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "skip")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "skip")); } else if (rse.Take != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "top")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "top")); } else if (rse.Projection != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("filter", "select")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "filter", "select")); } break; case (ExpressionType)ResourceExpressionType.OrderByQueryOption: if (rse.Skip != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("orderby", "skip")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "orderby", "skip")); } else if (rse.Take != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("orderby", "top")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "orderby", "top")); } else if (rse.Projection != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("orderby", "select")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "orderby", "select")); } break; case (ExpressionType)ResourceExpressionType.SkipQueryOption: if (rse.Take != null) { - throw new NotSupportedException(Strings.ALinq_QueryOptionOutOfOrder("skip", "top")); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionOutOfOrder, "skip", "top")); } break; default: @@ -2754,13 +2754,13 @@ internal static void RequireCanNavigate(Expression e) QueryableResourceExpression resourceExpression = e as QueryableResourceExpression; if (resourceExpression != null && resourceExpression.HasSequenceQueryOptions) { - throw new NotSupportedException(Strings.ALinq_QueryOptionsOnlyAllowedOnLeafNodes); + throw new NotSupportedException(SRResources.ALinq_QueryOptionsOnlyAllowedOnLeafNodes); } ResourceExpression resource; if (PatternRules.MatchResource(e, out resource) && resource.Projection != null) { - throw new NotSupportedException(Strings.ALinq_ProjectionOnlyAllowedOnLeafNodes); + throw new NotSupportedException(SRResources.ALinq_ProjectionOnlyAllowedOnLeafNodes); } } @@ -2769,17 +2769,17 @@ internal static void RequireCanProject(Expression e) ResourceExpression re = (ResourceExpression)e; if (!PatternRules.MatchResource(e, out re)) { - throw new NotSupportedException(Strings.ALinq_CanOnlyProjectTheLeaf); + throw new NotSupportedException(SRResources.ALinq_CanOnlyProjectTheLeaf); } if (re.Projection != null) { - throw new NotSupportedException(Strings.ALinq_ProjectionCanOnlyHaveOneProjection); + throw new NotSupportedException(SRResources.ALinq_ProjectionCanOnlyHaveOneProjection); } if (re.ExpandPaths.Count > 0) { - throw new NotSupportedException(Strings.ALinq_CannotProjectWithExplicitExpansion); + throw new NotSupportedException(SRResources.ALinq_CannotProjectWithExplicitExpansion); } } @@ -2788,12 +2788,12 @@ internal static void RequireCanExpand(Expression e) ResourceExpression re = (ResourceExpression)e; if (!PatternRules.MatchResource(e, out re)) { - throw new NotSupportedException(Strings.ALinq_CantExpand); + throw new NotSupportedException(SRResources.ALinq_CantExpand); } if (re.Projection != null) { - throw new NotSupportedException(Strings.ALinq_CannotProjectWithExplicitExpansion); + throw new NotSupportedException(SRResources.ALinq_CannotProjectWithExplicitExpansion); } } @@ -2802,13 +2802,13 @@ internal static void RequireCanAddCount(Expression e) ResourceExpression re = (ResourceExpression)e; if (!PatternRules.MatchResource(e, out re)) { - throw new NotSupportedException(Strings.ALinq_CannotAddCountOption); + throw new NotSupportedException(SRResources.ALinq_CannotAddCountOption); } // do we already have a count option? if (re.CountOption != CountOption.None) { - throw new NotSupportedException(Strings.ALinq_CannotAddCountOptionConflict); + throw new NotSupportedException(SRResources.ALinq_CannotAddCountOptionConflict); } } @@ -2817,7 +2817,7 @@ internal static void RequireCanAddCustomQueryOption(Expression e) ResourceExpression re = (ResourceExpression)e; if (!PatternRules.MatchResource(e, out re)) { - throw new NotSupportedException(Strings.ALinq_CantAddQueryOption); + throw new NotSupportedException(SRResources.ALinq_CantAddQueryOption); } } @@ -2826,7 +2826,7 @@ internal static void RequireNonSingleton(Expression e) ResourceExpression re = e as ResourceExpression; if (re != null && re.IsSingleton) { - throw new NotSupportedException(Strings.ALinq_QueryOptionsOnlyAllowedOnSingletons); + throw new NotSupportedException(SRResources.ALinq_QueryOptionsOnlyAllowedOnSingletons); } } @@ -2839,7 +2839,7 @@ internal static void RequireLegalCustomQueryOption(Expression e, ResourceExpress if (target.CustomQueryOptions.Any(c => (string)c.Key.Value == name)) { // don't allow dups in Astoria $ namespace. - throw new NotSupportedException(Strings.ALinq_CantAddDuplicateQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddDuplicateQueryOption, name)); } QueryableResourceExpression rse = target as QueryableResourceExpression; @@ -2850,12 +2850,12 @@ internal static void RequireLegalCustomQueryOption(Expression e, ResourceExpress case UriHelper.OPTIONFILTER: if (rse.Filter != null) { - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); } break; case UriHelper.OPTIONORDERBY: if (rse.OrderBy != null) - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); break; case UriHelper.OPTIONEXPAND: // how did we get here? @@ -2863,21 +2863,21 @@ internal static void RequireLegalCustomQueryOption(Expression e, ResourceExpress break; case UriHelper.OPTIONSKIP: if (rse.Skip != null) - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); break; case UriHelper.OPTIONTOP: if (rse.Take != null) - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); break; case UriHelper.OPTIONCOUNT: // cannot add count if any counting already exists if (rse.CountOption != CountOption.None) - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); break; case UriHelper.OPTIONSELECT: if (rse.Projection != null) { - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); } // DEVNOTE(pqian): // while the normal projection analyzer does not allow expansions, we must allow it here @@ -2889,10 +2889,10 @@ internal static void RequireLegalCustomQueryOption(Expression e, ResourceExpress break; case UriHelper.OPTIONAPPLY: if (rse.Apply != null) - throw new NotSupportedException(Strings.ALinq_CantAddAstoriaQueryOption(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantAddAstoriaQueryOption, name)); break; default: - throw new NotSupportedException(Strings.ALinq_QueryOptionNotSupported(name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_QueryOptionNotSupported, name)); } } } @@ -2904,7 +2904,7 @@ internal static void RequireLegalCustomQueryOption(Expression e, ResourceExpress [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "DataServiceContext", Justification = "The spelling is correct.")] private static void ThrowNotSupportedExceptionForTheFormatOption() { - throw new NotSupportedException(Strings.ALinq_FormatQueryOptionNotSupported); + throw new NotSupportedException(SRResources.ALinq_FormatQueryOptionNotSupported); } /// @@ -2930,7 +2930,7 @@ internal override Expression VisitMethodCall(MethodCallExpression mce) { if (this.checkedMethod == SequenceMethod.OrderBy) { - throw new NotSupportedException(Strings.ALinq_AnyAllNotSupportedInOrderBy(mce.Method.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_AnyAllNotSupportedInOrderBy, mce.Method.Name)); } Type filteredType = mce.Method.GetGenericArguments().SingleOrDefault(); @@ -2944,7 +2944,7 @@ internal override Expression VisitMethodCall(MethodCallExpression mce) !PatternRules.MatchNonPrivateReadableProperty(me, out pi, out boundTarget) || !WebUtil.IsCLRTypeCollection(pi.PropertyType, this.model)) { - throw new NotSupportedException(Strings.ALinq_InvalidSourceForAnyAll(mce.Method.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidSourceForAnyAll, mce.Method.Name)); } } @@ -2985,17 +2985,17 @@ internal override Expression VisitMemberAccess(MemberExpression m) { if (this.checkedMethod == SequenceMethod.Where) { - throw new NotSupportedException(Strings.ALinq_CollectionPropertyNotSupportedInWhere(pi.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CollectionPropertyNotSupportedInWhere, pi.Name)); } else { - throw new NotSupportedException(Strings.ALinq_CollectionPropertyNotSupportedInOrderBy(pi.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CollectionPropertyNotSupportedInOrderBy, pi.Name)); } } if (typeof(DataServiceStreamLink).IsAssignableFrom(pi.PropertyType)) { - throw new NotSupportedException(Strings.ALinq_LinkPropertyNotSupportedInExpression(pi.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_LinkPropertyNotSupportedInExpression, pi.Name)); } } @@ -3033,7 +3033,7 @@ internal static void DisallowMemberAccessInNavigation(Expression e, ClientEdmMod { if (WebUtil.IsCLRTypeCollection(me.Expression.Type, model)) { - throw new NotSupportedException(Strings.ALinq_CollectionMemberAccessNotSupportedInNavigation(me.Member.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CollectionMemberAccessNotSupportedInNavigation, me.Member.Name)); } me = StripTo(me.Expression); @@ -3054,7 +3054,7 @@ internal static void DisallowExpressionEndWithTypeAs(Expression exp, string meth Expression e = ResourceBinder.StripTo(exp); if (e != null && e.NodeType == ExpressionType.TypeAs) { - throw new NotSupportedException(Strings.ALinq_ExpressionCannotEndWithTypeAs(exp.ToString(), method)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ExpressionCannotEndWithTypeAs, exp.ToString(), method)); } } @@ -3098,7 +3098,7 @@ internal static void ValidateExpandPath(Expression input, DataServiceContext con } - throw new NotSupportedException(Strings.ALinq_InvalidExpressionInNavigationPath(input)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidExpressionInNavigationPath, input)); } /// @@ -3122,14 +3122,14 @@ internal static void ValidateAggregateExpression(Expression expr) // member expression will result into `memberExpr` being assigned a value of null. if (memberExpr == null) { - throw new NotSupportedException(Strings.ALinq_InvalidAggregateExpression(expr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidAggregateExpression, expr)); } // Validate that property is aggregatable. Applies to CountDistinct() since Queryable // aggregation methods (Average, Sum, Min, Max) validate that the property is aggregatable if (!PrimitiveType.IsKnownNullableType(memberExpr.Type)) { - throw new NotSupportedException(Strings.ALinq_InvalidAggregateExpression(expr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidAggregateExpression, expr)); } // Member access expressions involving properties of known primitive types @@ -3144,13 +3144,13 @@ internal static void ValidateAggregateExpression(Expression expr) { if (PrimitiveType.IsKnownNullableType(parentExpr.Type)) { - throw new NotSupportedException(Strings.ALinq_InvalidAggregateExpression(expr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidAggregateExpression, expr)); } Type collectionType = ClientTypeUtil.GetImplementationType(parentExpr.Type, typeof(ICollection<>)); if (collectionType != null) { - throw new NotSupportedException(Strings.ALinq_InvalidAggregateExpression(expr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidAggregateExpression, expr)); } } } @@ -3177,13 +3177,13 @@ internal static void ValidateGroupingExpression(Expression expr) { if (PrimitiveType.IsKnownNullableType(containingExpr.Type)) { - throw new NotSupportedException(Strings.ALinq_InvalidGroupingExpression(memberExpr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidGroupingExpression, memberExpr)); } Type collectionType = ClientTypeUtil.GetImplementationType(containingExpr.Type, typeof(ICollection<>)); if (collectionType != null) { - throw new NotSupportedException(Strings.ALinq_InvalidGroupingExpression(memberExpr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidGroupingExpression, memberExpr)); } } @@ -3191,7 +3191,7 @@ internal static void ValidateGroupingExpression(Expression expr) // Due to feature gap in OData WebApi if (!PrimitiveType.IsKnownNullableType(memberExpr.Type)) { - throw new NotSupportedException(Strings.ALinq_InvalidGroupingExpression(memberExpr)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_InvalidGroupingExpression, memberExpr)); } } } diff --git a/src/Microsoft.OData.Client/ALinq/SelectExpandPathToStringVisitor.cs b/src/Microsoft.OData.Client/ALinq/SelectExpandPathToStringVisitor.cs index b0231d9fc6..5ac4e3cf25 100644 --- a/src/Microsoft.OData.Client/ALinq/SelectExpandPathToStringVisitor.cs +++ b/src/Microsoft.OData.Client/ALinq/SelectExpandPathToStringVisitor.cs @@ -37,7 +37,7 @@ internal class SelectExpandPathToStringVisitor : IPathSegmentTokenVisitorAlways throws, because a system token is illegal in this case. public string Visit(SystemToken tokenIn) { - throw new NotSupportedException(Strings.ALinq_IllegalSystemQueryOption(tokenIn.Identifier)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, tokenIn.Identifier)); } /// diff --git a/src/Microsoft.OData.Client/ALinq/UriHelper.cs b/src/Microsoft.OData.Client/ALinq/UriHelper.cs index ba4d9289ee..4e0332ec01 100644 --- a/src/Microsoft.OData.Client/ALinq/UriHelper.cs +++ b/src/Microsoft.OData.Client/ALinq/UriHelper.cs @@ -214,7 +214,7 @@ internal static string GetTypeNameForUri(Type type, DataServiceContext context) else { // unsupported primitive type - throw new NotSupportedException(Strings.ALinq_CantCastToUnsupportedPrimitive(type.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantCastToUnsupportedPrimitive, type.Name)); } } else @@ -235,12 +235,12 @@ internal static string GetEntityTypeNameForUriAndValidateMaxProtocolVersion(Type if (context.MaxProtocolVersionAsVersion < Util.ODataVersion4) { - throw new NotSupportedException(Strings.ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3); + throw new NotSupportedException(SRResources.ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3); } if (!ClientTypeUtil.TypeOrElementTypeIsEntity(type)) { - throw new NotSupportedException(Strings.ALinq_TypeAsArgumentNotEntityType(type.FullName)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_TypeAsArgumentNotEntityType, type.FullName)); } // Raise the uriVersion each time we write the type segment on the uri. diff --git a/src/Microsoft.OData.Client/ALinq/UriWriter.cs b/src/Microsoft.OData.Client/ALinq/UriWriter.cs index aabed9dbd9..06015ce91d 100644 --- a/src/Microsoft.OData.Client/ALinq/UriWriter.cs +++ b/src/Microsoft.OData.Client/ALinq/UriWriter.cs @@ -112,7 +112,7 @@ internal override Expression VisitMethodCall(MethodCallExpression m) /// The visited UnaryExpression expression internal override Expression VisitUnary(UnaryExpression u) { - throw new NotSupportedException(Strings.ALinq_UnaryNotSupported(u.NodeType.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_UnaryNotSupported, u.NodeType.ToString())); } /// @@ -122,7 +122,7 @@ internal override Expression VisitUnary(UnaryExpression u) /// The visited BinaryExpression expression internal override Expression VisitBinary(BinaryExpression b) { - throw new NotSupportedException(Strings.ALinq_BinaryNotSupported(b.NodeType.ToString())); + throw new NotSupportedException(Error.Format(SRResources.ALinq_BinaryNotSupported, b.NodeType.ToString())); } /// @@ -132,7 +132,7 @@ internal override Expression VisitBinary(BinaryExpression b) /// The visited ConstantExpression expression internal override Expression VisitConstant(ConstantExpression c) { - throw new NotSupportedException(Strings.ALinq_ConstantNotSupported(c.Value)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_ConstantNotSupported, c.Value)); } /// @@ -142,7 +142,7 @@ internal override Expression VisitConstant(ConstantExpression c) /// The visited TypeBinaryExpression expression internal override Expression VisitTypeIs(TypeBinaryExpression b) { - throw new NotSupportedException(Strings.ALinq_TypeBinaryNotSupported); + throw new NotSupportedException(SRResources.ALinq_TypeBinaryNotSupported); } /// @@ -152,7 +152,7 @@ internal override Expression VisitTypeIs(TypeBinaryExpression b) /// The visited ConditionalExpression expression internal override Expression VisitConditional(ConditionalExpression c) { - throw new NotSupportedException(Strings.ALinq_ConditionalNotSupported); + throw new NotSupportedException(SRResources.ALinq_ConditionalNotSupported); } /// @@ -162,7 +162,7 @@ internal override Expression VisitConditional(ConditionalExpression c) /// The visited ParameterExpression expression internal override Expression VisitParameter(ParameterExpression p) { - throw new NotSupportedException(Strings.ALinq_ParameterNotSupported); + throw new NotSupportedException(SRResources.ALinq_ParameterNotSupported); } /// @@ -172,7 +172,7 @@ internal override Expression VisitParameter(ParameterExpression p) /// The visited MemberExpression expression internal override Expression VisitMemberAccess(MemberExpression m) { - throw new NotSupportedException(Strings.ALinq_MemberAccessNotSupported(m.Member.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_MemberAccessNotSupported, m.Member.Name)); } /// @@ -182,7 +182,7 @@ internal override Expression VisitMemberAccess(MemberExpression m) /// The visited LambdaExpression internal override Expression VisitLambda(LambdaExpression lambda) { - throw new NotSupportedException(Strings.ALinq_LambdaNotSupported); + throw new NotSupportedException(SRResources.ALinq_LambdaNotSupported); } /// @@ -192,7 +192,7 @@ internal override Expression VisitLambda(LambdaExpression lambda) /// The visited NewExpression internal override NewExpression VisitNew(NewExpression nex) { - throw new NotSupportedException(Strings.ALinq_NewNotSupported); + throw new NotSupportedException(SRResources.ALinq_NewNotSupported); } /// @@ -202,7 +202,7 @@ internal override NewExpression VisitNew(NewExpression nex) /// The visited MemberInitExpression internal override Expression VisitMemberInit(MemberInitExpression init) { - throw new NotSupportedException(Strings.ALinq_MemberInitNotSupported); + throw new NotSupportedException(SRResources.ALinq_MemberInitNotSupported); } /// @@ -212,7 +212,7 @@ internal override Expression VisitMemberInit(MemberInitExpression init) /// The visited ListInitExpression internal override Expression VisitListInit(ListInitExpression init) { - throw new NotSupportedException(Strings.ALinq_ListInitNotSupported); + throw new NotSupportedException(SRResources.ALinq_ListInitNotSupported); } /// @@ -222,7 +222,7 @@ internal override Expression VisitListInit(ListInitExpression init) /// The visited NewArrayExpression internal override Expression VisitNewArray(NewArrayExpression na) { - throw new NotSupportedException(Strings.ALinq_NewArrayNotSupported); + throw new NotSupportedException(SRResources.ALinq_NewArrayNotSupported); } /// @@ -232,7 +232,7 @@ internal override Expression VisitNewArray(NewArrayExpression na) /// The visited InvocationExpression internal override Expression VisitInvocation(InvocationExpression iv) { - throw new NotSupportedException(Strings.ALinq_InvocationNotSupported); + throw new NotSupportedException(SRResources.ALinq_InvocationNotSupported); } /// @@ -689,7 +689,7 @@ private string ConstructAggregateTransformation(IList f == null || f.Length == 0)) { - throw Error.Argument(Strings.DSKAttribute_MustSpecifyAtleastOnePropertyName, "keyNames"); + throw Error.Argument(SRResources.DSKAttribute_MustSpecifyAtleastOnePropertyName, "keyNames"); } this.keyNames = new ReadOnlyCollection(keyNames); diff --git a/src/Microsoft.OData.Client/BaseAsyncResult.cs b/src/Microsoft.OData.Client/BaseAsyncResult.cs index 10502e8aad..5e2ef7ee91 100644 --- a/src/Microsoft.OData.Client/BaseAsyncResult.cs +++ b/src/Microsoft.OData.Client/BaseAsyncResult.cs @@ -219,7 +219,7 @@ internal static T EndExecute(object source, string method, IAsyncResult async T result = (asyncResult as T); if ((result == null) || (source != result.Source) || (result.Method != method)) { - throw Error.Argument(Strings.Context_DidNotOriginateAsync, "asyncResult"); + throw Error.Argument(SRResources.Context_DidNotOriginateAsync, "asyncResult"); } Debug.Assert((result.CompletedSynchronously && result.IsCompleted) || !result.CompletedSynchronously, "CompletedSynchronously && !IsCompleted"); @@ -234,7 +234,7 @@ internal static T EndExecute(object source, string method, IAsyncResult async // Prevent EndExecute from being called more than once. if (Interlocked.Exchange(ref result.done, 1) != 0) { - throw Error.Argument(Strings.Context_AsyncAlreadyDone, "asyncResult"); + throw Error.Argument(SRResources.Context_AsyncAlreadyDone, "asyncResult"); } // Dispose the wait handle. @@ -250,7 +250,7 @@ internal static T EndExecute(object source, string method, IAsyncResult async if (result.IsAborted) { - throw Error.InvalidOperation(Strings.Context_OperationCanceled); + throw Error.InvalidOperation(SRResources.Context_OperationCanceled); } if (result.Failure != null) @@ -260,7 +260,7 @@ internal static T EndExecute(object source, string method, IAsyncResult async throw result.Failure; } - throw Error.InvalidOperation(Strings.DataServiceException_GeneralError, result.Failure); + throw Error.InvalidOperation(SRResources.DataServiceException_GeneralError, result.Failure); } return result; diff --git a/src/Microsoft.OData.Client/BaseSaveResult.cs b/src/Microsoft.OData.Client/BaseSaveResult.cs index 315699bdb5..530d92de69 100644 --- a/src/Microsoft.OData.Client/BaseSaveResult.cs +++ b/src/Microsoft.OData.Client/BaseSaveResult.cs @@ -203,7 +203,7 @@ internal static InvalidOperationException HandleResponse( InvalidOperationException failure = null; if (!CanHandleResponseVersion(responseVersion, out parsedResponseVersion)) { - string description = Strings.Context_VersionNotSupported(responseVersion, SerializeSupportedVersions()); + string description = Error.Format(SRResources.Context_VersionNotSupported, responseVersion, SerializeSupportedVersions()); failure = Error.InvalidOperation(description); } @@ -593,7 +593,7 @@ protected void HandleOperationResponseHeaders(HttpStatusCode statusCode, HeaderC // Except for preflight requests if (headers.HasHeader("Content-Type") && statusCode != HttpStatusCode.Created) { - throw Error.NotSupported(Strings.Deserialize_NoLocationHeader); + throw Error.NotSupported(SRResources.Deserialize_NoLocationHeader); } } @@ -606,7 +606,7 @@ protected void HandleOperationResponseHeaders(HttpStatusCode statusCode, HeaderC odataId = WebUtil.ValidateIdentityValue(odataEntityId); if (location == null) { - throw Error.NotSupported(Strings.Context_BothLocationAndIdMustBeSpecified); + throw Error.NotSupported(SRResources.Context_BothLocationAndIdMustBeSpecified); } } else @@ -1065,14 +1065,14 @@ private static void ValidateLinkDescriptorSourceAndTargetHaveIdentities(LinkDesc { binding.ContentGeneratedForSave = true; Debug.Assert(EntityStates.Added == sourceResource.State, "expected added state"); - throw Error.InvalidOperation(Strings.Context_LinkResourceInsertFailure, sourceResource.SaveError); + throw Error.InvalidOperation(SRResources.Context_LinkResourceInsertFailure, sourceResource.SaveError); } if (targetResource != null && targetResource.GetLatestIdentity() == null) { binding.ContentGeneratedForSave = true; Debug.Assert(targetResource.State == EntityStates.Added, "expected added state"); - throw Error.InvalidOperation(Strings.Context_LinkResourceInsertFailure, targetResource.SaveError); + throw Error.InvalidOperation(SRResources.Context_LinkResourceInsertFailure, targetResource.SaveError); } } diff --git a/src/Microsoft.OData.Client/BatchSaveResult.cs b/src/Microsoft.OData.Client/BatchSaveResult.cs index 9cb8f2b3ca..033e9706dd 100644 --- a/src/Microsoft.OData.Client/BatchSaveResult.cs +++ b/src/Microsoft.OData.Client/BatchSaveResult.cs @@ -405,7 +405,7 @@ private ODataRequestMessageWrapper GenerateBatchRequest() ClientTypeAnnotation type = model.GetClientTypeAnnotation(model.GetOrCreateEdmType(entityDescriptor.Entity.GetType())); if (type.IsMediaLinkEntry || entityDescriptor.IsMediaLinkEntry) { - throw Error.NotSupported(Strings.Context_BatchNotSupportedForMediaLink); + throw Error.NotSupported(SRResources.Context_BatchNotSupportedForMediaLink); } } else if (entityDescriptor.State == EntityStates.Unchanged || entityDescriptor.State == EntityStates.Modified) @@ -414,14 +414,14 @@ private ODataRequestMessageWrapper GenerateBatchRequest() // It's OK to PUT the MLE alone inside a batch mode though if (entityDescriptor.SaveStream != null) { - throw Error.NotSupported(Strings.Context_BatchNotSupportedForMediaLink); + throw Error.NotSupported(SRResources.Context_BatchNotSupportedForMediaLink); } } } else if (descriptor.DescriptorKind == DescriptorKind.NamedStream) { // Similar to MR, we do not support adding named streams in batch mode. - throw Error.NotSupported(Strings.Context_BatchNotSupportedForNamedStreams); + throw Error.NotSupported(SRResources.Context_BatchNotSupportedForNamedStreams); } ODataRequestMessageWrapper operationRequestMessage; @@ -471,7 +471,7 @@ private DataServiceResponse HandleBatchResponse() { if ((this.batchResponseMessage == null) || (this.batchResponseMessage.StatusCode == (int)HttpStatusCode.NoContent)) { // we always expect a response to our batch POST request - throw Error.InvalidOperation(Strings.Batch_ExpectedResponse(1)); + throw Error.InvalidOperation(Error.Format(SRResources.Batch_ExpectedResponse, 1)); } Func getResponseStream = () => this.ResponseStream; @@ -519,7 +519,7 @@ private DataServiceResponse HandleBatchResponse() (HttpStatusCode)this.batchResponseMessage.StatusCode); } - throw Error.InvalidOperation(Strings.Batch_ExpectedContentType(this.batchResponseMessage.GetHeader(XmlConstants.HttpContentType)), inner); + throw Error.InvalidOperation(Error.Format(SRResources.Batch_ExpectedContentType, this.batchResponseMessage.GetHeader(XmlConstants.HttpContentType)), inner); } DataServiceResponse response = this.HandleBatchResponseInternal(batchReader); @@ -541,7 +541,7 @@ private DataServiceResponse HandleBatchResponse() HeaderCollection headers = new HeaderCollection(this.batchResponseMessage); int statusCode = this.batchResponseMessage == null ? (int)HttpStatusCode.InternalServerError : (int)this.batchResponseMessage.StatusCode; DataServiceResponse response = new DataServiceResponse(headers, statusCode, Enumerable.Empty(), this.IsBatchRequest); - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, ex, response); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, ex, response); } finally { @@ -608,7 +608,7 @@ private DataServiceResponse HandleBatchResponseInternal(ODataBatchReader batchRe // Users need to inspect each OperationResponse to get the exception information from the failed operations. if (exception != null) { - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, exception, response); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, exception, response); } } @@ -810,7 +810,7 @@ private IEnumerable HandleBatchResponse(ODataBatchReader batc (!this.IsBatchRequest || this.ChangedEntries.FirstOrDefault(o => o.SaveError != null) == null))) || (this.Queries != null && queryCount != this.Queries.Length)) { - throw Error.InvalidOperation(Strings.Batch_IncompleteResponseCount); + throw Error.InvalidOperation(SRResources.Batch_IncompleteResponseCount); } } finally diff --git a/src/Microsoft.OData.Client/Binding/BindingGraph.cs b/src/Microsoft.OData.Client/Binding/BindingGraph.cs index 3bae1dbca3..5dab1ada4e 100644 --- a/src/Microsoft.OData.Client/Binding/BindingGraph.cs +++ b/src/Microsoft.OData.Client/Binding/BindingGraph.cs @@ -97,7 +97,7 @@ public bool AddDataServiceCollection( // Fail if the collection entity type does not implement INotifyPropertyChanged. if (!typeof(INotifyPropertyChanged).IsAssignableFrom(entityType)) { - throw new InvalidOperationException(Strings.DataBinding_NotifyPropertyChangedNotImpl(entityType)); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyPropertyChangedNotImpl, entityType)); } typeof(BindingGraph) @@ -164,7 +164,7 @@ public void AddPrimitiveOrComplexCollection( // Attach CollectionChanged event listener and fail if the collection type doesn't support notification if (!this.AttachPrimitiveOrComplexCollectionNotification(collection)) { - throw new InvalidOperationException(Strings.DataBinding_NotifyCollectionChangedNotImpl(collection.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyCollectionChangedNotImpl, collection.GetType())); } // If the collection contains complex objects, bind to all of the objects in the collection @@ -173,7 +173,7 @@ public void AddPrimitiveOrComplexCollection( // Fail if the collection contains a complex type that does not implement INotifyPropertyChanged. if (!typeof(INotifyPropertyChanged).IsAssignableFrom(collectionItemType)) { - throw new InvalidOperationException(Strings.DataBinding_NotifyPropertyChangedNotImpl(collectionItemType)); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyPropertyChangedNotImpl, collectionItemType)); } // Recursively bind to all of the complex objects in the collection and any nested complex objects or collections @@ -182,7 +182,7 @@ public void AddPrimitiveOrComplexCollection( } else { - throw new InvalidOperationException(Strings.DataBinding_CollectionAssociatedWithMultipleEntities(collection.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_CollectionAssociatedWithMultipleEntities, collection.GetType())); } } @@ -227,7 +227,7 @@ public bool AddEntity( // Register for entity notifications, fail if the entity does not implement INotifyPropertyChanged. if (!this.AttachEntityOrComplexObjectNotification(target)) { - throw new InvalidOperationException(Strings.DataBinding_NotifyPropertyChangedNotImpl(target.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyPropertyChangedNotImpl, target.GetType())); } addedNewEntity = true; @@ -236,7 +236,7 @@ public bool AddEntity( // Add relationship. Connect the from end to the target. if (this.graph.ExistsEdge(edgeSource, target, sourceVertex.IsDataServiceCollection ? null : sourceProperty)) { - throw new InvalidOperationException(Strings.DataBinding_EntityAlreadyInCollection(target.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_EntityAlreadyInCollection, target.GetType())); } this.graph.AddEdge(edgeSource, target, sourceVertex.IsDataServiceCollection ? null : sourceProperty); @@ -538,7 +538,7 @@ public void AddComplexObject(object source, string sourceProperty, object target // Register for complex type notifications, fail if the complex type does not implement INotifyPropertyChanged. if (!this.AttachEntityOrComplexObjectNotification(target)) { - throw new InvalidOperationException(Strings.DataBinding_NotifyPropertyChangedNotImpl(target.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyPropertyChangedNotImpl, target.GetType())); } this.graph.AddEdge(source, target, sourceProperty); @@ -548,7 +548,7 @@ public void AddComplexObject(object source, string sourceProperty, object target } else { - throw new InvalidOperationException(Strings.DataBinding_ComplexObjectAssociatedWithMultipleEntities(target.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_ComplexObjectAssociatedWithMultipleEntities, target.GetType())); } } diff --git a/src/Microsoft.OData.Client/Binding/BindingObserver.cs b/src/Microsoft.OData.Client/Binding/BindingObserver.cs index 5bcc73753d..1e22e4f4ba 100644 --- a/src/Microsoft.OData.Client/Binding/BindingObserver.cs +++ b/src/Microsoft.OData.Client/Binding/BindingObserver.cs @@ -504,7 +504,7 @@ internal void HandleAddEntity( // The user callback code could detach the source. if (source != null && this.IsDetachedOrDeletedFromContext(source)) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_DetachedSource); + throw new InvalidOperationException(SRResources.DataBinding_BindingOperation_DetachedSource); } // Default implementation. @@ -638,7 +638,7 @@ internal void HandleDeleteEntity( // The user callback code could detach the source. if (source != null && !this.IsContextTrackingEntity(source)) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_DetachedSource); + throw new InvalidOperationException(SRResources.DataBinding_BindingOperation_DetachedSource); } // Default implementation. @@ -718,7 +718,7 @@ internal void HandleUpdateEntityReference( // The user callback code could detach the source. if (this.IsDetachedOrDeletedFromContext(source)) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_DetachedSource); + throw new InvalidOperationException(SRResources.DataBinding_BindingOperation_DetachedSource); } // Default implementation. @@ -873,12 +873,12 @@ private void OnAddToDataServiceCollection( { if (target == null) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_ArrayItemNull("Add")); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_BindingOperation_ArrayItemNull, "Add")); } if (!BindingEntityInfo.IsEntityType(target.GetType(), this.Context.Model)) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_ArrayItemNotEntity("Add")); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_BindingOperation_ArrayItemNotEntity, "Add")); } // Start tracking the target entity and synchronize the context with the Add operation. @@ -1088,12 +1088,12 @@ private void ValidateDataServiceCollectionItem(object target) { if (target == null) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_ArrayItemNull("Remove")); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_BindingOperation_ArrayItemNull, "Remove")); } if (!BindingEntityInfo.IsEntityType(target.GetType(), this.Context.Model)) { - throw new InvalidOperationException(Strings.DataBinding_BindingOperation_ArrayItemNotEntity("Remove")); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_BindingOperation_ArrayItemNotEntity, "Remove")); } } diff --git a/src/Microsoft.OData.Client/Binding/BindingUtils.cs b/src/Microsoft.OData.Client/Binding/BindingUtils.cs index 702a570e37..0e40da6dd3 100644 --- a/src/Microsoft.OData.Client/Binding/BindingUtils.cs +++ b/src/Microsoft.OData.Client/Binding/BindingUtils.cs @@ -24,7 +24,7 @@ internal static void ValidateEntitySetName(string entitySetName, object entity) { if (String.IsNullOrEmpty(entitySetName)) { - throw new InvalidOperationException(Strings.DataBinding_Util_UnknownEntitySetName(entity.GetType().FullName)); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_Util_UnknownEntitySetName, entity.GetType().FullName)); } } @@ -72,7 +72,7 @@ internal static void VerifyObserverNotPresent(object oec, string sourceProper if (typedCollection.Observer != null) { - throw new InvalidOperationException(Strings.DataBinding_CollectionPropertySetterValueHasObserver(sourceProperty, sourceType)); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_CollectionPropertySetterValueHasObserver, sourceProperty, sourceType)); } } } diff --git a/src/Microsoft.OData.Client/Binding/DataServiceCollectionOfT.cs b/src/Microsoft.OData.Client/Binding/DataServiceCollectionOfT.cs index 26ad54d5cb..9bb8a3293e 100644 --- a/src/Microsoft.OData.Client/Binding/DataServiceCollectionOfT.cs +++ b/src/Microsoft.OData.Client/Binding/DataServiceCollectionOfT.cs @@ -316,12 +316,12 @@ public void LoadAsync(System.Linq.IQueryable query) DataServiceQuery dsq = query as DataServiceQuery; if (dsq == null) { - throw new ArgumentException(Strings.DataServiceCollection_LoadAsyncRequiresDataServiceQuery, nameof(query)); + throw new ArgumentException(SRResources.DataServiceCollection_LoadAsyncRequiresDataServiceQuery, nameof(query)); } if (this.ongoingAsyncOperation != null) { - throw new InvalidOperationException(Strings.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); + throw new InvalidOperationException(SRResources.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); } if (this.trackingOnLoad) @@ -358,12 +358,12 @@ public void LoadAsync(Uri requestUri) if (!this.IsTracking) { - throw new InvalidOperationException(Strings.DataServiceCollection_OperationForTrackedOnly); + throw new InvalidOperationException(SRResources.DataServiceCollection_OperationForTrackedOnly); } if (this.ongoingAsyncOperation != null) { - throw new InvalidOperationException(Strings.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); + throw new InvalidOperationException(SRResources.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); } DataServiceContext context = this.observer.Context; @@ -392,19 +392,19 @@ public void LoadAsync() { if (!this.IsTracking) { - throw new InvalidOperationException(Strings.DataServiceCollection_OperationForTrackedOnly); + throw new InvalidOperationException(SRResources.DataServiceCollection_OperationForTrackedOnly); } object parent; string property; if (!this.observer.LookupParent(this, out parent, out property)) { - throw new InvalidOperationException(Strings.DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity); + throw new InvalidOperationException(SRResources.DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity); } if (this.ongoingAsyncOperation != null) { - throw new InvalidOperationException(Strings.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); + throw new InvalidOperationException(SRResources.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); } this.BeginLoadAsyncOperation( @@ -428,12 +428,12 @@ public bool LoadNextPartialSetAsync() { if (!this.IsTracking) { - throw new InvalidOperationException(Strings.DataServiceCollection_OperationForTrackedOnly); + throw new InvalidOperationException(SRResources.DataServiceCollection_OperationForTrackedOnly); } if (this.ongoingAsyncOperation != null) { - throw new InvalidOperationException(Strings.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); + throw new InvalidOperationException(SRResources.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); } if (this.Continuation == null) @@ -504,7 +504,7 @@ public void Clear(bool stopTracking) { if (!this.IsTracking) { - throw new InvalidOperationException(Strings.DataServiceCollection_OperationForTrackedOnly); + throw new InvalidOperationException(SRResources.DataServiceCollection_OperationForTrackedOnly); } if (!stopTracking) @@ -536,13 +536,13 @@ public void Detach() { if (!this.IsTracking) { - throw new InvalidOperationException(Strings.DataServiceCollection_OperationForTrackedOnly); + throw new InvalidOperationException(SRResources.DataServiceCollection_OperationForTrackedOnly); } // Operation only allowed on root collections. if (!this.rootCollection) { - throw new InvalidOperationException(Strings.DataServiceCollection_CannotStopTrackingChildCollection); + throw new InvalidOperationException(SRResources.DataServiceCollection_CannotStopTrackingChildCollection); } this.observer.StopTracking(); @@ -562,7 +562,7 @@ protected override void InsertItem(int index, T item) { if (this.trackingOnLoad) { - throw new InvalidOperationException(Strings.DataServiceCollection_InsertIntoTrackedButNotLoadedCollection); + throw new InvalidOperationException(SRResources.DataServiceCollection_InsertIntoTrackedButNotLoadedCollection); } if (this.IsTracking && item != null) @@ -570,7 +570,7 @@ protected override void InsertItem(int index, T item) INotifyPropertyChanged notify = item as INotifyPropertyChanged; if (notify == null) { - throw new InvalidOperationException(Strings.DataBinding_NotifyPropertyChangedNotImpl(item.GetType())); + throw new InvalidOperationException(Error.Format(SRResources.DataBinding_NotifyPropertyChangedNotImpl, item.GetType())); } } @@ -615,7 +615,7 @@ private static DataServiceContext GetContextFromItems(IEnumerable items) return context; } - throw new ArgumentException(Strings.DataServiceCollection_CannotDetermineContextFromItems); + throw new ArgumentException(SRResources.DataServiceCollection_CannotDetermineContextFromItems); } /// @@ -665,7 +665,7 @@ private void StartLoading() // Observer must be present on the target collection which implies that the operation would fail on default constructed objects. if (this.observer.Context == null) { - throw new InvalidOperationException(Strings.DataServiceCollection_LoadRequiresTargetCollectionObserved); + throw new InvalidOperationException(SRResources.DataServiceCollection_LoadRequiresTargetCollectionObserved); } this.observer.AttachBehavior = true; @@ -705,7 +705,7 @@ private void StartTracking( // Validate here before any items are added to the collection because if this fails we want to prevent the collection from being populated. if (!BindingEntityInfo.IsEntityType(typeof(T), context.Model)) { - throw new ArgumentException(Strings.DataBinding_DataServiceCollectionArgumentMustHaveEntityType(typeof(T))); + throw new ArgumentException(Error.Format(SRResources.DataBinding_DataServiceCollectionArgumentMustHaveEntityType, typeof(T))); } // Set up the observer first because we want the collection to know it's supposed to be tracked while the items are being loaded. diff --git a/src/Microsoft.OData.Client/BulkUpdateGraph.cs b/src/Microsoft.OData.Client/BulkUpdateGraph.cs index e1e38e2b67..9f538a5702 100644 --- a/src/Microsoft.OData.Client/BulkUpdateGraph.cs +++ b/src/Microsoft.OData.Client/BulkUpdateGraph.cs @@ -93,7 +93,7 @@ private void ComputeEntitySetName() } else { - throw Error.InvalidOperation(Strings.DataBinding_Util_UnknownEntitySetName(parentDescriptor.Entity.GetType().FullName)); + throw Error.InvalidOperation(Error.Format(SRResources.DataBinding_Util_UnknownEntitySetName, parentDescriptor.Entity.GetType().FullName)); } } } diff --git a/src/Microsoft.OData.Client/BulkUpdateSaveResult.cs b/src/Microsoft.OData.Client/BulkUpdateSaveResult.cs index 7c42e724b8..cf3a781257 100644 --- a/src/Microsoft.OData.Client/BulkUpdateSaveResult.cs +++ b/src/Microsoft.OData.Client/BulkUpdateSaveResult.cs @@ -112,7 +112,7 @@ internal void BeginBulkUpdateRequest(params T[] objects) if (objects == null || objects.Length == 0) { - throw Error.Argument(Strings.Util_EmptyArray, nameof(objects)); + throw Error.Argument(SRResources.Util_EmptyArray, nameof(objects)); } BuildDescriptorGraph(this.ChangedEntries, true, objects); @@ -169,7 +169,7 @@ internal void BulkUpdateRequest(params T[] objects) { if (objects == null || objects.Length == 0) { - throw Error.Argument(Strings.Util_EmptyArray, nameof(objects)); + throw Error.Argument(SRResources.Util_EmptyArray, nameof(objects)); } BuildDescriptorGraph(this.ChangedEntries, true, objects); @@ -241,7 +241,7 @@ internal void BuildDescriptorGraph(IEnumerable descriptors, bool // for any of the provided objects then we throw an exception. if (topLevelDescriptor == null) { - throw Error.InvalidOperation(Strings.Context_EntityNotContained); + throw Error.InvalidOperation(SRResources.Context_EntityNotContained); } // If it is a top-level object, @@ -418,7 +418,7 @@ protected override DataServiceResponse HandleResponse() if (this.cachedResponse.Exception != null) { - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, this.cachedResponse.Exception, dataServiceResponse); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, this.cachedResponse.Exception, dataServiceResponse); } Stack<(int LastVisited, IReadOnlyList Descriptors)> adjacentDescriptors = new Stack<(int LastVisited, IReadOnlyList Descriptors)>(); @@ -693,7 +693,7 @@ private void CreateOperationResponse( if (ex != null) { - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, ex, dataServiceResponse); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, ex, dataServiceResponse); } } diff --git a/src/Microsoft.OData.Client/ClientConvert.cs b/src/Microsoft.OData.Client/ClientConvert.cs index 97f5364bad..5a631a2497 100644 --- a/src/Microsoft.OData.Client/ClientConvert.cs +++ b/src/Microsoft.OData.Client/ClientConvert.cs @@ -42,12 +42,12 @@ internal static object ChangeType(string propertyValue, Type propertyType) catch (FormatException ex) { propertyValue = propertyValue.Length == 0 ? "String.Empty" : "String"; - throw Error.InvalidOperation(Strings.Deserialize_Current(propertyType.ToString(), propertyValue), ex); + throw Error.InvalidOperation(Error.Format(SRResources.Deserialize_Current, propertyType.ToString(), propertyValue), ex); } catch (OverflowException ex) { propertyValue = propertyValue.Length == 0 ? "String.Empty" : "String"; - throw Error.InvalidOperation(Strings.Deserialize_Current(propertyType.ToString(), propertyValue), ex); + throw Error.InvalidOperation(Error.Format(SRResources.Deserialize_Current, propertyType.ToString(), propertyValue), ex); } } else @@ -163,7 +163,7 @@ internal static string GetEdmType(Type propertyType) // don't support reverse mappings for these types in this version // allows us to add real server support in the future without a // "breaking change" in the future client - throw new NotSupportedException(Strings.ALinq_CantCastToUnsupportedPrimitive(propertyType.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantCastToUnsupportedPrimitive, propertyType.Name)); } } else diff --git a/src/Microsoft.OData.Client/ClientEdmModel.cs b/src/Microsoft.OData.Client/ClientEdmModel.cs index fd052abb4d..23cea3b158 100644 --- a/src/Microsoft.OData.Client/ClientEdmModel.cs +++ b/src/Microsoft.OData.Client/ClientEdmModel.cs @@ -353,7 +353,7 @@ private void ValidateComplexType(Type type, EdmTypeCacheValue cachedEdmType) if (hasProperties == false && (type == typeof(System.Object) || type.IsGenericType())) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_NoSettableFields(type.ToString())); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_NoSettableFields, type.ToString())); } } } @@ -371,13 +371,13 @@ private void SetMimeTypeForProperties(IEdmStructuredType edmStructuredType) IEdmProperty dataProperty = edmStructuredType.Properties().SingleOrDefault(p => p.Name == attribute.DataPropertyName); if (dataProperty == null) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_MissingMimeTypeDataProperty(this.GetClientTypeAnnotation(edmStructuredType).ElementTypeName, attribute.DataPropertyName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingMimeTypeDataProperty, this.GetClientTypeAnnotation(edmStructuredType).ElementTypeName, attribute.DataPropertyName)); } IEdmProperty mimeTypeProperty = edmStructuredType.Properties().SingleOrDefault(p => p.Name == attribute.MimeTypePropertyName); if (mimeTypeProperty == null) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_MissingMimeTypeProperty(this.GetClientTypeAnnotation(edmStructuredType).ElementTypeName, attribute.MimeTypePropertyName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingMimeTypeProperty, this.GetClientTypeAnnotation(edmStructuredType).ElementTypeName, attribute.MimeTypePropertyName)); } this.GetClientPropertyAnnotation(dataProperty).MimeTypeProperty = this.GetClientPropertyAnnotation(mimeTypeProperty); @@ -438,7 +438,7 @@ private EdmTypeCacheValue GetOrCreateEdmTypeInternal(IEdmStructuredType edmBaseT // 2. will also throw during SaveChanges(), validated by unit test case 'SerializationOfCollection'in CollectionTests.cs. if ((itemType.TypeKind == EdmTypeKind.Collection)) { - throw new ODataException(Strings.ClientType_CollectionOfCollectionNotSupported); + throw new ODataException(SRResources.ClientType_CollectionOfCollectionNotSupported); } cachedEdmType = new EdmTypeCacheValue(new EdmCollectionType(itemType.ToEdmTypeReference(ClientTypeUtil.CanAssignNull(elementType))), hasProperties); @@ -602,7 +602,7 @@ private IEdmProperty CreateEdmProperty(IEdmStructuredType declaringType, Propert { if (declaringType as IEdmEntityType == null && declaringType as IEdmComplexType == null) { - throw Client.Error.InvalidOperation(Client.Strings.ClientTypeCache_NonEntityTypeCannotContainEntityProperties(propertyInfo.Name, propertyInfo.DeclaringType.ToString())); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientTypeCache_NonEntityTypeCannotContainEntityProperties, propertyInfo.Name, propertyInfo.DeclaringType.ToString())); } // Create a navigation property representing one side of an association. @@ -653,7 +653,7 @@ private ClientTypeAnnotation GetOrCreateClientTypeAnnotation(IEdmType edmType, T qualifiedName = type.AssemblyQualifiedName; if (this.typeNameToClientTypeAnnotationCache.TryGetValue(qualifiedName, out clientTypeAnnotation) && clientTypeAnnotation.ElementType != type) { - throw Client.Error.InvalidOperation(Strings.ClientType_MultipleTypesWithSameName(qualifiedName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MultipleTypesWithSameName, qualifiedName)); } } diff --git a/src/Microsoft.OData.Client/Common.cs b/src/Microsoft.OData.Client/Common.cs index d8626ea74c..a197cbe5e2 100644 --- a/src/Microsoft.OData.Client/Common.cs +++ b/src/Microsoft.OData.Client/Common.cs @@ -95,9 +95,9 @@ internal static string GetCollectionItemTypeName(string typeName, bool isNested) if (isNested) { #if ODATA_CLIENT - throw Error.InvalidOperation(Strings.ClientType_CollectionOfCollectionNotSupported); + throw Error.InvalidOperation(SRResources.ClientType_CollectionOfCollectionNotSupported); #else - throw DataServiceException.CreateBadRequestError(Strings.BadRequest_CollectionOfCollectionNotSupported); + throw DataServiceException.CreateBadRequestError(SRResources.BadRequest_CollectionOfCollectionNotSupported); #endif } diff --git a/src/Microsoft.OData.Client/ContentTypeUtil.cs b/src/Microsoft.OData.Client/ContentTypeUtil.cs index 6ce12aeb4f..7d1858d86f 100644 --- a/src/Microsoft.OData.Client/ContentTypeUtil.cs +++ b/src/Microsoft.OData.Client/ContentTypeUtil.cs @@ -250,7 +250,7 @@ internal static string SelectRequiredMimeType( if (!acceptable && !acceptTypesEmpty) { - throw Error.HttpHeaderFailure(415, Strings.DataServiceException_UnsupportedMediaType); + throw Error.HttpHeaderFailure(415, SRResources.DataServiceException_UnsupportedMediaType); } if (acceptTypesEmpty) @@ -405,7 +405,7 @@ internal static MediaParameter[] ReadContentType(string contentType, out string { if (String.IsNullOrEmpty(contentType)) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_ContentTypeMissing); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_ContentTypeMissing); } MediaType mediaType = ReadMediaType(contentType); @@ -447,7 +447,7 @@ internal static MediaParameter[] ReadContentType(string contentType, out string { if (String.IsNullOrEmpty(contentType)) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_ContentTypeMissing); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_ContentTypeMissing); } MediaType mediaType = ReadMediaType(contentType); @@ -485,7 +485,7 @@ private static Encoding EncodingFromName(string name) catch (ArgumentException) { // 400 - Bad Request - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_EncodingNotSupported(name)); + throw Error.HttpHeaderFailure(400, Error.Format(SRResources.HttpProcessUtility_EncodingNotSupported, name)); } } @@ -773,12 +773,12 @@ private static void ReadMediaTypeAndSubtype(string text, ref int textIndex, out int textStart = textIndex; if (ReadToken(text, ref textIndex)) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeUnspecified); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeUnspecified); } if (text[textIndex] != '/') { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeRequiresSlash); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeRequiresSlash); } type = text.Substring(textStart, textIndex - textStart); @@ -789,7 +789,7 @@ private static void ReadMediaTypeAndSubtype(string text, ref int textIndex, out if (textIndex == subTypeStart) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeRequiresSubType); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeRequiresSubType); } subType = text.Substring(subTypeStart, textIndex - subTypeStart); @@ -813,7 +813,7 @@ private static MediaType ReadMediaType(string text) { if (text[textIndex] != ';') { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter); } textIndex++; @@ -876,13 +876,13 @@ private static void ReadMediaTypeParameter(string text, ref int textIndex, ref M int startIndex = textIndex; if (ReadToken(text, ref textIndex)) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeMissingValue); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeMissingValue); } string parameterName = text.Substring(startIndex, textIndex - startIndex); if (text[textIndex] != '=') { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_MediaTypeMissingValue); + throw Error.HttpHeaderFailure(400, SRResources.HttpProcessUtility_MediaTypeMissingValue); } textIndex++; @@ -936,7 +936,7 @@ private static MediaParameter ReadQuotedParameterValue(string parameterName, str { if (!valueIsQuoted) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_EscapeCharWithoutQuotes(parameterName)); + throw Error.HttpHeaderFailure(400, Error.Format(SRResources.HttpProcessUtility_EscapeCharWithoutQuotes, parameterName)); } textIndex++; @@ -950,7 +950,7 @@ private static MediaParameter ReadQuotedParameterValue(string parameterName, str if (textIndex >= headerText.Length) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_EscapeCharAtEnd(parameterName)); + throw Error.HttpHeaderFailure(400, Error.Format(SRResources.HttpProcessUtility_EscapeCharAtEnd, parameterName)); } currentChar = headerText[textIndex]; @@ -968,7 +968,7 @@ private static MediaParameter ReadQuotedParameterValue(string parameterName, str if (valueIsQuoted) { - throw Error.HttpHeaderFailure(400, Strings.HttpProcessUtility_ClosingQuoteNotFound(parameterName)); + throw Error.HttpHeaderFailure(400, Error.Format(SRResources.HttpProcessUtility_ClosingQuoteNotFound, parameterName)); } return new MediaParameter(parameterName, parameterValue.ToString(), isQuoted); diff --git a/src/Microsoft.OData.Client/DataServiceClientException.cs b/src/Microsoft.OData.Client/DataServiceClientException.cs index 0b7a5185e6..75cd938132 100644 --- a/src/Microsoft.OData.Client/DataServiceClientException.cs +++ b/src/Microsoft.OData.Client/DataServiceClientException.cs @@ -24,7 +24,7 @@ public sealed class DataServiceClientException : InvalidOperationException /// Initializes a new instance of the class with a system-supplied message that describes the error. public DataServiceClientException() - : this(Strings.DataServiceException_GeneralError) + : this(SRResources.DataServiceException_GeneralError) { } diff --git a/src/Microsoft.OData.Client/DataServiceClientFormat.cs b/src/Microsoft.OData.Client/DataServiceClientFormat.cs index 668f4d1e3e..b940a1d2de 100644 --- a/src/Microsoft.OData.Client/DataServiceClientFormat.cs +++ b/src/Microsoft.OData.Client/DataServiceClientFormat.cs @@ -123,7 +123,7 @@ public void UseJson() { if (this.ServiceModel == null) { - throw new InvalidOperationException(Strings.DataServiceClientFormat_LoadServiceModelRequired); + throw new InvalidOperationException(SRResources.DataServiceClientFormat_LoadServiceModelRequired); } this.ODataFormat = ODataFormat.Json; diff --git a/src/Microsoft.OData.Client/DataServiceClientRequestPipelineConfiguration.cs b/src/Microsoft.OData.Client/DataServiceClientRequestPipelineConfiguration.cs index 16b6d57896..0bbb4d5bfb 100644 --- a/src/Microsoft.OData.Client/DataServiceClientRequestPipelineConfiguration.cs +++ b/src/Microsoft.OData.Client/DataServiceClientRequestPipelineConfiguration.cs @@ -10,7 +10,6 @@ namespace Microsoft.OData.Client using System.Collections.Generic; using System.Diagnostics; using Microsoft.OData; - using ClientStrings = Microsoft.OData.Client.Strings; /// /// Class that holds a variety of events for writing the payload from the OData to the wire @@ -66,7 +65,7 @@ public Func @@ -1016,7 +1014,7 @@ public virtual void CancelRequest(IAsyncResult asyncResult) if (context != this) { - throw Error.Argument(Strings.Context_DidNotOriginateAsync, "asyncResult"); + throw Error.Argument(SRResources.Context_DidNotOriginateAsync, "asyncResult"); } } @@ -1374,14 +1372,14 @@ private EntityDescriptor GetEntityDescriptorForStreamEntity(object entity) BaseEntityType baseEntity = entity as BaseEntityType; if (baseEntity == null) { - throw Error.InvalidOperation(Strings.Context_EntityMediaLinksNotTrackedInEntity); + throw Error.InvalidOperation(SRResources.Context_EntityMediaLinksNotTrackedInEntity); } descriptor = baseEntity.EntityDescriptor; if (descriptor == null) { - throw Error.InvalidOperation(Strings.Context_EntityInNonTrackedContextLacksMediaLinks); + throw Error.InvalidOperation(SRResources.Context_EntityInNonTrackedContextLacksMediaLinks); } } else @@ -1602,7 +1600,7 @@ public virtual void SetSaveStream(object entity, Stream stream, bool closeStream if (clientType.MediaDataMember != null) { throw new ArgumentException( - Strings.Context_SetSaveStreamOnMediaEntryProperty(clientType.ElementTypeName), + Error.Format(SRResources.Context_SetSaveStreamOnMediaEntryProperty, clientType.ElementTypeName), nameof(entity)); } @@ -1621,7 +1619,7 @@ public virtual void SetSaveStream(object entity, Stream stream, bool closeStream break; default: - throw new DataServiceClientException(Strings.Context_SetSaveStreamOnInvalidEntityState(Enum.GetName(typeof(EntityStates), box.State))); + throw new DataServiceClientException(Error.Format(SRResources.Context_SetSaveStreamOnInvalidEntityState, Enum.GetName(typeof(EntityStates), box.State))); } // Note that there's no need to mark the entity as updated because we consider the presence @@ -1667,14 +1665,14 @@ public virtual void SetSaveStream(object entity, string name, Stream stream, boo if (string.IsNullOrEmpty(args.ContentType)) { - throw Error.Argument(Strings.Context_ContentTypeRequiredForNamedStream, "args"); + throw Error.Argument(SRResources.Context_ContentTypeRequiredForNamedStream, "args"); } EntityDescriptor box = this.entityTracker.GetEntityDescriptor(entity); Debug.Assert(box.State != EntityStates.Detached, "We should never have a detached entity in the entityDescriptor dictionary."); if (box.State == EntityStates.Deleted) { - throw new DataServiceClientException(Strings.Context_SetSaveStreamOnInvalidEntityState(Enum.GetName(typeof(EntityStates), box.State))); + throw new DataServiceClientException(Error.Format(SRResources.Context_SetSaveStreamOnInvalidEntityState, Enum.GetName(typeof(EntityStates), box.State))); } StreamDescriptor namedStream = box.AddStreamInfoIfNotPresent(name); @@ -2003,7 +2001,7 @@ public virtual OperationResponse EndExecute(IAsyncResult asyncResult) QueryOperationResponse result = (QueryOperationResponse)DataServiceRequest.EndExecute(this, this, Util.ExecuteMethodNameForVoidResults, asyncResult); if (result.Any()) { - throw new DataServiceClientException(Strings.Context_EndExecuteExpectedVoidResponse); + throw new DataServiceClientException(SRResources.Context_EndExecuteExpectedVoidResponse); } return result; @@ -2058,7 +2056,7 @@ public virtual OperationResponse Execute(Uri requestUri, string httpMethod, para QueryOperationResponse result = (QueryOperationResponse)Execute(requestUri, httpMethod, false, operationParameters); if (result.Any()) { - throw new DataServiceClientException(Strings.Context_ExecuteExpectedVoidResponse); + throw new DataServiceClientException(SRResources.Context_ExecuteExpectedVoidResponse); } return result; @@ -2237,7 +2235,7 @@ public virtual DataServiceResponse BulkUpdate(params T[] objects) { if (objects == null || objects.Length == 0) { - throw Error.Argument(Strings.Util_EmptyArray, nameof(objects)); + throw Error.Argument(SRResources.Util_EmptyArray, nameof(objects)); } BulkUpdateSaveResult result = new BulkUpdateSaveResult(this, Util.BulkUpdateMethodName, SaveChangesOptions.BulkUpdate, callback: null, state: null); @@ -2274,7 +2272,7 @@ internal virtual IAsyncResult BeginBulkUpdate(AsyncCallback callback, object { if (objects == null || objects.Length == 0) { - throw Error.Argument(Strings.Util_EmptyArray, nameof(objects)); + throw Error.Argument(SRResources.Util_EmptyArray, nameof(objects)); } BulkUpdateSaveResult result = new BulkUpdateSaveResult(this, Util.BulkUpdateMethodName, SaveChangesOptions.BulkUpdate, callback, state); @@ -2450,7 +2448,7 @@ public virtual void DeleteLink(object source, string sourceProperty, object targ { if (delay) { // can't have non-added relationship when source or target is in added state - throw Error.InvalidOperation(Strings.Context_NoRelationWithInsertEnd); + throw Error.InvalidOperation(SRResources.Context_NoRelationWithInsertEnd); } if (existing == null) @@ -2528,7 +2526,7 @@ public virtual void SetRelatedObjectLink(object source, string sourceProperty, o // Check for deleted source entity if (sourceResource.State == EntityStates.Deleted) { - throw Error.InvalidOperation(Strings.Context_SetRelatedObjectLinkSourceDeleted); + throw Error.InvalidOperation(SRResources.Context_SetRelatedObjectLinkSourceDeleted); } // Validate that the property is valid and exists on the source @@ -2540,7 +2538,7 @@ public virtual void SetRelatedObjectLink(object source, string sourceProperty, o if (property.IsKnownType || property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_SetRelatedObjectLinkNonCollectionOnly); + throw Error.InvalidOperation(SRResources.Context_SetRelatedObjectLinkNonCollectionOnly); } // if (property.IsEntityCollection) then property.PropertyType is the collection elementType @@ -2551,7 +2549,7 @@ public virtual void SetRelatedObjectLink(object source, string sourceProperty, o if (!sourcePropertyType.ElementType.IsInstanceOfType(target)) { // target is not of the correct type - throw Error.Argument(Strings.Context_RelationNotRefOrCollection, nameof(target)); + throw Error.Argument(SRResources.Context_RelationNotRefOrCollection, nameof(target)); } LinkDescriptor descriptor = new LinkDescriptor(source, sourceProperty, target, this.model); @@ -2609,7 +2607,7 @@ public virtual void AddRelatedObject(object source, string sourceProperty, objec // Check for deleted source entity if (sourceResource.State == EntityStates.Deleted) { - throw Error.InvalidOperation(Strings.Context_AddRelatedObjectSourceDeleted); + throw Error.InvalidOperation(SRResources.Context_AddRelatedObjectSourceDeleted); } // Validate that the property is valid and exists on the source @@ -2617,7 +2615,7 @@ public virtual void AddRelatedObject(object source, string sourceProperty, objec ClientPropertyAnnotation property = parentType.GetProperty(sourceProperty, UndeclaredPropertyBehavior.ThrowException); if (property.IsKnownType || !property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_AddRelatedObjectCollectionOnly); + throw Error.InvalidOperation(SRResources.Context_AddRelatedObjectCollectionOnly); } // Validate that the target is an entity @@ -2629,7 +2627,7 @@ public virtual void AddRelatedObject(object source, string sourceProperty, objec if (!propertyElementType.ElementType.IsAssignableFrom(childType.ElementType)) { // target is not of the correct type - throw Error.Argument(Strings.Context_RelationNotRefOrCollection, "target"); + throw Error.Argument(SRResources.Context_RelationNotRefOrCollection, "target"); } var targetResource = new EntityDescriptor(this.model) @@ -2669,7 +2667,7 @@ public virtual void SetRelatedObject(object source, string sourceProperty, objec // Check for deleted source entity if (sourceResource.State == EntityStates.Deleted) { - throw Error.InvalidOperation(Strings.Context_SetRelatedObjectSourceDeleted); + throw Error.InvalidOperation(SRResources.Context_SetRelatedObjectSourceDeleted); } // Validate that the property is valid and exists on the source @@ -2678,7 +2676,7 @@ public virtual void SetRelatedObject(object source, string sourceProperty, objec if (property.IsKnownType || property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_SetRelatedObjectNonCollectionOnly); + throw Error.InvalidOperation(SRResources.Context_SetRelatedObjectNonCollectionOnly); } // Validate that the target is an entity @@ -2691,7 +2689,7 @@ public virtual void SetRelatedObject(object source, string sourceProperty, objec if (!propertyElementType.ElementType.IsAssignableFrom(childType.ElementType)) { // target is not of the correct type - throw Error.Argument(Strings.Context_RelationNotRefOrCollection, nameof(target)); + throw Error.Argument(SRResources.Context_RelationNotRefOrCollection, nameof(target)); } var targetResource = new EntityDescriptor(this.model) @@ -2852,7 +2850,7 @@ public virtual void UpdateRelatedObject(object source, string sourceProperty, ob // Check for deleted source entity if (sourceResource.State == EntityStates.Deleted) { - throw Error.InvalidOperation(Strings.Context_AddRelatedObjectSourceDeleted); + throw Error.InvalidOperation(SRResources.Context_AddRelatedObjectSourceDeleted); } // Validate that the property is valid and exists on the source @@ -2861,7 +2859,7 @@ public virtual void UpdateRelatedObject(object source, string sourceProperty, ob if (property.IsKnownType || property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_UpdateRelatedObjectNonCollectionOnly); + throw Error.InvalidOperation(SRResources.Context_UpdateRelatedObjectNonCollectionOnly); } // Validate that the target is an entity @@ -2872,7 +2870,7 @@ public virtual void UpdateRelatedObject(object source, string sourceProperty, ob if (!propertyElementType.ElementType.IsAssignableFrom(childType.ElementType)) { // target is not of the correct type - throw Error.Argument(Strings.Context_RelationNotRefOrCollection, "target"); + throw Error.Argument(SRResources.Context_RelationNotRefOrCollection, "target"); } EntityDescriptor targetResource = this.entityTracker.TryGetEntityDescriptor(target); @@ -2913,7 +2911,7 @@ public virtual void ChangeState(object entity, EntityStates state) switch (state) { case EntityStates.Added: - throw Error.NotSupported(ClientStrings.Context_CannotChangeStateToAdded); + throw Error.NotSupported(SRResources.Context_CannotChangeStateToAdded); case EntityStates.Modified: this.UpdateObjectInternal(entity, true /*failIfNotUnchanged*/); @@ -3605,7 +3603,7 @@ private static void ValidateEntitySetName(ref string entitySetName) !String.IsNullOrEmpty(UriUtil.CreateUri(new Uri("http://ConstBaseUri/ConstService.svc/"), tmp) .GetComponents(UriComponents.Query | UriComponents.Fragment, UriFormat.SafeUnescaped))) { - throw Error.Argument(Strings.Context_EntitySetName, "entitySetName"); + throw Error.Argument(SRResources.Context_EntitySetName, "entitySetName"); } } @@ -3620,7 +3618,7 @@ private static void ValidateEntityType(object entity, ClientEdmModel model) if (!ClientTypeUtil.TypeIsEntity(entity.GetType(), model)) { - throw Error.Argument(Strings.Content_EntityIsNotEntityType, "entity"); + throw Error.Argument(SRResources.Content_EntityIsNotEntityType, "entity"); } } @@ -3654,12 +3652,12 @@ private static void ValidateOperationParameters( { if (operationParameter == null) { - throw new ArgumentException(Strings.Context_NullElementInOperationParameterArray); + throw new ArgumentException(SRResources.Context_NullElementInOperationParameterArray); } if (String.IsNullOrEmpty(operationParameter.Name)) { - throw new ArgumentException(Strings.Context_MissingOperationParameterName); + throw new ArgumentException(SRResources.Context_MissingOperationParameterName); } String paramName = operationParameter.Name.Trim(); @@ -3669,12 +3667,12 @@ private static void ValidateOperationParameters( { if (string.CompareOrdinal(XmlConstants.HttpMethodGet, httpMethod) == 0) { - throw new ArgumentException(Strings.Context_BodyOperationParametersNotAllowedWithGet); + throw new ArgumentException(SRResources.Context_BodyOperationParametersNotAllowedWithGet); } if (!bodyParamNames.Add(paramName)) { - throw new ArgumentException(Strings.Context_DuplicateBodyOperationParameterName); + throw new ArgumentException(SRResources.Context_DuplicateBodyOperationParameterName); } bodyParams.Add(bodyOperationParameter); @@ -3686,7 +3684,7 @@ private static void ValidateOperationParameters( { if (!uriParamNames.Add(paramName)) { - throw new ArgumentException(Strings.Context_DuplicateUriOperationParameterName); + throw new ArgumentException(SRResources.Context_DuplicateUriOperationParameterName); } uriParams.Add(uriOperationParameter); @@ -3763,19 +3761,19 @@ private void ValidateSaveChangesOptions(SaveChangesOptions options) // OnlyPostExplicitProperties cannot be used without DataServiceCollection to track properties change if (Util.IsFlagSet(options, SaveChangesOptions.PostOnlySetProperties) && !this.UsingDataServiceCollection) { - throw Error.InvalidOperation(Strings.Context_MustBeUsedWith("SaveChangesOptions.OnlyPostExplicitProperties", "DataServiceCollection")); + throw Error.InvalidOperation(Error.Format(SRResources.Context_MustBeUsedWith, "SaveChangesOptions.OnlyPostExplicitProperties", "DataServiceCollection")); } // UseRelativeUri can only be used in Batch Requests if (Util.IsFlagSet(options, SaveChangesOptions.UseRelativeUri) && !Util.IsBatch(options)) { - throw Error.InvalidOperation(Strings.Context_MustBeUsedWith("SaveChangesOptions.UseRelativeUri", "DataServiceCollection")); + throw Error.InvalidOperation(Error.Format(SRResources.Context_MustBeUsedWith, "SaveChangesOptions.UseRelativeUri", "DataServiceCollection")); } // UseJsonBatch can only be used in Batch Requests if (Util.IsFlagSet(options, SaveChangesOptions.UseJsonBatch) && !Util.IsBatch(options)) { - throw Error.InvalidOperation(Strings.Context_MustBeUsedWith("SaveChangesOptions.UseJsonBatch", "DataServiceCollection")); + throw Error.InvalidOperation(Error.Format(SRResources.Context_MustBeUsedWith, "SaveChangesOptions.UseJsonBatch", "DataServiceCollection")); } // BulkUpdate cannot be used in Batch Requests @@ -3809,7 +3807,7 @@ private void ValidateExecuteParameters( string.CompareOrdinal(XmlConstants.HttpMethodPost, httpMethod) != 0 && string.CompareOrdinal(XmlConstants.HttpMethodDelete, httpMethod) != 0) { - throw new ArgumentException(Strings.Context_ExecuteExpectsGetOrPostOrDelete, nameof(httpMethod)); + throw new ArgumentException(SRResources.Context_ExecuteExpectsGetOrPostOrDelete, nameof(httpMethod)); } if (ClientTypeUtil.TypeOrElementTypeIsStructured(typeof(TElement))) @@ -3852,7 +3850,7 @@ private LoadPropertyResult CreateLoadPropertyRequest(object entity, string prope if (EntityStates.Added == box.State) { - throw Error.InvalidOperation(Strings.Context_NoLoadWithInsertEnd); + throw Error.InvalidOperation(SRResources.Context_NoLoadWithInsertEnd); } ClientPropertyAnnotation property = type.GetProperty(propertyName, UndeclaredPropertyBehavior.ThrowException); @@ -3951,7 +3949,7 @@ private bool EnsureRelatable(object source, string sourceProperty, object target if (property.IsKnownType) { - throw Error.InvalidOperation(Strings.Context_RelationNotRefOrCollection); + throw Error.InvalidOperation(SRResources.Context_RelationNotRefOrCollection); } if (EntityStates.Unchanged == state && target == null && property.IsEntityCollection) @@ -3962,11 +3960,11 @@ private bool EnsureRelatable(object source, string sourceProperty, object target if (((EntityStates.Added == state) || (EntityStates.Deleted == state)) && !property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_AddLinkCollectionOnly); + throw Error.InvalidOperation(SRResources.Context_AddLinkCollectionOnly); } else if (EntityStates.Modified == state && property.IsEntityCollection) { - throw Error.InvalidOperation(Strings.Context_SetLinkReferenceOnly); + throw Error.InvalidOperation(SRResources.Context_SetLinkReferenceOnly); } // if (property.IsEntityCollection) then property.PropertyType is the collection elementType @@ -3977,7 +3975,7 @@ private bool EnsureRelatable(object source, string sourceProperty, object target if ((target != null) && !type.ElementType.IsInstanceOfType(target)) { // target is not of the correct type - throw Error.Argument(Strings.Context_RelationNotRefOrCollection, "target"); + throw Error.Argument(SRResources.Context_RelationNotRefOrCollection, "target"); } if ((EntityStates.Added == state) || (EntityStates.Unchanged == state)) @@ -3986,7 +3984,7 @@ private bool EnsureRelatable(object source, string sourceProperty, object target ((targetResource != null) && (targetResource.State == EntityStates.Deleted))) { // can't add/attach new relationship when source or target in deleted state - throw Error.InvalidOperation(Strings.Context_NoRelationWithDeleteEnd); + throw Error.InvalidOperation(SRResources.Context_NoRelationWithDeleteEnd); } } @@ -4001,7 +3999,7 @@ private bool EnsureRelatable(object source, string sourceProperty, object target return true; } - throw Error.InvalidOperation(Strings.Context_NoRelationWithInsertEnd); + throw Error.InvalidOperation(SRResources.Context_NoRelationWithInsertEnd); } } @@ -4044,7 +4042,7 @@ private GetReadStreamResult CreateGetReadStreamResult( requestUri = entityDescriptor.ReadStreamUri; if (requestUri == null) { - throw new ArgumentException(Strings.Context_EntityNotMediaLinkEntry, nameof(entity)); + throw new ArgumentException(SRResources.Context_EntityNotMediaLinkEntry, nameof(entity)); } streamDescriptor = entityDescriptor.DefaultStreamDescriptor; @@ -4054,14 +4052,14 @@ private GetReadStreamResult CreateGetReadStreamResult( version = Util.ODataVersion4; if (!entityDescriptor.TryGetNamedStreamInfo(name, out streamDescriptor)) { - throw new ArgumentException(Strings.Context_EntityDoesNotContainNamedStream(name), nameof(name)); + throw new ArgumentException(Error.Format(SRResources.Context_EntityDoesNotContainNamedStream, name), nameof(name)); } // use the edit link, if self link is not specified. requestUri = streamDescriptor.SelfLink ?? streamDescriptor.EditLink; if (requestUri == null) { - throw new ArgumentException(Strings.Context_MissingSelfAndEditLinkForNamedStream(name), nameof(name)); + throw new ArgumentException(Error.Format(SRResources.Context_MissingSelfAndEditLinkForNamedStream, name), nameof(name)); } } @@ -4088,7 +4086,7 @@ private void EnsureMinimumProtocolVersionV3() { if (this.MaxProtocolVersionAsVersion < Util.ODataVersion4) { - throw Error.InvalidOperation(Strings.Context_RequestVersionIsBiggerThanProtocolVersion(Util.ODataVersion4, this.MaxProtocolVersionAsVersion)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_RequestVersionIsBiggerThanProtocolVersion, Util.ODataVersion4, this.MaxProtocolVersionAsVersion)); } } @@ -4106,7 +4104,7 @@ private ODataResourceMetadataBuilder GetEntityMetadataBuilderInternal(EntityDesc ODataResourceMetadataBuilder entityMetadataBuilder = this.GetEntityMetadataBuilder(descriptor.EntitySetName, descriptor.EdmValue); if (entityMetadataBuilder == null) { - throw new InvalidOperationException(Strings.Context_EntityMetadataBuilderIsRequired); + throw new InvalidOperationException(SRResources.Context_EntityMetadataBuilderIsRequired); } return entityMetadataBuilder; @@ -4171,7 +4169,7 @@ private void UpdateObjectInternal(object entity, bool failIfNotUnchanged, object EntityDescriptor resource = this.entityTracker.TryGetEntityDescriptor(entity); if (resource == null) { - throw Error.Argument(Strings.Context_EntityNotContained, "entity"); + throw Error.Argument(SRResources.Context_EntityNotContained, "entity"); } if (resource.State == EntityStates.Modified) @@ -4183,7 +4181,7 @@ private void UpdateObjectInternal(object entity, bool failIfNotUnchanged, object { if (failIfNotUnchanged) { - throw Error.InvalidOperation(ClientStrings.Context_CannotChangeStateToModifiedIfNotUnchanged); + throw Error.InvalidOperation(SRResources.Context_CannotChangeStateToModifiedIfNotUnchanged); } return; @@ -4237,7 +4235,7 @@ private void DeleteObjectInternal(object entity, bool failIfInAddedState, object { if (failIfInAddedState) { - throw Error.InvalidOperation(ClientStrings.Context_CannotChangeStateIfAdded(EntityStates.Deleted)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_CannotChangeStateIfAdded, EntityStates.Deleted)); } // added -> detach @@ -4311,7 +4309,7 @@ private void SetStateToUnchanged(object entity) EntityDescriptor descriptor = this.entityTracker.GetEntityDescriptor(entity); if (descriptor.State == EntityStates.Added) { - throw Error.InvalidOperation(ClientStrings.Context_CannotChangeStateIfAdded(EntityStates.Unchanged)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_CannotChangeStateIfAdded, EntityStates.Unchanged)); } descriptor.State = EntityStates.Unchanged; diff --git a/src/Microsoft.OData.Client/DataServiceQueryException.cs b/src/Microsoft.OData.Client/DataServiceQueryException.cs index e1ee7e54d4..4e5d0edc84 100644 --- a/src/Microsoft.OData.Client/DataServiceQueryException.cs +++ b/src/Microsoft.OData.Client/DataServiceQueryException.cs @@ -25,7 +25,7 @@ public sealed class DataServiceQueryException : InvalidOperationException /// Initializes a new instance of the class with a system-supplied message that describes the error. public DataServiceQueryException() - : base(Strings.DataServiceException_GeneralError) + : base(SRResources.DataServiceException_GeneralError) { } diff --git a/src/Microsoft.OData.Client/DataServiceQueryOfT.cs b/src/Microsoft.OData.Client/DataServiceQueryOfT.cs index a6bc878e01..fef64c72bf 100644 --- a/src/Microsoft.OData.Client/DataServiceQueryOfT.cs +++ b/src/Microsoft.OData.Client/DataServiceQueryOfT.cs @@ -383,7 +383,7 @@ public override string ToString() } catch (NotSupportedException e) { - return Strings.ALinq_TranslationError(e.Message); + return Error.Format(SRResources.ALinq_TranslationError, e.Message); } } diff --git a/src/Microsoft.OData.Client/DataServiceRequest.cs b/src/Microsoft.OData.Client/DataServiceRequest.cs index d1679ba1b7..fe43e58e8b 100644 --- a/src/Microsoft.OData.Client/DataServiceRequest.cs +++ b/src/Microsoft.OData.Client/DataServiceRequest.cs @@ -177,7 +177,7 @@ internal QueryOperationResponse Execute(DataServiceContext c } operationResponse.Error = ex; - throw new DataServiceQueryException(Strings.DataServiceException_GeneralError, ex, operationResponse); + throw new DataServiceQueryException(SRResources.DataServiceException_GeneralError, ex, operationResponse); } } @@ -229,7 +229,7 @@ internal TElement GetValue(DataServiceContext context, Func(DataServiceContext context, FuncInitializes a new instance of the class with a system-supplied message that describes the error. public DataServiceRequestException() - : base(Strings.DataServiceException_GeneralError) + : base(SRResources.DataServiceException_GeneralError) { } diff --git a/src/Microsoft.OData.Client/DataServiceUrlKeyDelimiter.cs b/src/Microsoft.OData.Client/DataServiceUrlKeyDelimiter.cs index 2790e8f7f6..01dff4060a 100644 --- a/src/Microsoft.OData.Client/DataServiceUrlKeyDelimiter.cs +++ b/src/Microsoft.OData.Client/DataServiceUrlKeyDelimiter.cs @@ -13,7 +13,6 @@ namespace Microsoft.OData.Client using System.Text; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; - using ErrorStrings = Microsoft.OData.Client.Strings; /// /// Component for controlling what convention set is used for generating URLs. @@ -67,7 +66,7 @@ internal void AppendKeyExpression(IEdmStructuredValue entity, StringBuilder buil IEdmEntityTypeReference edmEntityTypeReference = entity.Type as IEdmEntityTypeReference; if (edmEntityTypeReference == null || !edmEntityTypeReference.Key().Any()) { - throw Error.Argument(ErrorStrings.Content_EntityWithoutKey, "entity"); + throw Error.Argument(SRResources.Content_EntityWithoutKey, "entity"); } this.AppendKeyExpression(edmEntityTypeReference.Key().ToList(), p => p.Name, p => GetPropertyValue(entity.FindPropertyValue(p.Name), entity.Type), builder); @@ -89,7 +88,7 @@ internal void AppendKeyExpression(ICollection keyProperties, Func(IEnumerable descriptors, bool // Validate that we can only have one top level entity in Deep Insert. if (bulkUpdateGraph.TopLevelDescriptors.Count > 0) { - throw Error.InvalidOperation(Strings.Context_DeepInsertOneTopLevelEntity); + throw Error.InvalidOperation(SRResources.Context_DeepInsertOneTopLevelEntity); } topLevelDescriptor.ContentGeneratedForSave = true; @@ -206,7 +206,7 @@ internal void BuildDescriptorGraph(IEnumerable descriptors, bool if (entityDescriptor.State == EntityStates.Deleted || entityDescriptor.State == EntityStates.Modified) { string entitySetAndKey = GetEntitySetAndKey(entityDescriptor); - throw Error.InvalidOperation(Strings.Context_DeepInsertDeletedOrModified(entitySetAndKey)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_DeepInsertDeletedOrModified, entitySetAndKey)); } entityDescriptor.ContentGeneratedForSave = true; @@ -224,13 +224,13 @@ internal void BuildDescriptorGraph(IEnumerable descriptors, bool if (linkDescriptor.State == EntityStates.Deleted || linkDescriptor.State == EntityStates.Modified) { string entitySetAndKey = GetEntitySetAndKey(targetDescriptor); - throw Error.InvalidOperation(Strings.Context_DeepInsertDeletedOrModified(entitySetAndKey)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_DeepInsertDeletedOrModified, entitySetAndKey)); } if (targetDescriptor != null && (targetDescriptor.State == EntityStates.Deleted || targetDescriptor.State == EntityStates.Modified)) { string entitySetAndKey = GetEntitySetAndKey(targetDescriptor); - throw Error.InvalidOperation(Strings.Context_DeepInsertDeletedOrModified(entitySetAndKey)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_DeepInsertDeletedOrModified, entitySetAndKey)); } linkDescriptor.ContentGeneratedForSave = true; @@ -407,7 +407,7 @@ private DataServiceResponse HandleDeepInsertResponse() HeaderCollection headers = new HeaderCollection(this.batchResponseMessage); int statusCode = this.batchResponseMessage == null ? (int)HttpStatusCode.InternalServerError : (int)this.batchResponseMessage.StatusCode; DataServiceResponse dataServiceResponse = new DataServiceResponse(headers, statusCode, Enumerable.Empty(), this.IsBatchRequest); - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, ex, dataServiceResponse); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, ex, dataServiceResponse); } HandleDeepInsertResponseInternal(entry : entry, isTopLevelDescriptor : true, descriptor : entityDescriptor, parentOperationResponse : null); @@ -519,7 +519,7 @@ private OperationResponse CreateOperationResponse( if (ex != null) { - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, ex, dataServiceResponse); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, ex, dataServiceResponse); } return null; @@ -560,7 +560,7 @@ private void HandleLocationHeaders(Descriptor descriptor, HttpStatusCode statusC // Except for preflight requests if (headers.HasHeader("Content-Type") && statusCode != HttpStatusCode.Created) { - throw Error.NotSupported(Strings.Deserialize_NoLocationHeader); + throw Error.NotSupported(SRResources.Deserialize_NoLocationHeader); } } @@ -570,7 +570,7 @@ private void HandleLocationHeaders(Descriptor descriptor, HttpStatusCode statusC odataId = WebUtil.ValidateIdentityValue(odataEntityId); if (location == null) { - throw Error.NotSupported(Strings.Context_BothLocationAndIdMustBeSpecified); + throw Error.NotSupported(SRResources.Context_BothLocationAndIdMustBeSpecified); } } else diff --git a/src/Microsoft.OData.Client/EntityDescriptor.cs b/src/Microsoft.OData.Client/EntityDescriptor.cs index cab40ab9e0..7cdaf23786 100644 --- a/src/Microsoft.OData.Client/EntityDescriptor.cs +++ b/src/Microsoft.OData.Client/EntityDescriptor.cs @@ -926,7 +926,7 @@ private Uri GetLink(bool queryLink) if (this.State != EntityStates.Added) { - throw new ArgumentNullException(Strings.EntityDescriptor_MissingSelfEditLink(this.identity)); + throw new ArgumentNullException(Error.Format(SRResources.EntityDescriptor_MissingSelfEditLink, this.identity)); } else { diff --git a/src/Microsoft.OData.Client/EntityTracker.cs b/src/Microsoft.OData.Client/EntityTracker.cs index d4fba5d137..c0c2820880 100644 --- a/src/Microsoft.OData.Client/EntityTracker.cs +++ b/src/Microsoft.OData.Client/EntityTracker.cs @@ -103,7 +103,7 @@ internal override EntityDescriptor GetEntityDescriptor(object resource) EntityDescriptor entityDescriptor = this.TryGetEntityDescriptor(resource); if (entityDescriptor == null) { - throw Error.InvalidOperation(Strings.Context_EntityNotContained); + throw Error.InvalidOperation(SRResources.Context_EntityNotContained); } return entityDescriptor; @@ -138,7 +138,7 @@ internal void AddEntityDescriptor(EntityDescriptor descriptor) } catch (ArgumentException) { - throw Error.InvalidOperation(Strings.Context_EntityAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_EntityAlreadyContained); } } @@ -238,7 +238,7 @@ internal override void AttachLink(object source, string sourceProperty, object t break; case MergeOption.NoTracking: // public API point should throw if link exists - throw Error.InvalidOperation(Strings.Context_RelationAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_RelationAlreadyContained); } } else @@ -307,7 +307,7 @@ internal void AddLink(LinkDescriptor linkDescriptor) } catch (ArgumentException) { - throw Error.InvalidOperation(Strings.Context_RelationAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_RelationAlreadyContained); } } @@ -355,7 +355,7 @@ internal override void DetachExistingLink(LinkDescriptor existingLink, bool targ (parentOfTarget.State != EntityStates.Deleted || parentOfTarget.State != EntityStates.Detached)) { - throw new InvalidOperationException(Strings.Context_ChildResourceExists); + throw new InvalidOperationException(SRResources.Context_ChildResourceExists); } } } @@ -465,11 +465,11 @@ internal override EntityDescriptor InternalAttachEntityDescriptor(EntityDescript // identity existing & pointing to something else if (failIfDuplicated && (trackedEntityDescriptor != null)) { - throw Error.InvalidOperation(Strings.Context_EntityAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_EntityAlreadyContained); } else if (trackedEntityDescriptor != existing) { - throw Error.InvalidOperation(Strings.Context_DifferentEntityAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_DifferentEntityAlreadyContained); } else if (trackedEntityDescriptor == null) { @@ -549,7 +549,7 @@ private void ValidateDuplicateIdentity(Uri identity, EntityDescriptor descriptor { // we checked the state because we do not remove the deleted/detached entity descriptor from the dictionary until we have finished processing all changes // So for instance if you delete one entity and add back one with the same ID, they will be a temporary conflict in the dictionary. - throw Error.InvalidOperation(Strings.Context_DifferentEntityAlreadyContained); + throw Error.InvalidOperation(SRResources.Context_DifferentEntityAlreadyContained); } } } diff --git a/src/Microsoft.OData.Client/Error.cs b/src/Microsoft.OData.Client/Error.cs index b5ed9f7ed0..2d77cef8c1 100644 --- a/src/Microsoft.OData.Client/Error.cs +++ b/src/Microsoft.OData.Client/Error.cs @@ -81,21 +81,21 @@ internal static InvalidOperationException HttpHeaderFailure(int errorCode, strin /// exception to throw internal static NotSupportedException MethodNotSupported(System.Linq.Expressions.MethodCallExpression m) { - return Error.NotSupported(Strings.ALinq_MethodNotSupported(m.Method.Name)); + return Error.NotSupported(Error.Format(SRResources.ALinq_MethodNotSupported, m.Method.Name)); } /// throw an exception because unexpected batch content was encounted /// internal error internal static void ThrowBatchUnexpectedContent(InternalError value) { - throw InvalidOperation(Strings.Batch_UnexpectedContent((int)value)); + throw InvalidOperation(Error.Format(SRResources.Batch_UnexpectedContent, (int)value)); } /// throw an exception because expected batch content was not encountered /// internal error internal static void ThrowBatchExpectedResponse(InternalError value) { - throw InvalidOperation(Strings.Batch_ExpectedResponse((int)value)); + throw InvalidOperation(Error.Format(SRResources.Batch_ExpectedResponse, (int)value)); } /// unexpected xml when reading web responses @@ -103,7 +103,7 @@ internal static void ThrowBatchExpectedResponse(InternalError value) /// exception to throw internal static InvalidOperationException InternalError(InternalError value) { - return InvalidOperation(Strings.Context_InternalError((int)value)); + return InvalidOperation(Error.Format(SRResources.Context_InternalError, (int)value)); } /// throw exception for unexpected xml when reading web responses diff --git a/src/Microsoft.OData.Client/HeaderCollection.cs b/src/Microsoft.OData.Client/HeaderCollection.cs index 5bddfdb605..871780ae23 100644 --- a/src/Microsoft.OData.Client/HeaderCollection.cs +++ b/src/Microsoft.OData.Client/HeaderCollection.cs @@ -186,7 +186,7 @@ internal void SetRequestVersion(Version requestVersion, Version maxProtocolVersi { if (requestVersion > maxProtocolVersion) { - string message = Strings.Context_RequestVersionIsBiggerThanProtocolVersion(requestVersion.ToString(), maxProtocolVersion.ToString()); + string message = Error.Format(SRResources.Context_RequestVersionIsBiggerThanProtocolVersion, requestVersion.ToString(), maxProtocolVersion.ToString()); throw Error.InvalidOperation(message); } diff --git a/src/Microsoft.OData.Client/LoadPropertyResult.cs b/src/Microsoft.OData.Client/LoadPropertyResult.cs index 10291692c1..282e597738 100644 --- a/src/Microsoft.OData.Client/LoadPropertyResult.cs +++ b/src/Microsoft.OData.Client/LoadPropertyResult.cs @@ -70,7 +70,7 @@ internal QueryOperationResponse LoadProperty() if (EntityStates.Added == box.State) { - throw Error.InvalidOperation(Strings.Context_NoLoadWithInsertEnd); + throw Error.InvalidOperation(SRResources.Context_NoLoadWithInsertEnd); } ClientPropertyAnnotation property = type.GetProperty(this.propertyName, UndeclaredPropertyBehavior.ThrowException); @@ -94,7 +94,7 @@ internal QueryOperationResponse LoadProperty() if (response != null) { response.Error = ex; - throw new DataServiceQueryException(Strings.DataServiceException_GeneralError, ex, response); + throw new DataServiceQueryException(SRResources.DataServiceException_GeneralError, ex, response); } throw; @@ -136,7 +136,7 @@ private static byte[] ReadByteArrayWithContentLength(Stream responseStream, int int r = responseStream.Read(buffer, read, totalLength - read); if (r <= 0) { - throw Error.InvalidOperation(Strings.Context_UnexpectedZeroRawRead); + throw Error.InvalidOperation(SRResources.Context_UnexpectedZeroRawRead); } read += r; diff --git a/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs index ccf0fd7bd0..a7ba29c8bc 100644 --- a/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs @@ -84,7 +84,7 @@ internal object CreateCollectionPropertyInstance(ODataProperty collectionPropert // get a ClientType instance for the Collection property. This determines what type will be used later when creating the actual Collection instance ClientTypeAnnotation collectionClientType = this.materializerContext.ResolveTypeForMaterialization(userCollectionType, collectionValue.TypeName); - return this.CreateCollectionInstance(collectionClientType.EdmTypeReference as IEdmCollectionTypeReference, collectionClientType.ElementType, () => DSClient.Strings.Materializer_NoParameterlessCtorForCollectionProperty(collectionProperty.Name, collectionClientType.ElementTypeName)); + return this.CreateCollectionInstance(collectionClientType.EdmTypeReference as IEdmCollectionTypeReference, collectionClientType.ElementType, () => Error.Format(SRResources.Materializer_NoParameterlessCtorForCollectionProperty, collectionProperty.Name, collectionClientType.ElementTypeName)); } /// @@ -97,7 +97,7 @@ internal object CreateCollectionInstance(IEdmCollectionTypeReference edmCollecti { Debug.Assert(edmCollectionTypeReference != null, "edmCollectionTypeReference!=null"); Debug.Assert(clientCollectionType != null, "clientCollectionType!=null"); - return CreateCollectionInstance(edmCollectionTypeReference, clientCollectionType, () => DSClient.Strings.Materializer_MaterializationTypeError(clientCollectionType.FullName)); + return CreateCollectionInstance(edmCollectionTypeReference, clientCollectionType, () => Error.Format(SRResources.Materializer_MaterializationTypeError, clientCollectionType.FullName)); } /// @@ -171,7 +171,7 @@ internal void ApplyCollectionDataValues( { if (!isElementNullable && item == null) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Collection_NullCollectionItemsNotSupported); + throw DSClient.Error.InvalidOperation(SRResources.Collection_NullCollectionItemsNotSupported); } ODataEnumValue enumVal = null; @@ -181,7 +181,7 @@ internal void ApplyCollectionDataValues( { if (item is ODataCollectionValue) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed); + throw DSClient.Error.InvalidOperation(SRResources.Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed); } object materializedValue = this.primitiveValueMaterializationPolicy.MaterializePrimitiveDataValueCollectionElement(collectionItemType, wireTypeName, item); @@ -198,7 +198,7 @@ internal void ApplyCollectionDataValues( { if (item != null) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed); + throw DSClient.Error.InvalidOperation(SRResources.Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed); } addValueToBackingICollectionInstance(collectionInstance, null); @@ -225,7 +225,7 @@ private object CreateCollectionInstance(IEdmCollectionTypeReference edmCollectio // DataServiceCollection cannot track non-entity types so it should not be used for storing primitive or complex types if (ClientTypeUtil.IsDataServiceCollection(clientCollectionType)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_DataServiceCollectionNotSupportedForNonEntities); + throw DSClient.Error.InvalidOperation(SRResources.Materializer_DataServiceCollectionNotSupportedForNonEntities); } try diff --git a/src/Microsoft.OData.Client/Materialization/EntityTrackingAdapter.cs b/src/Microsoft.OData.Client/Materialization/EntityTrackingAdapter.cs index 2a12fde7e7..46b1f461b1 100644 --- a/src/Microsoft.OData.Client/Materialization/EntityTrackingAdapter.cs +++ b/src/Microsoft.OData.Client/Materialization/EntityTrackingAdapter.cs @@ -131,7 +131,7 @@ internal bool TryResolveAsExistingEntry(MaterializerEntry entry, Type expectedEn // The resolver methods below will both need access to Id, so first ensure it's not null if (entry.Id == null) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MissingIdElement); + throw DSClient.Error.InvalidOperation(SRResources.Deserialize_MissingIdElement); } return this.TryResolveAsCreated(entry) || this.TryResolveFromContext(entry, expectedEntryType); @@ -184,7 +184,7 @@ private bool TryResolveFromContext(MaterializerEntry entry, Type expectedEntryTy { if (!expectedEntryType.IsInstanceOfType(entry.ResolvedObject)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_Current(expectedEntryType, entry.ResolvedObject.GetType())); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_Current, expectedEntryType, entry.ResolvedObject.GetType())); } ClientEdmModel edmModel = this.Model; diff --git a/src/Microsoft.OData.Client/Materialization/EntryValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/EntryValueMaterializationPolicy.cs index 15f5549b92..a2fa1dc0d1 100644 --- a/src/Microsoft.OData.Client/Materialization/EntryValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/EntryValueMaterializationPolicy.cs @@ -94,7 +94,7 @@ internal static Type ValidatePropertyMatch(ClientPropertyAnnotation property, OD // and in the client, the property is not a collection property. if (!property.IsResourceSet) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MismatchEntryLinkFeedPropertyNotCollection(property.PropertyName)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_MismatchEntryLinkFeedPropertyNotCollection, property.PropertyName)); } propertyType = property.ResourceSetItemType; @@ -103,7 +103,7 @@ internal static Type ValidatePropertyMatch(ClientPropertyAnnotation property, OD { if (property.IsResourceSet) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MismatchEntryLinkEntryPropertyIsCollection(property.PropertyName)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_MismatchEntryLinkEntryPropertyIsCollection, property.PropertyName)); } propertyType = property.PropertyType; @@ -116,7 +116,7 @@ internal static Type ValidatePropertyMatch(ClientPropertyAnnotation property, OD { if (!ClientTypeUtil.TypeIsStructured(propertyType, model)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_InvalidNonEntityType(propertyType.ToString())); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Materializer_InvalidNonEntityType, propertyType.ToString())); } } @@ -141,7 +141,7 @@ internal static void ValidatePropertyMatch(ClientPropertyAnnotation property, OD if (property.IsKnownType && (feed != null || entry != null)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MismatchEntryLinkLocalSimple); + throw DSClient.Error.InvalidOperation(SRResources.Deserialize_MismatchEntryLinkLocalSimple); } Type propertyType = null; @@ -151,7 +151,7 @@ internal static void ValidatePropertyMatch(ClientPropertyAnnotation property, OD // and in the client, the property is not a collection property. if (!property.IsEntityCollection) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MismatchEntryLinkFeedPropertyNotCollection(property.PropertyName)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_MismatchEntryLinkFeedPropertyNotCollection, property.PropertyName)); } propertyType = property.EntityCollectionItemType; @@ -161,7 +161,7 @@ internal static void ValidatePropertyMatch(ClientPropertyAnnotation property, OD { if (property.IsEntityCollection) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MismatchEntryLinkEntryPropertyIsCollection(property.PropertyName)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_MismatchEntryLinkEntryPropertyIsCollection, property.PropertyName)); } propertyType = property.PropertyType; @@ -173,7 +173,7 @@ internal static void ValidatePropertyMatch(ClientPropertyAnnotation property, OD { if (!ClientTypeUtil.TypeIsEntity(propertyType, model)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_InvalidNonEntityType(propertyType.ToString())); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Materializer_InvalidNonEntityType, propertyType.ToString())); } } } @@ -351,7 +351,7 @@ private static void ValidateCollectionElementTypeIsItemType(Type itemType, Type { if (!collectionElementType.IsAssignableFrom(itemType)) { - string message = DSClient.Strings.Materializer_EntryIntoCollectionMismatch( + string message = Error.Format(SRResources.Materializer_EntryIntoCollectionMismatch, itemType.FullName, collectionElementType.FullName); @@ -569,7 +569,7 @@ private void MaterializeResolvedEntry(MaterializerEntry entry, bool includeLinks // This is a breaking change from V1/V2 where we allowed materialization of entities into non-entities and vice versa if (!actualType.IsStructuredType) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_InvalidNonEntityType(actualType.ElementTypeName)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Materializer_InvalidNonEntityType, actualType.ElementTypeName)); } // Note that even if ShouldUpdateFromPayload is false, we will still be creating diff --git a/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs index a0c6562685..0c4261b9db 100644 --- a/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs @@ -58,7 +58,7 @@ public object MaterializeEnumTypeProperty(Type valueType, ODataProperty property public object MaterializeEnumDataValueCollectionElement(Type collectionItemType, string wireTypeName, string item) { object materializedValue = null; - this.MaterializeODataEnumValue(collectionItemType, wireTypeName, item, () => DSClient.Strings.Collection_NullCollectionItemsNotSupported, out materializedValue); + this.MaterializeODataEnumValue(collectionItemType, wireTypeName, item, () => SRResources.Collection_NullCollectionItemsNotSupported, out materializedValue); return materializedValue; } diff --git a/src/Microsoft.OData.Client/Materialization/FeedAndEntryMaterializerAdapter.cs b/src/Microsoft.OData.Client/Materialization/FeedAndEntryMaterializerAdapter.cs index f31fc6f475..88cd4c7966 100644 --- a/src/Microsoft.OData.Client/Materialization/FeedAndEntryMaterializerAdapter.cs +++ b/src/Microsoft.OData.Client/Materialization/FeedAndEntryMaterializerAdapter.cs @@ -149,7 +149,7 @@ public long GetCountValue(bool readIfNoFeed) return this.currentFeed.Count.Value; } - throw new InvalidOperationException(DSClient.Strings.MaterializeFromObject_CountNotPresent); + throw new InvalidOperationException(SRResources.MaterializeFromObject_CountNotPresent); } /// @@ -652,7 +652,7 @@ private bool TryRead() } catch (ODataErrorException e) { - throw new DataServiceClientException(DSClient.Strings.Deserialize_ServerException(e.Error.Message), e); + throw new DataServiceClientException(Error.Format(SRResources.Deserialize_ServerException, e.Error.Message), e); } catch (ODataException o) { diff --git a/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs b/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs index e0ff0fc4c0..21adf0cedd 100644 --- a/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs +++ b/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs @@ -53,7 +53,7 @@ protected override void ReadWithExpectedType(IEdmTypeReference expectedClientTyp { if (!expectedClientType.IsCollection()) { - throw new DataServiceClientException(DSClient.Strings.Materializer_TypeShouldBeCollectionError(expectedClientType.FullName())); + throw new DataServiceClientException(Error.Format(SRResources.Materializer_TypeShouldBeCollectionError, expectedClientType.FullName())); } Type underlyingExpectedType = Nullable.GetUnderlyingType(this.ExpectedType) ?? this.ExpectedType; @@ -162,7 +162,7 @@ public bool MoveNext() /// The collection was modified after the enumerator was created. public void Reset() { - throw new InvalidOperationException(DSClient.Strings.Materializer_ResetAfterEnumeratorCreationError); + throw new InvalidOperationException(SRResources.Materializer_ResetAfterEnumeratorCreationError); } } } diff --git a/src/Microsoft.OData.Client/Materialization/ODataEntityMaterializer.cs b/src/Microsoft.OData.Client/Materialization/ODataEntityMaterializer.cs index 4ef2dc575c..a9db133ecc 100644 --- a/src/Microsoft.OData.Client/Materialization/ODataEntityMaterializer.cs +++ b/src/Microsoft.OData.Client/Materialization/ODataEntityMaterializer.cs @@ -402,7 +402,7 @@ internal static ODataResource ProjectionGetEntry(MaterializerEntry entry, string if (result == null) { - throw new InvalidOperationException(DSClient.Strings.Materializer_PropertyNotExpectedEntry(name)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_PropertyNotExpectedEntry, name)); } if (!materializerContext.AutoNullPropagation) @@ -437,7 +437,7 @@ internal static object ProjectionInitializeEntity( if (entry.Entry == null) { - throw new NullReferenceException(DSClient.Strings.Materializer_EntryToInitializeIsNull(resultType.FullName)); + throw new NullReferenceException(Error.Format(SRResources.Materializer_EntryToInitializeIsNull, resultType.FullName)); } if (!entry.EntityHasBeenResolved) @@ -446,7 +446,7 @@ internal static object ProjectionInitializeEntity( } else if (!resultType.IsAssignableFrom(entry.ActualType.ElementType)) { - string message = DSClient.Strings.Materializer_ProjectEntityTypeMismatch( + string message = Error.Format(SRResources.Materializer_ProjectEntityTypeMismatch, resultType.FullName, entry.ActualType.ElementType.FullName, entry.Id); @@ -558,7 +558,7 @@ internal static void ProjectionEnsureEntryAvailableOfType(ODataEntityMaterialize { if (!requiredType.IsAssignableFrom(entry.ResolvedObject.GetType())) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_Current(requiredType, entry.ResolvedObject.GetType())); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Deserialize_Current, requiredType, entry.ResolvedObject.GetType())); } } } @@ -652,7 +652,7 @@ internal object ProjectionValueForPath(MaterializerEntry entry, Type expectedTyp else { // the named stream projected did not come back as part of the property - throw new InvalidOperationException(DSClient.Strings.Materializer_PropertyMissing(propertyName)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_PropertyMissing, propertyName)); } } @@ -674,7 +674,7 @@ internal object ProjectionValueForPath(MaterializerEntry entry, Type expectedTyp link = odataProperty == null && links != null ? links.Where(p => p.Name == propertyName).FirstOrDefault() : null; if (link == null && odataProperty == null) { - throw new InvalidOperationException(DSClient.Strings.Materializer_PropertyMissing(propertyName)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_PropertyMissing, propertyName)); } if (link != null) @@ -775,7 +775,7 @@ internal object ProjectionValueForPath(MaterializerEntry entry, Type expectedTyp // This is a breaking change from V1/V2 where we allowed materialization of entities into non-entities and vice versa if (ClientTypeUtil.TypeOrElementTypeIsEntity(property.PropertyType)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_InvalidEntityType(property.EntityCollectionItemType ?? property.PropertyType)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Materializer_InvalidEntityType, property.EntityCollectionItemType ?? property.PropertyType)); } if (property.IsPrimitiveOrEnumOrComplexCollection) @@ -796,7 +796,7 @@ internal object ProjectionValueForPath(MaterializerEntry entry, Type expectedTyp { if (odataProperty.Value == null && !ClientTypeUtil.CanAssignNull(property.NullablePropertyType)) { - throw new InvalidOperationException(DSClient.Strings.Materializer_CannotAssignNull(odataProperty.Name, property.NullablePropertyType)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_CannotAssignNull, odataProperty.Name, property.NullablePropertyType)); } this.entryValueMaterializationPolicy.MaterializePrimitiveDataValue(property.NullablePropertyType, odataProperty); @@ -856,12 +856,12 @@ internal object ProjectionDynamicValueForPath(MaterializerEntry entry, Type expe if (odataProperty == null) { - throw new InvalidOperationException(DSClient.Strings.Materializer_PropertyMissing(propertyName)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_PropertyMissing, propertyName)); } if (odataProperty.Value == null && !ClientTypeUtil.CanAssignNull(expectedPropertyType)) { - throw new InvalidOperationException(DSClient.Strings.Materializer_CannotAssignNull(odataProperty.Name, expectedPropertyType)); + throw new InvalidOperationException(Error.Format(SRResources.Materializer_CannotAssignNull, odataProperty.Name, expectedPropertyType)); } this.entryValueMaterializationPolicy.MaterializePrimitiveDataValue(expectedPropertyType, odataProperty); @@ -970,7 +970,7 @@ private static void CheckEntryToAccessNotNull(MaterializerEntry entry, string na if (entry.Entry == null) { - throw new NullReferenceException(DSClient.Strings.Materializer_EntryToAccessIsNull(name)); + throw new NullReferenceException(Error.Format(SRResources.Materializer_EntryToAccessIsNull, name)); } } @@ -1050,7 +1050,7 @@ private static MaterializerNestedEntry GetPropertyOrThrow(IEnumerable /// Used to materialize a value from an . @@ -80,7 +79,7 @@ internal sealed override bool IsEndOfStream /// The count value returned from the server internal override long CountValue { - get { throw new InvalidOperationException(ClientStrings.MaterializeFromObject_CountNotPresent); } + get { throw new InvalidOperationException(SRResources.MaterializeFromObject_CountNotPresent); } } /// @@ -148,7 +147,7 @@ protected sealed override bool ReadImplementation() } catch (ODataErrorException e) { - throw new DataServiceClientException(ClientStrings.Deserialize_ServerException(e.Error.Message), e); + throw new DataServiceClientException(Error.Format(SRResources.Deserialize_ServerException, e.Error.Message), e); } catch (ODataException e) { diff --git a/src/Microsoft.OData.Client/Materialization/ODataReaderEntityMaterializer.cs b/src/Microsoft.OData.Client/Materialization/ODataReaderEntityMaterializer.cs index cb79b43ee0..1187a61975 100644 --- a/src/Microsoft.OData.Client/Materialization/ODataReaderEntityMaterializer.cs +++ b/src/Microsoft.OData.Client/Materialization/ODataReaderEntityMaterializer.cs @@ -145,7 +145,7 @@ internal static MaterializerEntry ParseSingleEntityPayload(IODataResponseMessage { if (entry != null) { - throw new InvalidOperationException(DSClient.Strings.Parser_SingleEntry_MultipleFound); + throw new InvalidOperationException(SRResources.Parser_SingleEntry_MultipleFound); } entry = parser.CurrentEntry; @@ -156,11 +156,11 @@ internal static MaterializerEntry ParseSingleEntityPayload(IODataResponseMessage { if (readFeed) { - throw new InvalidOperationException(DSClient.Strings.Parser_SingleEntry_NoneFound); + throw new InvalidOperationException(SRResources.Parser_SingleEntry_NoneFound); } else { - throw new InvalidOperationException(DSClient.Strings.Parser_SingleEntry_ExpectedFeedOrEntry); + throw new InvalidOperationException(SRResources.Parser_SingleEntry_ExpectedFeedOrEntry); } } @@ -204,11 +204,11 @@ internal static MaterializerDeltaFeed ParseDeltaResourceSetPayload(IODataRespons { if (readDeltaResourceSet) { - throw new InvalidOperationException(DSClient.Strings.Parser_SingleEntry_NoneFound); + throw new InvalidOperationException(SRResources.Parser_SingleEntry_NoneFound); } else { - throw new InvalidOperationException(DSClient.Strings.Parser_SingleEntry_ExpectedFeedOrEntry); + throw new InvalidOperationException(SRResources.Parser_SingleEntry_ExpectedFeedOrEntry); } } diff --git a/src/Microsoft.OData.Client/Materialization/PrimitivePropertyConverter.cs b/src/Microsoft.OData.Client/Materialization/PrimitivePropertyConverter.cs index ff1408b66f..203d338013 100644 --- a/src/Microsoft.OData.Client/Materialization/PrimitivePropertyConverter.cs +++ b/src/Microsoft.OData.Client/Materialization/PrimitivePropertyConverter.cs @@ -38,7 +38,7 @@ internal object ConvertPrimitiveValue(object value, Type propertyType) { if (!PrimitiveType.IsKnownNullableType(propertyType)) { - throw new InvalidOperationException(Client.Strings.ClientType_UnsupportedType(propertyType)); + throw new InvalidOperationException(Error.Format(SRResources.ClientType_UnsupportedType, propertyType)); } // Fast path for the supported primitive types that have a type code and are supported by ODataLib. diff --git a/src/Microsoft.OData.Client/Materialization/PrimitiveValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/PrimitiveValueMaterializationPolicy.cs index 707452cca0..af6e7cd7d5 100644 --- a/src/Microsoft.OData.Client/Materialization/PrimitiveValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/PrimitiveValueMaterializationPolicy.cs @@ -70,7 +70,7 @@ public object MaterializePrimitiveDataValue(Type collectionItemType, string wire public object MaterializePrimitiveDataValueCollectionElement(Type collectionItemType, string wireTypeName, object item) { object materializedValue = null; - this.MaterializePrimitiveDataValue(collectionItemType, wireTypeName, item, () => DSClient.Strings.Collection_NullCollectionItemsNotSupported, out materializedValue); + this.MaterializePrimitiveDataValue(collectionItemType, wireTypeName, item, () => SRResources.Collection_NullCollectionItemsNotSupported, out materializedValue); return materializedValue; } diff --git a/src/Microsoft.OData.Client/Materialization/StructuralValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/StructuralValueMaterializationPolicy.cs index f40d086a73..79572fa015 100644 --- a/src/Microsoft.OData.Client/Materialization/StructuralValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/StructuralValueMaterializationPolicy.cs @@ -169,13 +169,13 @@ internal void ApplyDataValue(ClientTypeAnnotation type, ODataProperty property, // Collections must not be null if (property.Value == null) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Collection_NullCollectionNotSupported(property.Name)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Collection_NullCollectionNotSupported, property.Name)); } // This happens if the payload contain just primitive value for a Collection property if (property.Value is string) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Deserialize_MixedTextWithComment); + throw DSClient.Error.InvalidOperation(SRResources.Deserialize_MixedTextWithComment); } // ODataLib already parsed the data and materialized all the primitive types. There is nothing more to materialize @@ -265,7 +265,7 @@ internal void MaterializeDataValues(ClientTypeAnnotation actualType, IEnumerable // This is a breaking change from V1/V2 where we allowed materialization of entities into non-entities and vice versa if (ClientTypeUtil.TypeOrElementTypeIsEntity(property.PropertyType)) { - throw DSClient.Error.InvalidOperation(DSClient.Strings.Materializer_InvalidEntityType(property.EntityCollectionItemType ?? property.PropertyType)); + throw DSClient.Error.InvalidOperation(Error.Format(SRResources.Materializer_InvalidEntityType, property.EntityCollectionItemType ?? property.PropertyType)); } if (property.IsKnownType) diff --git a/src/Microsoft.OData.Client/MemberAssignmentAnalysis.cs b/src/Microsoft.OData.Client/MemberAssignmentAnalysis.cs index 57c238dd55..0bc2e3f3db 100644 --- a/src/Microsoft.OData.Client/MemberAssignmentAnalysis.cs +++ b/src/Microsoft.OData.Client/MemberAssignmentAnalysis.cs @@ -370,7 +370,7 @@ private static Exception CheckCompatibleAssignmentsFail(Type targetType, Express Debug.Assert(previous != null, "previous != null"); Debug.Assert(candidate != null, "candidate != null"); - string message = Strings.ALinq_ProjectionMemberAssignmentMismatch(targetType.FullName, previous.LastOrDefault(), candidate.LastOrDefault()); + string message = Error.Format(SRResources.ALinq_ProjectionMemberAssignmentMismatch, targetType.FullName, previous.LastOrDefault(), candidate.LastOrDefault()); return new NotSupportedException(message); } diff --git a/src/Microsoft.OData.Client/Metadata/ClientPropertyAnnotation.cs b/src/Microsoft.OData.Client/Metadata/ClientPropertyAnnotation.cs index 2d15a8a515..72636669a9 100644 --- a/src/Microsoft.OData.Client/Metadata/ClientPropertyAnnotation.cs +++ b/src/Microsoft.OData.Client/Metadata/ClientPropertyAnnotation.cs @@ -443,7 +443,7 @@ internal void SetValue(object instance, object value, string propertyName, bool } else { - throw OData.Client.Error.InvalidOperation(OData.Client.Strings.ClientType_MissingProperty(value.GetType().ToString(), propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingProperty, value.GetType().ToString(), propertyName)); } } diff --git a/src/Microsoft.OData.Client/Metadata/ClientTypeAnnotation.cs b/src/Microsoft.OData.Client/Metadata/ClientTypeAnnotation.cs index 007d09897e..d884f714d3 100644 --- a/src/Microsoft.OData.Client/Metadata/ClientTypeAnnotation.cs +++ b/src/Microsoft.OData.Client/Metadata/ClientTypeAnnotation.cs @@ -176,7 +176,7 @@ internal ClientPropertyAnnotation GetProperty(string propertyName, UndeclaredPro string propertyClientName = ClientTypeUtil.GetClientPropertyName(this.ElementType, propertyName, undeclaredPropertyBehavior); if ((string.IsNullOrEmpty(propertyClientName) || !this.clientPropertyCache.TryGetValue(propertyClientName, out property)) && (undeclaredPropertyBehavior == UndeclaredPropertyBehavior.ThrowException)) { - throw Microsoft.OData.Client.Error.InvalidOperation(Microsoft.OData.Client.Strings.ClientType_MissingProperty(this.ElementTypeName, propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingProperty, this.ElementTypeName, propertyName)); } } @@ -256,7 +256,7 @@ private void CheckMediaLinkEntry() ClientPropertyAnnotation mediaProperty = this.Properties().SingleOrDefault(p => p.PropertyName == mediaEntryAttribute.MediaMemberName); if (mediaProperty == null) { - throw Microsoft.OData.Client.Error.InvalidOperation(Microsoft.OData.Client.Strings.ClientType_MissingMediaEntryProperty( + throw Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingMediaEntryProperty, this.ElementTypeName, mediaEntryAttribute.MediaMemberName)); } diff --git a/src/Microsoft.OData.Client/Metadata/ClientTypeCache.cs b/src/Microsoft.OData.Client/Metadata/ClientTypeCache.cs index acbaeed63e..b431c9cc08 100644 --- a/src/Microsoft.OData.Client/Metadata/ClientTypeCache.cs +++ b/src/Microsoft.OData.Client/Metadata/ClientTypeCache.cs @@ -120,7 +120,7 @@ private static void ResolveSubclass(string wireClassName, Type userType, Type ty { if (existing != null) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_Ambiguous(wireClassName, userType)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_Ambiguous, wireClassName, userType)); } existing = type; diff --git a/src/Microsoft.OData.Client/Metadata/ClientTypeUtil.cs b/src/Microsoft.OData.Client/Metadata/ClientTypeUtil.cs index 768b650d9c..7ac9102dc2 100644 --- a/src/Microsoft.OData.Client/Metadata/ClientTypeUtil.cs +++ b/src/Microsoft.OData.Client/Metadata/ClientTypeUtil.cs @@ -264,7 +264,7 @@ internal static Type GetImplementationType(Type type, Type genericTypeDefinition } else { // Multiple implementations (e.g. ICollection and ICollection) - throw Client.Error.NotSupported(Client.Strings.ClientType_MultipleImplementationNotSupported); + throw Client.Error.NotSupported(SRResources.ClientType_MultipleImplementationNotSupported); } } } @@ -561,7 +561,7 @@ internal static string GetEnumValuesString(string enumString, Type enumType) MemberInfo member = enumType.GetField(enumValue); if (member == null) { - throw new NotSupportedException(Strings.Serializer_InvalidEnumMemberValue(enumType.Name, enumValue)); + throw new NotSupportedException(Error.Format(SRResources.Serializer_InvalidEnumMemberValue, enumType.Name, enumValue)); } memberValues.Add(ClientTypeUtil.GetServerDefinedName(member)); diff --git a/src/Microsoft.OData.Client/Metadata/ODataTypeInfo.cs b/src/Microsoft.OData.Client/Metadata/ODataTypeInfo.cs index 9f6ef0ea87..599b3bea20 100644 --- a/src/Microsoft.OData.Client/Metadata/ODataTypeInfo.cs +++ b/src/Microsoft.OData.Client/Metadata/ODataTypeInfo.cs @@ -170,7 +170,7 @@ public string GetClientFieldName(string serverSideName) if (memberInfo == null) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_MissingProperty(type.ToString(), serverSideName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingProperty, type.ToString(), serverSideName)); } memberInfoName = memberInfo.Name; @@ -197,7 +197,7 @@ public PropertyInfo GetClientPropertyInfo(string serverDefinedName, UndeclaredPr if ((!_propertyInfoDict.TryGetValue(serverDefinedName, out clientPropertyInfo)) && undeclaredPropertyBehavior == UndeclaredPropertyBehavior.ThrowException) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_MissingProperty(type.ToString(), serverDefinedName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingProperty, type.ToString(), serverDefinedName)); } return clientPropertyInfo; @@ -274,7 +274,7 @@ private PropertyInfo[] GetKeyProperties() { if (CommonUtil.IsUnsupportedType(type)) { - throw new InvalidOperationException(Client.Strings.ClientType_UnsupportedType(type)); + throw new InvalidOperationException(Error.Format(SRResources.ClientType_UnsupportedType, type)); } string typeName = type.ToString(); @@ -318,14 +318,14 @@ private PropertyInfo[] GetKeyProperties() } else if (keyPropertyDeclaringType != key.DeclaringType) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_KeysOnDifferentDeclaredType(typeName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_KeysOnDifferentDeclaredType, typeName)); } // Check if the key property's type is a known primitive, an enum, or a nullable generic. // If it doesn't meet any of these conditions, throw an InvalidOperationException. if (!PrimitiveType.IsKnownType(key.PropertyType) && !key.PropertyType.IsEnum() && !(key.PropertyType.IsGenericType() && key.PropertyType.GetGenericTypeDefinition() == typeof(System.Nullable<>) && key.PropertyType.GetGenericArguments().First().IsEnum())) { - throw Client.Error.InvalidOperation(Client.Strings.ClientType_KeysMustBeSimpleTypes(key.Name, typeName, key.PropertyType.FullName)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_KeysMustBeSimpleTypes, key.Name, typeName, key.PropertyType.FullName)); } } @@ -338,7 +338,7 @@ private PropertyInfo[] GetKeyProperties() where b.Name == a select b).FirstOrDefault() == null select a).First(); - throw Client.Error.InvalidOperation(Client.Strings.ClientType_MissingProperty(typeName, m)); + throw Client.Error.InvalidOperation(Error.Format(SRResources.ClientType_MissingProperty, typeName, m)); } } diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.Common.txt b/src/Microsoft.OData.Client/Microsoft.OData.Client.Common.txt deleted file mode 100644 index f4eef17c48..0000000000 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.Common.txt +++ /dev/null @@ -1,303 +0,0 @@ - -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone - -; See ResourceManager documentation and the ResGen tool. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error Messages - -Batch_ExpectedContentType=The expected content type for a batch requests is "multipart/mixed;boundary=batch" not "{0}". -Batch_ExpectedResponse=The POST request expected a response with content. ID={0} -Batch_IncompleteResponseCount=Not all requests in the batch had a response. -Batch_UnexpectedContent=The web response contained unexpected sections. ID={0} - -Context_BaseUri=Expected an absolute, well formed http URL without a query or fragment. -Context_BaseUriRequired=You must set the BaseUri property before you perform this operation. -Context_ResolveReturnedInvalidUri=The Uri that is returned by the ResolveEntitySet function must be an absolute, well-formed URL with an "http" or "https" scheme name and without any query strings or fragment identifiers. -Context_RequestUriIsRelativeBaseUriRequired=Because the requestUri is a relative Uri, you must set the BaseUri property on the DataServiceContext. -Context_ResolveEntitySetOrBaseUriRequired=The ResolveEntitySet function must return a non-null Uri for the EntitySet '{0}', otherwise you must set the BaseUri property. -Context_CannotConvertKey=Unable to convert value '{0}' into a key string for a URI. -Context_TrackingExpectsAbsoluteUri=The identity value specified by either the entry id element or OData-EntityId header must be an absolute URI. -Context_LocationHeaderExpectsAbsoluteUri=The 'Location' header value specified in the response must be an absolute URI. -Context_LinkResourceInsertFailure=One of the link's resources failed to insert. -Context_InternalError=Microsoft.OData.Client internal error {0}. -Context_BatchExecuteError=An error occurred for this query during batch execution. See the inner exception for details. -Context_EntitySetName=Expected a relative URL path without query or fragment. -Context_BatchNotSupportedForNamedStreams=Changes cannot be saved as a batch when an entity has one or more streams associated with it. Retry the SaveChanges operation without enabling the SaveChangesOptions.BatchWithSingleChangeset and the SaveChangesOptions.BatchWithIndependentOperations options. -Context_SetSaveStreamWithoutNamedStreamEditLink=The stream named '{0}' cannot be modified because it does not have an edit-media link. Make sure that the stream name is correct and that an edit-media link for this stream is included in the entry element in the response. -Content_EntityWithoutKey=This operation requires the entity be of an Entity Type, and has at least one key property. -Content_EntityIsNotEntityType=This operation requires the entity to be of an Entity Type, either mark its key properties, or attribute the class with DataServiceEntityAttribute -Context_EntityNotContained=The context is not currently tracking the entity. -Context_EntityAlreadyContained=The context is already tracking the entity. -Context_DifferentEntityAlreadyContained=The context is already tracking a different entity with the same resource Uri. -Context_DidNotOriginateAsync=The current object did not originate the async result. -Context_AsyncAlreadyDone=The asynchronous result has already been completed. -Context_OperationCanceled=The operation has been canceled. -Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX=The property '{0}' is not supported when MaxProtocolVersion is greater than '{1}'. - -Context_NoLoadWithInsertEnd=The context can not load the related collection or reference for objects in the added state. -Context_NoRelationWithInsertEnd=One or both of the ends of the relationship is in the added state. -Context_NoRelationWithDeleteEnd=One or both of the ends of the relationship is in the deleted state. -Context_RelationAlreadyContained=The context is already tracking the relationship. -Context_RelationNotRefOrCollection=The sourceProperty is not a reference or collection of the target's object type. -Context_AddLinkCollectionOnly=AddLink and DeleteLink methods only work when the sourceProperty is a collection. -Context_AddRelatedObjectCollectionOnly=AddRelatedObject method only works when the sourceProperty is a collection. -Context_AddRelatedObjectSourceDeleted=AddRelatedObject method only works if the source entity is in a non-deleted state. -Context_UpdateRelatedObjectNonCollectionOnly=UpdateRelatedObject method only works when the sourceProperty is not collection. -Context_SetLinkReferenceOnly=SetLink method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectNonCollectionOnly=SetRelatedObject method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectSourceDeleted=SetRelatedObject method only works if the source entity is in a non-deleted state. -Context_SetRelatedObjectLinkNonCollectionOnly=SetRelatedObjectLink method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectLinkSourceDeleted=SetRelatedObjectLink method only works if the source entity is in a non-deleted state. - -Context_NoContentTypeForMediaLink=Media link object of type '{0}' is configured to use the MIME type specified in the property '{1}'. However, that property's value is null or empty. -Context_BatchNotSupportedForMediaLink=Saving entities with the [MediaEntry] attribute is not currently supported in batch mode. Use non-batched mode instead. -Context_UnexpectedZeroRawRead=Unexpected result (<= 0) from stream.Read() while reading raw data for this property. -Context_VersionNotSupported=Response version '{0}' is not supported. The only supported versions are: {1}. -Context_ResponseVersionIsBiggerThanProtocolVersion=The response version is {0}, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the version required by the response, and then retry the request. If the client does not support the required protocol version, then upgrade the client. -Context_RequestVersionIsBiggerThanProtocolVersion=The request requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the higher version, and then retry the operation. - -Context_ChildResourceExists=Attempt to delete a link between two objects failed because the identity of the target object of the link depends on the source object of the link. - -Context_ContentTypeRequiredForNamedStream=The ContentType value for a named stream cannot be null or an empty string. -Context_EntityNotMediaLinkEntry=This operation requires that the specified entity be a Media Link Entry and that the ReadStreamUri be available. However, the specified entity either is not a Media Link Entry or does not have a valid ReadStreamUri value. If the entity is a Media Link Entry, re-query the data service for this entity to obtain a valid ReadStreamUri value. -Context_MLEWithoutSaveStream=The entity type {0} is marked with MediaEntry attribute but no save stream was set for the entity. -Context_SetSaveStreamOnMediaEntryProperty=Can't use SetSaveStream on entity with type {0} which has a media entry property defined. -Context_SetSaveStreamWithoutEditMediaLink=There is no edit-media link for the entity's media stream. Make sure that the edit-media link is specified for this stream. -Context_SetSaveStreamOnInvalidEntityState=Calling SetSaveStream on an entity with state '{0}' is not allowed. -Context_EntityDoesNotContainNamedStream=The entity does not have a stream named '{0}'. Make sure that the name of the stream is correct. -Context_MissingSelfAndEditLinkForNamedStream=There is no self-link or edit-media link for the stream named '{0}'. Make sure that either the self-link or edit-media link is specified for this stream. -Context_BothLocationAndIdMustBeSpecified=The response should have both 'Location' and 'OData-EntityId' headers or the response should not have any of these headers. -Context_BodyOperationParametersNotAllowedWithGet=OperationParameter of type BodyOperationParameter cannot be specified when the HttpMethod is set to GET. -Context_MissingOperationParameterName=The Name property of an OperationParameter must be set to a non-null, non-empty string. -Context_DuplicateUriOperationParameterName=Multiple uri operation parameters were found with the same name. Uri operation parameter names must be unique. -Context_DuplicateBodyOperationParameterName=Multiple body operation parameters were found with the same name. Body operation parameter names must be unique. -Context_NullKeysAreNotSupported=The serialized resource has a null value in key member '{0}'. Null values are not supported in key members. -Context_ExecuteExpectsGetOrPostOrDelete=The HttpMethod must be GET, POST or DELETE. -Context_EndExecuteExpectedVoidResponse=EndExecute overload for void service operations and actions received a non-void response from the server. -Context_NullElementInOperationParameterArray=The operation parameters array contains a null element which is not allowed. -Context_EntityMetadataBuilderIsRequired=An implementation of ODataEntityMetadataBuilder is required, but a null value was returned from GetEntityMetadataBuilder. -Context_CannotChangeStateToAdded=The ChangeState method does not support the 'Added' state because additional information is needed for inserts. Use either AddObject or AddRelatedObject instead. -Context_CannotChangeStateToModifiedIfNotUnchanged=The entity's state can only be changed to 'Modified' if it is currently 'Unchanged'. -Context_CannotChangeStateIfAdded=An entity in the 'Added' state cannot be changed to '{0}', it can only be changed to 'Detached'. -Context_OnMessageCreatingReturningNull=DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property must not return a null value. Please return a non-null value for this property. -Context_SendingRequest_InvalidWhenUsingOnMessageCreating=SendingRequest cannot be used in combination with the DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property. Please use SendingRequest2 with DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property instead. -Context_MustBeUsedWith='{0}' must be used with '{1}'. -Context_EntityMediaLinksNotTrackedInEntity=The context is currently in no tracking mode, in order to use streams make sure your entities extend BaseEntityType and query the Item again from the server to populate the read link or enable tracking. -Context_EntityInNonTrackedContextLacksMediaLinks=The context is in non tracking mode, The entity does not seem to have the media links populated properly. Please verify server response is correct and that the entity extends BaseEntityType. -Context_DeepInsertOneTopLevelEntity=Deep insert can only have one top level entity. -Context_DeepInsertDeletedOrModified=For deep insert, ChangeState for '{0}' cannot be Deleted or Modified. - -DataServiceClientFormat_LoadServiceModelRequired=When you call the UseJson method without a parameter, you must use the LoadServiceModel property to provide a valid IEdmModel instance. -DataServiceClientFormat_ValidServiceModelRequiredForJson=To use the JSON format, you must first call DataServiceContext.Format.UseJson() and supply a valid service model. - -Collection_NullCollectionReference={0}.{1} must return a non-null open property collection. - -ClientType_MissingOpenProperty=The open object property '{0}:{1}' is not defined. -Clienttype_MultipleOpenProperty={0} has multiple definitions for OpenObjectAttribute. -ClientType_MissingProperty=The closed type {0} does not have a corresponding {1} settable property. -ClientType_KeysMustBeSimpleTypes=The key property '{0}' on for type '{1}' is of type '{2}', which is not a simple type. Only properties of simple type can be key properties. -ClientType_KeysOnDifferentDeclaredType={0} has key properties declared at different levels within its type hierarchy. -ClientType_MissingMimeTypeProperty=Type '{0}' has a MimeTypeProperty attribute that references the MIME type property '{1}'. However, this type does not have a property '{1}'. -ClientType_MissingMimeTypeDataProperty=Type '{0}' has a MimeTypeProperty attribute that references the data property '{1}'. However, this type does not have a property '{1}'. -ClientType_MissingMediaEntryProperty=Type '{0}' has a MediaEntry attribute that references a property called '{1}'. However, this type does not have a property '{1}'. -ClientType_NoSettableFields=The complex type '{0}' has no settable properties. -ClientType_MultipleImplementationNotSupported=Multiple implementations of ICollection is not supported. -ClientType_NullOpenProperties=The open type property '{0}' returned a null instance. -ClientType_Ambiguous=Resolving type from '{0}' that inherits from '{1}' is ambiguous. -ClientType_UnsupportedType=The type '{0}' is not supported by the client library. -ClientType_CollectionOfCollectionNotSupported=Collection properties of a collection type are not supported. -ClientType_MultipleTypesWithSameName=Multiple types were found with the same name '{0}'. Type names must be unique. - -WebUtil_TypeMismatchInCollection=An item in the collection property '{0}' is not of the correct type. All items in the collection property must be of the collection item type. -WebUtil_TypeMismatchInNonPropertyCollection=A collection of item type '{0}' has an item which is not of the correct type. All items in the collection must be of the collection item type. -ClientTypeCache_NonEntityTypeCannotContainEntityProperties=The property '{0}' is of entity type and it cannot be a property of the type '{1}', which is not of entity type. Only entity types can contain navigation properties. -DataServiceException_GeneralError=An error occurred while processing this request. - -Deserialize_GetEnumerator=Only a single enumeration is supported by this IEnumerable. -Deserialize_Current=The current value '{1}' type is not compatible with the expected '{0}' type. -Deserialize_MixedTextWithComment=Error processing response stream. Element value interspersed with a comment is not supported. -Deserialize_ExpectingSimpleValue=Error processing response stream. The XML element contains mixed content. -Deserialize_MismatchEntryLinkLocalSimple=Error processing response stream. Payload has a link, local object has a simple value. -Deserialize_MismatchEntryLinkFeedPropertyNotCollection=Error processing response stream. Payload has a feed and the property '{0}' is not a collection. -Deserialize_MismatchEntryLinkEntryPropertyIsCollection=Error processing response stream. Payload has an entry and the property '{0}' is a collection. -Deserialize_NoLocationHeader=The response to this POST request did not contain a 'location' header. That is not supported by this client. -Deserialize_ServerException=Error processing response stream. Server failed with following message:\r\n{0} -Deserialize_MissingIdElement=Error processing response stream. Missing id element in the response. - -Collection_NullCollectionNotSupported=The value of the property '{0}' is null. Properties that are a collection type of primitive or complex types cannot be null. -Collection_NullNonPropertyCollectionNotSupported=The value of the collection of item type '{0}' is null. A collection cannot have a null value. -Collection_NullCollectionItemsNotSupported=An item in the collection property has a null value. Collection properties that contain items with null values are not supported. -Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed=A collection property of primitive types cannot contain an item of a collection type. -Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed=A collection property of complex types cannot contain an item of a primitive type. - -EntityDescriptor_MissingSelfEditLink=The entity with identity '{0}' does not have a self-link or an edit-link associated with it. Please make sure that the entity has either a self-link or an edit-link associated with it. - -HttpProcessUtility_ContentTypeMissing=Content-Type header value missing. -HttpProcessUtility_MediaTypeMissingValue=Media type is missing a parameter value. -HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter=Media type requires a ';' character before a parameter definition. -HttpProcessUtility_MediaTypeRequiresSlash=Media type requires a '/' character. -HttpProcessUtility_MediaTypeRequiresSubType=Media type requires a subtype definition. -HttpProcessUtility_MediaTypeUnspecified=Media type is unspecified. -HttpProcessUtility_EncodingNotSupported=Character set '{0}' is not supported. -HttpProcessUtility_EscapeCharWithoutQuotes=Value for MIME type parameter '{0}' is incorrect because it contained escape characters even though it was not quoted. -HttpProcessUtility_EscapeCharAtEnd=Value for MIME type parameter '{0}' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value. -HttpProcessUtility_ClosingQuoteNotFound=Value for MIME type parameter '{0}' is incorrect because the closing quote character could not be found while the parameter value started with a quote character. - -MaterializeFromObject_CountNotPresent=Count value is not part of the response stream. -MaterializeFromObject_TopLevelLinkNotAvailable=The top level link is only available after the response has been enumerated. -MaterializeFromObject_CollectionKeyNotPresentInLinkTable=The collection is not part of the current entry -MaterializeFromObject_GetNestLinkForFlatCollection=This response does not contain any nested collections. Use null as Key instead. - -ODataRequestMessage_GetStreamMethodNotSupported=GetStream method is not supported. - -Util_EmptyString=Empty string. -Util_EmptyArray=Empty array. -Util_NullArrayElement=Array contains a null element. - -ALinq_UnsupportedExpression=The expression type {0} is not supported. -ALinq_CouldNotConvert=Could not convert constant {0} expression to string. -ALinq_MethodNotSupported=The method '{0}' is not supported. -ALinq_UnaryNotSupported=The unary operator '{0}' is not supported. -ALinq_BinaryNotSupported=The binary operator '{0}' is not supported. -ALinq_ConstantNotSupported=The constant for '{0}' is not supported. -ALinq_TypeBinaryNotSupported=An operation between an expression and a type is not supported. -ALinq_ConditionalNotSupported=The conditional expression is not supported. -ALinq_ParameterNotSupported=The parameter expression is not supported. -ALinq_MemberAccessNotSupported=The member access of '{0}' is not supported. -ALinq_LambdaNotSupported=Lambda Expressions not supported. -ALinq_NewNotSupported=New Expressions not supported. -ALinq_MemberInitNotSupported=Member Init Expressions not supported. -ALinq_ListInitNotSupported=List Init Expressions not supported. -ALinq_NewArrayNotSupported=New Array Expressions not supported. -ALinq_InvocationNotSupported=Invocation Expressions not supported. -ALinq_QueryOptionsOnlyAllowedOnLeafNodes=Can only specify query options (orderby, where, take, skip) after last navigation. -ALinq_CantExpand=Expand query option not allowed. -ALinq_CantCastToUnsupportedPrimitive=Can't cast to unsupported type '{0}' -ALinq_CantNavigateWithoutKeyPredicate=Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type. -ALinq_CanOnlyApplyOneKeyPredicate=Multiple key predicates cannot be specified for the same entity set. -ALinq_CantTranslateExpression=The expression {0} is not supported. -ALinq_TranslationError=Error translating Linq expression to URI: {0} -ALinq_CantAddQueryOption=Custom query option not allowed. -ALinq_CantAddDuplicateQueryOption=Can't add duplicate query option '{0}'. -ALinq_CantAddAstoriaQueryOption=Can't add query option '{0}' because it would conflict with the query options from the translated Linq expression. -ALinq_QueryOptionNotSupported=The query option '{0}' is not supported or is controlled by the OData service. -ALinq_CantReferToPublicField=Referencing public field '{0}' not supported in query option expression. Use public property instead. -ALinq_QueryOptionsOnlyAllowedOnSingletons=Cannot specify query options (orderby, where, take, skip, count) on single resource. -ALinq_QueryOptionOutOfOrder=The {0} query option cannot be specified after the {1} query option. -ALinq_CannotAddCountOption=Cannot add count option to the resource set. -ALinq_CannotAddCountOptionConflict=Cannot add count option to the resource set because it would conflict with existing count options. -ALinq_ProjectionOnlyAllowedOnLeafNodes=Can only specify 'select' query option after last navigation. -ALinq_ProjectionCanOnlyHaveOneProjection=Cannot translate multiple Linq Select operations in a single 'select' query option. -ALinq_ProjectionMemberAssignmentMismatch=Cannot initialize an instance of entity type '{0}' because '{1}' and '{2}' do not refer to the same source entity. -ALinq_InvalidExpressionInNavigationPath=The expression '{0}' is not a valid expression for navigation path. The only supported operations inside the lambda expression body are MemberAccess and TypeAs. The expression must contain at least one MemberAccess and it cannot end with TypeAs. -ALinq_ExpressionNotSupportedInProjectionToEntity=Initializing instances of the entity type {0} with the expression {1} is not supported. -ALinq_ExpressionNotSupportedInProjection=Constructing or initializing instances of the type {0} with the expression {1} is not supported. -ALinq_CannotConstructKnownEntityTypes=Construction of entity type instances must use object initializer with default constructor. -ALinq_CannotCreateConstantEntity=Referencing of local entity type instances not supported when projecting results. -ALinq_PropertyNamesMustMatchInProjections=Cannot assign the value from the {0} property to the {1} property. When projecting results into a entity type, the property names of the source type and the target type must match for the properties being projected. -ALinq_CanOnlyProjectTheLeaf=Can only project the last entity type in the query being translated. -ALinq_CannotProjectWithExplicitExpansion=Cannot create projection while there is an explicit expansion specified on the same query. -ALinq_CollectionPropertyNotSupportedInOrderBy=The collection property '{0}' cannot be used in an 'orderby' query expression. Collection properties are not supported by the 'orderby' query option. -ALinq_CollectionPropertyNotSupportedInWhere=The collection property '{0}' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option. -ALinq_CollectionMemberAccessNotSupportedInNavigation=Navigation to members of the collection property '{0}' in a 'select' query expression is not supported. -ALinq_LinkPropertyNotSupportedInExpression=The property '{0}' of type 'DataServiceStreamLink' cannot be used in 'where' or 'orderby' query expressions. Properties of type 'DataServiceStreamLink' are not supported by these query options. -ALinq_OfTypeArgumentNotAvailable=The target type for an OfType filter could not be determined. -ALinq_CannotUseTypeFiltersMultipleTimes=Non-redundant type filters (OfType, C# 'as' and VB 'TryCast') can only be used once per resource set. -ALinq_ExpressionCannotEndWithTypeAs=Unsupported expression '{0}' in '{1}' method. Expression cannot end with TypeAs. -ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3=The expression 'TypeAs' is not supported when MaxProtocolVersion is less than '3.0'. -ALinq_TypeAsArgumentNotEntityType=The type '{0}' is not an entity type. The target type for a TypeAs operator must be an entity type. -ALinq_InvalidSourceForAnyAll=The source parameter for the '{0}' method has to be either a navigation or a collection property. -ALinq_AnyAllNotSupportedInOrderBy=The method '{0}' is not supported by the 'orderby' query option. -ALinq_FormatQueryOptionNotSupported=The '$format' query option is not supported. Use the DataServiceContext.Format property to set the desired format. -ALinq_IllegalSystemQueryOption=Found the following illegal system token while building a projection or expansion path: '{0}' -ALinq_IllegalPathStructure=Found a projection as a non-leaf segment in an expand path. Please rephrase your query. The projected property was : '{0}' -ALinq_TypeTokenWithNoTrailingNavProp=Found an illegal type token '{0}' without a trailing navigation property. -ALinq_ContainsNotValidOnEmptyCollection=The Contains method cannot be used with an empty collection. -ALinq_AggregationMethodNotSupported=The aggregation method '{0}' is not supported. -ALinq_InvalidAggregateExpression=The expression '{0}' is not a valid aggregate expression. The aggregate expression must evaluate to a single-valued property path to an aggregatable property. -ALinq_InvalidGroupingExpression=The expression '{0}' is not a valid expression for grouping. The grouping expression must evaluate to a single-valued property path, i.e., a path ending in a single-valued primitive. -ALinq_InvalidGroupByKeySelector=The expression '{0}' in the GroupBy key selector is not supported. - -DSKAttribute_MustSpecifyAtleastOnePropertyName=DataServiceKey attribute must specify at least one property name. - -DataServiceCollection_LoadRequiresTargetCollectionObserved=Target collection for the Load operation must have an associated DataServiceContext. -DataServiceCollection_CannotStopTrackingChildCollection=The tracking of DataServiceCollection can not be stopped for child collections. -DataServiceCollection_OperationForTrackedOnly=This operation is only supported on collections that are being tracked. -DataServiceCollection_CannotDetermineContextFromItems=The DataServiceContext to which the DataServiceCollection instance belongs could not be determined. The DataServiceContext must either be supplied in the DataServiceCollection constructor or be used to create the DataServiceQuery or QueryOperationResponse object that is the source of the items in the DataServiceCollection. -DataServiceCollection_InsertIntoTrackedButNotLoadedCollection=An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection. -DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime=A previous LoadAsync operation has not yet completed. You cannot call the LoadAsync method on the DataServiceCollection again until the previous operation has completed. -DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity=The LoadAsync method cannot be called when the DataServiceCollection is not a child collection of a related entity. -DataServiceCollection_LoadAsyncRequiresDataServiceQuery=Only a typed DataServiceQuery object can be supplied when calling the LoadAsync method on DataServiceCollection. - -DataBinding_DataServiceCollectionArgumentMustHaveEntityType=The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type '{0}' does not have any key property. -DataBinding_CollectionPropertySetterValueHasObserver=Setting an instance of DataServiceCollection to an entity property is disallowed if the instance is already being tracked. Error occurred on property '{0}' for entity type '{1}'. -DataBinding_DataServiceCollectionChangedUnknownActionCollection=Unexpected action '{0}' on the OnCollectionChanged event raised by DataServiceCollection. -DataBinding_CollectionChangedUnknownActionCollection=Unexpected action '{0}' on the OnCollectionChanged event raised by a collection object of type '{1}'. -DataBinding_BindingOperation_DetachedSource=Add/Update/Delete operation cannot be performed on a child entity, if the parent entity is already detached. -DataBinding_BindingOperation_ArrayItemNull=Null values are disallowed during '{0}' operations on DataServiceCollection. -DataBinding_BindingOperation_ArrayItemNotEntity=A value provided during '{0}' operation on DataServiceCollection is not of an entity type with key. -DataBinding_Util_UnknownEntitySetName=Entity set name has not been provided for an entity of type '{0}'. -DataBinding_EntityAlreadyInCollection=An attempt was made to add entity of type '{0}' to a collection in which the same entity already exists. -DataBinding_NotifyPropertyChangedNotImpl=An attempt to track an entity or complex type failed because the entity or complex type '{0}' does not implement the INotifyPropertyChanged interface. -DataBinding_NotifyCollectionChangedNotImpl=An attempt to track an entity or complex type failed because the entity or complex type contains a collection property of type '{0}' that does not implement the INotifyCollectionChanged interface. -DataBinding_ComplexObjectAssociatedWithMultipleEntities=An attempt to track a complex object of type '{0}' failed because the complex object is already being tracked. -DataBinding_CollectionAssociatedWithMultipleEntities=An attempt to track a collection object of type '{0}' failed because the collection object is already being tracked. - -Parser_SingleEntry_NoneFound=Expected exactly one entry in the response from the server, but none was found. -Parser_SingleEntry_MultipleFound=Expected exactly one entry in the response from the server, but more than one was found. -Parser_SingleEntry_ExpectedFeedOrEntry=Expected a feed or entry in the response from the server, but found an unexpected element instead. - -Materializer_CannotAssignNull=The null value from property '{0}' cannot be assigned to a type '{1}'. -Materializer_EntryIntoCollectionMismatch=An entry of type '{0}' cannot be added to a collection that contains instances of type '{1}'. This may occur when an existing entry of a different type has the same identity value or when the same entity is projected into two different types in a single query. -Materializer_EntryToAccessIsNull=An entry returned by the navigation property '{0}' is null and cannot be initialized. You should check for a null value before accessing this property. -Materializer_EntryToInitializeIsNull=An entry that contains the data required to create an instance of type '{0}' is null and cannot be initialized. You should check for a null value before accessing this entry. -Materializer_ProjectEntityTypeMismatch=An entity of type '{0}' cannot be projected because there is already an instance of type '{1}' for '{2}'. -Materializer_PropertyMissing=The expected property '{0}' could not be found while processing an entry. Check for null before accessing this property. -Materializer_PropertyNotExpectedEntry=Property '{0}' is not an entity. -Materializer_DataServiceCollectionNotSupportedForNonEntities=A DataServiceCollection can only contain entity types. Primitive and complex types cannot be contained by this kind of collection. -Materializer_NoParameterlessCtorForCollectionProperty=Collection property '{0}' cannot be created because the type '{1}' does not have a public parameterless constructor. -Materializer_InvalidCollectionItem=The element '{0}' is not a valid collection item. The name of the collection item element must be 'element' and must belong to the 'http://docs.oasis-open.org/odata/ns/data' namespace. -Materializer_InvalidEntityType=There is a type mismatch between the client and the service. Type '{0}' is an entity type, but the type in the response payload does not represent an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. -Materializer_InvalidNonEntityType=There is a type mismatch between the client and the service. Type '{0}' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. -Materializer_CollectionExpectedCollection=Materialization of top level collection expected ICollection<>, but actual type was {0}. -Materializer_InvalidResponsePayload=The response payload is a not a valid response payload. Please make sure that the top level element is a valid JSON element or belongs to '{0}' namespace. -Materializer_InvalidContentTypeEncountered=The response content type '{0}' is not currently supported. -Materializer_MaterializationTypeError=Cannot materialize the results into a collection type '{0}' because it does not have a parameterless constructor. -Materializer_ResetAfterEnumeratorCreationError=Reset should never be called for collection reader in an internal enumerable. -Materializer_TypeShouldBeCollectionError=Cannot materialize a collection of a primitives or complex without the type '{0}' being a collection. - -Serializer_LoopsNotAllowedInComplexTypes=A circular loop was detected while serializing the property '{0}'. You must make sure that loops are not present in properties that return a collection or complex type. -Serializer_LoopsNotAllowedInNonPropertyComplexTypes=A circular loop was detected while serializing the complex type '{0}'. You must make sure that loops are not present in a collection or a complex type. -Serializer_InvalidCollectionParameterItemType=The operation parameter named '{0}' has a collection item of Edm type kind '{1}'. A collection item must be either a primitive type or a complex Edm type kind. -Serializer_NullCollectionParameterItemValue=The operation parameter named '{0}' has a null collection item. The items of a collection must not be null. -Serializer_InvalidParameterType=The operation parameter named '{0}' was of Edm type kind '{1}'. An operation parameter must be either a primitive type, a complex type or a collection of primitive or complex types. -Serializer_UriDoesNotContainParameterAlias=The parameter alias '{0}' was not present in the request URI. All parameters passed as alias must be present in the request URI. -Serializer_InvalidEnumMemberValue=The enum type '{0}' has no member named '{1}'. - -; NOTE: error message copied from Silverlight because the portable library requires this -DataServiceQuery_EnumerationNotSupported=This target framework does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because this framework only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration. - -; NOTE: Moved over to common as this is used in the portable library -Context_SendingRequestEventArgsNotHttp=Only instances of HttpWebRequest are currently allowed for this property. Other subtypes of WebRequest are not supported. - -; NOTE: these error messages are copied from ODL because they appear in shared source files. -General_InternalError=An internal error '{0}' occurred. - -ODataMetadataBuilder_MissingEntitySetUri=The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required. -ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix=The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments. -ODataMetadataBuilder_MissingEntityInstanceUri=Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required. - -EdmValueUtils_UnsupportedPrimitiveType=The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type. -EdmValueUtils_IncorrectPrimitiveTypeKind=Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. -EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName=Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. -EdmValueUtils_CannotConvertTypeToClrValue=A value with primitive kind '{0}' cannot be converted into a primitive object value. - -; NOTE: these error messages are copied from EdmLib because they appear in shared source files. -ValueParser_InvalidDuration=The value '{0}' is not a valid duration value. - -; Note: The below list of error messages are common to the ODataLib, EdmLib, Spatial, Server and Client projects. -PlatformHelper_DateTimeOffsetMustContainTimeZone=The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. -;END diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.Desktop.txt b/src/Microsoft.OData.Client/Microsoft.OData.Client.Desktop.txt deleted file mode 100644 index a161214a6f..0000000000 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.Desktop.txt +++ /dev/null @@ -1,15 +0,0 @@ - -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone - -; See ResourceManager documentation and the ResGen tool. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error Messages - -DataServiceRequest_FailGetCount=Failed to get the count value from the server. -DataServiceRequest_FailGetValue=Failed to get the value from the server. - -Context_ExecuteExpectedVoidResponse=Execute overload for void service operations and actions received a non-void response from the server. -;END diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.cs b/src/Microsoft.OData.Client/Microsoft.OData.Client.cs deleted file mode 100644 index 7b22649e81..0000000000 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.cs +++ /dev/null @@ -1,365 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -using System; -using System.Globalization; -using System.Reflection; -using System.Resources; -using System.Threading; - -namespace Microsoft.OData.Client -{ - /// - /// AutoGenerated resource class. Usage: - /// - /// string s = TextRes.GetString(TextRes.MyIdentifier); - /// - internal sealed class TextRes { - internal const string Batch_ExpectedContentType = "Batch_ExpectedContentType"; - internal const string Batch_ExpectedResponse = "Batch_ExpectedResponse"; - internal const string Batch_IncompleteResponseCount = "Batch_IncompleteResponseCount"; - internal const string Batch_UnexpectedContent = "Batch_UnexpectedContent"; - internal const string Context_BaseUri = "Context_BaseUri"; - internal const string Context_BaseUriRequired = "Context_BaseUriRequired"; - internal const string Context_ResolveReturnedInvalidUri = "Context_ResolveReturnedInvalidUri"; - internal const string Context_RequestUriIsRelativeBaseUriRequired = "Context_RequestUriIsRelativeBaseUriRequired"; - internal const string Context_ResolveEntitySetOrBaseUriRequired = "Context_ResolveEntitySetOrBaseUriRequired"; - internal const string Context_CannotConvertKey = "Context_CannotConvertKey"; - internal const string Context_TrackingExpectsAbsoluteUri = "Context_TrackingExpectsAbsoluteUri"; - internal const string Context_LocationHeaderExpectsAbsoluteUri = "Context_LocationHeaderExpectsAbsoluteUri"; - internal const string Context_LinkResourceInsertFailure = "Context_LinkResourceInsertFailure"; - internal const string Context_InternalError = "Context_InternalError"; - internal const string Context_BatchExecuteError = "Context_BatchExecuteError"; - internal const string Context_EntitySetName = "Context_EntitySetName"; - internal const string Context_BatchNotSupportedForNamedStreams = "Context_BatchNotSupportedForNamedStreams"; - internal const string Context_SetSaveStreamWithoutNamedStreamEditLink = "Context_SetSaveStreamWithoutNamedStreamEditLink"; - internal const string Content_EntityWithoutKey = "Content_EntityWithoutKey"; - internal const string Content_EntityIsNotEntityType = "Content_EntityIsNotEntityType"; - internal const string Context_EntityNotContained = "Context_EntityNotContained"; - internal const string Context_EntityAlreadyContained = "Context_EntityAlreadyContained"; - internal const string Context_DifferentEntityAlreadyContained = "Context_DifferentEntityAlreadyContained"; - internal const string Context_DidNotOriginateAsync = "Context_DidNotOriginateAsync"; - internal const string Context_AsyncAlreadyDone = "Context_AsyncAlreadyDone"; - internal const string Context_OperationCanceled = "Context_OperationCanceled"; - internal const string Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX = "Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX"; - internal const string Context_NoLoadWithInsertEnd = "Context_NoLoadWithInsertEnd"; - internal const string Context_NoRelationWithInsertEnd = "Context_NoRelationWithInsertEnd"; - internal const string Context_NoRelationWithDeleteEnd = "Context_NoRelationWithDeleteEnd"; - internal const string Context_RelationAlreadyContained = "Context_RelationAlreadyContained"; - internal const string Context_RelationNotRefOrCollection = "Context_RelationNotRefOrCollection"; - internal const string Context_AddLinkCollectionOnly = "Context_AddLinkCollectionOnly"; - internal const string Context_AddRelatedObjectCollectionOnly = "Context_AddRelatedObjectCollectionOnly"; - internal const string Context_AddRelatedObjectSourceDeleted = "Context_AddRelatedObjectSourceDeleted"; - internal const string Context_UpdateRelatedObjectNonCollectionOnly = "Context_UpdateRelatedObjectNonCollectionOnly"; - internal const string Context_SetLinkReferenceOnly = "Context_SetLinkReferenceOnly"; - internal const string Context_SetRelatedObjectNonCollectionOnly = "Context_SetRelatedObjectNonCollectionOnly"; - internal const string Context_SetRelatedObjectSourceDeleted = "Context_SetRelatedObjectSourceDeleted"; - internal const string Context_SetRelatedObjectLinkNonCollectionOnly = "Context_SetRelatedObjectLinkNonCollectionOnly"; - internal const string Context_SetRelatedObjectLinkSourceDeleted = "Context_SetRelatedObjectLinkSourceDeleted"; - internal const string Context_NoContentTypeForMediaLink = "Context_NoContentTypeForMediaLink"; - internal const string Context_BatchNotSupportedForMediaLink = "Context_BatchNotSupportedForMediaLink"; - internal const string Context_UnexpectedZeroRawRead = "Context_UnexpectedZeroRawRead"; - internal const string Context_VersionNotSupported = "Context_VersionNotSupported"; - internal const string Context_ResponseVersionIsBiggerThanProtocolVersion = "Context_ResponseVersionIsBiggerThanProtocolVersion"; - internal const string Context_RequestVersionIsBiggerThanProtocolVersion = "Context_RequestVersionIsBiggerThanProtocolVersion"; - internal const string Context_ChildResourceExists = "Context_ChildResourceExists"; - internal const string Context_ContentTypeRequiredForNamedStream = "Context_ContentTypeRequiredForNamedStream"; - internal const string Context_EntityNotMediaLinkEntry = "Context_EntityNotMediaLinkEntry"; - internal const string Context_MLEWithoutSaveStream = "Context_MLEWithoutSaveStream"; - internal const string Context_SetSaveStreamOnMediaEntryProperty = "Context_SetSaveStreamOnMediaEntryProperty"; - internal const string Context_SetSaveStreamWithoutEditMediaLink = "Context_SetSaveStreamWithoutEditMediaLink"; - internal const string Context_SetSaveStreamOnInvalidEntityState = "Context_SetSaveStreamOnInvalidEntityState"; - internal const string Context_EntityDoesNotContainNamedStream = "Context_EntityDoesNotContainNamedStream"; - internal const string Context_MissingSelfAndEditLinkForNamedStream = "Context_MissingSelfAndEditLinkForNamedStream"; - internal const string Context_BothLocationAndIdMustBeSpecified = "Context_BothLocationAndIdMustBeSpecified"; - internal const string Context_BodyOperationParametersNotAllowedWithGet = "Context_BodyOperationParametersNotAllowedWithGet"; - internal const string Context_MissingOperationParameterName = "Context_MissingOperationParameterName"; - internal const string Context_DuplicateUriOperationParameterName = "Context_DuplicateUriOperationParameterName"; - internal const string Context_DuplicateBodyOperationParameterName = "Context_DuplicateBodyOperationParameterName"; - internal const string Context_NullKeysAreNotSupported = "Context_NullKeysAreNotSupported"; - internal const string Context_ExecuteExpectsGetOrPostOrDelete = "Context_ExecuteExpectsGetOrPostOrDelete"; - internal const string Context_EndExecuteExpectedVoidResponse = "Context_EndExecuteExpectedVoidResponse"; - internal const string Context_NullElementInOperationParameterArray = "Context_NullElementInOperationParameterArray"; - internal const string Context_EntityMetadataBuilderIsRequired = "Context_EntityMetadataBuilderIsRequired"; - internal const string Context_CannotChangeStateToAdded = "Context_CannotChangeStateToAdded"; - internal const string Context_CannotChangeStateToModifiedIfNotUnchanged = "Context_CannotChangeStateToModifiedIfNotUnchanged"; - internal const string Context_CannotChangeStateIfAdded = "Context_CannotChangeStateIfAdded"; - internal const string Context_OnMessageCreatingReturningNull = "Context_OnMessageCreatingReturningNull"; - internal const string Context_SendingRequest_InvalidWhenUsingOnMessageCreating = "Context_SendingRequest_InvalidWhenUsingOnMessageCreating"; - internal const string Context_MustBeUsedWith = "Context_MustBeUsedWith"; - internal const string Context_EntityMediaLinksNotTrackedInEntity = "Context_EntityMediaLinksNotTrackedInEntity"; - internal const string Context_EntityInNonTrackedContextLacksMediaLinks = "Context_EntityInNonTrackedContextLacksMediaLinks"; - internal const string Context_DeepInsertOneTopLevelEntity = "Context_DeepInsertOneTopLevelEntity"; - internal const string Context_DeepInsertDeletedOrModified = "Context_DeepInsertDeletedOrModified"; - internal const string DataServiceClientFormat_LoadServiceModelRequired = "DataServiceClientFormat_LoadServiceModelRequired"; - internal const string DataServiceClientFormat_ValidServiceModelRequiredForJson = "DataServiceClientFormat_ValidServiceModelRequiredForJson"; - internal const string Collection_NullCollectionReference = "Collection_NullCollectionReference"; - internal const string ClientType_MissingOpenProperty = "ClientType_MissingOpenProperty"; - internal const string Clienttype_MultipleOpenProperty = "Clienttype_MultipleOpenProperty"; - internal const string ClientType_MissingProperty = "ClientType_MissingProperty"; - internal const string ClientType_KeysMustBeSimpleTypes = "ClientType_KeysMustBeSimpleTypes"; - internal const string ClientType_KeysOnDifferentDeclaredType = "ClientType_KeysOnDifferentDeclaredType"; - internal const string ClientType_MissingMimeTypeProperty = "ClientType_MissingMimeTypeProperty"; - internal const string ClientType_MissingMimeTypeDataProperty = "ClientType_MissingMimeTypeDataProperty"; - internal const string ClientType_MissingMediaEntryProperty = "ClientType_MissingMediaEntryProperty"; - internal const string ClientType_NoSettableFields = "ClientType_NoSettableFields"; - internal const string ClientType_MultipleImplementationNotSupported = "ClientType_MultipleImplementationNotSupported"; - internal const string ClientType_NullOpenProperties = "ClientType_NullOpenProperties"; - internal const string ClientType_Ambiguous = "ClientType_Ambiguous"; - internal const string ClientType_UnsupportedType = "ClientType_UnsupportedType"; - internal const string ClientType_CollectionOfCollectionNotSupported = "ClientType_CollectionOfCollectionNotSupported"; - internal const string ClientType_MultipleTypesWithSameName = "ClientType_MultipleTypesWithSameName"; - internal const string WebUtil_TypeMismatchInCollection = "WebUtil_TypeMismatchInCollection"; - internal const string WebUtil_TypeMismatchInNonPropertyCollection = "WebUtil_TypeMismatchInNonPropertyCollection"; - internal const string ClientTypeCache_NonEntityTypeCannotContainEntityProperties = "ClientTypeCache_NonEntityTypeCannotContainEntityProperties"; - internal const string DataServiceException_GeneralError = "DataServiceException_GeneralError"; - internal const string Deserialize_GetEnumerator = "Deserialize_GetEnumerator"; - internal const string Deserialize_Current = "Deserialize_Current"; - internal const string Deserialize_MixedTextWithComment = "Deserialize_MixedTextWithComment"; - internal const string Deserialize_ExpectingSimpleValue = "Deserialize_ExpectingSimpleValue"; - internal const string Deserialize_MismatchEntryLinkLocalSimple = "Deserialize_MismatchEntryLinkLocalSimple"; - internal const string Deserialize_MismatchEntryLinkFeedPropertyNotCollection = "Deserialize_MismatchEntryLinkFeedPropertyNotCollection"; - internal const string Deserialize_MismatchEntryLinkEntryPropertyIsCollection = "Deserialize_MismatchEntryLinkEntryPropertyIsCollection"; - internal const string Deserialize_NoLocationHeader = "Deserialize_NoLocationHeader"; - internal const string Deserialize_ServerException = "Deserialize_ServerException"; - internal const string Deserialize_MissingIdElement = "Deserialize_MissingIdElement"; - internal const string Collection_NullCollectionNotSupported = "Collection_NullCollectionNotSupported"; - internal const string Collection_NullNonPropertyCollectionNotSupported = "Collection_NullNonPropertyCollectionNotSupported"; - internal const string Collection_NullCollectionItemsNotSupported = "Collection_NullCollectionItemsNotSupported"; - internal const string Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed = "Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed"; - internal const string Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed = "Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed"; - internal const string EntityDescriptor_MissingSelfEditLink = "EntityDescriptor_MissingSelfEditLink"; - internal const string HttpProcessUtility_ContentTypeMissing = "HttpProcessUtility_ContentTypeMissing"; - internal const string HttpProcessUtility_MediaTypeMissingValue = "HttpProcessUtility_MediaTypeMissingValue"; - internal const string HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter = "HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter"; - internal const string HttpProcessUtility_MediaTypeRequiresSlash = "HttpProcessUtility_MediaTypeRequiresSlash"; - internal const string HttpProcessUtility_MediaTypeRequiresSubType = "HttpProcessUtility_MediaTypeRequiresSubType"; - internal const string HttpProcessUtility_MediaTypeUnspecified = "HttpProcessUtility_MediaTypeUnspecified"; - internal const string HttpProcessUtility_EncodingNotSupported = "HttpProcessUtility_EncodingNotSupported"; - internal const string HttpProcessUtility_EscapeCharWithoutQuotes = "HttpProcessUtility_EscapeCharWithoutQuotes"; - internal const string HttpProcessUtility_EscapeCharAtEnd = "HttpProcessUtility_EscapeCharAtEnd"; - internal const string HttpProcessUtility_ClosingQuoteNotFound = "HttpProcessUtility_ClosingQuoteNotFound"; - internal const string MaterializeFromObject_CountNotPresent = "MaterializeFromObject_CountNotPresent"; - internal const string MaterializeFromObject_TopLevelLinkNotAvailable = "MaterializeFromObject_TopLevelLinkNotAvailable"; - internal const string MaterializeFromObject_CollectionKeyNotPresentInLinkTable = "MaterializeFromObject_CollectionKeyNotPresentInLinkTable"; - internal const string MaterializeFromObject_GetNestLinkForFlatCollection = "MaterializeFromObject_GetNestLinkForFlatCollection"; - internal const string ODataRequestMessage_GetStreamMethodNotSupported = "ODataRequestMessage_GetStreamMethodNotSupported"; - internal const string Util_EmptyString = "Util_EmptyString"; - internal const string Util_EmptyArray = "Util_EmptyArray"; - internal const string Util_NullArrayElement = "Util_NullArrayElement"; - internal const string ALinq_UnsupportedExpression = "ALinq_UnsupportedExpression"; - internal const string ALinq_CouldNotConvert = "ALinq_CouldNotConvert"; - internal const string ALinq_MethodNotSupported = "ALinq_MethodNotSupported"; - internal const string ALinq_UnaryNotSupported = "ALinq_UnaryNotSupported"; - internal const string ALinq_BinaryNotSupported = "ALinq_BinaryNotSupported"; - internal const string ALinq_ConstantNotSupported = "ALinq_ConstantNotSupported"; - internal const string ALinq_TypeBinaryNotSupported = "ALinq_TypeBinaryNotSupported"; - internal const string ALinq_ConditionalNotSupported = "ALinq_ConditionalNotSupported"; - internal const string ALinq_ParameterNotSupported = "ALinq_ParameterNotSupported"; - internal const string ALinq_MemberAccessNotSupported = "ALinq_MemberAccessNotSupported"; - internal const string ALinq_LambdaNotSupported = "ALinq_LambdaNotSupported"; - internal const string ALinq_NewNotSupported = "ALinq_NewNotSupported"; - internal const string ALinq_MemberInitNotSupported = "ALinq_MemberInitNotSupported"; - internal const string ALinq_ListInitNotSupported = "ALinq_ListInitNotSupported"; - internal const string ALinq_NewArrayNotSupported = "ALinq_NewArrayNotSupported"; - internal const string ALinq_InvocationNotSupported = "ALinq_InvocationNotSupported"; - internal const string ALinq_QueryOptionsOnlyAllowedOnLeafNodes = "ALinq_QueryOptionsOnlyAllowedOnLeafNodes"; - internal const string ALinq_CantExpand = "ALinq_CantExpand"; - internal const string ALinq_CantCastToUnsupportedPrimitive = "ALinq_CantCastToUnsupportedPrimitive"; - internal const string ALinq_CantNavigateWithoutKeyPredicate = "ALinq_CantNavigateWithoutKeyPredicate"; - internal const string ALinq_CanOnlyApplyOneKeyPredicate = "ALinq_CanOnlyApplyOneKeyPredicate"; - internal const string ALinq_CantTranslateExpression = "ALinq_CantTranslateExpression"; - internal const string ALinq_TranslationError = "ALinq_TranslationError"; - internal const string ALinq_CantAddQueryOption = "ALinq_CantAddQueryOption"; - internal const string ALinq_CantAddDuplicateQueryOption = "ALinq_CantAddDuplicateQueryOption"; - internal const string ALinq_CantAddAstoriaQueryOption = "ALinq_CantAddAstoriaQueryOption"; - internal const string ALinq_QueryOptionNotSupported = "ALinq_QueryOptionNotSupported"; - internal const string ALinq_CantReferToPublicField = "ALinq_CantReferToPublicField"; - internal const string ALinq_QueryOptionsOnlyAllowedOnSingletons = "ALinq_QueryOptionsOnlyAllowedOnSingletons"; - internal const string ALinq_QueryOptionOutOfOrder = "ALinq_QueryOptionOutOfOrder"; - internal const string ALinq_CannotAddCountOption = "ALinq_CannotAddCountOption"; - internal const string ALinq_CannotAddCountOptionConflict = "ALinq_CannotAddCountOptionConflict"; - internal const string ALinq_ProjectionOnlyAllowedOnLeafNodes = "ALinq_ProjectionOnlyAllowedOnLeafNodes"; - internal const string ALinq_ProjectionCanOnlyHaveOneProjection = "ALinq_ProjectionCanOnlyHaveOneProjection"; - internal const string ALinq_ProjectionMemberAssignmentMismatch = "ALinq_ProjectionMemberAssignmentMismatch"; - internal const string ALinq_InvalidExpressionInNavigationPath = "ALinq_InvalidExpressionInNavigationPath"; - internal const string ALinq_ExpressionNotSupportedInProjectionToEntity = "ALinq_ExpressionNotSupportedInProjectionToEntity"; - internal const string ALinq_ExpressionNotSupportedInProjection = "ALinq_ExpressionNotSupportedInProjection"; - internal const string ALinq_CannotConstructKnownEntityTypes = "ALinq_CannotConstructKnownEntityTypes"; - internal const string ALinq_CannotCreateConstantEntity = "ALinq_CannotCreateConstantEntity"; - internal const string ALinq_PropertyNamesMustMatchInProjections = "ALinq_PropertyNamesMustMatchInProjections"; - internal const string ALinq_CanOnlyProjectTheLeaf = "ALinq_CanOnlyProjectTheLeaf"; - internal const string ALinq_CannotProjectWithExplicitExpansion = "ALinq_CannotProjectWithExplicitExpansion"; - internal const string ALinq_CollectionPropertyNotSupportedInOrderBy = "ALinq_CollectionPropertyNotSupportedInOrderBy"; - internal const string ALinq_CollectionPropertyNotSupportedInWhere = "ALinq_CollectionPropertyNotSupportedInWhere"; - internal const string ALinq_CollectionMemberAccessNotSupportedInNavigation = "ALinq_CollectionMemberAccessNotSupportedInNavigation"; - internal const string ALinq_LinkPropertyNotSupportedInExpression = "ALinq_LinkPropertyNotSupportedInExpression"; - internal const string ALinq_OfTypeArgumentNotAvailable = "ALinq_OfTypeArgumentNotAvailable"; - internal const string ALinq_CannotUseTypeFiltersMultipleTimes = "ALinq_CannotUseTypeFiltersMultipleTimes"; - internal const string ALinq_ExpressionCannotEndWithTypeAs = "ALinq_ExpressionCannotEndWithTypeAs"; - internal const string ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3 = "ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3"; - internal const string ALinq_TypeAsArgumentNotEntityType = "ALinq_TypeAsArgumentNotEntityType"; - internal const string ALinq_InvalidSourceForAnyAll = "ALinq_InvalidSourceForAnyAll"; - internal const string ALinq_AnyAllNotSupportedInOrderBy = "ALinq_AnyAllNotSupportedInOrderBy"; - internal const string ALinq_FormatQueryOptionNotSupported = "ALinq_FormatQueryOptionNotSupported"; - internal const string ALinq_IllegalSystemQueryOption = "ALinq_IllegalSystemQueryOption"; - internal const string ALinq_IllegalPathStructure = "ALinq_IllegalPathStructure"; - internal const string ALinq_TypeTokenWithNoTrailingNavProp = "ALinq_TypeTokenWithNoTrailingNavProp"; - internal const string ALinq_ContainsNotValidOnEmptyCollection = "ALinq_ContainsNotValidOnEmptyCollection"; - internal const string ALinq_AggregationMethodNotSupported = "ALinq_AggregationMethodNotSupported"; - internal const string ALinq_InvalidAggregateExpression = "ALinq_InvalidAggregateExpression"; - internal const string ALinq_InvalidGroupingExpression = "ALinq_InvalidGroupingExpression"; - internal const string ALinq_InvalidGroupByKeySelector = "ALinq_InvalidGroupByKeySelector"; - internal const string DSKAttribute_MustSpecifyAtleastOnePropertyName = "DSKAttribute_MustSpecifyAtleastOnePropertyName"; - internal const string DataServiceCollection_LoadRequiresTargetCollectionObserved = "DataServiceCollection_LoadRequiresTargetCollectionObserved"; - internal const string DataServiceCollection_CannotStopTrackingChildCollection = "DataServiceCollection_CannotStopTrackingChildCollection"; - internal const string DataServiceCollection_OperationForTrackedOnly = "DataServiceCollection_OperationForTrackedOnly"; - internal const string DataServiceCollection_CannotDetermineContextFromItems = "DataServiceCollection_CannotDetermineContextFromItems"; - internal const string DataServiceCollection_InsertIntoTrackedButNotLoadedCollection = "DataServiceCollection_InsertIntoTrackedButNotLoadedCollection"; - internal const string DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime = "DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime"; - internal const string DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity = "DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity"; - internal const string DataServiceCollection_LoadAsyncRequiresDataServiceQuery = "DataServiceCollection_LoadAsyncRequiresDataServiceQuery"; - internal const string DataBinding_DataServiceCollectionArgumentMustHaveEntityType = "DataBinding_DataServiceCollectionArgumentMustHaveEntityType"; - internal const string DataBinding_CollectionPropertySetterValueHasObserver = "DataBinding_CollectionPropertySetterValueHasObserver"; - internal const string DataBinding_DataServiceCollectionChangedUnknownActionCollection = "DataBinding_DataServiceCollectionChangedUnknownActionCollection"; - internal const string DataBinding_CollectionChangedUnknownActionCollection = "DataBinding_CollectionChangedUnknownActionCollection"; - internal const string DataBinding_BindingOperation_DetachedSource = "DataBinding_BindingOperation_DetachedSource"; - internal const string DataBinding_BindingOperation_ArrayItemNull = "DataBinding_BindingOperation_ArrayItemNull"; - internal const string DataBinding_BindingOperation_ArrayItemNotEntity = "DataBinding_BindingOperation_ArrayItemNotEntity"; - internal const string DataBinding_Util_UnknownEntitySetName = "DataBinding_Util_UnknownEntitySetName"; - internal const string DataBinding_EntityAlreadyInCollection = "DataBinding_EntityAlreadyInCollection"; - internal const string DataBinding_NotifyPropertyChangedNotImpl = "DataBinding_NotifyPropertyChangedNotImpl"; - internal const string DataBinding_NotifyCollectionChangedNotImpl = "DataBinding_NotifyCollectionChangedNotImpl"; - internal const string DataBinding_ComplexObjectAssociatedWithMultipleEntities = "DataBinding_ComplexObjectAssociatedWithMultipleEntities"; - internal const string DataBinding_CollectionAssociatedWithMultipleEntities = "DataBinding_CollectionAssociatedWithMultipleEntities"; - internal const string Parser_SingleEntry_NoneFound = "Parser_SingleEntry_NoneFound"; - internal const string Parser_SingleEntry_MultipleFound = "Parser_SingleEntry_MultipleFound"; - internal const string Parser_SingleEntry_ExpectedFeedOrEntry = "Parser_SingleEntry_ExpectedFeedOrEntry"; - internal const string Materializer_CannotAssignNull = "Materializer_CannotAssignNull"; - internal const string Materializer_EntryIntoCollectionMismatch = "Materializer_EntryIntoCollectionMismatch"; - internal const string Materializer_EntryToAccessIsNull = "Materializer_EntryToAccessIsNull"; - internal const string Materializer_EntryToInitializeIsNull = "Materializer_EntryToInitializeIsNull"; - internal const string Materializer_ProjectEntityTypeMismatch = "Materializer_ProjectEntityTypeMismatch"; - internal const string Materializer_PropertyMissing = "Materializer_PropertyMissing"; - internal const string Materializer_PropertyNotExpectedEntry = "Materializer_PropertyNotExpectedEntry"; - internal const string Materializer_DataServiceCollectionNotSupportedForNonEntities = "Materializer_DataServiceCollectionNotSupportedForNonEntities"; - internal const string Materializer_NoParameterlessCtorForCollectionProperty = "Materializer_NoParameterlessCtorForCollectionProperty"; - internal const string Materializer_InvalidCollectionItem = "Materializer_InvalidCollectionItem"; - internal const string Materializer_InvalidEntityType = "Materializer_InvalidEntityType"; - internal const string Materializer_InvalidNonEntityType = "Materializer_InvalidNonEntityType"; - internal const string Materializer_CollectionExpectedCollection = "Materializer_CollectionExpectedCollection"; - internal const string Materializer_InvalidResponsePayload = "Materializer_InvalidResponsePayload"; - internal const string Materializer_InvalidContentTypeEncountered = "Materializer_InvalidContentTypeEncountered"; - internal const string Materializer_MaterializationTypeError = "Materializer_MaterializationTypeError"; - internal const string Materializer_ResetAfterEnumeratorCreationError = "Materializer_ResetAfterEnumeratorCreationError"; - internal const string Materializer_TypeShouldBeCollectionError = "Materializer_TypeShouldBeCollectionError"; - internal const string Serializer_LoopsNotAllowedInComplexTypes = "Serializer_LoopsNotAllowedInComplexTypes"; - internal const string Serializer_LoopsNotAllowedInNonPropertyComplexTypes = "Serializer_LoopsNotAllowedInNonPropertyComplexTypes"; - internal const string Serializer_InvalidCollectionParameterItemType = "Serializer_InvalidCollectionParameterItemType"; - internal const string Serializer_NullCollectionParameterItemValue = "Serializer_NullCollectionParameterItemValue"; - internal const string Serializer_InvalidParameterType = "Serializer_InvalidParameterType"; - internal const string Serializer_UriDoesNotContainParameterAlias = "Serializer_UriDoesNotContainParameterAlias"; - internal const string Serializer_InvalidEnumMemberValue = "Serializer_InvalidEnumMemberValue"; - internal const string DataServiceQuery_EnumerationNotSupported = "DataServiceQuery_EnumerationNotSupported"; - internal const string Context_SendingRequestEventArgsNotHttp = "Context_SendingRequestEventArgsNotHttp"; - internal const string General_InternalError = "General_InternalError"; - internal const string ODataMetadataBuilder_MissingEntitySetUri = "ODataMetadataBuilder_MissingEntitySetUri"; - internal const string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix = "ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix"; - internal const string ODataMetadataBuilder_MissingEntityInstanceUri = "ODataMetadataBuilder_MissingEntityInstanceUri"; - internal const string EdmValueUtils_UnsupportedPrimitiveType = "EdmValueUtils_UnsupportedPrimitiveType"; - internal const string EdmValueUtils_IncorrectPrimitiveTypeKind = "EdmValueUtils_IncorrectPrimitiveTypeKind"; - internal const string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName = "EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName"; - internal const string EdmValueUtils_CannotConvertTypeToClrValue = "EdmValueUtils_CannotConvertTypeToClrValue"; - internal const string ValueParser_InvalidDuration = "ValueParser_InvalidDuration"; - internal const string PlatformHelper_DateTimeOffsetMustContainTimeZone = "PlatformHelper_DateTimeOffsetMustContainTimeZone"; - internal const string DataServiceRequest_FailGetCount = "DataServiceRequest_FailGetCount"; - internal const string DataServiceRequest_FailGetValue = "DataServiceRequest_FailGetValue"; - internal const string Context_ExecuteExpectedVoidResponse = "Context_ExecuteExpectedVoidResponse"; - - static TextRes loader = null; - ResourceManager resources; - - internal TextRes() - { - resources = new System.Resources.ResourceManager("Microsoft.OData.Client", this.GetType().GetTypeInfo().Assembly); - } - - private static TextRes GetLoader() - { - if (loader == null) - { - TextRes sr = new TextRes(); - Interlocked.CompareExchange(ref loader, sr, null); - } - - return loader; - } - - private static CultureInfo Culture - { - get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; } - } - - public static ResourceManager Resources - { - get - { - return GetLoader().resources; - } - } - - public static string GetString(string name, params object[] args) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - string res = sys.resources.GetString(name, TextRes.Culture); - - if (args != null && args.Length > 0) - { - for (int i = 0; i < args.Length; i ++) - { - String value = args[i] as String; - if (value != null && value.Length > 1024) - { - args[i] = value.Substring(0, 1024 - 3) + "..."; - } - } - return String.Format(CultureInfo.CurrentCulture, res, args); - } - else - { - return res; - } - } - - public static string GetString(string name) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - return sys.resources.GetString(name, TextRes.Culture); - } - - public static string GetString(string name, out bool usedFallback) - { - // always false for this version of gensr - usedFallback = false; - return GetString(name); - } - } -} diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.csproj b/src/Microsoft.OData.Client/Microsoft.OData.Client.csproj index cba7753665..18144f5028 100644 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.csproj +++ b/src/Microsoft.OData.Client/Microsoft.OData.Client.csproj @@ -31,10 +31,8 @@ - - @@ -105,48 +103,6 @@ - - - TextTemplatingFileGenerator - Microsoft.OData.Client.cs - - - TextTemplatingFileGenerator - Parameterized.Microsoft.OData.Client.cs - - - - - - True - True - Microsoft.OData.Client.tt - - - True - True - Parameterized.Microsoft.OData.Client.tt - - - - - - Microsoft.OData.Client - true - true - internal - true - Microsoft.OData.Client.TextRes - skip - - - - - - - - - @@ -176,13 +132,21 @@ - - TextTemplatingFileGenerator - Microsoft.OData.Client.cs - + - + + ResXFileCodeGenerator + SRResources.Designer.cs + + + + True + True + SRResources.resx + + + diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.tt b/src/Microsoft.OData.Client/Microsoft.OData.Client.tt deleted file mode 100644 index 7b29f79e99..0000000000 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.tt +++ /dev/null @@ -1,20 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\ResourceClassGenerator2.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData.Client"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Client"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Client.Common.txt", - "Microsoft.OData.Client.Desktop.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Client/Microsoft.OData.Client.txt b/src/Microsoft.OData.Client/Microsoft.OData.Client.txt deleted file mode 100644 index d944564a9d..0000000000 --- a/src/Microsoft.OData.Client/Microsoft.OData.Client.txt +++ /dev/null @@ -1,317 +0,0 @@ - -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone - -; See ResourceManager documentation and the ResGen tool. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error Messages - -Batch_ExpectedContentType=The expected content type for a batch requests is "multipart/mixed;boundary=batch" not "{0}". -Batch_ExpectedResponse=The POST request expected a response with content. ID={0} -Batch_IncompleteResponseCount=Not all requests in the batch had a response. -Batch_UnexpectedContent=The web response contained unexpected sections. ID={0} - -Context_BaseUri=Expected an absolute, well formed http URL without a query or fragment. -Context_BaseUriRequired=You must set the BaseUri property before you perform this operation. -Context_ResolveReturnedInvalidUri=The Uri that is returned by the ResolveEntitySet function must be an absolute, well-formed URL with an "http" or "https" scheme name and without any query strings or fragment identifiers. -Context_RequestUriIsRelativeBaseUriRequired=Because the requestUri is a relative Uri, you must set the BaseUri property on the DataServiceContext. -Context_ResolveEntitySetOrBaseUriRequired=The ResolveEntitySet function must return a non-null Uri for the EntitySet '{0}', otherwise you must set the BaseUri property. -Context_CannotConvertKey=Unable to convert value '{0}' into a key string for a URI. -Context_TrackingExpectsAbsoluteUri=The identity value specified by either the the OData-EntityId header must be an absolute URI. -Context_LocationHeaderExpectsAbsoluteUri=The 'Location' header value specified in the response must be an absolute URI. -Context_LinkResourceInsertFailure=One of the link's resources failed to insert. -Context_InternalError=Microsoft.OData.Client internal error {0}. -Context_BatchExecuteError=An error occurred for this query during batch execution. See the inner exception for details. -Context_EntitySetName=Expected a relative URL path without query or fragment. -Context_BatchNotSupportedForNamedStreams=Changes cannot be saved as a batch when an entity has one or more streams associated with it. Retry the SaveChanges operation without enabling the SaveChangesOptions.BatchWithSingleChangeset and the SaveChangesOptions.BatchWithIndependentOperations options. -Context_SetSaveStreamWithoutNamedStreamEditLink=The stream named '{0}' cannot be modified because it does not have an edit-media link. Make sure that the stream name is correct and that an edit-media link for this stream is included in the entry element in the response. -Content_EntityWithoutKey=This operation requires the entity be of an Entity Type, and has at least one key property. -Content_EntityIsNotEntityType=This operation requires the entity to be of an Entity Type, either mark its key properties, or attribute the class with DataServiceEntityAttribute -Context_EntityNotContained=The context is not currently tracking the entity. -Context_EntityAlreadyContained=The context is already tracking the entity. -Context_DifferentEntityAlreadyContained=The context is already tracking a different entity with the same resource Uri. -Context_DidNotOriginateAsync=The current object did not originate the async result. -Context_AsyncAlreadyDone=The asynchronous result has already been completed. -Context_OperationCanceled=The operation has been canceled. -Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX=The property '{0}' is not supported when MaxProtocolVersion is greater than '{1}'. - -Context_NoLoadWithInsertEnd=The context can not load the related collection or reference for objects in the added state. -Context_NoRelationWithInsertEnd=One or both of the ends of the relationship is in the added state. -Context_NoRelationWithDeleteEnd=One or both of the ends of the relationship is in the deleted state. -Context_RelationAlreadyContained=The context is already tracking the relationship. -Context_RelationNotRefOrCollection=The sourceProperty is not a reference or collection of the target's object type. -Context_AddLinkCollectionOnly=AddLink and DeleteLink methods only work when the sourceProperty is a collection. -Context_AddRelatedObjectCollectionOnly=AddRelatedObject method only works when the sourceProperty is a collection. -Context_AddRelatedObjectSourceDeleted=AddRelatedObject method only works if the source entity is in a non-deleted state. -Context_UpdateRelatedObjectNonCollectionOnly=UpdateRelatedObject method only works when the sourceProperty is not collection. -Context_SetLinkReferenceOnly=SetLink method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectNonCollectionOnly=SetRelatedObject method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectSourceDeleted=SetRelatedObject method only works if the source entity is in a non-deleted state. -Context_SetRelatedObjectLinkNonCollectionOnly=SetRelatedObjectLink method only works when the sourceProperty is not a collection. -Context_SetRelatedObjectLinkSourceDeleted=SetRelatedObjectLink method only works if the source entity is in a non-deleted state. - -Context_NoContentTypeForMediaLink=Media link object of type '{0}' is configured to use the MIME type specified in the property '{1}'. However, that property's value is null or empty. -Context_BatchNotSupportedForMediaLink=Saving entities with the [MediaEntry] attribute is not currently supported in batch mode. Use non-batched mode instead. -Context_UnexpectedZeroRawRead=Unexpected result (<= 0) from stream.Read() while reading raw data for this property. -Context_VersionNotSupported=Response version '{0}' is not supported. The only supported versions are: {1}. -Context_ResponseVersionIsBiggerThanProtocolVersion=The response version is {0}, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the version required by the response, and then retry the request. If the client does not support the required protocol version, then upgrade the client. -Context_RequestVersionIsBiggerThanProtocolVersion=The request requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the higher version, and then retry the operation. - -Context_ChildResourceExists=Attempt to delete a link between two objects failed because the identity of the target object of the link depends on the source object of the link. - -Context_ContentTypeRequiredForNamedStream=The ContentType value for a named stream cannot be null or an empty string. -Context_EntityNotMediaLinkEntry=This operation requires that the specified entity be a Media Link Entry and that the ReadStreamUri be available. However, the specified entity either is not a Media Link Entry or does not have a valid ReadStreamUri value. If the entity is a Media Link Entry, re-query the data service for this entity to obtain a valid ReadStreamUri value. -Context_MLEWithoutSaveStream=The entity type {0} is marked with MediaEntry attribute but no save stream was set for the entity. -Context_SetSaveStreamOnMediaEntryProperty=Can't use SetSaveStream on entity with type {0} which has a media entry property defined. -Context_SetSaveStreamWithoutEditMediaLink=There is no edit-media link for the entity's media stream. Make sure that the edit-media link is specified for this stream. -Context_SetSaveStreamOnInvalidEntityState=Calling SetSaveStream on an entity with state '{0}' is not allowed. -Context_EntityDoesNotContainNamedStream=The entity does not have a stream named '{0}'. Make sure that the name of the stream is correct. -Context_MissingSelfAndEditLinkForNamedStream=There is no self-link or edit-media link for the stream named '{0}'. Make sure that either the self-link or edit-media link is specified for this stream. -Context_BothLocationAndIdMustBeSpecified=The response should have both 'Location' and 'OData-EntityId' headers or the response should not have any of these headers. -Context_BodyOperationParametersNotAllowedWithGet=OperationParameter of type BodyOperationParameter cannot be specified when the HttpMethod is set to GET. -Context_MissingOperationParameterName=The Name property of an OperationParameter must be set to a non-null, non-empty string. -Context_DuplicateUriOperationParameterName=Multiple uri operation parameters were found with the same name. Uri operation parameter names must be unique. -Context_DuplicateBodyOperationParameterName=Multiple body operation parameters were found with the same name. Body operation parameter names must be unique. -Context_NullKeysAreNotSupported=The serialized resource has a null value in key member '{0}'. Null values are not supported in key members. -Context_ExecuteExpectsGetOrPostOrDelete=The HttpMethod must be GET, POST or DELETE. -Context_EndExecuteExpectedVoidResponse=EndExecute overload for void service operations and actions received a non-void response from the server. -Context_NullElementInOperationParameterArray=The operation parameters array contains a null element which is not allowed. -Context_EntityMetadataBuilderIsRequired=An implementation of ODataEntityMetadataBuilder is required, but a null value was returned from GetEntityMetadataBuilder. -Context_CannotChangeStateToAdded=The ChangeState method does not support the 'Added' state because additional information is needed for inserts. Use either AddObject or AddRelatedObject instead. -Context_CannotChangeStateToModifiedIfNotUnchanged=The entity's state can only be changed to 'Modified' if it is currently 'Unchanged'. -Context_CannotChangeStateIfAdded=An entity in the 'Added' state cannot be changed to '{0}', it can only be changed to 'Detached'. -Context_OnMessageCreatingReturningNull=DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property must not return a null value. Please return a non-null value for this property. -Context_SendingRequest_InvalidWhenUsingOnMessageCreating=SendingRequest cannot be used in combination with the DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property. Please use SendingRequest2 with DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property instead. -Context_MustBeUsedWith='{0}' must be used with '{1}'. -Context_DeepInsertOneTopLevelEntity=Deep insert can only have one top level entity. -Context_DeepInsertDeletedOrModified=For deep insert, ChangeState for '{0}' cannot be Deleted or Modified. - -DataServiceClientFormat_LoadServiceModelRequired=When you call the UseJson method without a parameter, you must use the LoadServiceModel property to provide a valid IEdmModel instance. -DataServiceClientFormat_ValidServiceModelRequiredForJson=To use the JSON format, you must first call DataServiceContext.Format.UseJson() and supply a valid service model. - -Collection_NullCollectionReference={0}.{1} must return a non-null open property collection. - -ClientType_MissingOpenProperty=The open object property '{0}:{1}' is not defined. -Clienttype_MultipleOpenProperty={0} has multiple definitions for OpenObjectAttribute. -ClientType_MissingProperty=The closed type {0} does not have a corresponding {1} settable property. -ClientType_KeysMustBeSimpleTypes=The key property '{0}' on for type '{1}' is of type '{2}', which is not a simple type. Only properties of simple type can be key properties. -ClientType_KeysOnDifferentDeclaredType={0} has key properties declared at different levels within its type hierarchy. -ClientType_MissingMimeTypeProperty=Type '{0}' has a MimeTypeProperty attribute that references the MIME type property '{1}'. However, this type does not have a property '{1}'. -ClientType_MissingMimeTypeDataProperty=Type '{0}' has a MimeTypeProperty attribute that references the data property '{1}'. However, this type does not have a property '{1}'. -ClientType_MissingMediaEntryProperty=Type '{0}' has a MediaEntry attribute that references a property called '{1}'. However, this type does not have a property '{1}'. -ClientType_NoSettableFields=The complex type '{0}' has no settable properties. -ClientType_MultipleImplementationNotSupported=Multiple implementations of ICollection is not supported. -ClientType_NullOpenProperties=The open type property '{0}' returned a null instance. -ClientType_Ambiguous=Resolving type from '{0}' that inherits from '{1}' is ambiguous. -ClientType_UnsupportedType=The type '{0}' is not supported by the client library. -ClientType_CollectionOfCollectionNotSupported=Collection properties of a collection type are not supported. -ClientType_MultipleTypesWithSameName=Multiple types were found with the same name '{0}'. Type names must be unique. - -WebUtil_TypeMismatchInCollection=An item in the collection property '{0}' is not of the correct type. All items in the collection property must be of the collection item type. -WebUtil_TypeMismatchInNonPropertyCollection=A collection of item type '{0}' has an item which is not of the correct type. All items in the collection must be of the collection item type. -ClientTypeCache_NonEntityTypeCannotContainEntityProperties=The property '{0}' is of entity type and it cannot be a property of the type '{1}', which is not of entity type. Only entity types can contain navigation properties. -DataServiceException_GeneralError=An error occurred while processing this request. - -Deserialize_GetEnumerator=Only a single enumeration is supported by this IEnumerable. -Deserialize_Current=The current value '{1}' type is not compatible with the expected '{0}' type. -Deserialize_MixedTextWithComment=Error processing response stream. Element value interspersed with a comment is not supported. -Deserialize_ExpectingSimpleValue=Error processing response stream. The XML element contains mixed content. -Deserialize_MismatchEntryLinkLocalSimple=Error processing response stream. Payload has a link, local object has a simple value. -Deserialize_MismatchEntryLinkFeedPropertyNotCollection=Error processing response stream. Payload has a feed and the property '{0}' is not a collection. -Deserialize_MismatchEntryLinkEntryPropertyIsCollection=Error processing response stream. Payload has an entry and the property '{0}' is a collection. -Deserialize_NoLocationHeader=The response to this POST request did not contain a 'location' header. That is not supported by this client. -Deserialize_ServerException=Error processing response stream. Server failed with following message:\r\n{0} -Deserialize_MissingIdElement=Error processing response stream. Missing id element in the response. - -Collection_NullCollectionNotSupported=The value of the property '{0}' is null. Properties that are a collection type of primitive or complex types cannot be null. -Collection_NullNonPropertyCollectionNotSupported=The value of the collection of item type '{0}' is null. A collection cannot have a null value. -Collection_NullCollectionItemsNotSupported=An item in the collection property has a null value. Collection properties that contain items with null values are not supported. -Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed=A collection property of primitive types cannot contain an item of a collection type. -Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed=A collection property of complex types cannot contain an item of a primitive type. - -EntityDescriptor_MissingSelfEditLink=The entity with identity '{0}' does not have a self-link or an edit-link associated with it. Please make sure that the entity has either a self-link or an edit-link associated with it. - -HttpProcessUtility_ContentTypeMissing=Content-Type header value missing. -HttpProcessUtility_MediaTypeMissingValue=Media type is missing a parameter value. -HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter=Media type requires a ';' character before a parameter definition. -HttpProcessUtility_MediaTypeRequiresSlash=Media type requires a '/' character. -HttpProcessUtility_MediaTypeRequiresSubType=Media type requires a subtype definition. -HttpProcessUtility_MediaTypeUnspecified=Media type is unspecified. -HttpProcessUtility_EncodingNotSupported=Character set '{0}' is not supported. -HttpProcessUtility_EscapeCharWithoutQuotes=Value for MIME type parameter '{0}' is incorrect because it contained escape characters even though it was not quoted. -HttpProcessUtility_EscapeCharAtEnd=Value for MIME type parameter '{0}' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value. -HttpProcessUtility_ClosingQuoteNotFound=Value for MIME type parameter '{0}' is incorrect because the closing quote character could not be found while the parameter value started with a quote character. - -MaterializeFromObject_CountNotPresent=Count value is not part of the response stream. -MaterializeFromObject_TopLevelLinkNotAvailable=The top level link is only available after the response has been enumerated. -MaterializeFromObject_CollectionKeyNotPresentInLinkTable=The collection is not part of the current entry -MaterializeFromObject_GetNestLinkForFlatCollection=This response does not contain any nested collections. Use null as Key instead. - -ODataRequestMessage_GetStreamMethodNotSupported=GetStream method is not supported. - -Util_EmptyString=Empty string. -Util_EmptyArray=Empty array. -Util_NullArrayElement=Array contains a null element. - -ALinq_UnsupportedExpression=The expression type {0} is not supported. -ALinq_CouldNotConvert=Could not convert constant {0} expression to string. -ALinq_MethodNotSupported=The method '{0}' is not supported. -ALinq_UnaryNotSupported=The unary operator '{0}' is not supported. -ALinq_BinaryNotSupported=The binary operator '{0}' is not supported. -ALinq_ConstantNotSupported=The constant for '{0}' is not supported. -ALinq_TypeBinaryNotSupported=An operation between an expression and a type is not supported. -ALinq_ConditionalNotSupported=The conditional expression is not supported. -ALinq_ParameterNotSupported=The parameter expression is not supported. -ALinq_MemberAccessNotSupported=The member access of '{0}' is not supported. -ALinq_LambdaNotSupported=Lambda Expressions not supported. -ALinq_NewNotSupported=New Expressions not supported. -ALinq_MemberInitNotSupported=Member Init Expressions not supported. -ALinq_ListInitNotSupported=List Init Expressions not supported. -ALinq_NewArrayNotSupported=New Array Expressions not supported. -ALinq_InvocationNotSupported=Invocation Expressions not supported. -ALinq_QueryOptionsOnlyAllowedOnLeafNodes=Can only specify query options (orderby, where, take, skip) after last navigation. -ALinq_CantExpand=Expand query option not allowed. -ALinq_CantCastToUnsupportedPrimitive=Can't cast to unsupported type '{0}' -ALinq_CantNavigateWithoutKeyPredicate=Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type. -ALinq_CanOnlyApplyOneKeyPredicate=Multiple key predicates cannot be specified for the same entity set. -ALinq_CantTranslateExpression=The expression {0} is not supported. -ALinq_TranslationError=Error translating Linq expression to URI: {0} -ALinq_CantAddQueryOption=Custom query option not allowed. -ALinq_CantAddDuplicateQueryOption=Can't add duplicate query option '{0}'. -ALinq_CantAddAstoriaQueryOption=Can't add query option '{0}' because it would conflict with the query options from the translated Linq expression. -ALinq_CantAddQueryOptionStartingWithDollarSign=Can't add query option '{0}' because it begins with reserved character '$'. -ALinq_CantReferToPublicField=Referencing public field '{0}' not supported in query option expression. Use public property instead. -ALinq_QueryOptionNotSupported=The query option '{0}' is not supported or is controlled by the OData service. -ALinq_QueryOptionsOnlyAllowedOnSingletons=Cannot specify query options (orderby, where, take, skip, count) on single resource. -ALinq_QueryOptionOutOfOrder=The {0} query option cannot be specified after the {1} query option. -ALinq_CannotAddCountOption=Cannot add count option to the resource set. -ALinq_CannotAddCountOptionConflict=Cannot add count option to the resource set because it would conflict with existing count options. -ALinq_ProjectionOnlyAllowedOnLeafNodes=Can only specify 'select' query option after last navigation. -ALinq_ProjectionCanOnlyHaveOneProjection=Cannot translate multiple Linq Select operations in a single 'select' query option. -ALinq_ProjectionMemberAssignmentMismatch=Cannot initialize an instance of entity type '{0}' because '{1}' and '{2}' do not refer to the same source entity. -ALinq_InvalidExpressionInNavigationPath=The expression '{0}' is not a valid expression for navigation path. The only supported operations inside the lambda expression body are MemberAccess and TypeAs. The expression must contain at least one MemberAccess and it cannot end with TypeAs. -ALinq_ExpressionNotSupportedInProjectionToEntity=Initializing instances of the entity type {0} with the expression {1} is not supported. -ALinq_ExpressionNotSupportedInProjection=Constructing or initializing instances of the type {0} with the expression {1} is not supported. -ALinq_CannotConstructKnownEntityTypes=Construction of entity type instances must use object initializer with default constructor. -ALinq_CannotCreateConstantEntity=Referencing of local entity type instances not supported when projecting results. -ALinq_PropertyNamesMustMatchInProjections=Cannot assign the value from the {0} property to the {1} property. When projecting results into a entity type, the property names of the source type and the target type must match for the properties being projected. -ALinq_CanOnlyProjectTheLeaf=Can only project the last entity type in the query being translated. -ALinq_CannotProjectWithExplicitExpansion=Cannot create projection while there is an explicit expansion specified on the same query. -ALinq_CollectionPropertyNotSupportedInOrderBy=The collection property '{0}' cannot be used in an 'orderby' query expression. Collection properties are not supported by the 'orderby' query option. -ALinq_CollectionPropertyNotSupportedInWhere=The collection property '{0}' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option. -ALinq_CollectionMemberAccessNotSupportedInNavigation=Navigation to members of the collection property '{0}' in a 'select' query expression is not supported. -ALinq_LinkPropertyNotSupportedInExpression=The property '{0}' of type 'DataServiceStreamLink' cannot be used in 'where' or 'orderby' query expressions. Properties of type 'DataServiceStreamLink' are not supported by these query options. -ALinq_OfTypeArgumentNotAvailable=The target type for an OfType filter could not be determined. -ALinq_CannotUseTypeFiltersMultipleTimes=Non-redundant type filters (OfType, C# 'as' and VB 'TryCast') can only be used once per resource set. -ALinq_ExpressionCannotEndWithTypeAs=Unsupported expression '{0}' in '{1}' method. Expression cannot end with TypeAs. -ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3=The expression 'TypeAs' is not supported when MaxProtocolVersion is less than '3.0'. -ALinq_TypeAsArgumentNotEntityType=The type '{0}' is not an entity type. The target type for a TypeAs operator must be an entity type. -ALinq_InvalidSourceForAnyAll=The source parameter for the '{0}' method has to be either a navigation or a collection property. -ALinq_AnyAllNotSupportedInOrderBy=The method '{0}' is not supported by the 'orderby' query option. -ALinq_FormatQueryOptionNotSupported=The '$format' query option is not supported. Use the DataServiceContext.Format property to set the desired format. -ALinq_IllegalSystemQueryOption=Found the following illegal system token while building a projection or expansion path: '{0}' -ALinq_IllegalPathStructure=Found a projection as a non-leaf segment in an expand path. Please rephrase your query. The projected property was : '{0}' -ALinq_TypeTokenWithNoTrailingNavProp=Found an illegal type token '{0}' without a trailing navigation property. -ALinq_ContainsNotValidOnEmptyCollection=The Contains method cannot be used with an empty collection. -ALinq_AggregationMethodNotSupported=The aggregation method '{0}' is not supported. -ALinq_InvalidAggregateExpression=The expression '{0}' is not a valid aggregate expression. The aggregate expression must evaluate to a single-valued property path to an aggregatable property. -ALinq_InvalidGroupingExpression=The expression '{0}' is not a valid expression for grouping. The grouping expression must evaluate to a single-valued property path, i.e., a path ending in a single-valued primitive. -ALinq_InvalidGroupByKeySelector=The expression '{0}' in the GroupBy key selector is not supported. - -DSKAttribute_MustSpecifyAtleastOnePropertyName=DataServiceKey attribute must specify at least one property name. - -DataServiceCollection_LoadRequiresTargetCollectionObserved=Target collection for the Load operation must have an associated DataServiceContext. -DataServiceCollection_CannotStopTrackingChildCollection=The tracking of DataServiceCollection can not be stopped for child collections. -DataServiceCollection_OperationForTrackedOnly=This operation is only supported on collections that are being tracked. -DataServiceCollection_CannotDetermineContextFromItems=The DataServiceContext to which the DataServiceCollection instance belongs could not be determined. The DataServiceContext must either be supplied in the DataServiceCollection constructor or be used to create the DataServiceQuery or QueryOperationResponse object that is the source of the items in the DataServiceCollection. -DataServiceCollection_InsertIntoTrackedButNotLoadedCollection=An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection. -DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime=A previous LoadAsync operation has not yet completed. You cannot call the LoadAsync method on the DataServiceCollection again until the previous operation has completed. -DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity=The LoadAsync method cannot be called when the DataServiceCollection is not a child collection of a related entity. -DataServiceCollection_LoadAsyncRequiresDataServiceQuery=Only a typed DataServiceQuery object can be supplied when calling the LoadAsync method on DataServiceCollection. - -DataBinding_DataServiceCollectionArgumentMustHaveEntityType=The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type '{0}' does not have any key property. -DataBinding_CollectionPropertySetterValueHasObserver=Setting an instance of DataServiceCollection to an entity property is disallowed if the instance is already being tracked. Error occurred on property '{0}' for entity type '{1}'. -DataBinding_DataServiceCollectionChangedUnknownActionCollection=Unexpected action '{0}' on the OnCollectionChanged event raised by DataServiceCollection. -DataBinding_CollectionChangedUnknownActionCollection=Unexpected action '{0}' on the OnCollectionChanged event raised by a collection object of type '{1}'. -DataBinding_BindingOperation_DetachedSource=Add/Update/Delete operation cannot be performed on a child entity, if the parent entity is already detached. -DataBinding_BindingOperation_ArrayItemNull=Null values are disallowed during '{0}' operations on DataServiceCollection. -DataBinding_BindingOperation_ArrayItemNotEntity=A value provided during '{0}' operation on DataServiceCollection is not of an entity type with key. -DataBinding_Util_UnknownEntitySetName=Entity set name has not been provided for an entity of type '{0}'. -DataBinding_EntityAlreadyInCollection=An attempt was made to add entity of type '{0}' to a collection in which the same entity already exists. -DataBinding_NotifyPropertyChangedNotImpl=An attempt to track an entity or complex type failed because the entity or complex type '{0}' does not implement the INotifyPropertyChanged interface. -DataBinding_NotifyCollectionChangedNotImpl=An attempt to track an entity or complex type failed because the entity or complex type contains a collection property of type '{0}' that does not implement the INotifyCollectionChanged interface. -DataBinding_ComplexObjectAssociatedWithMultipleEntities=An attempt to track a complex object of type '{0}' failed because the complex object is already being tracked. -DataBinding_CollectionAssociatedWithMultipleEntities=An attempt to track a collection object of type '{0}' failed because the collection object is already being tracked. - -Parser_SingleEntry_NoneFound=Expected exactly one entry in the response from the server, but none was found. -Parser_SingleEntry_MultipleFound=Expected exactly one entry in the response from the server, but more than one was found. -Parser_SingleEntry_ExpectedFeedOrEntry=Expected a feed or entry in the response from the server, but found an unexpected element instead. - -Materializer_CannotAssignNull=The null value from property '{0}' cannot be assigned to a type '{1}'. -Materializer_EntryIntoCollectionMismatch=An entry of type '{0}' cannot be added to a collection that contains instances of type '{1}'. This may occur when an existing entry of a different type has the same identity value or when the same entity is projected into two different types in a single query. -Materializer_EntryToAccessIsNull=An entry returned by the navigation property '{0}' is null and cannot be initialized. You should check for a null value before accessing this property. -Materializer_EntryToInitializeIsNull=An entry that contains the data required to create an instance of type '{0}' is null and cannot be initialized. You should check for a null value before accessing this entry. -Materializer_ProjectEntityTypeMismatch=An entity of type '{0}' cannot be projected because there is already an instance of type '{1}' for '{2}'. -Materializer_PropertyMissing=The expected property '{0}' could not be found while processing an entry. Check for null before accessing this property. -Materializer_PropertyNotExpectedEntry=Property '{0}' is not an entity. -Materializer_DataServiceCollectionNotSupportedForNonEntities=A DataServiceCollection can only contain entity types. Primitive and complex types cannot be contained by this kind of collection. -Materializer_NoParameterlessCtorForCollectionProperty=Collection property '{0}' cannot be created because the type '{1}' does not have a public parameterless constructor. -Materializer_InvalidCollectionItem=The element '{0}' is not a valid collection item. The name of the collection item element must be 'element' and must belong to the 'http://docs.oasis-open.org/odata/ns/data' namespace. -Materializer_InvalidEntityType=There is a type mismatch between the client and the service. Type '{0}' is an entity type, but the type in the response payload does not represent an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. -Materializer_InvalidNonEntityType=There is a type mismatch between the client and the service. Type '{0}' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. -Materializer_CollectionExpectedCollection=Materialization of top level collection expected ICollection<>, but actual type was {0}. -Materializer_InvalidResponsePayload=The response payload is a not a valid response payload. Please make sure that the top level element is a valid JSON element or belongs to '{0}' namespace. -Materializer_InvalidContentTypeEncountered=The response content type '{0}' is not currently supported. -Materializer_MaterializationTypeError=Cannot materialize the results into a collection type '{0}' because it does not have a parameterless constructor. -Materializer_ResetAfterEnumeratorCreationError=Reset should never be called for collection reader in an internal enumerable. -Materializer_TypeShouldBeCollectionError=Cannot materialize a collection of a primitives or complex without the type '{0}' being a collection. - -Serializer_LoopsNotAllowedInComplexTypes=A circular loop was detected while serializing the property '{0}'. You must make sure that loops are not present in properties that return a collection or complex type. -Serializer_LoopsNotAllowedInNonPropertyComplexTypes=A circular loop was detected while serializing the complex type '{0}'. You must make sure that loops are not present in a collection or a complex type. -Serializer_InvalidCollectionParameterItemType=The operation parameter named '{0}' has a collection item of Edm type kind '{1}'. A collection item must be either a primitive type or a complex Edm type kind. -Serializer_NullCollectionParameterItemValue=The operation parameter named '{0}' has a null collection item. The items of a collection must not be null. -Serializer_InvalidParameterType=The operation parameter named '{0}' was of Edm type kind '{1}'. An operation parameter must be either a primitive type, a complex type or a collection of primitive or complex types. -Serializer_UriDoesNotContainParameterAlias=The parameter alias '{0}' was not present in the request URI. All parameters passed as alias must be present in the request URI. -Serializer_InvalidEnumMemberValue=The enum type '{0}' has no member named '{1}'. - -; NOTE: error message copied from Silverlight because the portable library requires this -DataServiceQuery_EnumerationNotSupported=This target framework does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because this framework only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration. - -; NOTE: Moved over to common as this is used in the portable library -Context_SendingRequestEventArgsNotHttp=Only instances of HttpWebRequest are currently allowed for this property. Other subtypes of WebRequest are not supported. - -; NOTE: these error messages are copied from ODL because they appear in shared source files. -General_InternalError=An internal error '{0}' occurred. - -ODataMetadataBuilder_MissingEntitySetUri=The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required. -ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix=The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments. -ODataMetadataBuilder_MissingEntityInstanceUri=Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required. - -EdmValueUtils_UnsupportedPrimitiveType=The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type. -EdmValueUtils_IncorrectPrimitiveTypeKind=Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. -EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName=Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. -EdmValueUtils_CannotConvertTypeToClrValue=A value with primitive kind '{0}' cannot be converted into a primitive object value. - -; NOTE: these error messages are copied from EdmLib because they appear in shared source files. -ValueParser_InvalidDuration=The value '{0}' is not a valid duration value. - -; Note: The below list of error messages are common to the ODataLib, EdmLib, Spatial, Server and Client projects. -PlatformHelper_DateTimeOffsetMustContainTimeZone=The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. -;END - -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone - -; See ResourceManager documentation and the ResGen tool. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error Messages - -DataServiceRequest_FailGetCount=Failed to get the count value from the server. -DataServiceRequest_FailGetValue=Failed to get the value from the server. - -Context_ExecuteExpectedVoidResponse=Execute overload for void service operations and actions received a non-void response from the server. -;END diff --git a/src/Microsoft.OData.Client/ObjectMaterializer.cs b/src/Microsoft.OData.Client/ObjectMaterializer.cs index d8ddbdd4ad..70aa5e6f3b 100644 --- a/src/Microsoft.OData.Client/ObjectMaterializer.cs +++ b/src/Microsoft.OData.Client/ObjectMaterializer.cs @@ -429,7 +429,7 @@ internal virtual DataServiceQueryContinuation GetContinuation(IEnumerable key) { // expectingSingleValue && !moved : haven't started parsing single value (single value should not have next link anyway) // !expectingSingleValue && !IsEndOfStream : collection type feed did not finish parsing yet - throw new InvalidOperationException(Strings.MaterializeFromObject_TopLevelLinkNotAvailable); + throw new InvalidOperationException(SRResources.MaterializeFromObject_TopLevelLinkNotAvailable); } // we have already moved to the end of stream @@ -451,7 +451,7 @@ internal virtual DataServiceQueryContinuation GetContinuation(IEnumerable key) if (!this.materializer.NextLinkTable.TryGetValue(key, out result)) { // someone has asked for a collection that's "out of scope" or doesn't exist - throw new ArgumentException(Strings.MaterializeFromObject_CollectionKeyNotPresentInLinkTable); + throw new ArgumentException(SRResources.MaterializeFromObject_CollectionKeyNotPresentInLinkTable); } } @@ -463,7 +463,7 @@ private void CheckGetEnumerator() { if (this.calledGetEnumerator) { - throw Error.NotSupported(Strings.Deserialize_GetEnumerator); + throw Error.NotSupported(SRResources.Deserialize_GetEnumerator); } this.calledGetEnumerator = true; @@ -495,7 +495,7 @@ internal static string ReadElementString(XmlReader reader, bool checkNullAttribu case XmlNodeType.SignificantWhitespace: if (result != null) { - throw Error.InvalidOperation(Strings.Deserialize_MixedTextWithComment); + throw Error.InvalidOperation(SRResources.Deserialize_MixedTextWithComment); } result = reader.Value; @@ -509,13 +509,13 @@ internal static string ReadElementString(XmlReader reader, bool checkNullAttribu goto default; default: - throw Error.InvalidOperation(Strings.Deserialize_ExpectingSimpleValue); + throw Error.InvalidOperation(SRResources.Deserialize_ExpectingSimpleValue); #endregion } } // xml ended before EndElement? - throw Error.InvalidOperation(Strings.Deserialize_ExpectingSimpleValue); + throw Error.InvalidOperation(SRResources.Deserialize_ExpectingSimpleValue); } /// @@ -573,7 +573,7 @@ internal override DataServiceQueryContinuation GetContinuation(IEnumerable key) } else { - throw new InvalidOperationException(Strings.MaterializeFromObject_GetNestLinkForFlatCollection); + throw new InvalidOperationException(SRResources.MaterializeFromObject_GetNestLinkForFlatCollection); } } diff --git a/src/Microsoft.OData.Client/OperationParameter.cs b/src/Microsoft.OData.Client/OperationParameter.cs index 6c92af3276..b8c9ade028 100644 --- a/src/Microsoft.OData.Client/OperationParameter.cs +++ b/src/Microsoft.OData.Client/OperationParameter.cs @@ -24,7 +24,7 @@ protected OperationParameter(string name, Object value) { if (string.IsNullOrEmpty(name)) { - throw new ArgumentException(Strings.Context_MissingOperationParameterName); + throw new ArgumentException(SRResources.Context_MissingOperationParameterName); } this.parameterName = name; diff --git a/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.cs b/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.cs deleted file mode 100644 index 316bec8466..0000000000 --- a/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.cs +++ /dev/null @@ -1,2528 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -namespace Microsoft.OData.Client { - using System; - using System.Resources; - - /// - /// Strongly-typed and parameterized string resources. - /// - internal static class Strings { - /// - /// A string like "The expected content type for a batch requests is "multipart/mixed;boundary=batch" not "{0}"." - /// - internal static string Batch_ExpectedContentType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Batch_ExpectedContentType, p0); - } - - /// - /// A string like "The POST request expected a response with content. ID={0}" - /// - internal static string Batch_ExpectedResponse(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Batch_ExpectedResponse, p0); - } - - /// - /// A string like "Not all requests in the batch had a response." - /// - internal static string Batch_IncompleteResponseCount - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Batch_IncompleteResponseCount); - } - } - - /// - /// A string like "The web response contained unexpected sections. ID={0}" - /// - internal static string Batch_UnexpectedContent(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Batch_UnexpectedContent, p0); - } - - /// - /// A string like "Expected an absolute, well formed http URL without a query or fragment." - /// - internal static string Context_BaseUri - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BaseUri); - } - } - - /// - /// A string like "You must set the BaseUri property before you perform this operation." - /// - internal static string Context_BaseUriRequired - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BaseUriRequired); - } - } - - /// - /// A string like "The Uri that is returned by the ResolveEntitySet function must be an absolute, well-formed URL with an "http" or "https" scheme name and without any query strings or fragment identifiers." - /// - internal static string Context_ResolveReturnedInvalidUri - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ResolveReturnedInvalidUri); - } - } - - /// - /// A string like "Because the requestUri is a relative Uri, you must set the BaseUri property on the DataServiceContext." - /// - internal static string Context_RequestUriIsRelativeBaseUriRequired - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_RequestUriIsRelativeBaseUriRequired); - } - } - - /// - /// A string like "The ResolveEntitySet function must return a non-null Uri for the EntitySet '{0}', otherwise you must set the BaseUri property." - /// - internal static string Context_ResolveEntitySetOrBaseUriRequired(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ResolveEntitySetOrBaseUriRequired, p0); - } - - /// - /// A string like "Unable to convert value '{0}' into a key string for a URI." - /// - internal static string Context_CannotConvertKey(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_CannotConvertKey, p0); - } - - /// - /// A string like "The identity value specified by either the OData-EntityId header must be an absolute URI." - /// - internal static string Context_TrackingExpectsAbsoluteUri - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_TrackingExpectsAbsoluteUri); - } - } - - /// - /// A string like "The 'Location' header value specified in the response must be an absolute URI." - /// - internal static string Context_LocationHeaderExpectsAbsoluteUri - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_LocationHeaderExpectsAbsoluteUri); - } - } - - /// - /// A string like "One of the link's resources failed to insert." - /// - internal static string Context_LinkResourceInsertFailure - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_LinkResourceInsertFailure); - } - } - - /// - /// A string like "Microsoft.OData.Client internal error {0}." - /// - internal static string Context_InternalError(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_InternalError, p0); - } - - /// - /// A string like "An error occurred for this query during batch execution. See the inner exception for details." - /// - internal static string Context_BatchExecuteError - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BatchExecuteError); - } - } - - /// - /// A string like "Expected a relative URL path without query or fragment." - /// - internal static string Context_EntitySetName - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntitySetName); - } - } - - /// - /// A string like "Changes cannot be saved as a batch when an entity has one or more streams associated with it. Retry the SaveChanges operation without enabling the SaveChangesOptions.BatchWithSingleChangeset and the SaveChangesOptions.BatchWithIndependentOperations options." - /// - internal static string Context_BatchNotSupportedForNamedStreams - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BatchNotSupportedForNamedStreams); - } - } - - /// - /// A string like "The stream named '{0}' cannot be modified because it does not have an edit-media link. Make sure that the stream name is correct and that an edit-media link for this stream is included in the entry element in the response." - /// - internal static string Context_SetSaveStreamWithoutNamedStreamEditLink(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetSaveStreamWithoutNamedStreamEditLink, p0); - } - - /// - /// A string like "This operation requires the entity be of an Entity Type, and has at least one key property." - /// - internal static string Content_EntityWithoutKey - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Content_EntityWithoutKey); - } - } - - /// - /// A string like "This operation requires the entity to be of an Entity Type, either mark its key properties, or attribute the class with DataServiceEntityAttribute" - /// - internal static string Content_EntityIsNotEntityType - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Content_EntityIsNotEntityType); - } - } - - /// - /// A string like "The context is not currently tracking the entity." - /// - internal static string Context_EntityNotContained - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityNotContained); - } - } - - /// - /// A string like "The context is already tracking the entity." - /// - internal static string Context_EntityAlreadyContained - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityAlreadyContained); - } - } - - /// - /// A string like "The context is already tracking a different entity with the same resource Uri." - /// - internal static string Context_DifferentEntityAlreadyContained - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DifferentEntityAlreadyContained); - } - } - - /// - /// A string like "The current object did not originate the async result." - /// - internal static string Context_DidNotOriginateAsync - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DidNotOriginateAsync); - } - } - - /// - /// A string like "The asynchronous result has already been completed." - /// - internal static string Context_AsyncAlreadyDone - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_AsyncAlreadyDone); - } - } - - /// - /// A string like "The operation has been canceled." - /// - internal static string Context_OperationCanceled - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_OperationCanceled); - } - } - - /// - /// A string like "The property '{0}' is not supported when MaxProtocolVersion is greater than '{1}'." - /// - internal static string Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX, p0, p1); - } - - /// - /// A string like "The context can not load the related collection or reference for objects in the added state." - /// - internal static string Context_NoLoadWithInsertEnd - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NoLoadWithInsertEnd); - } - } - - /// - /// A string like "One or both of the ends of the relationship is in the added state." - /// - internal static string Context_NoRelationWithInsertEnd - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NoRelationWithInsertEnd); - } - } - - /// - /// A string like "One or both of the ends of the relationship is in the deleted state." - /// - internal static string Context_NoRelationWithDeleteEnd - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NoRelationWithDeleteEnd); - } - } - - /// - /// A string like "The context is already tracking the relationship." - /// - internal static string Context_RelationAlreadyContained - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_RelationAlreadyContained); - } - } - - /// - /// A string like "The sourceProperty is not a reference or collection of the target's object type." - /// - internal static string Context_RelationNotRefOrCollection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_RelationNotRefOrCollection); - } - } - - /// - /// A string like "AddLink and DeleteLink methods only work when the sourceProperty is a collection." - /// - internal static string Context_AddLinkCollectionOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_AddLinkCollectionOnly); - } - } - - /// - /// A string like "AddRelatedObject method only works when the sourceProperty is a collection." - /// - internal static string Context_AddRelatedObjectCollectionOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_AddRelatedObjectCollectionOnly); - } - } - - /// - /// A string like "AddRelatedObject method only works if the source entity is in a non-deleted state." - /// - internal static string Context_AddRelatedObjectSourceDeleted - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_AddRelatedObjectSourceDeleted); - } - } - - /// - /// A string like "UpdateRelatedObject method only works when the sourceProperty is not collection." - /// - internal static string Context_UpdateRelatedObjectNonCollectionOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_UpdateRelatedObjectNonCollectionOnly); - } - } - - /// - /// A string like "SetLink method only works when the sourceProperty is not a collection." - /// - internal static string Context_SetLinkReferenceOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetLinkReferenceOnly); - } - } - - /// - /// A string like "SetRelatedObject method only works when the sourceProperty is not a collection." - /// - internal static string Context_SetRelatedObjectNonCollectionOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetRelatedObjectNonCollectionOnly); - } - } - - /// - /// A string like "SetRelatedObject method only works if the source entity is in a non-deleted state." - /// - internal static string Context_SetRelatedObjectSourceDeleted - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetRelatedObjectSourceDeleted); - } - } - - /// - /// A string like "SetRelatedObjectLink method only works when the sourceProperty is not a collection." - /// - internal static string Context_SetRelatedObjectLinkNonCollectionOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetRelatedObjectLinkNonCollectionOnly); - } - } - - /// - /// A string like "SetRelatedObjectLink method only works if the source entity is in a non-deleted state." - /// - internal static string Context_SetRelatedObjectLinkSourceDeleted - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetRelatedObjectLinkSourceDeleted); - } - } - - /// - /// A string like "Media link object of type '{0}' is configured to use the MIME type specified in the property '{1}'. However, that property's value is null or empty." - /// - internal static string Context_NoContentTypeForMediaLink(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NoContentTypeForMediaLink, p0, p1); - } - - /// - /// A string like "Saving entities with the [MediaEntry] attribute is not currently supported in batch mode. Use non-batched mode instead." - /// - internal static string Context_BatchNotSupportedForMediaLink - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BatchNotSupportedForMediaLink); - } - } - - /// - /// A string like "Unexpected result (<= 0) from stream.Read() while reading raw data for this property." - /// - internal static string Context_UnexpectedZeroRawRead - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_UnexpectedZeroRawRead); - } - } - - /// - /// A string like "Response version '{0}' is not supported. The only supported versions are: {1}." - /// - internal static string Context_VersionNotSupported(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_VersionNotSupported, p0, p1); - } - - /// - /// A string like "The response version is {0}, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the version required by the response, and then retry the request. If the client does not support the required protocol version, then upgrade the client." - /// - internal static string Context_ResponseVersionIsBiggerThanProtocolVersion(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ResponseVersionIsBiggerThanProtocolVersion, p0, p1); - } - - /// - /// A string like "The request requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the higher version, and then retry the operation." - /// - internal static string Context_RequestVersionIsBiggerThanProtocolVersion(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_RequestVersionIsBiggerThanProtocolVersion, p0, p1); - } - - /// - /// A string like "Attempt to delete a link between two objects failed because the identity of the target object of the link depends on the source object of the link." - /// - internal static string Context_ChildResourceExists - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ChildResourceExists); - } - } - - /// - /// A string like "The ContentType value for a named stream cannot be null or an empty string." - /// - internal static string Context_ContentTypeRequiredForNamedStream - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ContentTypeRequiredForNamedStream); - } - } - - /// - /// A string like "This operation requires that the specified entity be a Media Link Entry and that the ReadStreamUri be available. However, the specified entity either is not a Media Link Entry or does not have a valid ReadStreamUri value. If the entity is a Media Link Entry, re-query the data service for this entity to obtain a valid ReadStreamUri value." - /// - internal static string Context_EntityNotMediaLinkEntry - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityNotMediaLinkEntry); - } - } - - /// - /// A string like "The entity type {0} is marked with MediaEntry attribute but no save stream was set for the entity." - /// - internal static string Context_MLEWithoutSaveStream(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_MLEWithoutSaveStream, p0); - } - - /// - /// A string like "Can't use SetSaveStream on entity with type {0} which has a media entry property defined." - /// - internal static string Context_SetSaveStreamOnMediaEntryProperty(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetSaveStreamOnMediaEntryProperty, p0); - } - - /// - /// A string like "There is no edit-media link for the entity's media stream. Make sure that the edit-media link is specified for this stream." - /// - internal static string Context_SetSaveStreamWithoutEditMediaLink - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetSaveStreamWithoutEditMediaLink); - } - } - - /// - /// A string like "Calling SetSaveStream on an entity with state '{0}' is not allowed." - /// - internal static string Context_SetSaveStreamOnInvalidEntityState(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SetSaveStreamOnInvalidEntityState, p0); - } - - /// - /// A string like "The entity does not have a stream named '{0}'. Make sure that the name of the stream is correct." - /// - internal static string Context_EntityDoesNotContainNamedStream(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityDoesNotContainNamedStream, p0); - } - - /// - /// A string like "There is no self-link or edit-media link for the stream named '{0}'. Make sure that either the self-link or edit-media link is specified for this stream." - /// - internal static string Context_MissingSelfAndEditLinkForNamedStream(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_MissingSelfAndEditLinkForNamedStream, p0); - } - - /// - /// A string like "The response should have both 'Location' and 'OData-EntityId' headers or the response should not have any of these headers." - /// - internal static string Context_BothLocationAndIdMustBeSpecified - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BothLocationAndIdMustBeSpecified); - } - } - - /// - /// A string like "OperationParameter of type BodyOperationParameter cannot be specified when the HttpMethod is set to GET." - /// - internal static string Context_BodyOperationParametersNotAllowedWithGet - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_BodyOperationParametersNotAllowedWithGet); - } - } - - /// - /// A string like "The Name property of an OperationParameter must be set to a non-null, non-empty string." - /// - internal static string Context_MissingOperationParameterName - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_MissingOperationParameterName); - } - } - - /// - /// A string like "Multiple uri operation parameters were found with the same name. Uri operation parameter names must be unique." - /// - internal static string Context_DuplicateUriOperationParameterName - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DuplicateUriOperationParameterName); - } - } - - /// - /// A string like "Multiple body operation parameters were found with the same name. Body operation parameter names must be unique." - /// - internal static string Context_DuplicateBodyOperationParameterName - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DuplicateBodyOperationParameterName); - } - } - - /// - /// A string like "The serialized resource has a null value in key member '{0}'. Null values are not supported in key members." - /// - internal static string Context_NullKeysAreNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NullKeysAreNotSupported, p0); - } - - /// - /// A string like "The HttpMethod must be GET, POST or DELETE." - /// - internal static string Context_ExecuteExpectsGetOrPostOrDelete - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ExecuteExpectsGetOrPostOrDelete); - } - } - - /// - /// A string like "EndExecute overload for void service operations and actions received a non-void response from the server." - /// - internal static string Context_EndExecuteExpectedVoidResponse - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EndExecuteExpectedVoidResponse); - } - } - - /// - /// A string like "The operation parameters array contains a null element which is not allowed." - /// - internal static string Context_NullElementInOperationParameterArray - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_NullElementInOperationParameterArray); - } - } - - /// - /// A string like "An implementation of ODataEntityMetadataBuilder is required, but a null value was returned from GetEntityMetadataBuilder." - /// - internal static string Context_EntityMetadataBuilderIsRequired - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityMetadataBuilderIsRequired); - } - } - - /// - /// A string like "The ChangeState method does not support the 'Added' state because additional information is needed for inserts. Use either AddObject or AddRelatedObject instead." - /// - internal static string Context_CannotChangeStateToAdded - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_CannotChangeStateToAdded); - } - } - - /// - /// A string like "The entity's state can only be changed to 'Modified' if it is currently 'Unchanged'." - /// - internal static string Context_CannotChangeStateToModifiedIfNotUnchanged - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_CannotChangeStateToModifiedIfNotUnchanged); - } - } - - /// - /// A string like "An entity in the 'Added' state cannot be changed to '{0}', it can only be changed to 'Detached'." - /// - internal static string Context_CannotChangeStateIfAdded(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_CannotChangeStateIfAdded, p0); - } - - /// - /// A string like "DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property must not return a null value. Please return a non-null value for this property." - /// - internal static string Context_OnMessageCreatingReturningNull - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_OnMessageCreatingReturningNull); - } - } - - /// - /// A string like "SendingRequest cannot be used in combination with the DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property. Please use SendingRequest2 with DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property instead." - /// - internal static string Context_SendingRequest_InvalidWhenUsingOnMessageCreating - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SendingRequest_InvalidWhenUsingOnMessageCreating); - } - } - - /// - /// A string like "'{0}' must be used with '{1}'." - /// - internal static string Context_MustBeUsedWith(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_MustBeUsedWith, p0, p1); - } - - /// - /// A string like "The context is currently in no tracking mode, in order to use streams make sure your entities extend BaseEntityType and query the Item again from the server to populate the read link or enable tracking." - /// - internal static string Context_EntityMediaLinksNotTrackedInEntity - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityMediaLinksNotTrackedInEntity); - } - } - - /// - /// A string like "The context is in non tracking mode, The entity does not seem to have the media links populated properly. Please verify server response is correct and that the entity extends BaseEntityType." - /// - internal static string Context_EntityInNonTrackedContextLacksMediaLinks - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_EntityInNonTrackedContextLacksMediaLinks); - } - } - - /// - /// A string like "Deep insert can only have one top level entity." - /// - internal static string Context_DeepInsertOneTopLevelEntity - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DeepInsertOneTopLevelEntity); - } - } - - /// - /// A string like "For deep insert, ChangeState for '{0}' cannot be Deleted or Modified." - /// - internal static string Context_DeepInsertDeletedOrModified(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_DeepInsertDeletedOrModified, p0); - } - - /// - /// A string like "When you call the UseJson method without a parameter, you must use the LoadServiceModel property to provide a valid IEdmModel instance." - /// - internal static string DataServiceClientFormat_LoadServiceModelRequired - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceClientFormat_LoadServiceModelRequired); - } - } - - /// - /// A string like "To use the JSON format, you must first call DataServiceContext.Format.UseJson() and supply a valid service model." - /// - internal static string DataServiceClientFormat_ValidServiceModelRequiredForJson - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceClientFormat_ValidServiceModelRequiredForJson); - } - } - - /// - /// A string like "{0}.{1} must return a non-null open property collection." - /// - internal static string Collection_NullCollectionReference(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_NullCollectionReference, p0, p1); - } - - /// - /// A string like "The open object property '{0}:{1}' is not defined." - /// - internal static string ClientType_MissingOpenProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MissingOpenProperty, p0, p1); - } - - /// - /// A string like "{0} has multiple definitions for OpenObjectAttribute." - /// - internal static string Clienttype_MultipleOpenProperty(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Clienttype_MultipleOpenProperty, p0); - } - - /// - /// A string like "The closed type {0} does not have a corresponding {1} settable property." - /// - internal static string ClientType_MissingProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MissingProperty, p0, p1); - } - - /// - /// A string like "The key property '{0}' on for type '{1}' is of type '{2}', which is not a simple type. Only properties of simple type can be key properties." - /// - internal static string ClientType_KeysMustBeSimpleTypes(object p0, object p1, object p2) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_KeysMustBeSimpleTypes, p0, p1, p2); - } - - /// - /// A string like "{0} has key properties declared at different levels within its type hierarchy." - /// - internal static string ClientType_KeysOnDifferentDeclaredType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_KeysOnDifferentDeclaredType, p0); - } - - /// - /// A string like "Type '{0}' has a MimeTypeProperty attribute that references the MIME type property '{1}'. However, this type does not have a property '{1}'." - /// - internal static string ClientType_MissingMimeTypeProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MissingMimeTypeProperty, p0, p1); - } - - /// - /// A string like "Type '{0}' has a MimeTypeProperty attribute that references the data property '{1}'. However, this type does not have a property '{1}'." - /// - internal static string ClientType_MissingMimeTypeDataProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MissingMimeTypeDataProperty, p0, p1); - } - - /// - /// A string like "Type '{0}' has a MediaEntry attribute that references a property called '{1}'. However, this type does not have a property '{1}'." - /// - internal static string ClientType_MissingMediaEntryProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MissingMediaEntryProperty, p0, p1); - } - - /// - /// A string like "The complex type '{0}' has no settable properties." - /// - internal static string ClientType_NoSettableFields(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_NoSettableFields, p0); - } - - /// - /// A string like "Multiple implementations of ICollection<T> is not supported." - /// - internal static string ClientType_MultipleImplementationNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MultipleImplementationNotSupported); - } - } - - /// - /// A string like "The open type property '{0}' returned a null instance." - /// - internal static string ClientType_NullOpenProperties(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_NullOpenProperties, p0); - } - - /// - /// A string like "Resolving type from '{0}' that inherits from '{1}' is ambiguous." - /// - internal static string ClientType_Ambiguous(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_Ambiguous, p0, p1); - } - - /// - /// A string like "The type '{0}' is not supported by the client library." - /// - internal static string ClientType_UnsupportedType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_UnsupportedType, p0); - } - - /// - /// A string like "Collection properties of a collection type are not supported." - /// - internal static string ClientType_CollectionOfCollectionNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_CollectionOfCollectionNotSupported); - } - } - - /// - /// A string like "Multiple types were found with the same name '{0}'. Type names must be unique." - /// - internal static string ClientType_MultipleTypesWithSameName(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientType_MultipleTypesWithSameName, p0); - } - - /// - /// A string like "An item in the collection property '{0}' is not of the correct type. All items in the collection property must be of the collection item type." - /// - internal static string WebUtil_TypeMismatchInCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.WebUtil_TypeMismatchInCollection, p0); - } - - /// - /// A string like "A collection of item type '{0}' has an item which is not of the correct type. All items in the collection must be of the collection item type." - /// - internal static string WebUtil_TypeMismatchInNonPropertyCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.WebUtil_TypeMismatchInNonPropertyCollection, p0); - } - - /// - /// A string like "The property '{0}' is of entity type and it cannot be a property of the type '{1}', which is not of entity type. Only entity types can contain navigation properties." - /// - internal static string ClientTypeCache_NonEntityTypeCannotContainEntityProperties(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ClientTypeCache_NonEntityTypeCannotContainEntityProperties, p0, p1); - } - - /// - /// A string like "An error occurred while processing this request." - /// - internal static string DataServiceException_GeneralError - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceException_GeneralError); - } - } - - /// - /// A string like "Only a single enumeration is supported by this IEnumerable." - /// - internal static string Deserialize_GetEnumerator - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_GetEnumerator); - } - } - - /// - /// A string like "The current value '{1}' type is not compatible with the expected '{0}' type." - /// - internal static string Deserialize_Current(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_Current, p0, p1); - } - - /// - /// A string like "Error processing response stream. Element value interspersed with a comment is not supported." - /// - internal static string Deserialize_MixedTextWithComment - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_MixedTextWithComment); - } - } - - /// - /// A string like "Error processing response stream. The XML element contains mixed content." - /// - internal static string Deserialize_ExpectingSimpleValue - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_ExpectingSimpleValue); - } - } - - /// - /// A string like "Error processing response stream. Payload has a link, local object has a simple value." - /// - internal static string Deserialize_MismatchEntryLinkLocalSimple - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_MismatchEntryLinkLocalSimple); - } - } - - /// - /// A string like "Error processing response stream. Payload has a feed and the property '{0}' is not a collection." - /// - internal static string Deserialize_MismatchEntryLinkFeedPropertyNotCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_MismatchEntryLinkFeedPropertyNotCollection, p0); - } - - /// - /// A string like "Error processing response stream. Payload has an entry and the property '{0}' is a collection." - /// - internal static string Deserialize_MismatchEntryLinkEntryPropertyIsCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_MismatchEntryLinkEntryPropertyIsCollection, p0); - } - - /// - /// A string like "The response to this POST request did not contain a 'location' header. That is not supported by this client." - /// - internal static string Deserialize_NoLocationHeader - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_NoLocationHeader); - } - } - - /// - /// A string like "Error processing response stream. Server failed with following message:\r\n{0}" - /// - internal static string Deserialize_ServerException(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_ServerException, p0); - } - - /// - /// A string like "Error processing response stream. Missing id element in the response." - /// - internal static string Deserialize_MissingIdElement - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Deserialize_MissingIdElement); - } - } - - /// - /// A string like "The value of the property '{0}' is null. Properties that are a collection type of primitive or complex types cannot be null." - /// - internal static string Collection_NullCollectionNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_NullCollectionNotSupported, p0); - } - - /// - /// A string like "The value of the collection of item type '{0}' is null. A collection cannot have a null value." - /// - internal static string Collection_NullNonPropertyCollectionNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_NullNonPropertyCollectionNotSupported, p0); - } - - /// - /// A string like "An item in the collection property has a null value. Collection properties that contain items with null values are not supported." - /// - internal static string Collection_NullCollectionItemsNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_NullCollectionItemsNotSupported); - } - } - - /// - /// A string like "A collection property of primitive types cannot contain an item of a collection type." - /// - internal static string Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed); - } - } - - /// - /// A string like "A collection property of complex types cannot contain an item of a primitive type." - /// - internal static string Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed); - } - } - - /// - /// A string like "The entity with identity '{0}' does not have a self-link or an edit-link associated with it. Please make sure that the entity has either a self-link or an edit-link associated with it." - /// - internal static string EntityDescriptor_MissingSelfEditLink(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.EntityDescriptor_MissingSelfEditLink, p0); - } - - /// - /// A string like "Content-Type header value missing." - /// - internal static string HttpProcessUtility_ContentTypeMissing - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_ContentTypeMissing); - } - } - - /// - /// A string like "Media type is missing a parameter value." - /// - internal static string HttpProcessUtility_MediaTypeMissingValue - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_MediaTypeMissingValue); - } - } - - /// - /// A string like "Media type requires a ';' character before a parameter definition." - /// - internal static string HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter); - } - } - - /// - /// A string like "Media type requires a '/' character." - /// - internal static string HttpProcessUtility_MediaTypeRequiresSlash - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_MediaTypeRequiresSlash); - } - } - - /// - /// A string like "Media type requires a subtype definition." - /// - internal static string HttpProcessUtility_MediaTypeRequiresSubType - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_MediaTypeRequiresSubType); - } - } - - /// - /// A string like "Media type is unspecified." - /// - internal static string HttpProcessUtility_MediaTypeUnspecified - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_MediaTypeUnspecified); - } - } - - /// - /// A string like "Character set '{0}' is not supported." - /// - internal static string HttpProcessUtility_EncodingNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_EncodingNotSupported, p0); - } - - /// - /// A string like "Value for MIME type parameter '{0}' is incorrect because it contained escape characters even though it was not quoted." - /// - internal static string HttpProcessUtility_EscapeCharWithoutQuotes(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_EscapeCharWithoutQuotes, p0); - } - - /// - /// A string like "Value for MIME type parameter '{0}' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value." - /// - internal static string HttpProcessUtility_EscapeCharAtEnd(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_EscapeCharAtEnd, p0); - } - - /// - /// A string like "Value for MIME type parameter '{0}' is incorrect because the closing quote character could not be found while the parameter value started with a quote character." - /// - internal static string HttpProcessUtility_ClosingQuoteNotFound(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.HttpProcessUtility_ClosingQuoteNotFound, p0); - } - - /// - /// A string like "Count value is not part of the response stream." - /// - internal static string MaterializeFromObject_CountNotPresent - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.MaterializeFromObject_CountNotPresent); - } - } - - /// - /// A string like "The top level link is only available after the response has been enumerated." - /// - internal static string MaterializeFromObject_TopLevelLinkNotAvailable - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.MaterializeFromObject_TopLevelLinkNotAvailable); - } - } - - /// - /// A string like "The collection is not part of the current entry" - /// - internal static string MaterializeFromObject_CollectionKeyNotPresentInLinkTable - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.MaterializeFromObject_CollectionKeyNotPresentInLinkTable); - } - } - - /// - /// A string like "This response does not contain any nested collections. Use null as Key instead." - /// - internal static string MaterializeFromObject_GetNestLinkForFlatCollection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.MaterializeFromObject_GetNestLinkForFlatCollection); - } - } - - /// - /// A string like "GetStream method is not supported." - /// - internal static string ODataRequestMessage_GetStreamMethodNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ODataRequestMessage_GetStreamMethodNotSupported); - } - } - - /// - /// A string like "Empty string." - /// - internal static string Util_EmptyString - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Util_EmptyString); - } - } - - /// - /// A string like "Empty array." - /// - internal static string Util_EmptyArray - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Util_EmptyArray); - } - } - - /// - /// A string like "Array contains a null element." - /// - internal static string Util_NullArrayElement - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Util_NullArrayElement); - } - } - - /// - /// A string like "The expression type {0} is not supported." - /// - internal static string ALinq_UnsupportedExpression(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_UnsupportedExpression, p0); - } - - /// - /// A string like "Could not convert constant {0} expression to string." - /// - internal static string ALinq_CouldNotConvert(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CouldNotConvert, p0); - } - - /// - /// A string like "The method '{0}' is not supported." - /// - internal static string ALinq_MethodNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_MethodNotSupported, p0); - } - - /// - /// A string like "The unary operator '{0}' is not supported." - /// - internal static string ALinq_UnaryNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_UnaryNotSupported, p0); - } - - /// - /// A string like "The binary operator '{0}' is not supported." - /// - internal static string ALinq_BinaryNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_BinaryNotSupported, p0); - } - - /// - /// A string like "The constant for '{0}' is not supported." - /// - internal static string ALinq_ConstantNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ConstantNotSupported, p0); - } - - /// - /// A string like "An operation between an expression and a type is not supported." - /// - internal static string ALinq_TypeBinaryNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_TypeBinaryNotSupported); - } - } - - /// - /// A string like "The conditional expression is not supported." - /// - internal static string ALinq_ConditionalNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ConditionalNotSupported); - } - } - - /// - /// A string like "The parameter expression is not supported." - /// - internal static string ALinq_ParameterNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ParameterNotSupported); - } - } - - /// - /// A string like "The member access of '{0}' is not supported." - /// - internal static string ALinq_MemberAccessNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_MemberAccessNotSupported, p0); - } - - /// - /// A string like "Lambda Expressions not supported." - /// - internal static string ALinq_LambdaNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_LambdaNotSupported); - } - } - - /// - /// A string like "New Expressions not supported." - /// - internal static string ALinq_NewNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_NewNotSupported); - } - } - - /// - /// A string like "Member Init Expressions not supported." - /// - internal static string ALinq_MemberInitNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_MemberInitNotSupported); - } - } - - /// - /// A string like "List Init Expressions not supported." - /// - internal static string ALinq_ListInitNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ListInitNotSupported); - } - } - - /// - /// A string like "New Array Expressions not supported." - /// - internal static string ALinq_NewArrayNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_NewArrayNotSupported); - } - } - - /// - /// A string like "Invocation Expressions not supported." - /// - internal static string ALinq_InvocationNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvocationNotSupported); - } - } - - /// - /// A string like "Can only specify query options (orderby, where, take, skip) after last navigation." - /// - internal static string ALinq_QueryOptionsOnlyAllowedOnLeafNodes - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_QueryOptionsOnlyAllowedOnLeafNodes); - } - } - - /// - /// A string like "Expand query option not allowed." - /// - internal static string ALinq_CantExpand - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantExpand); - } - } - - /// - /// A string like "Can't cast to unsupported type '{0}'" - /// - internal static string ALinq_CantCastToUnsupportedPrimitive(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantCastToUnsupportedPrimitive, p0); - } - - /// - /// A string like "Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type." - /// - internal static string ALinq_CantNavigateWithoutKeyPredicate - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantNavigateWithoutKeyPredicate); - } - } - - /// - /// A string like "Multiple key predicates cannot be specified for the same entity set." - /// - internal static string ALinq_CanOnlyApplyOneKeyPredicate - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CanOnlyApplyOneKeyPredicate); - } - } - - /// - /// A string like "The expression {0} is not supported." - /// - internal static string ALinq_CantTranslateExpression(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantTranslateExpression, p0); - } - - /// - /// A string like "Error translating Linq expression to URI: {0}" - /// - internal static string ALinq_TranslationError(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_TranslationError, p0); - } - - /// - /// A string like "Custom query option not allowed." - /// - internal static string ALinq_CantAddQueryOption - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantAddQueryOption); - } - } - - /// - /// A string like "Can't add duplicate query option '{0}'." - /// - internal static string ALinq_CantAddDuplicateQueryOption(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantAddDuplicateQueryOption, p0); - } - - /// - /// A string like "Can't add query option '{0}' because it would conflict with the query options from the translated Linq expression." - /// - internal static string ALinq_CantAddAstoriaQueryOption(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantAddAstoriaQueryOption, p0); - } - - /// - /// A string like "The query option '{0}' is not supported or is controlled by the OData service." - /// - internal static string ALinq_QueryOptionNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_QueryOptionNotSupported, p0); - } - - /// - /// A string like "Referencing public field '{0}' not supported in query option expression. Use public property instead." - /// - internal static string ALinq_CantReferToPublicField(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CantReferToPublicField, p0); - } - - /// - /// A string like "Cannot specify query options (orderby, where, take, skip, count) on single resource." - /// - internal static string ALinq_QueryOptionsOnlyAllowedOnSingletons - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_QueryOptionsOnlyAllowedOnSingletons); - } - } - - /// - /// A string like "The {0} query option cannot be specified after the {1} query option." - /// - internal static string ALinq_QueryOptionOutOfOrder(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_QueryOptionOutOfOrder, p0, p1); - } - - /// - /// A string like "Cannot add count option to the resource set." - /// - internal static string ALinq_CannotAddCountOption - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotAddCountOption); - } - } - - /// - /// A string like "Cannot add count option to the resource set because it would conflict with existing count options." - /// - internal static string ALinq_CannotAddCountOptionConflict - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotAddCountOptionConflict); - } - } - - /// - /// A string like "Can only specify 'select' query option after last navigation." - /// - internal static string ALinq_ProjectionOnlyAllowedOnLeafNodes - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ProjectionOnlyAllowedOnLeafNodes); - } - } - - /// - /// A string like "Cannot translate multiple Linq Select operations in a single 'select' query option." - /// - internal static string ALinq_ProjectionCanOnlyHaveOneProjection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ProjectionCanOnlyHaveOneProjection); - } - } - - /// - /// A string like "Cannot initialize an instance of entity type '{0}' because '{1}' and '{2}' do not refer to the same source entity." - /// - internal static string ALinq_ProjectionMemberAssignmentMismatch(object p0, object p1, object p2) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ProjectionMemberAssignmentMismatch, p0, p1, p2); - } - - /// - /// A string like "The expression '{0}' is not a valid expression for navigation path. The only supported operations inside the lambda expression body are MemberAccess and TypeAs. The expression must contain at least one MemberAccess and it cannot end with TypeAs." - /// - internal static string ALinq_InvalidExpressionInNavigationPath(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvalidExpressionInNavigationPath, p0); - } - - /// - /// A string like "Initializing instances of the entity type {0} with the expression {1} is not supported." - /// - internal static string ALinq_ExpressionNotSupportedInProjectionToEntity(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ExpressionNotSupportedInProjectionToEntity, p0, p1); - } - - /// - /// A string like "Constructing or initializing instances of the type {0} with the expression {1} is not supported." - /// - internal static string ALinq_ExpressionNotSupportedInProjection(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ExpressionNotSupportedInProjection, p0, p1); - } - - /// - /// A string like "Construction of entity type instances must use object initializer with default constructor." - /// - internal static string ALinq_CannotConstructKnownEntityTypes - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotConstructKnownEntityTypes); - } - } - - /// - /// A string like "Referencing of local entity type instances not supported when projecting results." - /// - internal static string ALinq_CannotCreateConstantEntity - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotCreateConstantEntity); - } - } - - /// - /// A string like "Cannot assign the value from the {0} property to the {1} property. When projecting results into a entity type, the property names of the source type and the target type must match for the properties being projected." - /// - internal static string ALinq_PropertyNamesMustMatchInProjections(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_PropertyNamesMustMatchInProjections, p0, p1); - } - - /// - /// A string like "Can only project the last entity type in the query being translated." - /// - internal static string ALinq_CanOnlyProjectTheLeaf - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CanOnlyProjectTheLeaf); - } - } - - /// - /// A string like "Cannot create projection while there is an explicit expansion specified on the same query." - /// - internal static string ALinq_CannotProjectWithExplicitExpansion - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotProjectWithExplicitExpansion); - } - } - - /// - /// A string like "The collection property '{0}' cannot be used in an 'orderby' query expression. Collection properties are not supported by the 'orderby' query option." - /// - internal static string ALinq_CollectionPropertyNotSupportedInOrderBy(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CollectionPropertyNotSupportedInOrderBy, p0); - } - - /// - /// A string like "The collection property '{0}' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option." - /// - internal static string ALinq_CollectionPropertyNotSupportedInWhere(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CollectionPropertyNotSupportedInWhere, p0); - } - - /// - /// A string like "Navigation to members of the collection property '{0}' in a 'select' query expression is not supported." - /// - internal static string ALinq_CollectionMemberAccessNotSupportedInNavigation(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CollectionMemberAccessNotSupportedInNavigation, p0); - } - - /// - /// A string like "The property '{0}' of type 'DataServiceStreamLink' cannot be used in 'where' or 'orderby' query expressions. Properties of type 'DataServiceStreamLink' are not supported by these query options." - /// - internal static string ALinq_LinkPropertyNotSupportedInExpression(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_LinkPropertyNotSupportedInExpression, p0); - } - - /// - /// A string like "The target type for an OfType filter could not be determined." - /// - internal static string ALinq_OfTypeArgumentNotAvailable - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_OfTypeArgumentNotAvailable); - } - } - - /// - /// A string like "Non-redundant type filters (OfType<T>, C# 'as' and VB 'TryCast') can only be used once per resource set." - /// - internal static string ALinq_CannotUseTypeFiltersMultipleTimes - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_CannotUseTypeFiltersMultipleTimes); - } - } - - /// - /// A string like "Unsupported expression '{0}' in '{1}' method. Expression cannot end with TypeAs." - /// - internal static string ALinq_ExpressionCannotEndWithTypeAs(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ExpressionCannotEndWithTypeAs, p0, p1); - } - - /// - /// A string like "The expression 'TypeAs' is not supported when MaxProtocolVersion is less than '3.0'." - /// - internal static string ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3 - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3); - } - } - - /// - /// A string like "The type '{0}' is not an entity type. The target type for a TypeAs operator must be an entity type." - /// - internal static string ALinq_TypeAsArgumentNotEntityType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_TypeAsArgumentNotEntityType, p0); - } - - /// - /// A string like "The source parameter for the '{0}' method has to be either a navigation or a collection property." - /// - internal static string ALinq_InvalidSourceForAnyAll(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvalidSourceForAnyAll, p0); - } - - /// - /// A string like "The method '{0}' is not supported by the 'orderby' query option." - /// - internal static string ALinq_AnyAllNotSupportedInOrderBy(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_AnyAllNotSupportedInOrderBy, p0); - } - - /// - /// A string like "The '$format' query option is not supported. Use the DataServiceContext.Format property to set the desired format." - /// - internal static string ALinq_FormatQueryOptionNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_FormatQueryOptionNotSupported); - } - } - - /// - /// A string like "Found the following illegal system token while building a projection or expansion path: '{0}'" - /// - internal static string ALinq_IllegalSystemQueryOption(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_IllegalSystemQueryOption, p0); - } - - /// - /// A string like "Found a projection as a non-leaf segment in an expand path. Please rephrase your query. The projected property was : '{0}'" - /// - internal static string ALinq_IllegalPathStructure(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_IllegalPathStructure, p0); - } - - /// - /// A string like "Found an illegal type token '{0}' without a trailing navigation property." - /// - internal static string ALinq_TypeTokenWithNoTrailingNavProp(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_TypeTokenWithNoTrailingNavProp, p0); - } - - /// - /// A string like "The Contains method cannot be used with an empty collection." - /// - internal static string ALinq_ContainsNotValidOnEmptyCollection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_ContainsNotValidOnEmptyCollection); - } - } - - /// - /// A string like "The aggregation method '{0}' is not supported." - /// - internal static string ALinq_AggregationMethodNotSupported(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_AggregationMethodNotSupported, p0); - } - - /// - /// A string like "The expression '{0}' is not a valid aggregate expression. The aggregate expression must evaluate to a single-valued property path to an aggregatable property." - /// - internal static string ALinq_InvalidAggregateExpression(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvalidAggregateExpression, p0); - } - - /// - /// A string like "The expression '{0}' is not a valid expression for grouping. The grouping expression must evaluate to a single-valued property path, i.e., a path ending in a single-valued primitive." - /// - internal static string ALinq_InvalidGroupingExpression(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvalidGroupingExpression, p0); - } - - /// - /// A string like "The expression '{0}' in the GroupBy key selector is not supported." - /// - internal static string ALinq_InvalidGroupByKeySelector(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ALinq_InvalidGroupByKeySelector, p0); - } - - /// - /// A string like "DataServiceKey attribute must specify at least one property name." - /// - internal static string DSKAttribute_MustSpecifyAtleastOnePropertyName - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DSKAttribute_MustSpecifyAtleastOnePropertyName); - } - } - - /// - /// A string like "Target collection for the Load operation must have an associated DataServiceContext." - /// - internal static string DataServiceCollection_LoadRequiresTargetCollectionObserved - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_LoadRequiresTargetCollectionObserved); - } - } - - /// - /// A string like "The tracking of DataServiceCollection can not be stopped for child collections." - /// - internal static string DataServiceCollection_CannotStopTrackingChildCollection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_CannotStopTrackingChildCollection); - } - } - - /// - /// A string like "This operation is only supported on collections that are being tracked." - /// - internal static string DataServiceCollection_OperationForTrackedOnly - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_OperationForTrackedOnly); - } - } - - /// - /// A string like "The DataServiceContext to which the DataServiceCollection instance belongs could not be determined. The DataServiceContext must either be supplied in the DataServiceCollection constructor or be used to create the DataServiceQuery or QueryOperationResponse object that is the source of the items in the DataServiceCollection." - /// - internal static string DataServiceCollection_CannotDetermineContextFromItems - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_CannotDetermineContextFromItems); - } - } - - /// - /// A string like "An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection." - /// - internal static string DataServiceCollection_InsertIntoTrackedButNotLoadedCollection - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_InsertIntoTrackedButNotLoadedCollection); - } - } - - /// - /// A string like "A previous LoadAsync operation has not yet completed. You cannot call the LoadAsync method on the DataServiceCollection again until the previous operation has completed." - /// - internal static string DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime); - } - } - - /// - /// A string like "The LoadAsync method cannot be called when the DataServiceCollection is not a child collection of a related entity." - /// - internal static string DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity); - } - } - - /// - /// A string like "Only a typed DataServiceQuery object can be supplied when calling the LoadAsync method on DataServiceCollection." - /// - internal static string DataServiceCollection_LoadAsyncRequiresDataServiceQuery - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceCollection_LoadAsyncRequiresDataServiceQuery); - } - } - - /// - /// A string like "The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type '{0}' does not have any key property." - /// - internal static string DataBinding_DataServiceCollectionArgumentMustHaveEntityType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_DataServiceCollectionArgumentMustHaveEntityType, p0); - } - - /// - /// A string like "Setting an instance of DataServiceCollection to an entity property is disallowed if the instance is already being tracked. Error occurred on property '{0}' for entity type '{1}'." - /// - internal static string DataBinding_CollectionPropertySetterValueHasObserver(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_CollectionPropertySetterValueHasObserver, p0, p1); - } - - /// - /// A string like "Unexpected action '{0}' on the OnCollectionChanged event raised by DataServiceCollection." - /// - internal static string DataBinding_DataServiceCollectionChangedUnknownActionCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_DataServiceCollectionChangedUnknownActionCollection, p0); - } - - /// - /// A string like "Unexpected action '{0}' on the OnCollectionChanged event raised by a collection object of type '{1}'." - /// - internal static string DataBinding_CollectionChangedUnknownActionCollection(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_CollectionChangedUnknownActionCollection, p0, p1); - } - - /// - /// A string like "Add/Update/Delete operation cannot be performed on a child entity, if the parent entity is already detached." - /// - internal static string DataBinding_BindingOperation_DetachedSource - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_BindingOperation_DetachedSource); - } - } - - /// - /// A string like "Null values are disallowed during '{0}' operations on DataServiceCollection." - /// - internal static string DataBinding_BindingOperation_ArrayItemNull(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_BindingOperation_ArrayItemNull, p0); - } - - /// - /// A string like "A value provided during '{0}' operation on DataServiceCollection is not of an entity type with key." - /// - internal static string DataBinding_BindingOperation_ArrayItemNotEntity(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_BindingOperation_ArrayItemNotEntity, p0); - } - - /// - /// A string like "Entity set name has not been provided for an entity of type '{0}'." - /// - internal static string DataBinding_Util_UnknownEntitySetName(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_Util_UnknownEntitySetName, p0); - } - - /// - /// A string like "An attempt was made to add entity of type '{0}' to a collection in which the same entity already exists." - /// - internal static string DataBinding_EntityAlreadyInCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_EntityAlreadyInCollection, p0); - } - - /// - /// A string like "An attempt to track an entity or complex type failed because the entity or complex type '{0}' does not implement the INotifyPropertyChanged interface." - /// - internal static string DataBinding_NotifyPropertyChangedNotImpl(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_NotifyPropertyChangedNotImpl, p0); - } - - /// - /// A string like "An attempt to track an entity or complex type failed because the entity or complex type contains a collection property of type '{0}' that does not implement the INotifyCollectionChanged interface." - /// - internal static string DataBinding_NotifyCollectionChangedNotImpl(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_NotifyCollectionChangedNotImpl, p0); - } - - /// - /// A string like "An attempt to track a complex object of type '{0}' failed because the complex object is already being tracked." - /// - internal static string DataBinding_ComplexObjectAssociatedWithMultipleEntities(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_ComplexObjectAssociatedWithMultipleEntities, p0); - } - - /// - /// A string like "An attempt to track a collection object of type '{0}' failed because the collection object is already being tracked." - /// - internal static string DataBinding_CollectionAssociatedWithMultipleEntities(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataBinding_CollectionAssociatedWithMultipleEntities, p0); - } - - /// - /// A string like "Expected exactly one entry in the response from the server, but none was found." - /// - internal static string Parser_SingleEntry_NoneFound - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Parser_SingleEntry_NoneFound); - } - } - - /// - /// A string like "Expected exactly one entry in the response from the server, but more than one was found." - /// - internal static string Parser_SingleEntry_MultipleFound - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Parser_SingleEntry_MultipleFound); - } - } - - /// - /// A string like "Expected a feed or entry in the response from the server, but found an unexpected element instead." - /// - internal static string Parser_SingleEntry_ExpectedFeedOrEntry - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Parser_SingleEntry_ExpectedFeedOrEntry); - } - } - - /// - /// A string like "The null value from property '{0}' cannot be assigned to a type '{1}'." - /// - internal static string Materializer_CannotAssignNull(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_CannotAssignNull, p0, p1); - } - - /// - /// A string like "An entry of type '{0}' cannot be added to a collection that contains instances of type '{1}'. This may occur when an existing entry of a different type has the same identity value or when the same entity is projected into two different types in a single query." - /// - internal static string Materializer_EntryIntoCollectionMismatch(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_EntryIntoCollectionMismatch, p0, p1); - } - - /// - /// A string like "An entry returned by the navigation property '{0}' is null and cannot be initialized. You should check for a null value before accessing this property." - /// - internal static string Materializer_EntryToAccessIsNull(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_EntryToAccessIsNull, p0); - } - - /// - /// A string like "An entry that contains the data required to create an instance of type '{0}' is null and cannot be initialized. You should check for a null value before accessing this entry." - /// - internal static string Materializer_EntryToInitializeIsNull(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_EntryToInitializeIsNull, p0); - } - - /// - /// A string like "An entity of type '{0}' cannot be projected because there is already an instance of type '{1}' for '{2}'." - /// - internal static string Materializer_ProjectEntityTypeMismatch(object p0, object p1, object p2) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_ProjectEntityTypeMismatch, p0, p1, p2); - } - - /// - /// A string like "The expected property '{0}' could not be found while processing an entry. Check for null before accessing this property." - /// - internal static string Materializer_PropertyMissing(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_PropertyMissing, p0); - } - - /// - /// A string like "Property '{0}' is not an entity." - /// - internal static string Materializer_PropertyNotExpectedEntry(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_PropertyNotExpectedEntry, p0); - } - - /// - /// A string like "A DataServiceCollection can only contain entity types. Primitive and complex types cannot be contained by this kind of collection." - /// - internal static string Materializer_DataServiceCollectionNotSupportedForNonEntities - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_DataServiceCollectionNotSupportedForNonEntities); - } - } - - /// - /// A string like "Collection property '{0}' cannot be created because the type '{1}' does not have a public parameterless constructor." - /// - internal static string Materializer_NoParameterlessCtorForCollectionProperty(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_NoParameterlessCtorForCollectionProperty, p0, p1); - } - - /// - /// A string like "The element '{0}' is not a valid collection item. The name of the collection item element must be 'element' and must belong to the 'http://docs.oasis-open.org/odata/ns/data' namespace." - /// - internal static string Materializer_InvalidCollectionItem(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_InvalidCollectionItem, p0); - } - - /// - /// A string like "There is a type mismatch between the client and the service. Type '{0}' is an entity type, but the type in the response payload does not represent an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client." - /// - internal static string Materializer_InvalidEntityType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_InvalidEntityType, p0); - } - - /// - /// A string like "There is a type mismatch between the client and the service. Type '{0}' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client." - /// - internal static string Materializer_InvalidNonEntityType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_InvalidNonEntityType, p0); - } - - /// - /// A string like "Materialization of top level collection expected ICollection<>, but actual type was {0}." - /// - internal static string Materializer_CollectionExpectedCollection(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_CollectionExpectedCollection, p0); - } - - /// - /// A string like "The response payload is a not a valid response payload. Please make sure that the top level element is a valid JSON element or belongs to '{0}' namespace." - /// - internal static string Materializer_InvalidResponsePayload(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_InvalidResponsePayload, p0); - } - - /// - /// A string like "The response content type '{0}' is not currently supported." - /// - internal static string Materializer_InvalidContentTypeEncountered(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_InvalidContentTypeEncountered, p0); - } - - /// - /// A string like "Cannot materialize the results into a collection type '{0}' because it does not have a parameterless constructor." - /// - internal static string Materializer_MaterializationTypeError(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_MaterializationTypeError, p0); - } - - /// - /// A string like "Reset should never be called for collection reader in an internal enumerable." - /// - internal static string Materializer_ResetAfterEnumeratorCreationError - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_ResetAfterEnumeratorCreationError); - } - } - - /// - /// A string like "Cannot materialize a collection of a primitives or complex without the type '{0}' being a collection." - /// - internal static string Materializer_TypeShouldBeCollectionError(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Materializer_TypeShouldBeCollectionError, p0); - } - - /// - /// A string like "A circular loop was detected while serializing the property '{0}'. You must make sure that loops are not present in properties that return a collection or complex type." - /// - internal static string Serializer_LoopsNotAllowedInComplexTypes(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_LoopsNotAllowedInComplexTypes, p0); - } - - /// - /// A string like "A circular loop was detected while serializing the complex type '{0}'. You must make sure that loops are not present in a collection or a complex type." - /// - internal static string Serializer_LoopsNotAllowedInNonPropertyComplexTypes(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_LoopsNotAllowedInNonPropertyComplexTypes, p0); - } - - /// - /// A string like "The operation parameter named '{0}' has a collection item of Edm type kind '{1}'. A collection item must be either a primitive type or a complex Edm type kind." - /// - internal static string Serializer_InvalidCollectionParameterItemType(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_InvalidCollectionParameterItemType, p0, p1); - } - - /// - /// A string like "The operation parameter named '{0}' has a null collection item. The items of a collection must not be null." - /// - internal static string Serializer_NullCollectionParameterItemValue(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_NullCollectionParameterItemValue, p0); - } - - /// - /// A string like "The operation parameter named '{0}' was of Edm type kind '{1}'. An operation parameter must be either a primitive type, a complex type or a collection of primitive or complex types." - /// - internal static string Serializer_InvalidParameterType(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_InvalidParameterType, p0, p1); - } - - /// - /// A string like "The parameter alias '{0}' was not present in the request URI. All parameters passed as alias must be present in the request URI." - /// - internal static string Serializer_UriDoesNotContainParameterAlias(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_UriDoesNotContainParameterAlias, p0); - } - - /// - /// A string like "The enum type '{0}' has no member named '{1}'." - /// - internal static string Serializer_InvalidEnumMemberValue(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Serializer_InvalidEnumMemberValue, p0, p1); - } - - /// - /// A string like "This target framework does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because this framework only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration." - /// - internal static string DataServiceQuery_EnumerationNotSupported - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceQuery_EnumerationNotSupported); - } - } - - /// - /// A string like "Only instances of HttpWebRequest are currently allowed for this property. Other subtypes of WebRequest are not supported." - /// - internal static string Context_SendingRequestEventArgsNotHttp - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_SendingRequestEventArgsNotHttp); - } - } - - /// - /// A string like "An internal error '{0}' occurred." - /// - internal static string General_InternalError(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.General_InternalError, p0); - } - - /// - /// A string like "The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required." - /// - internal static string ODataMetadataBuilder_MissingEntitySetUri(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ODataMetadataBuilder_MissingEntitySetUri, p0); - } - - /// - /// A string like "The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments." - /// - internal static string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix, p0, p1); - } - - /// - /// A string like "Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required." - /// - internal static string ODataMetadataBuilder_MissingEntityInstanceUri(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ODataMetadataBuilder_MissingEntityInstanceUri, p0); - } - - /// - /// A string like "The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type." - /// - internal static string EdmValueUtils_UnsupportedPrimitiveType(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.EdmValueUtils_UnsupportedPrimitiveType, p0); - } - - /// - /// A string like "Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'." - /// - internal static string EdmValueUtils_IncorrectPrimitiveTypeKind(object p0, object p1, object p2) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.EdmValueUtils_IncorrectPrimitiveTypeKind, p0, p1, p2); - } - - /// - /// A string like "Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'." - /// - internal static string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName(object p0, object p1) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName, p0, p1); - } - - /// - /// A string like "A value with primitive kind '{0}' cannot be converted into a primitive object value." - /// - internal static string EdmValueUtils_CannotConvertTypeToClrValue(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.EdmValueUtils_CannotConvertTypeToClrValue, p0); - } - - /// - /// A string like "The value '{0}' is not a valid duration value." - /// - internal static string ValueParser_InvalidDuration(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.ValueParser_InvalidDuration, p0); - } - - /// - /// A string like "The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information." - /// - internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone(object p0) - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.PlatformHelper_DateTimeOffsetMustContainTimeZone, p0); - } - - /// - /// A string like "Failed to get the count value from the server." - /// - internal static string DataServiceRequest_FailGetCount - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceRequest_FailGetCount); - } - } - - /// - /// A string like "Failed to get the value from the server." - /// - internal static string DataServiceRequest_FailGetValue - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.DataServiceRequest_FailGetValue); - } - } - - /// - /// A string like "Execute overload for void service operations and actions received a non-void response from the server." - /// - internal static string Context_ExecuteExpectedVoidResponse - { - get - { - return Microsoft.OData.Client.TextRes.GetString(Microsoft.OData.Client.TextRes.Context_ExecuteExpectedVoidResponse); - } - } - - } - - /// - /// Strongly-typed and parameterized exception factory. - /// - internal static partial class Error { - - /// - /// The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. - /// - internal static Exception ArgumentNull(string paramName) { - return new ArgumentNullException(paramName); - } - - /// - /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. - /// - internal static Exception ArgumentOutOfRange(string paramName) { - return new ArgumentOutOfRangeException(paramName); - } - - /// - /// The exception that is thrown when the author has not yet implemented the logic at this point in the program. This can act as an exception based TODO tag. - /// - internal static Exception NotImplemented() { - return new NotImplementedException(); - } - - /// - /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. - /// - internal static Exception NotSupported() { - return new NotSupportedException(); - } - } -} diff --git a/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.tt b/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.tt deleted file mode 100644 index 683958f939..0000000000 --- a/src/Microsoft.OData.Client/Parameterized.Microsoft.OData.Client.tt +++ /dev/null @@ -1,20 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\StringsClassGenerator.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData.Client"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Client"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Client.Common.txt", - "Microsoft.OData.Client.Desktop.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Client/QueryOperationResponse.cs b/src/Microsoft.OData.Client/QueryOperationResponse.cs index c186f6fb19..5c2afc23c9 100644 --- a/src/Microsoft.OData.Client/QueryOperationResponse.cs +++ b/src/Microsoft.OData.Client/QueryOperationResponse.cs @@ -72,7 +72,7 @@ internal ObjectMaterializer Results { if (this.Error != null) { - throw Microsoft.OData.Client.Error.InvalidOperation(Strings.Context_BatchExecuteError, this.Error); + throw Microsoft.OData.Client.Error.InvalidOperation(SRResources.Context_BatchExecuteError, this.Error); } return this.results; @@ -159,7 +159,7 @@ protected T GetEnumeratorHelper(Func getEnumerator) where T : IEnumerator if (materializedCollection == null) { - throw new DataServiceClientException(Strings.Materializer_CollectionExpectedCollection(innerObject.GetType().ToString())); + throw new DataServiceClientException(Client.Error.Format(SRResources.Materializer_CollectionExpectedCollection, innerObject.GetType().ToString())); } Debug.Assert(!enumerator.MoveNext(), "MaterializationEvents of top level collection expected one result of ICollection<>, but found at least 2 results"); diff --git a/src/Microsoft.OData.Client/QueryOperationResponseOfT.cs b/src/Microsoft.OData.Client/QueryOperationResponseOfT.cs index 77fededc4e..f1e38f4232 100644 --- a/src/Microsoft.OData.Client/QueryOperationResponseOfT.cs +++ b/src/Microsoft.OData.Client/QueryOperationResponseOfT.cs @@ -52,7 +52,7 @@ public override long Count } else { - throw new InvalidOperationException(Strings.MaterializeFromObject_CountNotPresent); + throw new InvalidOperationException(SRResources.MaterializeFromObject_CountNotPresent); } } } diff --git a/src/Microsoft.OData.Client/QueryResult.cs b/src/Microsoft.OData.Client/QueryResult.cs index cfeaa35cd0..ac663e700a 100644 --- a/src/Microsoft.OData.Client/QueryResult.cs +++ b/src/Microsoft.OData.Client/QueryResult.cs @@ -149,7 +149,7 @@ internal static QueryResult EndExecuteQuery(object source, string meth if (operationResponse != null) { operationResponse.Error = ex; - throw new DataServiceQueryException(Strings.DataServiceException_GeneralError, ex, operationResponse); + throw new DataServiceQueryException(SRResources.DataServiceException_GeneralError, ex, operationResponse); } throw; diff --git a/src/Microsoft.OData.Client/RequestInfo.cs b/src/Microsoft.OData.Client/RequestInfo.cs index 06a9098d48..589854853e 100644 --- a/src/Microsoft.OData.Client/RequestInfo.cs +++ b/src/Microsoft.OData.Client/RequestInfo.cs @@ -349,7 +349,7 @@ internal InvalidOperationException ValidateResponseVersion(Version responseVersi { if (responseVersion != null && responseVersion > this.Context.MaxProtocolVersionAsVersion) { - string message = Strings.Context_ResponseVersionIsBiggerThanProtocolVersion( + string message = Error.Format(SRResources.Context_ResponseVersionIsBiggerThanProtocolVersion, responseVersion.ToString(), this.Context.MaxProtocolVersion.ToString()); return Error.InvalidOperation(message); @@ -436,7 +436,7 @@ internal DataServiceClientRequestMessage CreateRequestMessage(BuildingRequestEve clientRequestMessage = this.Configurations.RequestPipeline.OnMessageCreating(clientRequestMessageArgs); if (clientRequestMessage == null) { - throw Error.InvalidOperation(Strings.Context_OnMessageCreatingReturningNull); + throw Error.InvalidOperation(SRResources.Context_OnMessageCreatingReturningNull); } } else diff --git a/src/Microsoft.OData.Client/SRResources.Designer.cs b/src/Microsoft.OData.Client/SRResources.Designer.cs new file mode 100644 index 0000000000..85050cd27b --- /dev/null +++ b/src/Microsoft.OData.Client/SRResources.Designer.cs @@ -0,0 +1,2412 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.OData.Client { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SRResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SRResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.OData.Client.SRResources", typeof(SRResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The aggregation method '{0}' is not supported.. + /// + internal static string ALinq_AggregationMethodNotSupported { + get { + return ResourceManager.GetString("ALinq_AggregationMethodNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The method '{0}' is not supported by the 'orderby' query option.. + /// + internal static string ALinq_AnyAllNotSupportedInOrderBy { + get { + return ResourceManager.GetString("ALinq_AnyAllNotSupportedInOrderBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The binary operator '{0}' is not supported.. + /// + internal static string ALinq_BinaryNotSupported { + get { + return ResourceManager.GetString("ALinq_BinaryNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot add count option to the resource set.. + /// + internal static string ALinq_CannotAddCountOption { + get { + return ResourceManager.GetString("ALinq_CannotAddCountOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot add count option to the resource set because it would conflict with existing count options.. + /// + internal static string ALinq_CannotAddCountOptionConflict { + get { + return ResourceManager.GetString("ALinq_CannotAddCountOptionConflict", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Construction of entity type instances must use object initializer with default constructor.. + /// + internal static string ALinq_CannotConstructKnownEntityTypes { + get { + return ResourceManager.GetString("ALinq_CannotConstructKnownEntityTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Referencing of local entity type instances not supported when projecting results.. + /// + internal static string ALinq_CannotCreateConstantEntity { + get { + return ResourceManager.GetString("ALinq_CannotCreateConstantEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create projection while there is an explicit expansion specified on the same query.. + /// + internal static string ALinq_CannotProjectWithExplicitExpansion { + get { + return ResourceManager.GetString("ALinq_CannotProjectWithExplicitExpansion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Non-redundant type filters (OfType <T>, C# 'as' and VB 'TryCast') can only be used once per resource set.. + /// + internal static string ALinq_CannotUseTypeFiltersMultipleTimes { + get { + return ResourceManager.GetString("ALinq_CannotUseTypeFiltersMultipleTimes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple key predicates cannot be specified for the same entity set.. + /// + internal static string ALinq_CanOnlyApplyOneKeyPredicate { + get { + return ResourceManager.GetString("ALinq_CanOnlyApplyOneKeyPredicate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can only project the last entity type in the query being translated.. + /// + internal static string ALinq_CanOnlyProjectTheLeaf { + get { + return ResourceManager.GetString("ALinq_CanOnlyProjectTheLeaf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't add query option '{0}' because it would conflict with the query options from the translated Linq expression.. + /// + internal static string ALinq_CantAddAstoriaQueryOption { + get { + return ResourceManager.GetString("ALinq_CantAddAstoriaQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't add duplicate query option '{0}'.. + /// + internal static string ALinq_CantAddDuplicateQueryOption { + get { + return ResourceManager.GetString("ALinq_CantAddDuplicateQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Custom query option not allowed.. + /// + internal static string ALinq_CantAddQueryOption { + get { + return ResourceManager.GetString("ALinq_CantAddQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't add query option '{0}' because it begins with reserved character '$'.. + /// + internal static string ALinq_CantAddQueryOptionStartingWithDollarSign { + get { + return ResourceManager.GetString("ALinq_CantAddQueryOptionStartingWithDollarSign", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't cast to unsupported type '{0}'. + /// + internal static string ALinq_CantCastToUnsupportedPrimitive { + get { + return ResourceManager.GetString("ALinq_CantCastToUnsupportedPrimitive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expand query option not allowed.. + /// + internal static string ALinq_CantExpand { + get { + return ResourceManager.GetString("ALinq_CantExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type.. + /// + internal static string ALinq_CantNavigateWithoutKeyPredicate { + get { + return ResourceManager.GetString("ALinq_CantNavigateWithoutKeyPredicate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Referencing public field '{0}' not supported in query option expression. Use public property instead.. + /// + internal static string ALinq_CantReferToPublicField { + get { + return ResourceManager.GetString("ALinq_CantReferToPublicField", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression {0} is not supported.. + /// + internal static string ALinq_CantTranslateExpression { + get { + return ResourceManager.GetString("ALinq_CantTranslateExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Navigation to members of the collection property '{0}' in a 'select' query expression is not supported.. + /// + internal static string ALinq_CollectionMemberAccessNotSupportedInNavigation { + get { + return ResourceManager.GetString("ALinq_CollectionMemberAccessNotSupportedInNavigation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The collection property '{0}' cannot be used in an 'orderby' query expression. Collection properties are not supported by the 'orderby' query option.. + /// + internal static string ALinq_CollectionPropertyNotSupportedInOrderBy { + get { + return ResourceManager.GetString("ALinq_CollectionPropertyNotSupportedInOrderBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The collection property '{0}' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option.. + /// + internal static string ALinq_CollectionPropertyNotSupportedInWhere { + get { + return ResourceManager.GetString("ALinq_CollectionPropertyNotSupportedInWhere", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The conditional expression is not supported.. + /// + internal static string ALinq_ConditionalNotSupported { + get { + return ResourceManager.GetString("ALinq_ConditionalNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The constant for '{0}' is not supported.. + /// + internal static string ALinq_ConstantNotSupported { + get { + return ResourceManager.GetString("ALinq_ConstantNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Contains method cannot be used with an empty collection.. + /// + internal static string ALinq_ContainsNotValidOnEmptyCollection { + get { + return ResourceManager.GetString("ALinq_ContainsNotValidOnEmptyCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not convert constant {0} expression to string.. + /// + internal static string ALinq_CouldNotConvert { + get { + return ResourceManager.GetString("ALinq_CouldNotConvert", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported expression '{0}' in '{1}' method. Expression cannot end with TypeAs.. + /// + internal static string ALinq_ExpressionCannotEndWithTypeAs { + get { + return ResourceManager.GetString("ALinq_ExpressionCannotEndWithTypeAs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Constructing or initializing instances of the type {0} with the expression {1} is not supported.. + /// + internal static string ALinq_ExpressionNotSupportedInProjection { + get { + return ResourceManager.GetString("ALinq_ExpressionNotSupportedInProjection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing instances of the entity type {0} with the expression {1} is not supported.. + /// + internal static string ALinq_ExpressionNotSupportedInProjectionToEntity { + get { + return ResourceManager.GetString("ALinq_ExpressionNotSupportedInProjectionToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '$format' query option is not supported. Use the DataServiceContext.Format property to set the desired format.. + /// + internal static string ALinq_FormatQueryOptionNotSupported { + get { + return ResourceManager.GetString("ALinq_FormatQueryOptionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a projection as a non-leaf segment in an expand path. Please rephrase your query. The projected property was : '{0}'. + /// + internal static string ALinq_IllegalPathStructure { + get { + return ResourceManager.GetString("ALinq_IllegalPathStructure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found the following illegal system token while building a projection or expansion path: '{0}'. + /// + internal static string ALinq_IllegalSystemQueryOption { + get { + return ResourceManager.GetString("ALinq_IllegalSystemQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression '{0}' is not a valid aggregate expression. The aggregate expression must evaluate to a single-valued property path to an aggregatable property.. + /// + internal static string ALinq_InvalidAggregateExpression { + get { + return ResourceManager.GetString("ALinq_InvalidAggregateExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression '{0}' is not a valid expression for navigation path. The only supported operations inside the lambda expression body are MemberAccess and TypeAs. The expression must contain at least one MemberAccess and it cannot end with TypeAs.. + /// + internal static string ALinq_InvalidExpressionInNavigationPath { + get { + return ResourceManager.GetString("ALinq_InvalidExpressionInNavigationPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression '{0}' in the GroupBy key selector is not supported.. + /// + internal static string ALinq_InvalidGroupByKeySelector { + get { + return ResourceManager.GetString("ALinq_InvalidGroupByKeySelector", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression '{0}' is not a valid expression for grouping. The grouping expression must evaluate to a single-valued property path, i.e., a path ending in a single-valued primitive.. + /// + internal static string ALinq_InvalidGroupingExpression { + get { + return ResourceManager.GetString("ALinq_InvalidGroupingExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The source parameter for the '{0}' method has to be either a navigation or a collection property.. + /// + internal static string ALinq_InvalidSourceForAnyAll { + get { + return ResourceManager.GetString("ALinq_InvalidSourceForAnyAll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invocation Expressions not supported.. + /// + internal static string ALinq_InvocationNotSupported { + get { + return ResourceManager.GetString("ALinq_InvocationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Lambda Expressions not supported.. + /// + internal static string ALinq_LambdaNotSupported { + get { + return ResourceManager.GetString("ALinq_LambdaNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' of type 'DataServiceStreamLink' cannot be used in 'where' or 'orderby' query expressions. Properties of type 'DataServiceStreamLink' are not supported by these query options.. + /// + internal static string ALinq_LinkPropertyNotSupportedInExpression { + get { + return ResourceManager.GetString("ALinq_LinkPropertyNotSupportedInExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List Init Expressions not supported.. + /// + internal static string ALinq_ListInitNotSupported { + get { + return ResourceManager.GetString("ALinq_ListInitNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The member access of '{0}' is not supported.. + /// + internal static string ALinq_MemberAccessNotSupported { + get { + return ResourceManager.GetString("ALinq_MemberAccessNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Member Init Expressions not supported.. + /// + internal static string ALinq_MemberInitNotSupported { + get { + return ResourceManager.GetString("ALinq_MemberInitNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The method '{0}' is not supported.. + /// + internal static string ALinq_MethodNotSupported { + get { + return ResourceManager.GetString("ALinq_MethodNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Array Expressions not supported.. + /// + internal static string ALinq_NewArrayNotSupported { + get { + return ResourceManager.GetString("ALinq_NewArrayNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Expressions not supported.. + /// + internal static string ALinq_NewNotSupported { + get { + return ResourceManager.GetString("ALinq_NewNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target type for an OfType filter could not be determined.. + /// + internal static string ALinq_OfTypeArgumentNotAvailable { + get { + return ResourceManager.GetString("ALinq_OfTypeArgumentNotAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter expression is not supported.. + /// + internal static string ALinq_ParameterNotSupported { + get { + return ResourceManager.GetString("ALinq_ParameterNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot translate multiple Linq Select operations in a single 'select' query option.. + /// + internal static string ALinq_ProjectionCanOnlyHaveOneProjection { + get { + return ResourceManager.GetString("ALinq_ProjectionCanOnlyHaveOneProjection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot initialize an instance of entity type '{0}' because '{1}' and '{2}' do not refer to the same source entity.. + /// + internal static string ALinq_ProjectionMemberAssignmentMismatch { + get { + return ResourceManager.GetString("ALinq_ProjectionMemberAssignmentMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can only specify 'select' query option after last navigation.. + /// + internal static string ALinq_ProjectionOnlyAllowedOnLeafNodes { + get { + return ResourceManager.GetString("ALinq_ProjectionOnlyAllowedOnLeafNodes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot assign the value from the {0} property to the {1} property. When projecting results into a entity type, the property names of the source type and the target type must match for the properties being projected.. + /// + internal static string ALinq_PropertyNamesMustMatchInProjections { + get { + return ResourceManager.GetString("ALinq_PropertyNamesMustMatchInProjections", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The query option '{0}' is not supported or is controlled by the OData service.. + /// + internal static string ALinq_QueryOptionNotSupported { + get { + return ResourceManager.GetString("ALinq_QueryOptionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} query option cannot be specified after the {1} query option.. + /// + internal static string ALinq_QueryOptionOutOfOrder { + get { + return ResourceManager.GetString("ALinq_QueryOptionOutOfOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can only specify query options (orderby, where, take, skip) after last navigation.. + /// + internal static string ALinq_QueryOptionsOnlyAllowedOnLeafNodes { + get { + return ResourceManager.GetString("ALinq_QueryOptionsOnlyAllowedOnLeafNodes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot specify query options (orderby, where, take, skip, count) on single resource.. + /// + internal static string ALinq_QueryOptionsOnlyAllowedOnSingletons { + get { + return ResourceManager.GetString("ALinq_QueryOptionsOnlyAllowedOnSingletons", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error translating Linq expression to URI: {0}. + /// + internal static string ALinq_TranslationError { + get { + return ResourceManager.GetString("ALinq_TranslationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not an entity type. The target type for a TypeAs operator must be an entity type.. + /// + internal static string ALinq_TypeAsArgumentNotEntityType { + get { + return ResourceManager.GetString("ALinq_TypeAsArgumentNotEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression 'TypeAs' is not supported when MaxProtocolVersion is less than '3.0'.. + /// + internal static string ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3 { + get { + return ResourceManager.GetString("ALinq_TypeAsNotSupportedForMaxDataServiceVersionLessThan3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An operation between an expression and a type is not supported.. + /// + internal static string ALinq_TypeBinaryNotSupported { + get { + return ResourceManager.GetString("ALinq_TypeBinaryNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found an illegal type token '{0}' without a trailing navigation property. . + /// + internal static string ALinq_TypeTokenWithNoTrailingNavProp { + get { + return ResourceManager.GetString("ALinq_TypeTokenWithNoTrailingNavProp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The unary operator '{0}' is not supported.. + /// + internal static string ALinq_UnaryNotSupported { + get { + return ResourceManager.GetString("ALinq_UnaryNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expression type {0} is not supported.. + /// + internal static string ALinq_UnsupportedExpression { + get { + return ResourceManager.GetString("ALinq_UnsupportedExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected content type for a batch requests is "multipart/mixed;boundary=batch" not "{0}".. + /// + internal static string Batch_ExpectedContentType { + get { + return ResourceManager.GetString("Batch_ExpectedContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The POST request expected a response with content. ID={0}. + /// + internal static string Batch_ExpectedResponse { + get { + return ResourceManager.GetString("Batch_ExpectedResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not all requests in the batch had a response.. + /// + internal static string Batch_IncompleteResponseCount { + get { + return ResourceManager.GetString("Batch_IncompleteResponseCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web response contained unexpected sections. ID={0}. + /// + internal static string Batch_UnexpectedContent { + get { + return ResourceManager.GetString("Batch_UnexpectedContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resolving type from '{0}' that inherits from '{1}' is ambiguous.. + /// + internal static string ClientType_Ambiguous { + get { + return ResourceManager.GetString("ClientType_Ambiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collection properties of a collection type are not supported.. + /// + internal static string ClientType_CollectionOfCollectionNotSupported { + get { + return ResourceManager.GetString("ClientType_CollectionOfCollectionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key property '{0}' on for type '{1}' is of type '{2}', which is not a simple type. Only properties of simple type can be key properties.. + /// + internal static string ClientType_KeysMustBeSimpleTypes { + get { + return ResourceManager.GetString("ClientType_KeysMustBeSimpleTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} has key properties declared at different levels within its type hierarchy.. + /// + internal static string ClientType_KeysOnDifferentDeclaredType { + get { + return ResourceManager.GetString("ClientType_KeysOnDifferentDeclaredType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' has a MediaEntry attribute that references a property called '{1}'. However, this type does not have a property '{1}'.. + /// + internal static string ClientType_MissingMediaEntryProperty { + get { + return ResourceManager.GetString("ClientType_MissingMediaEntryProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' has a MimeTypeProperty attribute that references the data property '{1}'. However, this type does not have a property '{1}'.. + /// + internal static string ClientType_MissingMimeTypeDataProperty { + get { + return ResourceManager.GetString("ClientType_MissingMimeTypeDataProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' has a MimeTypeProperty attribute that references the MIME type property '{1}'. However, this type does not have a property '{1}'.. + /// + internal static string ClientType_MissingMimeTypeProperty { + get { + return ResourceManager.GetString("ClientType_MissingMimeTypeProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The open object property '{0}:{1}' is not defined.. + /// + internal static string ClientType_MissingOpenProperty { + get { + return ResourceManager.GetString("ClientType_MissingOpenProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The closed type {0} does not have a corresponding {1} settable property.. + /// + internal static string ClientType_MissingProperty { + get { + return ResourceManager.GetString("ClientType_MissingProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple implementations of ICollection<T> is not supported.. + /// + internal static string ClientType_MultipleImplementationNotSupported { + get { + return ResourceManager.GetString("ClientType_MultipleImplementationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} has multiple definitions for OpenObjectAttribute.. + /// + internal static string Clienttype_MultipleOpenProperty { + get { + return ResourceManager.GetString("Clienttype_MultipleOpenProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple types were found with the same name '{0}'. Type names must be unique.. + /// + internal static string ClientType_MultipleTypesWithSameName { + get { + return ResourceManager.GetString("ClientType_MultipleTypesWithSameName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' has no settable properties.. + /// + internal static string ClientType_NoSettableFields { + get { + return ResourceManager.GetString("ClientType_NoSettableFields", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The open type property '{0}' returned a null instance.. + /// + internal static string ClientType_NullOpenProperties { + get { + return ResourceManager.GetString("ClientType_NullOpenProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not supported by the client library.. + /// + internal static string ClientType_UnsupportedType { + get { + return ResourceManager.GetString("ClientType_UnsupportedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' is of entity type and it cannot be a property of the type '{1}', which is not of entity type. Only entity types can contain navigation properties.. + /// + internal static string ClientTypeCache_NonEntityTypeCannotContainEntityProperties { + get { + return ResourceManager.GetString("ClientTypeCache_NonEntityTypeCannotContainEntityProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A collection property of primitive types cannot contain an item of a collection type.. + /// + internal static string Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed { + get { + return ResourceManager.GetString("Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An item in the collection property has a null value. Collection properties that contain items with null values are not supported.. + /// + internal static string Collection_NullCollectionItemsNotSupported { + get { + return ResourceManager.GetString("Collection_NullCollectionItemsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the property '{0}' is null. Properties that are a collection type of primitive or complex types cannot be null.. + /// + internal static string Collection_NullCollectionNotSupported { + get { + return ResourceManager.GetString("Collection_NullCollectionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}.{1} must return a non-null open property collection.. + /// + internal static string Collection_NullCollectionReference { + get { + return ResourceManager.GetString("Collection_NullCollectionReference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the collection of item type '{0}' is null. A collection cannot have a null value.. + /// + internal static string Collection_NullNonPropertyCollectionNotSupported { + get { + return ResourceManager.GetString("Collection_NullNonPropertyCollectionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A collection property of complex types cannot contain an item of a primitive type.. + /// + internal static string Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed { + get { + return ResourceManager.GetString("Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This operation requires the entity to be of an Entity Type, either mark its key properties, or attribute the class with DataServiceEntityAttribute. + /// + internal static string Content_EntityIsNotEntityType { + get { + return ResourceManager.GetString("Content_EntityIsNotEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This operation requires the entity be of an Entity Type, and has at least one key property.. + /// + internal static string Content_EntityWithoutKey { + get { + return ResourceManager.GetString("Content_EntityWithoutKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AddLink and DeleteLink methods only work when the sourceProperty is a collection.. + /// + internal static string Context_AddLinkCollectionOnly { + get { + return ResourceManager.GetString("Context_AddLinkCollectionOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AddRelatedObject method only works when the sourceProperty is a collection.. + /// + internal static string Context_AddRelatedObjectCollectionOnly { + get { + return ResourceManager.GetString("Context_AddRelatedObjectCollectionOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AddRelatedObject method only works if the source entity is in a non-deleted state.. + /// + internal static string Context_AddRelatedObjectSourceDeleted { + get { + return ResourceManager.GetString("Context_AddRelatedObjectSourceDeleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The asynchronous result has already been completed.. + /// + internal static string Context_AsyncAlreadyDone { + get { + return ResourceManager.GetString("Context_AsyncAlreadyDone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected an absolute, well formed http URL without a query or fragment.. + /// + internal static string Context_BaseUri { + get { + return ResourceManager.GetString("Context_BaseUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must set the BaseUri property before you perform this operation.. + /// + internal static string Context_BaseUriRequired { + get { + return ResourceManager.GetString("Context_BaseUriRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred for this query during batch execution. See the inner exception for details.. + /// + internal static string Context_BatchExecuteError { + get { + return ResourceManager.GetString("Context_BatchExecuteError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Saving entities with the [MediaEntry] attribute is not currently supported in batch mode. Use non-batched mode instead.. + /// + internal static string Context_BatchNotSupportedForMediaLink { + get { + return ResourceManager.GetString("Context_BatchNotSupportedForMediaLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changes cannot be saved as a batch when an entity has one or more streams associated with it. Retry the SaveChanges operation without enabling the SaveChangesOptions.BatchWithSingleChangeset and the SaveChangesOptions.BatchWithIndependentOperations options.. + /// + internal static string Context_BatchNotSupportedForNamedStreams { + get { + return ResourceManager.GetString("Context_BatchNotSupportedForNamedStreams", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationParameter of type BodyOperationParameter cannot be specified when the HttpMethod is set to GET.. + /// + internal static string Context_BodyOperationParametersNotAllowedWithGet { + get { + return ResourceManager.GetString("Context_BodyOperationParametersNotAllowedWithGet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response should have both 'Location' and 'OData-EntityId' headers or the response should not have any of these headers.. + /// + internal static string Context_BothLocationAndIdMustBeSpecified { + get { + return ResourceManager.GetString("Context_BothLocationAndIdMustBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity in the 'Added' state cannot be changed to '{0}', it can only be changed to 'Detached'.. + /// + internal static string Context_CannotChangeStateIfAdded { + get { + return ResourceManager.GetString("Context_CannotChangeStateIfAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ChangeState method does not support the 'Added' state because additional information is needed for inserts. Use either AddObject or AddRelatedObject instead.. + /// + internal static string Context_CannotChangeStateToAdded { + get { + return ResourceManager.GetString("Context_CannotChangeStateToAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity's state can only be changed to 'Modified' if it is currently 'Unchanged'.. + /// + internal static string Context_CannotChangeStateToModifiedIfNotUnchanged { + get { + return ResourceManager.GetString("Context_CannotChangeStateToModifiedIfNotUnchanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to convert value '{0}' into a key string for a URI.. + /// + internal static string Context_CannotConvertKey { + get { + return ResourceManager.GetString("Context_CannotConvertKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Attempt to delete a link between two objects failed because the identity of the target object of the link depends on the source object of the link.. + /// + internal static string Context_ChildResourceExists { + get { + return ResourceManager.GetString("Context_ChildResourceExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ContentType value for a named stream cannot be null or an empty string.. + /// + internal static string Context_ContentTypeRequiredForNamedStream { + get { + return ResourceManager.GetString("Context_ContentTypeRequiredForNamedStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to For deep insert, ChangeState for '{0}' cannot be Deleted or Modified.. + /// + internal static string Context_DeepInsertDeletedOrModified { + get { + return ResourceManager.GetString("Context_DeepInsertDeletedOrModified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deep insert can only have one top level entity.. + /// + internal static string Context_DeepInsertOneTopLevelEntity { + get { + return ResourceManager.GetString("Context_DeepInsertOneTopLevelEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current object did not originate the async result.. + /// + internal static string Context_DidNotOriginateAsync { + get { + return ResourceManager.GetString("Context_DidNotOriginateAsync", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is already tracking a different entity with the same resource Uri.. + /// + internal static string Context_DifferentEntityAlreadyContained { + get { + return ResourceManager.GetString("Context_DifferentEntityAlreadyContained", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple body operation parameters were found with the same name. Body operation parameter names must be unique.. + /// + internal static string Context_DuplicateBodyOperationParameterName { + get { + return ResourceManager.GetString("Context_DuplicateBodyOperationParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple uri operation parameters were found with the same name. Uri operation parameter names must be unique.. + /// + internal static string Context_DuplicateUriOperationParameterName { + get { + return ResourceManager.GetString("Context_DuplicateUriOperationParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to EndExecute overload for void service operations and actions received a non-void response from the server.. + /// + internal static string Context_EndExecuteExpectedVoidResponse { + get { + return ResourceManager.GetString("Context_EndExecuteExpectedVoidResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is already tracking the entity.. + /// + internal static string Context_EntityAlreadyContained { + get { + return ResourceManager.GetString("Context_EntityAlreadyContained", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity does not have a stream named '{0}'. Make sure that the name of the stream is correct.. + /// + internal static string Context_EntityDoesNotContainNamedStream { + get { + return ResourceManager.GetString("Context_EntityDoesNotContainNamedStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is in non tracking mode, The entity does not seem to have the media links populated properly. Please verify server response is correct and that the entity extends BaseEntityType.. + /// + internal static string Context_EntityInNonTrackedContextLacksMediaLinks { + get { + return ResourceManager.GetString("Context_EntityInNonTrackedContextLacksMediaLinks", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is currently in no tracking mode, in order to use streams make sure your entities extend BaseEntityType and query the Item again from the server to populate the read link or enable tracking.. + /// + internal static string Context_EntityMediaLinksNotTrackedInEntity { + get { + return ResourceManager.GetString("Context_EntityMediaLinksNotTrackedInEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An implementation of ODataEntityMetadataBuilder is required, but a null value was returned from GetEntityMetadataBuilder.. + /// + internal static string Context_EntityMetadataBuilderIsRequired { + get { + return ResourceManager.GetString("Context_EntityMetadataBuilderIsRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is not currently tracking the entity.. + /// + internal static string Context_EntityNotContained { + get { + return ResourceManager.GetString("Context_EntityNotContained", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This operation requires that the specified entity be a Media Link Entry and that the ReadStreamUri be available. However, the specified entity either is not a Media Link Entry or does not have a valid ReadStreamUri value. If the entity is a Media Link Entry, re-query the data service for this entity to obtain a valid ReadStreamUri value.. + /// + internal static string Context_EntityNotMediaLinkEntry { + get { + return ResourceManager.GetString("Context_EntityNotMediaLinkEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected a relative URL path without query or fragment.. + /// + internal static string Context_EntitySetName { + get { + return ResourceManager.GetString("Context_EntitySetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execute overload for void service operations and actions received a non-void response from the server.. + /// + internal static string Context_ExecuteExpectedVoidResponse { + get { + return ResourceManager.GetString("Context_ExecuteExpectedVoidResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HttpMethod must be GET, POST or DELETE.. + /// + internal static string Context_ExecuteExpectsGetOrPostOrDelete { + get { + return ResourceManager.GetString("Context_ExecuteExpectsGetOrPostOrDelete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.OData.Client internal error {0}.. + /// + internal static string Context_InternalError { + get { + return ResourceManager.GetString("Context_InternalError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One of the link's resources failed to insert.. + /// + internal static string Context_LinkResourceInsertFailure { + get { + return ResourceManager.GetString("Context_LinkResourceInsertFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Location' header value specified in the response must be an absolute URI.. + /// + internal static string Context_LocationHeaderExpectsAbsoluteUri { + get { + return ResourceManager.GetString("Context_LocationHeaderExpectsAbsoluteUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Name property of an OperationParameter must be set to a non-null, non-empty string.. + /// + internal static string Context_MissingOperationParameterName { + get { + return ResourceManager.GetString("Context_MissingOperationParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no self-link or edit-media link for the stream named '{0}'. Make sure that either the self-link or edit-media link is specified for this stream.. + /// + internal static string Context_MissingSelfAndEditLinkForNamedStream { + get { + return ResourceManager.GetString("Context_MissingSelfAndEditLinkForNamedStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type {0} is marked with MediaEntry attribute but no save stream was set for the entity.. + /// + internal static string Context_MLEWithoutSaveStream { + get { + return ResourceManager.GetString("Context_MLEWithoutSaveStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be used with '{1}'.. + /// + internal static string Context_MustBeUsedWith { + get { + return ResourceManager.GetString("Context_MustBeUsedWith", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media link object of type '{0}' is configured to use the MIME type specified in the property '{1}'. However, that property's value is null or empty.. + /// + internal static string Context_NoContentTypeForMediaLink { + get { + return ResourceManager.GetString("Context_NoContentTypeForMediaLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context can not load the related collection or reference for objects in the added state.. + /// + internal static string Context_NoLoadWithInsertEnd { + get { + return ResourceManager.GetString("Context_NoLoadWithInsertEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or both of the ends of the relationship is in the deleted state.. + /// + internal static string Context_NoRelationWithDeleteEnd { + get { + return ResourceManager.GetString("Context_NoRelationWithDeleteEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or both of the ends of the relationship is in the added state.. + /// + internal static string Context_NoRelationWithInsertEnd { + get { + return ResourceManager.GetString("Context_NoRelationWithInsertEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation parameters array contains a null element which is not allowed.. + /// + internal static string Context_NullElementInOperationParameterArray { + get { + return ResourceManager.GetString("Context_NullElementInOperationParameterArray", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The serialized resource has a null value in key member '{0}'. Null values are not supported in key members.. + /// + internal static string Context_NullKeysAreNotSupported { + get { + return ResourceManager.GetString("Context_NullKeysAreNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property must not return a null value. Please return a non-null value for this property.. + /// + internal static string Context_OnMessageCreatingReturningNull { + get { + return ResourceManager.GetString("Context_OnMessageCreatingReturningNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation has been canceled.. + /// + internal static string Context_OperationCanceled { + get { + return ResourceManager.GetString("Context_OperationCanceled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' is not supported when MaxProtocolVersion is greater than '{1}'.. + /// + internal static string Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX { + get { + return ResourceManager.GetString("Context_PropertyNotSupportedForMaxDataServiceVersionGreaterThanX", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context is already tracking the relationship.. + /// + internal static string Context_RelationAlreadyContained { + get { + return ResourceManager.GetString("Context_RelationAlreadyContained", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The sourceProperty is not a reference or collection of the target's object type.. + /// + internal static string Context_RelationNotRefOrCollection { + get { + return ResourceManager.GetString("Context_RelationNotRefOrCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Because the requestUri is a relative Uri, you must set the BaseUri property on the DataServiceContext.. + /// + internal static string Context_RequestUriIsRelativeBaseUriRequired { + get { + return ResourceManager.GetString("Context_RequestUriIsRelativeBaseUriRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the higher version, and then retry the operation.. + /// + internal static string Context_RequestVersionIsBiggerThanProtocolVersion { + get { + return ResourceManager.GetString("Context_RequestVersionIsBiggerThanProtocolVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ResolveEntitySet function must return a non-null Uri for the EntitySet '{0}', otherwise you must set the BaseUri property.. + /// + internal static string Context_ResolveEntitySetOrBaseUriRequired { + get { + return ResourceManager.GetString("Context_ResolveEntitySetOrBaseUriRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Uri that is returned by the ResolveEntitySet function must be an absolute, well-formed URL with an "http" or "https" scheme name and without any query strings or fragment identifiers.. + /// + internal static string Context_ResolveReturnedInvalidUri { + get { + return ResourceManager.GetString("Context_ResolveReturnedInvalidUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response version is {0}, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the version required by the response, and then retry the request. If the client does not support the required protocol version, then upgrade the client.. + /// + internal static string Context_ResponseVersionIsBiggerThanProtocolVersion { + get { + return ResourceManager.GetString("Context_ResponseVersionIsBiggerThanProtocolVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SendingRequest cannot be used in combination with the DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property. Please use SendingRequest2 with DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property instead.. + /// + internal static string Context_SendingRequest_InvalidWhenUsingOnMessageCreating { + get { + return ResourceManager.GetString("Context_SendingRequest_InvalidWhenUsingOnMessageCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only instances of HttpWebRequest are currently allowed for this property. Other subtypes of WebRequest are not supported.. + /// + internal static string Context_SendingRequestEventArgsNotHttp { + get { + return ResourceManager.GetString("Context_SendingRequestEventArgsNotHttp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SetLink method only works when the sourceProperty is not a collection.. + /// + internal static string Context_SetLinkReferenceOnly { + get { + return ResourceManager.GetString("Context_SetLinkReferenceOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SetRelatedObjectLink method only works when the sourceProperty is not a collection.. + /// + internal static string Context_SetRelatedObjectLinkNonCollectionOnly { + get { + return ResourceManager.GetString("Context_SetRelatedObjectLinkNonCollectionOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SetRelatedObjectLink method only works if the source entity is in a non-deleted state.. + /// + internal static string Context_SetRelatedObjectLinkSourceDeleted { + get { + return ResourceManager.GetString("Context_SetRelatedObjectLinkSourceDeleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SetRelatedObject method only works when the sourceProperty is not a collection.. + /// + internal static string Context_SetRelatedObjectNonCollectionOnly { + get { + return ResourceManager.GetString("Context_SetRelatedObjectNonCollectionOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SetRelatedObject method only works if the source entity is in a non-deleted state.. + /// + internal static string Context_SetRelatedObjectSourceDeleted { + get { + return ResourceManager.GetString("Context_SetRelatedObjectSourceDeleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calling SetSaveStream on an entity with state '{0}' is not allowed.. + /// + internal static string Context_SetSaveStreamOnInvalidEntityState { + get { + return ResourceManager.GetString("Context_SetSaveStreamOnInvalidEntityState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't use SetSaveStream on entity with type {0} which has a media entry property defined.. + /// + internal static string Context_SetSaveStreamOnMediaEntryProperty { + get { + return ResourceManager.GetString("Context_SetSaveStreamOnMediaEntryProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no edit-media link for the entity's media stream. Make sure that the edit-media link is specified for this stream.. + /// + internal static string Context_SetSaveStreamWithoutEditMediaLink { + get { + return ResourceManager.GetString("Context_SetSaveStreamWithoutEditMediaLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream named '{0}' cannot be modified because it does not have an edit-media link. Make sure that the stream name is correct and that an edit-media link for this stream is included in the entry element in the response.. + /// + internal static string Context_SetSaveStreamWithoutNamedStreamEditLink { + get { + return ResourceManager.GetString("Context_SetSaveStreamWithoutNamedStreamEditLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The identity value specified by either the the OData-EntityId header must be an absolute URI.. + /// + internal static string Context_TrackingExpectsAbsoluteUri { + get { + return ResourceManager.GetString("Context_TrackingExpectsAbsoluteUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected result (<= 0) from stream.Read() while reading raw data for this property.. + /// + internal static string Context_UnexpectedZeroRawRead { + get { + return ResourceManager.GetString("Context_UnexpectedZeroRawRead", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UpdateRelatedObject method only works when the sourceProperty is not collection.. + /// + internal static string Context_UpdateRelatedObjectNonCollectionOnly { + get { + return ResourceManager.GetString("Context_UpdateRelatedObjectNonCollectionOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Response version '{0}' is not supported. The only supported versions are: {1}.. + /// + internal static string Context_VersionNotSupported { + get { + return ResourceManager.GetString("Context_VersionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value provided during '{0}' operation on DataServiceCollection is not of an entity type with key.. + /// + internal static string DataBinding_BindingOperation_ArrayItemNotEntity { + get { + return ResourceManager.GetString("DataBinding_BindingOperation_ArrayItemNotEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Null values are disallowed during '{0}' operations on DataServiceCollection.. + /// + internal static string DataBinding_BindingOperation_ArrayItemNull { + get { + return ResourceManager.GetString("DataBinding_BindingOperation_ArrayItemNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add/Update/Delete operation cannot be performed on a child entity, if the parent entity is already detached.. + /// + internal static string DataBinding_BindingOperation_DetachedSource { + get { + return ResourceManager.GetString("DataBinding_BindingOperation_DetachedSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to track a collection object of type '{0}' failed because the collection object is already being tracked.. + /// + internal static string DataBinding_CollectionAssociatedWithMultipleEntities { + get { + return ResourceManager.GetString("DataBinding_CollectionAssociatedWithMultipleEntities", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected action '{0}' on the OnCollectionChanged event raised by a collection object of type '{1}'.. + /// + internal static string DataBinding_CollectionChangedUnknownActionCollection { + get { + return ResourceManager.GetString("DataBinding_CollectionChangedUnknownActionCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting an instance of DataServiceCollection to an entity property is disallowed if the instance is already being tracked. Error occurred on property '{0}' for entity type '{1}'.. + /// + internal static string DataBinding_CollectionPropertySetterValueHasObserver { + get { + return ResourceManager.GetString("DataBinding_CollectionPropertySetterValueHasObserver", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to track a complex object of type '{0}' failed because the complex object is already being tracked.. + /// + internal static string DataBinding_ComplexObjectAssociatedWithMultipleEntities { + get { + return ResourceManager.GetString("DataBinding_ComplexObjectAssociatedWithMultipleEntities", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type '{0}' does not have any key property.. + /// + internal static string DataBinding_DataServiceCollectionArgumentMustHaveEntityType { + get { + return ResourceManager.GetString("DataBinding_DataServiceCollectionArgumentMustHaveEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected action '{0}' on the OnCollectionChanged event raised by DataServiceCollection.. + /// + internal static string DataBinding_DataServiceCollectionChangedUnknownActionCollection { + get { + return ResourceManager.GetString("DataBinding_DataServiceCollectionChangedUnknownActionCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt was made to add entity of type '{0}' to a collection in which the same entity already exists.. + /// + internal static string DataBinding_EntityAlreadyInCollection { + get { + return ResourceManager.GetString("DataBinding_EntityAlreadyInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to track an entity or complex type failed because the entity or complex type contains a collection property of type '{0}' that does not implement the INotifyCollectionChanged interface.. + /// + internal static string DataBinding_NotifyCollectionChangedNotImpl { + get { + return ResourceManager.GetString("DataBinding_NotifyCollectionChangedNotImpl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to track an entity or complex type failed because the entity or complex type '{0}' does not implement the INotifyPropertyChanged interface.. + /// + internal static string DataBinding_NotifyPropertyChangedNotImpl { + get { + return ResourceManager.GetString("DataBinding_NotifyPropertyChangedNotImpl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Entity set name has not been provided for an entity of type '{0}'.. + /// + internal static string DataBinding_Util_UnknownEntitySetName { + get { + return ResourceManager.GetString("DataBinding_Util_UnknownEntitySetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When you call the UseJson method without a parameter, you must use the LoadServiceModel property to provide a valid IEdmModel instance.. + /// + internal static string DataServiceClientFormat_LoadServiceModelRequired { + get { + return ResourceManager.GetString("DataServiceClientFormat_LoadServiceModelRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use the JSON format, you must first call DataServiceContext.Format.UseJson() and supply a valid service model.. + /// + internal static string DataServiceClientFormat_ValidServiceModelRequiredForJson { + get { + return ResourceManager.GetString("DataServiceClientFormat_ValidServiceModelRequiredForJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The DataServiceContext to which the DataServiceCollection instance belongs could not be determined. The DataServiceContext must either be supplied in the DataServiceCollection constructor or be used to create the DataServiceQuery or QueryOperationResponse object that is the source of the items in the DataServiceCollection.. + /// + internal static string DataServiceCollection_CannotDetermineContextFromItems { + get { + return ResourceManager.GetString("DataServiceCollection_CannotDetermineContextFromItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The tracking of DataServiceCollection can not be stopped for child collections.. + /// + internal static string DataServiceCollection_CannotStopTrackingChildCollection { + get { + return ResourceManager.GetString("DataServiceCollection_CannotStopTrackingChildCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection.. + /// + internal static string DataServiceCollection_InsertIntoTrackedButNotLoadedCollection { + get { + return ResourceManager.GetString("DataServiceCollection_InsertIntoTrackedButNotLoadedCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LoadAsync method cannot be called when the DataServiceCollection is not a child collection of a related entity.. + /// + internal static string DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity { + get { + return ResourceManager.GetString("DataServiceCollection_LoadAsyncNoParamsWithoutParentEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only a typed DataServiceQuery object can be supplied when calling the LoadAsync method on DataServiceCollection.. + /// + internal static string DataServiceCollection_LoadAsyncRequiresDataServiceQuery { + get { + return ResourceManager.GetString("DataServiceCollection_LoadAsyncRequiresDataServiceQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target collection for the Load operation must have an associated DataServiceContext.. + /// + internal static string DataServiceCollection_LoadRequiresTargetCollectionObserved { + get { + return ResourceManager.GetString("DataServiceCollection_LoadRequiresTargetCollectionObserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A previous LoadAsync operation has not yet completed. You cannot call the LoadAsync method on the DataServiceCollection again until the previous operation has completed.. + /// + internal static string DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime { + get { + return ResourceManager.GetString("DataServiceCollection_MultipleLoadAsyncOperationsAtTheSameTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This operation is only supported on collections that are being tracked.. + /// + internal static string DataServiceCollection_OperationForTrackedOnly { + get { + return ResourceManager.GetString("DataServiceCollection_OperationForTrackedOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred while processing this request.. + /// + internal static string DataServiceException_GeneralError { + get { + return ResourceManager.GetString("DataServiceException_GeneralError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This target framework does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because this framework only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration.. + /// + internal static string DataServiceQuery_EnumerationNotSupported { + get { + return ResourceManager.GetString("DataServiceQuery_EnumerationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to get the count value from the server.. + /// + internal static string DataServiceRequest_FailGetCount { + get { + return ResourceManager.GetString("DataServiceRequest_FailGetCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to get the value from the server.. + /// + internal static string DataServiceRequest_FailGetValue { + get { + return ResourceManager.GetString("DataServiceRequest_FailGetValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current value '{1}' type is not compatible with the expected '{0}' type.. + /// + internal static string Deserialize_Current { + get { + return ResourceManager.GetString("Deserialize_Current", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. The XML element contains mixed content.. + /// + internal static string Deserialize_ExpectingSimpleValue { + get { + return ResourceManager.GetString("Deserialize_ExpectingSimpleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only a single enumeration is supported by this IEnumerable.. + /// + internal static string Deserialize_GetEnumerator { + get { + return ResourceManager.GetString("Deserialize_GetEnumerator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Payload has an entry and the property '{0}' is a collection.. + /// + internal static string Deserialize_MismatchEntryLinkEntryPropertyIsCollection { + get { + return ResourceManager.GetString("Deserialize_MismatchEntryLinkEntryPropertyIsCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Payload has a feed and the property '{0}' is not a collection.. + /// + internal static string Deserialize_MismatchEntryLinkFeedPropertyNotCollection { + get { + return ResourceManager.GetString("Deserialize_MismatchEntryLinkFeedPropertyNotCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Payload has a link, local object has a simple value.. + /// + internal static string Deserialize_MismatchEntryLinkLocalSimple { + get { + return ResourceManager.GetString("Deserialize_MismatchEntryLinkLocalSimple", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Missing id element in the response.. + /// + internal static string Deserialize_MissingIdElement { + get { + return ResourceManager.GetString("Deserialize_MissingIdElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Element value interspersed with a comment is not supported.. + /// + internal static string Deserialize_MixedTextWithComment { + get { + return ResourceManager.GetString("Deserialize_MixedTextWithComment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response to this POST request did not contain a 'location' header. That is not supported by this client.. + /// + internal static string Deserialize_NoLocationHeader { + get { + return ResourceManager.GetString("Deserialize_NoLocationHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing response stream. Server failed with following message:\r\n{0}. + /// + internal static string Deserialize_ServerException { + get { + return ResourceManager.GetString("Deserialize_ServerException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DataServiceKey attribute must specify at least one property name.. + /// + internal static string DSKAttribute_MustSpecifyAtleastOnePropertyName { + get { + return ResourceManager.GetString("DSKAttribute_MustSpecifyAtleastOnePropertyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value with primitive kind '{0}' cannot be converted into a primitive object value.. + /// + internal static string EdmValueUtils_CannotConvertTypeToClrValue { + get { + return ResourceManager.GetString("EdmValueUtils_CannotConvertTypeToClrValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'.. + /// + internal static string EdmValueUtils_IncorrectPrimitiveTypeKind { + get { + return ResourceManager.GetString("EdmValueUtils_IncorrectPrimitiveTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'.. + /// + internal static string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName { + get { + return ResourceManager.GetString("EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type.. + /// + internal static string EdmValueUtils_UnsupportedPrimitiveType { + get { + return ResourceManager.GetString("EdmValueUtils_UnsupportedPrimitiveType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity with identity '{0}' does not have a self-link or an edit-link associated with it. Please make sure that the entity has either a self-link or an edit-link associated with it.. + /// + internal static string EntityDescriptor_MissingSelfEditLink { + get { + return ResourceManager.GetString("EntityDescriptor_MissingSelfEditLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An internal error '{0}' occurred.. + /// + internal static string General_InternalError { + get { + return ResourceManager.GetString("General_InternalError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value for MIME type parameter '{0}' is incorrect because the closing quote character could not be found while the parameter value started with a quote character.. + /// + internal static string HttpProcessUtility_ClosingQuoteNotFound { + get { + return ResourceManager.GetString("HttpProcessUtility_ClosingQuoteNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Content-Type header value missing.. + /// + internal static string HttpProcessUtility_ContentTypeMissing { + get { + return ResourceManager.GetString("HttpProcessUtility_ContentTypeMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Character set '{0}' is not supported.. + /// + internal static string HttpProcessUtility_EncodingNotSupported { + get { + return ResourceManager.GetString("HttpProcessUtility_EncodingNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value for MIME type parameter '{0}' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value.. + /// + internal static string HttpProcessUtility_EscapeCharAtEnd { + get { + return ResourceManager.GetString("HttpProcessUtility_EscapeCharAtEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value for MIME type parameter '{0}' is incorrect because it contained escape characters even though it was not quoted.. + /// + internal static string HttpProcessUtility_EscapeCharWithoutQuotes { + get { + return ResourceManager.GetString("HttpProcessUtility_EscapeCharWithoutQuotes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media type is missing a parameter value.. + /// + internal static string HttpProcessUtility_MediaTypeMissingValue { + get { + return ResourceManager.GetString("HttpProcessUtility_MediaTypeMissingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media type requires a ';' character before a parameter definition.. + /// + internal static string HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter { + get { + return ResourceManager.GetString("HttpProcessUtility_MediaTypeRequiresSemicolonBeforeParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media type requires a '/' character.. + /// + internal static string HttpProcessUtility_MediaTypeRequiresSlash { + get { + return ResourceManager.GetString("HttpProcessUtility_MediaTypeRequiresSlash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media type requires a subtype definition.. + /// + internal static string HttpProcessUtility_MediaTypeRequiresSubType { + get { + return ResourceManager.GetString("HttpProcessUtility_MediaTypeRequiresSubType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media type is unspecified.. + /// + internal static string HttpProcessUtility_MediaTypeUnspecified { + get { + return ResourceManager.GetString("HttpProcessUtility_MediaTypeUnspecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The collection is not part of the current entry. + /// + internal static string MaterializeFromObject_CollectionKeyNotPresentInLinkTable { + get { + return ResourceManager.GetString("MaterializeFromObject_CollectionKeyNotPresentInLinkTable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Count value is not part of the response stream.. + /// + internal static string MaterializeFromObject_CountNotPresent { + get { + return ResourceManager.GetString("MaterializeFromObject_CountNotPresent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This response does not contain any nested collections. Use null as Key instead.. + /// + internal static string MaterializeFromObject_GetNestLinkForFlatCollection { + get { + return ResourceManager.GetString("MaterializeFromObject_GetNestLinkForFlatCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The top level link is only available after the response has been enumerated.. + /// + internal static string MaterializeFromObject_TopLevelLinkNotAvailable { + get { + return ResourceManager.GetString("MaterializeFromObject_TopLevelLinkNotAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The null value from property '{0}' cannot be assigned to a type '{1}'.. + /// + internal static string Materializer_CannotAssignNull { + get { + return ResourceManager.GetString("Materializer_CannotAssignNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Materialization of top level collection expected ICollection <T>, but actual type was {0}.. + /// + internal static string Materializer_CollectionExpectedCollection { + get { + return ResourceManager.GetString("Materializer_CollectionExpectedCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A DataServiceCollection can only contain entity types. Primitive and complex types cannot be contained by this kind of collection.. + /// + internal static string Materializer_DataServiceCollectionNotSupportedForNonEntities { + get { + return ResourceManager.GetString("Materializer_DataServiceCollectionNotSupportedForNonEntities", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entry of type '{0}' cannot be added to a collection that contains instances of type '{1}'. This may occur when an existing entry of a different type has the same identity value or when the same entity is projected into two different types in a single query.. + /// + internal static string Materializer_EntryIntoCollectionMismatch { + get { + return ResourceManager.GetString("Materializer_EntryIntoCollectionMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entry returned by the navigation property '{0}' is null and cannot be initialized. You should check for a null value before accessing this property.. + /// + internal static string Materializer_EntryToAccessIsNull { + get { + return ResourceManager.GetString("Materializer_EntryToAccessIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entry that contains the data required to create an instance of type '{0}' is null and cannot be initialized. You should check for a null value before accessing this entry.. + /// + internal static string Materializer_EntryToInitializeIsNull { + get { + return ResourceManager.GetString("Materializer_EntryToInitializeIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The element '{0}' is not a valid collection item. The name of the collection item element must be 'element' and must belong to the 'http://docs.oasis-open.org/odata/ns/data' namespace.. + /// + internal static string Materializer_InvalidCollectionItem { + get { + return ResourceManager.GetString("Materializer_InvalidCollectionItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response content type '{0}' is not currently supported.. + /// + internal static string Materializer_InvalidContentTypeEncountered { + get { + return ResourceManager.GetString("Materializer_InvalidContentTypeEncountered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a type mismatch between the client and the service. Type '{0}' is an entity type, but the type in the response payload does not represent an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client.. + /// + internal static string Materializer_InvalidEntityType { + get { + return ResourceManager.GetString("Materializer_InvalidEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a type mismatch between the client and the service. Type '{0}' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client.. + /// + internal static string Materializer_InvalidNonEntityType { + get { + return ResourceManager.GetString("Materializer_InvalidNonEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response payload is a not a valid response payload. Please make sure that the top level element is a valid JSON element or belongs to '{0}' namespace.. + /// + internal static string Materializer_InvalidResponsePayload { + get { + return ResourceManager.GetString("Materializer_InvalidResponsePayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot materialize the results into a collection type '{0}' because it does not have a parameterless constructor.. + /// + internal static string Materializer_MaterializationTypeError { + get { + return ResourceManager.GetString("Materializer_MaterializationTypeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collection property '{0}' cannot be created because the type '{1}' does not have a public parameterless constructor.. + /// + internal static string Materializer_NoParameterlessCtorForCollectionProperty { + get { + return ResourceManager.GetString("Materializer_NoParameterlessCtorForCollectionProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity of type '{0}' cannot be projected because there is already an instance of type '{1}' for '{2}'.. + /// + internal static string Materializer_ProjectEntityTypeMismatch { + get { + return ResourceManager.GetString("Materializer_ProjectEntityTypeMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected property '{0}' could not be found while processing an entry. Check for null before accessing this property.. + /// + internal static string Materializer_PropertyMissing { + get { + return ResourceManager.GetString("Materializer_PropertyMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property '{0}' is not an entity.. + /// + internal static string Materializer_PropertyNotExpectedEntry { + get { + return ResourceManager.GetString("Materializer_PropertyNotExpectedEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset should never be called for collection reader in an internal enumerable.. + /// + internal static string Materializer_ResetAfterEnumeratorCreationError { + get { + return ResourceManager.GetString("Materializer_ResetAfterEnumeratorCreationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot materialize a collection of a primitives or complex without the type '{0}' being a collection.. + /// + internal static string Materializer_TypeShouldBeCollectionError { + get { + return ResourceManager.GetString("Materializer_TypeShouldBeCollectionError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required.. + /// + internal static string ODataMetadataBuilder_MissingEntityInstanceUri { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingEntityInstanceUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required.. + /// + internal static string ODataMetadataBuilder_MissingEntitySetUri { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingEntitySetUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments.. + /// + internal static string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GetStream method is not supported.. + /// + internal static string ODataRequestMessage_GetStreamMethodNotSupported { + get { + return ResourceManager.GetString("ODataRequestMessage_GetStreamMethodNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected a feed or entry in the response from the server, but found an unexpected element instead.. + /// + internal static string Parser_SingleEntry_ExpectedFeedOrEntry { + get { + return ResourceManager.GetString("Parser_SingleEntry_ExpectedFeedOrEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected exactly one entry in the response from the server, but more than one was found.. + /// + internal static string Parser_SingleEntry_MultipleFound { + get { + return ResourceManager.GetString("Parser_SingleEntry_MultipleFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected exactly one entry in the response from the server, but none was found.. + /// + internal static string Parser_SingleEntry_NoneFound { + get { + return ResourceManager.GetString("Parser_SingleEntry_NoneFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information.. + /// + internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone { + get { + return ResourceManager.GetString("PlatformHelper_DateTimeOffsetMustContainTimeZone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation parameter named '{0}' has a collection item of Edm type kind '{1}'. A collection item must be either a primitive type or a complex Edm type kind.. + /// + internal static string Serializer_InvalidCollectionParameterItemType { + get { + return ResourceManager.GetString("Serializer_InvalidCollectionParameterItemType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enum type '{0}' has no member named '{1}'.. + /// + internal static string Serializer_InvalidEnumMemberValue { + get { + return ResourceManager.GetString("Serializer_InvalidEnumMemberValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation parameter named '{0}' was of Edm type kind '{1}'. An operation parameter must be either a primitive type, a complex type or a collection of primitive or complex types.. + /// + internal static string Serializer_InvalidParameterType { + get { + return ResourceManager.GetString("Serializer_InvalidParameterType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A circular loop was detected while serializing the property '{0}'. You must make sure that loops are not present in properties that return a collection or complex type.. + /// + internal static string Serializer_LoopsNotAllowedInComplexTypes { + get { + return ResourceManager.GetString("Serializer_LoopsNotAllowedInComplexTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A circular loop was detected while serializing the complex type '{0}'. You must make sure that loops are not present in a collection or a complex type.. + /// + internal static string Serializer_LoopsNotAllowedInNonPropertyComplexTypes { + get { + return ResourceManager.GetString("Serializer_LoopsNotAllowedInNonPropertyComplexTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation parameter named '{0}' has a null collection item. The items of a collection must not be null.. + /// + internal static string Serializer_NullCollectionParameterItemValue { + get { + return ResourceManager.GetString("Serializer_NullCollectionParameterItemValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter alias '{0}' was not present in the request URI. All parameters passed as alias must be present in the request URI.. + /// + internal static string Serializer_UriDoesNotContainParameterAlias { + get { + return ResourceManager.GetString("Serializer_UriDoesNotContainParameterAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty array.. + /// + internal static string Util_EmptyArray { + get { + return ResourceManager.GetString("Util_EmptyArray", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty string.. + /// + internal static string Util_EmptyString { + get { + return ResourceManager.GetString("Util_EmptyString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Array contains a null element.. + /// + internal static string Util_NullArrayElement { + get { + return ResourceManager.GetString("Util_NullArrayElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid duration value.. + /// + internal static string ValueParser_InvalidDuration { + get { + return ResourceManager.GetString("ValueParser_InvalidDuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An item in the collection property '{0}' is not of the correct type. All items in the collection property must be of the collection item type.. + /// + internal static string WebUtil_TypeMismatchInCollection { + get { + return ResourceManager.GetString("WebUtil_TypeMismatchInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A collection of item type '{0}' has an item which is not of the correct type. All items in the collection must be of the collection item type.. + /// + internal static string WebUtil_TypeMismatchInNonPropertyCollection { + get { + return ResourceManager.GetString("WebUtil_TypeMismatchInNonPropertyCollection", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.OData.Client/SRResources.resx b/src/Microsoft.OData.Client/SRResources.resx new file mode 100644 index 0000000000..237c14d8a2 --- /dev/null +++ b/src/Microsoft.OData.Client/SRResources.resx @@ -0,0 +1,885 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The expected content type for a batch requests is "multipart/mixed;boundary=batch" not "{0}". + + + The POST request expected a response with content. ID={0} + + + Not all requests in the batch had a response. + + + The web response contained unexpected sections. ID={0} + + + Expected an absolute, well formed http URL without a query or fragment. + + + You must set the BaseUri property before you perform this operation. + + + The Uri that is returned by the ResolveEntitySet function must be an absolute, well-formed URL with an "http" or "https" scheme name and without any query strings or fragment identifiers. + + + Because the requestUri is a relative Uri, you must set the BaseUri property on the DataServiceContext. + + + The ResolveEntitySet function must return a non-null Uri for the EntitySet '{0}', otherwise you must set the BaseUri property. + + + Unable to convert value '{0}' into a key string for a URI. + + + The identity value specified by either the the OData-EntityId header must be an absolute URI. + + + The 'Location' header value specified in the response must be an absolute URI. + + + One of the link's resources failed to insert. + + + Microsoft.OData.Client internal error {0}. + + + An error occurred for this query during batch execution. See the inner exception for details. + + + Expected a relative URL path without query or fragment. + + + Changes cannot be saved as a batch when an entity has one or more streams associated with it. Retry the SaveChanges operation without enabling the SaveChangesOptions.BatchWithSingleChangeset and the SaveChangesOptions.BatchWithIndependentOperations options. + + + The stream named '{0}' cannot be modified because it does not have an edit-media link. Make sure that the stream name is correct and that an edit-media link for this stream is included in the entry element in the response. + + + This operation requires the entity be of an Entity Type, and has at least one key property. + + + This operation requires the entity to be of an Entity Type, either mark its key properties, or attribute the class with DataServiceEntityAttribute + + + The context is not currently tracking the entity. + + + The context is already tracking the entity. + + + The context is already tracking a different entity with the same resource Uri. + + + The current object did not originate the async result. + + + The asynchronous result has already been completed. + + + The operation has been canceled. + + + The property '{0}' is not supported when MaxProtocolVersion is greater than '{1}'. + + + The context can not load the related collection or reference for objects in the added state. + + + One or both of the ends of the relationship is in the added state. + + + One or both of the ends of the relationship is in the deleted state. + + + The context is already tracking the relationship. + + + The sourceProperty is not a reference or collection of the target's object type. + + + AddLink and DeleteLink methods only work when the sourceProperty is a collection. + + + AddRelatedObject method only works when the sourceProperty is a collection. + + + AddRelatedObject method only works if the source entity is in a non-deleted state. + + + UpdateRelatedObject method only works when the sourceProperty is not collection. + + + SetLink method only works when the sourceProperty is not a collection. + + + SetRelatedObject method only works when the sourceProperty is not a collection. + + + SetRelatedObject method only works if the source entity is in a non-deleted state. + + + SetRelatedObjectLink method only works when the sourceProperty is not a collection. + + + SetRelatedObjectLink method only works if the source entity is in a non-deleted state. + + + Media link object of type '{0}' is configured to use the MIME type specified in the property '{1}'. However, that property's value is null or empty. + + + Saving entities with the [MediaEntry] attribute is not currently supported in batch mode. Use non-batched mode instead. + + + Unexpected result (<= 0) from stream.Read() while reading raw data for this property. + + + Response version '{0}' is not supported. The only supported versions are: {1}. + + + The response version is {0}, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the version required by the response, and then retry the request. If the client does not support the required protocol version, then upgrade the client. + + + The request requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service context is set to {1}. Set the MaxProtocolVersion to the higher version, and then retry the operation. + + + Attempt to delete a link between two objects failed because the identity of the target object of the link depends on the source object of the link. + + + The ContentType value for a named stream cannot be null or an empty string. + + + This operation requires that the specified entity be a Media Link Entry and that the ReadStreamUri be available. However, the specified entity either is not a Media Link Entry or does not have a valid ReadStreamUri value. If the entity is a Media Link Entry, re-query the data service for this entity to obtain a valid ReadStreamUri value. + + + The entity type {0} is marked with MediaEntry attribute but no save stream was set for the entity. + + + Can't use SetSaveStream on entity with type {0} which has a media entry property defined. + + + There is no edit-media link for the entity's media stream. Make sure that the edit-media link is specified for this stream. + + + Calling SetSaveStream on an entity with state '{0}' is not allowed. + + + The entity does not have a stream named '{0}'. Make sure that the name of the stream is correct. + + + There is no self-link or edit-media link for the stream named '{0}'. Make sure that either the self-link or edit-media link is specified for this stream. + + + The response should have both 'Location' and 'OData-EntityId' headers or the response should not have any of these headers. + + + OperationParameter of type BodyOperationParameter cannot be specified when the HttpMethod is set to GET. + + + The Name property of an OperationParameter must be set to a non-null, non-empty string. + + + Multiple uri operation parameters were found with the same name. Uri operation parameter names must be unique. + + + Multiple body operation parameters were found with the same name. Body operation parameter names must be unique. + + + The serialized resource has a null value in key member '{0}'. Null values are not supported in key members. + + + The HttpMethod must be GET, POST or DELETE. + + + EndExecute overload for void service operations and actions received a non-void response from the server. + + + The operation parameters array contains a null element which is not allowed. + + + An implementation of ODataEntityMetadataBuilder is required, but a null value was returned from GetEntityMetadataBuilder. + + + The ChangeState method does not support the 'Added' state because additional information is needed for inserts. Use either AddObject or AddRelatedObject instead. + + + The entity's state can only be changed to 'Modified' if it is currently 'Unchanged'. + + + An entity in the 'Added' state cannot be changed to '{0}', it can only be changed to 'Detached'. + + + DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property must not return a null value. Please return a non-null value for this property. + + + SendingRequest cannot be used in combination with the DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property. Please use SendingRequest2 with DataServiceContext.Configurations.RequestPipeline.OnMessageCreating property instead. + + + '{0}' must be used with '{1}'. + + + Deep insert can only have one top level entity. + + + For deep insert, ChangeState for '{0}' cannot be Deleted or Modified. + + + When you call the UseJson method without a parameter, you must use the LoadServiceModel property to provide a valid IEdmModel instance. + + + To use the JSON format, you must first call DataServiceContext.Format.UseJson() and supply a valid service model. + + + {0}.{1} must return a non-null open property collection. + + + The open object property '{0}:{1}' is not defined. + + + {0} has multiple definitions for OpenObjectAttribute. + + + The closed type {0} does not have a corresponding {1} settable property. + + + The key property '{0}' on for type '{1}' is of type '{2}', which is not a simple type. Only properties of simple type can be key properties. + + + {0} has key properties declared at different levels within its type hierarchy. + + + Type '{0}' has a MimeTypeProperty attribute that references the MIME type property '{1}'. However, this type does not have a property '{1}'. + + + Type '{0}' has a MimeTypeProperty attribute that references the data property '{1}'. However, this type does not have a property '{1}'. + + + Type '{0}' has a MediaEntry attribute that references a property called '{1}'. However, this type does not have a property '{1}'. + + + The complex type '{0}' has no settable properties. + + + Multiple implementations of ICollection<T> is not supported. + + + The open type property '{0}' returned a null instance. + + + Resolving type from '{0}' that inherits from '{1}' is ambiguous. + + + The type '{0}' is not supported by the client library. + + + Collection properties of a collection type are not supported. + + + Multiple types were found with the same name '{0}'. Type names must be unique. + + + An item in the collection property '{0}' is not of the correct type. All items in the collection property must be of the collection item type. + + + A collection of item type '{0}' has an item which is not of the correct type. All items in the collection must be of the collection item type. + + + The property '{0}' is of entity type and it cannot be a property of the type '{1}', which is not of entity type. Only entity types can contain navigation properties. + + + An error occurred while processing this request. + + + Only a single enumeration is supported by this IEnumerable. + + + The current value '{1}' type is not compatible with the expected '{0}' type. + + + Error processing response stream. Element value interspersed with a comment is not supported. + + + Error processing response stream. The XML element contains mixed content. + + + Error processing response stream. Payload has a link, local object has a simple value. + + + Error processing response stream. Payload has a feed and the property '{0}' is not a collection. + + + Error processing response stream. Payload has an entry and the property '{0}' is a collection. + + + The response to this POST request did not contain a 'location' header. That is not supported by this client. + + + Error processing response stream. Server failed with following message:\r\n{0} + + + Error processing response stream. Missing id element in the response. + + + The value of the property '{0}' is null. Properties that are a collection type of primitive or complex types cannot be null. + + + The value of the collection of item type '{0}' is null. A collection cannot have a null value. + + + An item in the collection property has a null value. Collection properties that contain items with null values are not supported. + + + A collection property of primitive types cannot contain an item of a collection type. + + + A collection property of complex types cannot contain an item of a primitive type. + + + The entity with identity '{0}' does not have a self-link or an edit-link associated with it. Please make sure that the entity has either a self-link or an edit-link associated with it. + + + Content-Type header value missing. + + + Media type is missing a parameter value. + + + Media type requires a ';' character before a parameter definition. + + + Media type requires a '/' character. + + + Media type requires a subtype definition. + + + Media type is unspecified. + + + Character set '{0}' is not supported. + + + Value for MIME type parameter '{0}' is incorrect because it contained escape characters even though it was not quoted. + + + Value for MIME type parameter '{0}' is incorrect because it terminated with escape character. Escape characters must always be followed by a character in a parameter value. + + + Value for MIME type parameter '{0}' is incorrect because the closing quote character could not be found while the parameter value started with a quote character. + + + Count value is not part of the response stream. + + + The top level link is only available after the response has been enumerated. + + + The collection is not part of the current entry + + + This response does not contain any nested collections. Use null as Key instead. + + + GetStream method is not supported. + + + Empty string. + + + Empty array. + + + Array contains a null element. + + + The expression type {0} is not supported. + + + Could not convert constant {0} expression to string. + + + The method '{0}' is not supported. + + + The unary operator '{0}' is not supported. + + + The binary operator '{0}' is not supported. + + + The constant for '{0}' is not supported. + + + An operation between an expression and a type is not supported. + + + The conditional expression is not supported. + + + The parameter expression is not supported. + + + The member access of '{0}' is not supported. + + + Lambda Expressions not supported. + + + New Expressions not supported. + + + Member Init Expressions not supported. + + + List Init Expressions not supported. + + + New Array Expressions not supported. + + + Invocation Expressions not supported. + + + Can only specify query options (orderby, where, take, skip) after last navigation. + + + Expand query option not allowed. + + + Can't cast to unsupported type '{0}' + + + Individual properties can only be selected from a single resource or as part of a type. Specify a key predicate to restrict the entity set to a single instance or project the property into a named or anonymous type. + + + Multiple key predicates cannot be specified for the same entity set. + + + The expression {0} is not supported. + + + Error translating Linq expression to URI: {0} + + + Custom query option not allowed. + + + Can't add duplicate query option '{0}'. + + + Can't add query option '{0}' because it would conflict with the query options from the translated Linq expression. + + + Can't add query option '{0}' because it begins with reserved character '$'. + + + Referencing public field '{0}' not supported in query option expression. Use public property instead. + + + The query option '{0}' is not supported or is controlled by the OData service. + + + Cannot specify query options (orderby, where, take, skip, count) on single resource. + + + The {0} query option cannot be specified after the {1} query option. + + + Cannot add count option to the resource set. + + + Cannot add count option to the resource set because it would conflict with existing count options. + + + Can only specify 'select' query option after last navigation. + + + Cannot translate multiple Linq Select operations in a single 'select' query option. + + + Cannot initialize an instance of entity type '{0}' because '{1}' and '{2}' do not refer to the same source entity. + + + The expression '{0}' is not a valid expression for navigation path. The only supported operations inside the lambda expression body are MemberAccess and TypeAs. The expression must contain at least one MemberAccess and it cannot end with TypeAs. + + + Initializing instances of the entity type {0} with the expression {1} is not supported. + + + Constructing or initializing instances of the type {0} with the expression {1} is not supported. + + + Construction of entity type instances must use object initializer with default constructor. + + + Referencing of local entity type instances not supported when projecting results. + + + Cannot assign the value from the {0} property to the {1} property. When projecting results into a entity type, the property names of the source type and the target type must match for the properties being projected. + + + Can only project the last entity type in the query being translated. + + + Cannot create projection while there is an explicit expansion specified on the same query. + + + The collection property '{0}' cannot be used in an 'orderby' query expression. Collection properties are not supported by the 'orderby' query option. + + + The collection property '{0}' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option. + + + Navigation to members of the collection property '{0}' in a 'select' query expression is not supported. + + + The property '{0}' of type 'DataServiceStreamLink' cannot be used in 'where' or 'orderby' query expressions. Properties of type 'DataServiceStreamLink' are not supported by these query options. + + + The target type for an OfType filter could not be determined. + + + Non-redundant type filters (OfType <T>, C# 'as' and VB 'TryCast') can only be used once per resource set. + + + Unsupported expression '{0}' in '{1}' method. Expression cannot end with TypeAs. + + + The expression 'TypeAs' is not supported when MaxProtocolVersion is less than '3.0'. + + + The type '{0}' is not an entity type. The target type for a TypeAs operator must be an entity type. + + + The source parameter for the '{0}' method has to be either a navigation or a collection property. + + + The method '{0}' is not supported by the 'orderby' query option. + + + The '$format' query option is not supported. Use the DataServiceContext.Format property to set the desired format. + + + Found the following illegal system token while building a projection or expansion path: '{0}' + + + Found a projection as a non-leaf segment in an expand path. Please rephrase your query. The projected property was : '{0}' + + + Found an illegal type token '{0}' without a trailing navigation property. + + + The Contains method cannot be used with an empty collection. + + + The aggregation method '{0}' is not supported. + + + The expression '{0}' is not a valid aggregate expression. The aggregate expression must evaluate to a single-valued property path to an aggregatable property. + + + The expression '{0}' is not a valid expression for grouping. The grouping expression must evaluate to a single-valued property path, i.e., a path ending in a single-valued primitive. + + + The expression '{0}' in the GroupBy key selector is not supported. + + + DataServiceKey attribute must specify at least one property name. + + + Target collection for the Load operation must have an associated DataServiceContext. + + + The tracking of DataServiceCollection can not be stopped for child collections. + + + This operation is only supported on collections that are being tracked. + + + The DataServiceContext to which the DataServiceCollection instance belongs could not be determined. The DataServiceContext must either be supplied in the DataServiceCollection constructor or be used to create the DataServiceQuery or QueryOperationResponse object that is the source of the items in the DataServiceCollection. + + + An item could not be added to the collection. When items in a DataServiceCollection are tracked by the DataServiceContext, new items cannot be added before items have been loaded into the collection. + + + A previous LoadAsync operation has not yet completed. You cannot call the LoadAsync method on the DataServiceCollection again until the previous operation has completed. + + + The LoadAsync method cannot be called when the DataServiceCollection is not a child collection of a related entity. + + + Only a typed DataServiceQuery object can be supplied when calling the LoadAsync method on DataServiceCollection. + + + The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type '{0}' does not have any key property. + + + Setting an instance of DataServiceCollection to an entity property is disallowed if the instance is already being tracked. Error occurred on property '{0}' for entity type '{1}'. + + + Unexpected action '{0}' on the OnCollectionChanged event raised by DataServiceCollection. + + + Unexpected action '{0}' on the OnCollectionChanged event raised by a collection object of type '{1}'. + + + Add/Update/Delete operation cannot be performed on a child entity, if the parent entity is already detached. + + + Null values are disallowed during '{0}' operations on DataServiceCollection. + + + A value provided during '{0}' operation on DataServiceCollection is not of an entity type with key. + + + Entity set name has not been provided for an entity of type '{0}'. + + + An attempt was made to add entity of type '{0}' to a collection in which the same entity already exists. + + + An attempt to track an entity or complex type failed because the entity or complex type '{0}' does not implement the INotifyPropertyChanged interface. + + + An attempt to track an entity or complex type failed because the entity or complex type contains a collection property of type '{0}' that does not implement the INotifyCollectionChanged interface. + + + An attempt to track a complex object of type '{0}' failed because the complex object is already being tracked. + + + An attempt to track a collection object of type '{0}' failed because the collection object is already being tracked. + + + Expected exactly one entry in the response from the server, but none was found. + + + Expected exactly one entry in the response from the server, but more than one was found. + + + Expected a feed or entry in the response from the server, but found an unexpected element instead. + + + The null value from property '{0}' cannot be assigned to a type '{1}'. + + + An entry of type '{0}' cannot be added to a collection that contains instances of type '{1}'. This may occur when an existing entry of a different type has the same identity value or when the same entity is projected into two different types in a single query. + + + An entry returned by the navigation property '{0}' is null and cannot be initialized. You should check for a null value before accessing this property. + + + An entry that contains the data required to create an instance of type '{0}' is null and cannot be initialized. You should check for a null value before accessing this entry. + + + An entity of type '{0}' cannot be projected because there is already an instance of type '{1}' for '{2}'. + + + The expected property '{0}' could not be found while processing an entry. Check for null before accessing this property. + + + Property '{0}' is not an entity. + + + A DataServiceCollection can only contain entity types. Primitive and complex types cannot be contained by this kind of collection. + + + Collection property '{0}' cannot be created because the type '{1}' does not have a public parameterless constructor. + + + The element '{0}' is not a valid collection item. The name of the collection item element must be 'element' and must belong to the 'http://docs.oasis-open.org/odata/ns/data' namespace. + + + There is a type mismatch between the client and the service. Type '{0}' is an entity type, but the type in the response payload does not represent an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. + + + There is a type mismatch between the client and the service. Type '{0}' is not an entity type, but the type in the response payload represents an entity type. Please ensure that types defined on the client match the data model of the service, or update the service reference on the client. + + + Materialization of top level collection expected ICollection <T>, but actual type was {0}. + + + The response payload is a not a valid response payload. Please make sure that the top level element is a valid JSON element or belongs to '{0}' namespace. + + + The response content type '{0}' is not currently supported. + + + Cannot materialize the results into a collection type '{0}' because it does not have a parameterless constructor. + + + Reset should never be called for collection reader in an internal enumerable. + + + Cannot materialize a collection of a primitives or complex without the type '{0}' being a collection. + + + A circular loop was detected while serializing the property '{0}'. You must make sure that loops are not present in properties that return a collection or complex type. + + + A circular loop was detected while serializing the complex type '{0}'. You must make sure that loops are not present in a collection or a complex type. + + + The operation parameter named '{0}' has a collection item of Edm type kind '{1}'. A collection item must be either a primitive type or a complex Edm type kind. + + + The operation parameter named '{0}' has a null collection item. The items of a collection must not be null. + + + The operation parameter named '{0}' was of Edm type kind '{1}'. An operation parameter must be either a primitive type, a complex type or a collection of primitive or complex types. + + + The parameter alias '{0}' was not present in the request URI. All parameters passed as alias must be present in the request URI. + + + The enum type '{0}' has no member named '{1}'. + + + This target framework does not enable you to directly enumerate over a data service query. This is because enumeration automatically sends a synchronous request to the data service. Because this framework only supports asynchronous operations, you must instead call the BeginExecute and EndExecute methods to obtain a query result that supports enumeration. + + + Only instances of HttpWebRequest are currently allowed for this property. Other subtypes of WebRequest are not supported. + + + An internal error '{0}' occurred. + + + The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required. + + + The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments. + + + Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required. + + + The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type. + + + Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. + + + Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. + + + A value with primitive kind '{0}' cannot be converted into a primitive object value. + + + The value '{0}' is not a valid duration value. + + + The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. + + + Failed to get the count value from the server. + + + Failed to get the value from the server. + + + Execute overload for void service operations and actions received a non-void response from the server. + + + The context is currently in no tracking mode, in order to use streams make sure your entities extend BaseEntityType and query the Item again from the server to populate the read link or enable tracking. + + + The context is in non tracking mode, The entity does not seem to have the media links populated properly. Please verify server response is correct and that the entity extends BaseEntityType. + + + diff --git a/src/Microsoft.OData.Client/SaveResult.cs b/src/Microsoft.OData.Client/SaveResult.cs index 01d027d006..53ebcc28b0 100644 --- a/src/Microsoft.OData.Client/SaveResult.cs +++ b/src/Microsoft.OData.Client/SaveResult.cs @@ -344,7 +344,7 @@ protected override DataServiceResponse HandleResponse() if (ex != null) { - throw new DataServiceRequestException(Strings.DataServiceException_GeneralError, ex, service); + throw new DataServiceRequestException(SRResources.DataServiceException_GeneralError, ex, service); } return service; @@ -539,7 +539,7 @@ private ODataRequestMessageWrapper CheckAndProcessMediaEntryPost(EntityDescripto { // The entity is marked as MLE but we don't have the content property // and the user didn't set the save stream. - throw Error.InvalidOperation(Strings.Context_MLEWithoutSaveStream(type.ElementTypeName)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_MLEWithoutSaveStream, type.ElementTypeName)); } Debug.Assert( @@ -565,7 +565,7 @@ private ODataRequestMessageWrapper CheckAndProcessMediaEntryPost(EntityDescripto if (String.IsNullOrEmpty(mimeType)) { throw Error.InvalidOperation( - Strings.Context_NoContentTypeForMediaLink( + Error.Format(SRResources.Context_NoContentTypeForMediaLink, type.ElementTypeName, type.MediaDataMember.MimeTypeProperty.PropertyName)); } @@ -658,7 +658,7 @@ private ODataRequestMessageWrapper CheckAndProcessMediaEntryPut(EntityDescriptor if (requestUri == null) { throw Error.InvalidOperation( - Strings.Context_SetSaveStreamWithoutEditMediaLink); + SRResources.Context_SetSaveStreamWithoutEditMediaLink); } HeaderCollection headers = new HeaderCollection(); @@ -917,7 +917,7 @@ private ODataRequestMessageWrapper CreateNamedStreamRequest(StreamDescriptor nam Uri requestUri = namedStreamInfo.GetLatestEditLink(); if (requestUri == null) { - throw Error.InvalidOperation(Strings.Context_SetSaveStreamWithoutNamedStreamEditLink(namedStreamInfo.Name)); + throw Error.InvalidOperation(Error.Format(SRResources.Context_SetSaveStreamWithoutNamedStreamEditLink, namedStreamInfo.Name)); } HeaderCollection headers = new HeaderCollection(); diff --git a/src/Microsoft.OData.Client/SendingRequestEventArgs.cs b/src/Microsoft.OData.Client/SendingRequestEventArgs.cs index 9af651c182..6e375a4450 100644 --- a/src/Microsoft.OData.Client/SendingRequestEventArgs.cs +++ b/src/Microsoft.OData.Client/SendingRequestEventArgs.cs @@ -49,7 +49,7 @@ public System.Net.WebRequest Request Util.CheckArgumentNull(value, "value"); if (!(value is System.Net.HttpWebRequest)) { - throw Error.Argument(Strings.Context_SendingRequestEventArgsNotHttp, "value"); + throw Error.Argument(SRResources.Context_SendingRequestEventArgsNotHttp, "value"); } this.request = value; diff --git a/src/Microsoft.OData.Client/Serialization/HttpClientRequestMessage.cs b/src/Microsoft.OData.Client/Serialization/HttpClientRequestMessage.cs index 7f152cd14f..3228182c8c 100644 --- a/src/Microsoft.OData.Client/Serialization/HttpClientRequestMessage.cs +++ b/src/Microsoft.OData.Client/Serialization/HttpClientRequestMessage.cs @@ -312,7 +312,7 @@ public override Stream GetStream() { if (this.inSendingRequest2Event) { - throw new NotSupportedException(Strings.ODataRequestMessage_GetStreamMethodNotSupported); + throw new NotSupportedException(SRResources.ODataRequestMessage_GetStreamMethodNotSupported); } return _messageStream; } @@ -335,7 +335,7 @@ public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, objec { if (this.inSendingRequest2Event) { - throw new NotSupportedException(Strings.ODataRequestMessage_GetStreamMethodNotSupported); + throw new NotSupportedException(SRResources.ODataRequestMessage_GetStreamMethodNotSupported); } TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); taskCompletionSource.TrySetResult(_messageStream); diff --git a/src/Microsoft.OData.Client/Serialization/ODataPropertyConverter.cs b/src/Microsoft.OData.Client/Serialization/ODataPropertyConverter.cs index 21869d4fc6..f5b31d2ca2 100644 --- a/src/Microsoft.OData.Client/Serialization/ODataPropertyConverter.cs +++ b/src/Microsoft.OData.Client/Serialization/ODataPropertyConverter.cs @@ -155,12 +155,12 @@ internal ODataResourceWrapper CreateODataResourceWrapperForComplex(Type complexT { if (propertyName != null) { - throw Error.InvalidOperation(Strings.Serializer_LoopsNotAllowedInComplexTypes(propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.Serializer_LoopsNotAllowedInComplexTypes, propertyName)); } else { Debug.Assert(complexTypeAnnotation.ElementTypeName != null, "complexTypeAnnotation.ElementTypeName != null"); - throw Error.InvalidOperation(Strings.Serializer_LoopsNotAllowedInNonPropertyComplexTypes(complexTypeAnnotation.ElementTypeName)); + throw Error.InvalidOperation(Error.Format(SRResources.Serializer_LoopsNotAllowedInNonPropertyComplexTypes, complexTypeAnnotation.ElementTypeName)); } } @@ -592,7 +592,7 @@ internal static object ConvertPrimitiveValueToRecognizedODataType(object propert // don't support reverse mappings for these types in this version // allows us to add real server support in the future without a // "breaking change" in the future client - throw new NotSupportedException(Strings.ALinq_CantCastToUnsupportedPrimitive(propertyType.Name)); + throw new NotSupportedException(Error.Format(SRResources.ALinq_CantCastToUnsupportedPrimitive, propertyType.Name)); } return propertyValue; diff --git a/src/Microsoft.OData.Client/Serialization/ODataWriterWrapper.cs b/src/Microsoft.OData.Client/Serialization/ODataWriterWrapper.cs index 3a48f0888b..5d8f1780b1 100644 --- a/src/Microsoft.OData.Client/Serialization/ODataWriterWrapper.cs +++ b/src/Microsoft.OData.Client/Serialization/ODataWriterWrapper.cs @@ -74,7 +74,7 @@ internal static ODataWriterWrapper CreateForDeltaFeed(ODataMessageWriter message if (edmEntitySet == null) { - throw Error.InvalidOperation(Strings.DataBinding_Util_UnknownEntitySetName(entityDescriptor.Entity.GetType().FullName)); + throw Error.InvalidOperation(Error.Format(SRResources.DataBinding_Util_UnknownEntitySetName, entityDescriptor.Entity.GetType().FullName)); } return new ODataWriterWrapper(messageWriter.CreateODataDeltaResourceSetWriter(edmEntitySet, entityType), requestPipeline); diff --git a/src/Microsoft.OData.Client/Serialization/Serializer.cs b/src/Microsoft.OData.Client/Serialization/Serializer.cs index b0da9debb7..5d2118b396 100644 --- a/src/Microsoft.OData.Client/Serialization/Serializer.cs +++ b/src/Microsoft.OData.Client/Serialization/Serializer.cs @@ -295,7 +295,7 @@ internal void WriteBodyOperationParameters(List operatio default: // EdmTypeKind.Row // EdmTypeKind.EntityReference - throw new NotSupportedException(Strings.Serializer_InvalidParameterType(operationParameter.Name, edmType.TypeKind)); + throw new NotSupportedException(Error.Format(SRResources.Serializer_InvalidParameterType, operationParameter.Name, edmType.TypeKind)); } } // else } // foreach @@ -940,7 +940,7 @@ internal Uri WriteUriOperationParametersToUri(Uri requestUri, List @@ -125,7 +125,7 @@ internal Uri GetEntitySetUri(string entitySetName) /// The BaseUri property with a slash. internal Uri GetBaseUriWithSlash() { - return this.GetBaseUriWithSlash(() => Strings.Context_BaseUriRequired); + return this.GetBaseUriWithSlash(() => SRResources.Context_BaseUriRequired); } /// @@ -138,7 +138,7 @@ internal Uri GetOrCreateAbsoluteUri(Uri requestUri) Util.CheckArgumentNull(requestUri, "requestUri"); if (!requestUri.IsAbsoluteUri) { - return UriUtil.CreateUri(this.GetBaseUriWithSlash(() => Strings.Context_RequestUriIsRelativeBaseUriRequired), requestUri); + return UriUtil.CreateUri(this.GetBaseUriWithSlash(() => SRResources.Context_RequestUriIsRelativeBaseUriRequired), requestUri); } return requestUri; @@ -157,10 +157,10 @@ private static void ConvertToAbsoluteAndValidateBaseUri(ref Uri baseUri, string { if (parameterName != null) { - throw Error.Argument(Strings.Context_BaseUri, parameterName); + throw Error.Argument(SRResources.Context_BaseUri, parameterName); } - throw Error.InvalidOperation(Strings.Context_BaseUri); + throw Error.InvalidOperation(SRResources.Context_BaseUri); } } @@ -285,7 +285,7 @@ private Uri GetEntitySetUriFromResolver(string entitySetName) return resolved; } - throw Error.InvalidOperation(Strings.Context_ResolveReturnedInvalidUri); + throw Error.InvalidOperation(SRResources.Context_ResolveReturnedInvalidUri); } } diff --git a/src/Microsoft.OData.Client/Util.cs b/src/Microsoft.OData.Client/Util.cs index 74c4c8117d..d837bcc261 100644 --- a/src/Microsoft.OData.Client/Util.cs +++ b/src/Microsoft.OData.Client/Util.cs @@ -156,7 +156,7 @@ internal static void CheckArgumentNotEmpty(string value, string parameterName) { if (value != null && value.Length == 0) { - throw Error.Argument(Strings.Util_EmptyString, parameterName); + throw Error.Argument(SRResources.Util_EmptyString, parameterName); } } @@ -174,14 +174,14 @@ internal static void CheckArgumentNotEmpty(T[] value, string parameterName) w CheckArgumentNull(value, parameterName); if (value.Length == 0) { - throw Error.Argument(Strings.Util_EmptyArray, parameterName); + throw Error.Argument(SRResources.Util_EmptyArray, parameterName); } for (int i = 0; i < value.Length; ++i) { if (Object.ReferenceEquals(value[i], null)) { - throw Error.Argument(Strings.Util_NullArrayElement, parameterName); + throw Error.Argument(SRResources.Util_NullArrayElement, parameterName); } } } diff --git a/src/Microsoft.OData.Client/WebUtil.cs b/src/Microsoft.OData.Client/WebUtil.cs index e117eb1659..3c602a0dca 100644 --- a/src/Microsoft.OData.Client/WebUtil.cs +++ b/src/Microsoft.OData.Client/WebUtil.cs @@ -223,7 +223,7 @@ internal static void ValidateCollection(Type collectionItemType, object property if (!PrimitiveType.IsKnownNullableType(collectionItemType) && collectionItemType.GetInterfaces().SingleOrDefault(t => t == typeof(IEnumerable)) != null) { - throw Error.InvalidOperation(Strings.ClientType_CollectionOfCollectionNotSupported); + throw Error.InvalidOperation(SRResources.ClientType_CollectionOfCollectionNotSupported); } if (propertyValue == null) @@ -232,12 +232,12 @@ internal static void ValidateCollection(Type collectionItemType, object property { if (!isDynamicProperty) { - throw Error.InvalidOperation(Strings.Collection_NullCollectionNotSupported(propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.Collection_NullCollectionNotSupported, propertyName)); } } else { - throw Error.InvalidOperation(Strings.Collection_NullNonPropertyCollectionNotSupported(collectionItemType)); + throw Error.InvalidOperation(Error.Format(SRResources.Collection_NullNonPropertyCollectionNotSupported, collectionItemType)); } } } @@ -258,18 +258,18 @@ internal static void ValidatePrimitiveCollectionItem(object itemValue, string pr if (!PrimitiveType.IsKnownNullableType(itemValueType)) { - throw Error.InvalidOperation(Strings.Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed); + throw Error.InvalidOperation(SRResources.Collection_CollectionTypesInCollectionOfPrimitiveTypesNotAllowed); } if (!collectionItemType.IsAssignableFrom(itemValueType)) { if (propertyName != null) { - throw Error.InvalidOperation(Strings.WebUtil_TypeMismatchInCollection(propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.WebUtil_TypeMismatchInCollection, propertyName)); } else { - throw Error.InvalidOperation(Strings.WebUtil_TypeMismatchInNonPropertyCollection(collectionItemType)); + throw Error.InvalidOperation(Error.Format(SRResources.WebUtil_TypeMismatchInNonPropertyCollection, collectionItemType)); } } } @@ -290,18 +290,18 @@ internal static void ValidateComplexCollectionItem(object itemValue, string prop if (PrimitiveType.IsKnownNullableType(itemValueType)) { - throw Error.InvalidOperation(Strings.Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed); + throw Error.InvalidOperation(SRResources.Collection_PrimitiveTypesInCollectionOfComplexTypesNotAllowed); } if (!collectionItemType.IsAssignableFrom(itemValueType)) { if (propertyName != null) { - throw Error.InvalidOperation(Strings.WebUtil_TypeMismatchInCollection(propertyName)); + throw Error.InvalidOperation(Error.Format(SRResources.WebUtil_TypeMismatchInCollection, propertyName)); } else { - throw Error.InvalidOperation(Strings.WebUtil_TypeMismatchInNonPropertyCollection(collectionItemType)); + throw Error.InvalidOperation(Error.Format(SRResources.WebUtil_TypeMismatchInNonPropertyCollection, collectionItemType)); } } } @@ -324,7 +324,7 @@ internal static Uri ValidateIdentityValue(string identityValue) } catch (FormatException) { - throw Error.InvalidOperation(Strings.Context_TrackingExpectsAbsoluteUri); + throw Error.InvalidOperation(SRResources.Context_TrackingExpectsAbsoluteUri); } return identity; @@ -342,7 +342,7 @@ internal static Uri ValidateLocationHeader(string location) Uri locationUri = UriUtil.CreateUri(location, UriKind.RelativeOrAbsolute); if (!locationUri.IsAbsoluteUri) { - throw Error.InvalidOperation(Strings.Context_LocationHeaderExpectsAbsoluteUri); + throw Error.InvalidOperation(SRResources.Context_LocationHeaderExpectsAbsoluteUri); } return locationUri; diff --git a/src/Microsoft.OData.Core/AnnotationFilterPattern.cs b/src/Microsoft.OData.Core/AnnotationFilterPattern.cs index 4d9f55c513..e2f3429a64 100644 --- a/src/Microsoft.OData.Core/AnnotationFilterPattern.cs +++ b/src/Microsoft.OData.Core/AnnotationFilterPattern.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; using System; using System.Diagnostics; @@ -243,7 +244,7 @@ private static void ValidatePattern(string pattern) if (segmentCount == 1) { - throw new ArgumentException(Strings.AnnotationFilterPattern_InvalidPatternMissingDot(pattern)); + throw new ArgumentException(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternMissingDot, pattern)); } for (int idx = 0; idx < segmentCount; idx++) @@ -251,18 +252,18 @@ private static void ValidatePattern(string pattern) string currentSegment = segments[idx]; if (string.IsNullOrEmpty(currentSegment)) { - throw new ArgumentException(Strings.AnnotationFilterPattern_InvalidPatternEmptySegment(pattern)); + throw new ArgumentException(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternEmptySegment, pattern)); } if (currentSegment != WildCard && currentSegment.Contains(WildCard, StringComparison.Ordinal)) { - throw new ArgumentException(Strings.AnnotationFilterPattern_InvalidPatternWildCardInSegment(pattern)); + throw new ArgumentException(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternWildCardInSegment, pattern)); } bool isLastSegment = idx + 1 == segmentCount; if (currentSegment == WildCard && !isLastSegment) { - throw new ArgumentException(Strings.AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment(pattern)); + throw new ArgumentException(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment, pattern)); } } } diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchOperationHeaders.cs b/src/Microsoft.OData.Core/Batch/ODataBatchOperationHeaders.cs index af3cd2d691..85c9f7df1a 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchOperationHeaders.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchOperationHeaders.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections; @@ -43,7 +44,7 @@ public string this[string key] return value; } - throw new KeyNotFoundException(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(key)); + throw new KeyNotFoundException(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, key)); } set diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchOperationMessage.cs b/src/Microsoft.OData.Core/Batch/ODataBatchOperationMessage.cs index a294029703..39661b2863 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchOperationMessage.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchOperationMessage.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -211,7 +212,7 @@ internal void VerifyNotCompleted() { if (this.contentStreamCreatorFunc == null) { - throw new ODataException(Strings.ODataBatchOperationMessage_VerifyNotCompleted); + throw new ODataException(SRResources.ODataBatchOperationMessage_VerifyNotCompleted); } } } diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchReader.cs b/src/Microsoft.OData.Core/Batch/ODataBatchReader.cs index 1e2e72180d..8beb400850 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchReader.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchReader.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; @@ -454,7 +455,7 @@ private void IncreaseBatchSize() { if (this.currentBatchSize == this.inputContext.MessageReaderSettings.MessageQuotas.MaxPartsPerBatch) { - throw new ODataException(Strings.ODataBatchReader_MaxBatchSizeExceeded(this.inputContext.MessageReaderSettings.MessageQuotas.MaxPartsPerBatch)); + throw new ODataException(Error.Format(SRResources.ODataBatchReader_MaxBatchSizeExceeded, this.inputContext.MessageReaderSettings.MessageQuotas.MaxPartsPerBatch)); } this.currentBatchSize++; @@ -467,7 +468,7 @@ private void IncreaseChangesetSize() { if (this.currentChangeSetSize == this.inputContext.MessageReaderSettings.MessageQuotas.MaxOperationsPerChangeset) { - throw new ODataException(Strings.ODataBatchReader_MaxChangeSetSizeExceeded(this.inputContext.MessageReaderSettings.MessageQuotas.MaxOperationsPerChangeset)); + throw new ODataException(Error.Format(SRResources.ODataBatchReader_MaxChangeSetSizeExceeded, this.inputContext.MessageReaderSettings.MessageQuotas.MaxOperationsPerChangeset)); } this.currentChangeSetSize++; @@ -525,7 +526,7 @@ private bool ReadImplementation() if (this.ReaderOperationState == OperationState.None) { // No message was created; fail - throw new ODataException(Strings.ODataBatchReader_NoMessageWasCreatedForOperation); + throw new ODataException(SRResources.ODataBatchReader_NoMessageWasCreatedForOperation); } // Reset the operation state; the operation state only @@ -540,7 +541,7 @@ private bool ReadImplementation() if (this.PayloadUriConverter.ContainsContentId(this.contentIdToAddOnNextRead)) { throw new ODataException( - Strings.ODataBatchReader_DuplicateContentIDsNotAllowed(this.contentIdToAddOnNextRead)); + Error.Format(SRResources.ODataBatchReader_DuplicateContentIDsNotAllowed, this.contentIdToAddOnNextRead)); } this.PayloadUriConverter.AddContentId(this.contentIdToAddOnNextRead); @@ -570,7 +571,7 @@ private bool ReadImplementation() // changeset (or the end boundary of the changeset). if (this.isInChangeset) { - ThrowODataException(Strings.ODataBatchReaderStream_NestedChangesetsAreNotSupported); + ThrowODataException(SRResources.ODataBatchReaderStream_NestedChangesetsAreNotSupported); } // Increment the batch size at the start of the changeset since we haven't counted it yet @@ -597,11 +598,11 @@ private bool ReadImplementation() case ODataBatchReaderState.Exception: // fall through case ODataBatchReaderState.Completed: Debug.Assert(false, "Should have checked in VerifyCanRead that we are not in one of these states."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReader_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReader_ReadImplementation)); default: Debug.Assert(false, "Unsupported reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReader_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReader_ReadImplementation)); } return this.State != ODataBatchReaderState.Completed && this.State != ODataBatchReaderState.Exception; @@ -636,7 +637,7 @@ private async Task ReadImplementationAsync() if (this.ReaderOperationState == OperationState.None) { // No message was created; fail - throw new ODataException(Strings.ODataBatchReader_NoMessageWasCreatedForOperation); + throw new ODataException(SRResources.ODataBatchReader_NoMessageWasCreatedForOperation); } // Reset the operation state; the operation state only @@ -651,7 +652,7 @@ private async Task ReadImplementationAsync() if (this.PayloadUriConverter.ContainsContentId(this.contentIdToAddOnNextRead)) { throw new ODataException( - Strings.ODataBatchReader_DuplicateContentIDsNotAllowed(this.contentIdToAddOnNextRead)); + Error.Format(SRResources.ODataBatchReader_DuplicateContentIDsNotAllowed, this.contentIdToAddOnNextRead)); } this.PayloadUriConverter.AddContentId(this.contentIdToAddOnNextRead); @@ -682,7 +683,7 @@ private async Task ReadImplementationAsync() // changeset (or the end boundary of the changeset). if (this.isInChangeset) { - ThrowODataException(Strings.ODataBatchReaderStream_NestedChangesetsAreNotSupported); + ThrowODataException(SRResources.ODataBatchReaderStream_NestedChangesetsAreNotSupported); } // Increment the batch size at the start of the changeset since we haven't counted it yet @@ -711,11 +712,11 @@ private async Task ReadImplementationAsync() case ODataBatchReaderState.Exception: // fall through case ODataBatchReaderState.Completed: Debug.Assert(false, "Should have checked in VerifyCanRead that we are not in one of these states."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReader_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReader_ReadImplementation)); default: Debug.Assert(false, "Unsupported reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReader_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReader_ReadImplementation)); } return this.State != ODataBatchReaderState.Completed && this.State != ODataBatchReaderState.Exception; @@ -732,17 +733,17 @@ private void VerifyCanCreateOperationRequestMessage(bool synchronousCall) if (this.inputContext.ReadingResponse) { - this.ThrowODataException(Strings.ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse); + this.ThrowODataException(SRResources.ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse); } if (this.State != ODataBatchReaderState.Operation) { - this.ThrowODataException(Strings.ODataBatchReader_InvalidStateForCreateOperationRequestMessage(this.State)); + this.ThrowODataException(Error.Format(SRResources.ODataBatchReader_InvalidStateForCreateOperationRequestMessage, this.State)); } if (this.operationState != OperationState.None) { - this.ThrowODataException(Strings.ODataBatchReader_OperationRequestMessageAlreadyCreated); + this.ThrowODataException(SRResources.ODataBatchReader_OperationRequestMessageAlreadyCreated); } } @@ -757,17 +758,17 @@ private void VerifyCanCreateOperationResponseMessage(bool synchronousCall) if (!this.inputContext.ReadingResponse) { - this.ThrowODataException(Strings.ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest); + this.ThrowODataException(SRResources.ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest); } if (this.State != ODataBatchReaderState.Operation) { - this.ThrowODataException(Strings.ODataBatchReader_InvalidStateForCreateOperationResponseMessage(this.State)); + this.ThrowODataException(Error.Format(SRResources.ODataBatchReader_InvalidStateForCreateOperationResponseMessage, this.State)); } if (this.operationState != OperationState.None) { - this.ThrowODataException(Strings.ODataBatchReader_OperationResponseMessageAlreadyCreated); + this.ThrowODataException(SRResources.ODataBatchReader_OperationResponseMessageAlreadyCreated); } } @@ -782,7 +783,7 @@ private void VerifyCanRead(bool synchronousCall) if (this.State == ODataBatchReaderState.Exception || this.State == ODataBatchReaderState.Completed) { - throw new ODataException(Strings.ODataBatchReader_ReadOrReadAsyncCalledInInvalidState(this.State)); + throw new ODataException(Error.Format(SRResources.ODataBatchReader_ReadOrReadAsyncCalledInInvalidState, this.State)); } } @@ -796,7 +797,7 @@ private void VerifyReaderReady() // If the operation stream was requested but not yet disposed, the batch reader can't be used to do anything. if (this.operationState == OperationState.StreamRequested) { - throw new ODataException(Strings.ODataBatchReader_CannotUseReaderWhileOperationStreamActive); + throw new ODataException(SRResources.ODataBatchReader_CannotUseReaderWhileOperationStreamActive); } } @@ -810,14 +811,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.synchronous) { - throw new ODataException(Strings.ODataBatchReader_SyncCallOnAsyncReader); + throw new ODataException(SRResources.ODataBatchReader_SyncCallOnAsyncReader); } } else { if (this.synchronous) { - throw new ODataException(Strings.ODataBatchReader_AsyncCallOnSyncReader); + throw new ODataException(SRResources.ODataBatchReader_AsyncCallOnSyncReader); } } } diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchReaderStreamBuffer.cs b/src/Microsoft.OData.Core/Batch/ODataBatchReaderStreamBuffer.cs index 2eac4fb37d..ea280587d8 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchReaderStreamBuffer.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchReaderStreamBuffer.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -235,7 +236,7 @@ internal ODataBatchReaderStreamScanResult ScanForBoundary( break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); } } @@ -247,7 +248,7 @@ internal ODataBatchReaderStreamScanResult ScanForBoundary( break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); } } } @@ -479,7 +480,7 @@ private ODataBatchReaderStreamScanResult MatchBoundary( // and we still could not find the end of it because there are // so many whitespaces before the terminating line resource set - fail // (security limit on the whitespaces) - throw new ODataException(Strings.ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached(BufferLength)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached, BufferLength)); } // Report a partial match. @@ -501,7 +502,7 @@ private ODataBatchReaderStreamScanResult MatchBoundary( // and we still could not find the end of it because there are // so many whitespaces before the terminating line resource set - fail // (security limit on the whitespaces) - throw new ODataException(Strings.ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached(BufferLength)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached, BufferLength)); } // Report a partial match. @@ -515,7 +516,7 @@ private ODataBatchReaderStreamScanResult MatchBoundary( return ODataBatchReaderStreamScanResult.Match; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStreamBuffer_ScanForBoundary)); } } } diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchUtils.cs b/src/Microsoft.OData.Core/Batch/ODataBatchUtils.cs index ebfa4e7256..1e797249d5 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchUtils.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -59,8 +60,8 @@ internal static Uri CreateOperationRequestUri(Uri uri, Uri baseUri, IODataPayloa if (baseUri == null) { string errorMessage = UriUtils.UriToString(uri).StartsWith("$", StringComparison.Ordinal) - ? Strings.ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified(UriUtils.UriToString(uri)) - : Strings.ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified(UriUtils.UriToString(uri)); + ? Error.Format(SRResources.ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified, UriUtils.UriToString(uri)) + : Error.Format(SRResources.ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified, UriUtils.UriToString(uri)); throw new ODataException(errorMessage); } @@ -94,7 +95,7 @@ internal static ODataReadStream CreateBatchOperationReadStream( int length = Int32.Parse(contentLengthValue, CultureInfo.InvariantCulture); if (length < 0) { - throw new ODataException(Strings.ODataBatchReaderStream_InvalidContentLengthSpecified(contentLengthValue)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_InvalidContentLengthSpecified, contentLengthValue)); } return ODataReadStream.Create(batchReaderStream, operationListener, length, synchronous); @@ -213,7 +214,7 @@ internal static void ValidateReferenceUri(Uri uri, IEnumerable dependsOn // ids, therefore it should contain the request id referenced by the Uri. if (dependsOnRequestIds == null || !dependsOnRequestIds.Contains(referenceId)) { - throw new ODataException(Strings.ODataBatchReader_ReferenceIdNotIncludedInDependsOn( + throw new ODataException(Error.Format(SRResources.ODataBatchReader_ReferenceIdNotIncludedInDependsOn, referenceId, UriUtils.UriToString(uri), dependsOnRequestIds != null ? string.Join(",", dependsOnRequestIds.ToArray()) : "null")); } diff --git a/src/Microsoft.OData.Core/Batch/ODataBatchWriter.cs b/src/Microsoft.OData.Core/Batch/ODataBatchWriter.cs index 8cd6aa0b5a..ac6e205ea4 100644 --- a/src/Microsoft.OData.Core/Batch/ODataBatchWriter.cs +++ b/src/Microsoft.OData.Core/Batch/ODataBatchWriter.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -960,7 +961,7 @@ private void RememberContentIdHeader(string contentId) // want to fail on the duplicate. if (contentId != null && this.payloadUriConverter.ContainsContentId(contentId)) { - throw new ODataException(Strings.ODataBatchWriter_DuplicateContentIDsNotAllowed(contentId)); + throw new ODataException(Error.Format(SRResources.ODataBatchWriter_DuplicateContentIDsNotAllowed, contentId)); } // Set the current content ID. If no Content-ID header is found in the message, @@ -977,7 +978,7 @@ private void IncreaseBatchSize() if (this.currentBatchSize > this.outputContext.MessageWriterSettings.MessageQuotas.MaxPartsPerBatch) { - throw new ODataException(Strings.ODataBatchWriter_MaxBatchSizeExceeded(this.outputContext.MessageWriterSettings.MessageQuotas.MaxPartsPerBatch)); + throw new ODataException(Error.Format(SRResources.ODataBatchWriter_MaxBatchSizeExceeded, this.outputContext.MessageWriterSettings.MessageQuotas.MaxPartsPerBatch)); } } @@ -990,7 +991,7 @@ private void IncreaseChangeSetSize() if (this.currentChangeSetSize > this.outputContext.MessageWriterSettings.MessageQuotas.MaxOperationsPerChangeset) { - throw new ODataException(Strings.ODataBatchWriter_MaxChangeSetSizeExceeded(this.outputContext.MessageWriterSettings.MessageQuotas.MaxOperationsPerChangeset)); + throw new ODataException(Error.Format(SRResources.ODataBatchWriter_MaxChangeSetSizeExceeded, this.outputContext.MessageWriterSettings.MessageQuotas.MaxOperationsPerChangeset)); } } @@ -1012,14 +1013,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataBatchWriter_SyncCallOnAsyncWriter); + throw new ODataException(SRResources.ODataBatchWriter_SyncCallOnAsyncWriter); } } else { if (this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataBatchWriter_AsyncCallOnSyncWriter); + throw new ODataException(SRResources.ODataBatchWriter_AsyncCallOnSyncWriter); } } } @@ -1043,12 +1044,12 @@ private void VerifyCanCreateOperationRequestMessage(bool synchronousCall, string { if (HttpUtils.IsQueryMethod(method)) { - this.ThrowODataException(Strings.ODataBatch_InvalidHttpMethodForChangeSetRequest(method)); + this.ThrowODataException(Error.Format(SRResources.ODataBatch_InvalidHttpMethodForChangeSetRequest, method)); } if (string.IsNullOrEmpty(contentId)) { - this.ThrowODataException(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(ODataConstants.ContentIdHeader)); + this.ThrowODataException(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, ODataConstants.ContentIdHeader)); } } @@ -1058,7 +1059,7 @@ private void VerifyCanCreateOperationRequestMessage(bool synchronousCall, string if (this.outputContext.WritingResponse) { - this.ThrowODataException(Strings.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse); + this.ThrowODataException(SRResources.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse); } } @@ -1072,7 +1073,7 @@ private void VerifyCanFlush(bool synchronousCall) this.VerifyCallAllowed(synchronousCall); if (this.state == BatchWriterState.OperationStreamRequested) { - this.ThrowODataException(Strings.ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState); + this.ThrowODataException(SRResources.ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState); } } @@ -1086,7 +1087,7 @@ private void ValidateWriterReady() // If the operation stream was requested but not yet disposed, the writer can't be used to do anything. if (this.state == BatchWriterState.OperationStreamRequested) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested); } } @@ -1152,7 +1153,7 @@ private void VerifyCanCreateOperationResponseMessage(bool synchronousCall) if (!this.outputContext.WritingResponse) { - this.ThrowODataException(Strings.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest); + this.ThrowODataException(SRResources.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest); } } @@ -1175,7 +1176,7 @@ private void ValidateTransition(BatchWriterState newState) // make sure that we are not starting a changeset when one is already active if (this.isInChangeset) { - throw new ODataException(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); + throw new ODataException(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); } break; @@ -1183,7 +1184,7 @@ private void ValidateTransition(BatchWriterState newState) // make sure that we are not completing a changeset without an active changeset if (!this.isInChangeset) { - throw new ODataException(Strings.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet); + throw new ODataException(SRResources.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet); } break; @@ -1191,7 +1192,7 @@ private void ValidateTransition(BatchWriterState newState) // make sure that we are not completing a batch while a changeset is still active if (this.isInChangeset) { - throw new ODataException(Strings.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet); + throw new ODataException(SRResources.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet); } break; @@ -1202,21 +1203,21 @@ private void ValidateTransition(BatchWriterState newState) case BatchWriterState.Start: if (newState != BatchWriterState.BatchStarted) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromStart); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromStart); } break; case BatchWriterState.BatchStarted: if (newState != BatchWriterState.ChangesetStarted && newState != BatchWriterState.OperationCreated && newState != BatchWriterState.BatchCompleted) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromBatchStarted); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromBatchStarted); } break; case BatchWriterState.ChangesetStarted: if (newState != BatchWriterState.OperationCreated && newState != BatchWriterState.ChangesetCompleted) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetStarted); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetStarted); } break; @@ -1227,7 +1228,7 @@ private void ValidateTransition(BatchWriterState newState) newState != BatchWriterState.ChangesetCompleted && newState != BatchWriterState.BatchCompleted) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromOperationCreated); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromOperationCreated); } Debug.Assert(newState != BatchWriterState.OperationStreamDisposed, "newState != BatchWriterState.OperationStreamDisposed"); @@ -1236,7 +1237,7 @@ private void ValidateTransition(BatchWriterState newState) case BatchWriterState.OperationStreamRequested: if (newState != BatchWriterState.OperationStreamDisposed) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested); } break; @@ -1246,7 +1247,7 @@ private void ValidateTransition(BatchWriterState newState) newState != BatchWriterState.ChangesetCompleted && newState != BatchWriterState.BatchCompleted) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed); } break; @@ -1255,24 +1256,24 @@ private void ValidateTransition(BatchWriterState newState) newState != BatchWriterState.ChangesetStarted && newState != BatchWriterState.OperationCreated) { - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted); } break; case BatchWriterState.BatchCompleted: // no more state transitions should happen once in completed state - throw new ODataException(Strings.ODataBatchWriter_InvalidTransitionFromBatchCompleted); + throw new ODataException(SRResources.ODataBatchWriter_InvalidTransitionFromBatchCompleted); case BatchWriterState.Error: if (newState != BatchWriterState.Error) { // No more state transitions once we are in error state except for the fatal error - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromError(this.state.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromError, this.state.ToString(), newState.ToString())); } break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchWriter_ValidateTransition_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchWriter_ValidateTransition_UnreachableCodePath)); } } } diff --git a/src/Microsoft.OData.Core/Buffers/BufferUtils.cs b/src/Microsoft.OData.Core/Buffers/BufferUtils.cs index 10387bd717..e15bb5412e 100644 --- a/src/Microsoft.OData.Core/Buffers/BufferUtils.cs +++ b/src/Microsoft.OData.Core/Buffers/BufferUtils.cs @@ -4,6 +4,8 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; + namespace Microsoft.OData.Buffers { /// @@ -58,7 +60,7 @@ public static char[] RentFromBuffer(ICharArrayPool bufferPool, int minSize) char[] buffer = bufferPool.Rent(minSize); if (buffer == null || buffer.Length < minSize) { - throw new ODataException(Strings.BufferUtils_InvalidBufferOrSize(minSize)); + throw new ODataException(Error.Format(SRResources.BufferUtils_InvalidBufferOrSize, minSize)); } return buffer; diff --git a/src/Microsoft.OData.Core/CollectionWithoutExpectedTypeValidator.cs b/src/Microsoft.OData.Core/CollectionWithoutExpectedTypeValidator.cs index eb29b2d227..403000f222 100644 --- a/src/Microsoft.OData.Core/CollectionWithoutExpectedTypeValidator.cs +++ b/src/Microsoft.OData.Core/CollectionWithoutExpectedTypeValidator.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { #region Namespaces using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -80,7 +81,7 @@ internal void ValidateCollectionItem(string collectionItemTypeName, EdmTypeKind // Only primitive and complex values are allowed in collections if (collectionItemTypeKind != EdmTypeKind.Primitive && collectionItemTypeKind != EdmTypeKind.Enum && collectionItemTypeKind != EdmTypeKind.Complex) { - throw new ODataException(Strings.CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind(collectionItemTypeKind)); + throw new ODataException(Error.Format(SRResources.CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind, collectionItemTypeKind)); } if (this.itemTypeDerivedFromCollectionValue) @@ -185,7 +186,7 @@ private void ValidateCollectionItemTypeNameAndKind(string collectionItemTypeName // Compare the item type kinds. if (this.itemTypeKind != collectionItemTypeKind) { - throw new ODataException(Strings.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind(collectionItemTypeKind, this.itemTypeKind)); + throw new ODataException(Error.Format(SRResources.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind, collectionItemTypeKind, this.itemTypeKind)); } if (this.itemTypeKind == EdmTypeKind.Primitive) @@ -225,14 +226,14 @@ private void ValidateCollectionItemTypeNameAndKind(string collectionItemTypeName } } - throw new ODataException(Strings.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName(collectionItemTypeName, this.itemTypeName)); + throw new ODataException(Error.Format(SRResources.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName, collectionItemTypeName, this.itemTypeName)); } else { // Since we do not support type inheritance for complex types, comparison of the type names is sufficient if (string.CompareOrdinal(this.itemTypeName, collectionItemTypeName) != 0) { - throw new ODataException(Strings.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName(collectionItemTypeName, this.itemTypeName)); + throw new ODataException(Error.Format(SRResources.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName, collectionItemTypeName, this.itemTypeName)); } } } diff --git a/src/Microsoft.OData.Core/DerivedTypeValidator.cs b/src/Microsoft.OData.Core/DerivedTypeValidator.cs index cb3fd6b483..385b99712c 100644 --- a/src/Microsoft.OData.Core/DerivedTypeValidator.cs +++ b/src/Microsoft.OData.Core/DerivedTypeValidator.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { using System.Collections.Generic; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Edm; /// @@ -70,7 +71,7 @@ internal void ValidateResourceType(string resourceTypeName) return; } - throw new ODataException(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(resourceTypeName, resourceKind, resourceName)); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, resourceTypeName, resourceKind, resourceName)); } } } diff --git a/src/Microsoft.OData.Core/DuplicatePropertyNameChecker.cs b/src/Microsoft.OData.Core/DuplicatePropertyNameChecker.cs index d4bfb7bd2f..f4b05dcd94 100644 --- a/src/Microsoft.OData.Core/DuplicatePropertyNameChecker.cs +++ b/src/Microsoft.OData.Core/DuplicatePropertyNameChecker.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Collections.Generic; @@ -57,8 +58,7 @@ public void ValidatePropertyUniqueness(ODataPropertyInfo property) catch (ArgumentException) { throw new ODataException( - Strings.DuplicatePropertyNamesNotAllowed( - property.Name)); + Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, property.Name)); } } @@ -78,8 +78,7 @@ public void ValidatePropertyUniqueness(ODataNestedResourceInfo property) if (state != State.AssociationLink) { throw new ODataException( - Strings.DuplicatePropertyNamesNotAllowed( - property.Name)); + Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, property.Name)); } else { @@ -105,8 +104,7 @@ public void ValidatePropertyOpenForAssociationLink(string propertyName) if (state != State.NestedResource) { throw new ODataException( - Strings.DuplicatePropertyNamesNotAllowed( - propertyName)); + Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, propertyName)); } else { diff --git a/src/Microsoft.OData.Core/ErrorUtils.cs b/src/Microsoft.OData.Core/ErrorUtils.cs index b330c13d4d..b939adf7c0 100644 --- a/src/Microsoft.OData.Core/ErrorUtils.cs +++ b/src/Microsoft.OData.Core/ErrorUtils.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Xml; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Microsoft.OData.Metadata; @@ -119,7 +120,7 @@ private static void WriteXmlInnerError( if (recursionDepth > maxInnerErrorDepth) { #if ODATA_CORE - throw new ODataException(Strings.ValidationUtils_RecursionDepthLimitReached(maxInnerErrorDepth)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_RecursionDepthLimitReached, maxInnerErrorDepth)); #else throw new ODataException(Microsoft.OData.Service.Strings.BadRequest_DeepRecursion(maxInnerErrorDepth)); #endif diff --git a/src/Microsoft.OData.Core/Evaluation/EdmValueUtils.cs b/src/Microsoft.OData.Core/Evaluation/EdmValueUtils.cs index c09092ae97..972f481901 100644 --- a/src/Microsoft.OData.Core/Evaluation/EdmValueUtils.cs +++ b/src/Microsoft.OData.Core/Evaluation/EdmValueUtils.cs @@ -9,13 +9,9 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.Spatial; +using Microsoft.OData.Core; #if ODATA_CLIENT using Microsoft.OData; - using ErrorStrings = Microsoft.OData.Client.Strings; - using PlatformHelpers = Microsoft.OData.Client.PlatformHelper; -#else -using ErrorStrings = Microsoft.OData.Strings; -using PlatformHelpers = Microsoft.OData.PlatformHelper; #endif #if ODATA_CLIENT @@ -153,7 +149,7 @@ internal static object ToClrValue(this IEdmPrimitiveValue edmValue) return ((IEdmEnumValue)edmValue).Value.Value; } - throw new ODataException(ErrorStrings.EdmValueUtils_CannotConvertTypeToClrValue(edmValue.ValueKind)); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_CannotConvertTypeToClrValue, edmValue.ValueKind)); } #if !ODATA_CLIENT @@ -196,7 +192,7 @@ internal static object GetPrimitivePropertyClrValue(this IEdmStructuredValue str IEdmPropertyValue propertyValue = structuredValue.FindPropertyValue(propertyName); if (propertyValue == null) { - throw new ODataException(ErrorStrings.EdmValueUtils_PropertyDoesntExist(valueType.FullName(), propertyName)); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, valueType.FullName(), propertyName)); } if (propertyValue.Value.ValueKind == EdmValueKind.Null) @@ -207,7 +203,7 @@ internal static object GetPrimitivePropertyClrValue(this IEdmStructuredValue str IEdmPrimitiveValue primitiveValue = propertyValue.Value as IEdmPrimitiveValue; if (primitiveValue == null) { - throw new ODataException(ErrorStrings.EdmValueUtils_NonPrimitiveValue(propertyValue.Name, valueType.FullName())); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_NonPrimitiveValue, propertyValue.Name, valueType.FullName())); } return primitiveValue.ToClrValue(); @@ -336,7 +332,7 @@ private static IEdmDelayedValue ConvertPrimitiveValueWithoutTypeCode(object prim } #endif - throw new ODataException(ErrorStrings.EdmValueUtils_UnsupportedPrimitiveType(primitiveValue.GetType().FullName)); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_UnsupportedPrimitiveType, primitiveValue.GetType().FullName)); } #if ODATA_CLIENT @@ -397,10 +393,10 @@ private static IEdmPrimitiveTypeReference EnsurePrimitiveType(IEdmPrimitiveTypeR string typeName = type.FullName(); if (typeName == null) { - throw new ODataException(ErrorStrings.EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName(primitiveKindFromType.ToString(), primitiveKindFromValue.ToString())); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName, primitiveKindFromType.ToString(), primitiveKindFromValue.ToString())); } - throw new ODataException(ErrorStrings.EdmValueUtils_IncorrectPrimitiveTypeKind(typeName, primitiveKindFromValue.ToString(), primitiveKindFromType.ToString())); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_IncorrectPrimitiveTypeKind, typeName, primitiveKindFromValue.ToString(), primitiveKindFromType.ToString())); } } diff --git a/src/Microsoft.OData.Core/Evaluation/LiteralFormatter.cs b/src/Microsoft.OData.Core/Evaluation/LiteralFormatter.cs index 1760944cc8..3028730544 100644 --- a/src/Microsoft.OData.Core/Evaluation/LiteralFormatter.cs +++ b/src/Microsoft.OData.Core/Evaluation/LiteralFormatter.cs @@ -307,10 +307,10 @@ internal static InvalidOperationException CreateExceptionForUnconvertableType(ob return new InvalidOperationException(Microsoft.OData.Service.Strings.Serializer_CannotConvertValue(value)); #endif #if ODATA_CLIENT - return Error.InvalidOperation(Client.Strings.Context_CannotConvertKey(value)); + return Error.InvalidOperation(Error.Format(SRResources.Context_CannotConvertKey, value)); #endif #if ODATA_CORE - return new ODataException(Strings.ODataUriUtils_ConvertToUriLiteralUnsupportedType(value.GetType().ToString())); + return new ODataException(Core.Error.Format(Core.SRResources.ODataUriUtils_ConvertToUriLiteralUnsupportedType, value.GetType().ToString())); #endif } diff --git a/src/Microsoft.OData.Core/Evaluation/ODataConventionalIdMetadataBuilder.cs b/src/Microsoft.OData.Core/Evaluation/ODataConventionalIdMetadataBuilder.cs index f4926dc193..633f75f72c 100644 --- a/src/Microsoft.OData.Core/Evaluation/ODataConventionalIdMetadataBuilder.cs +++ b/src/Microsoft.OData.Core/Evaluation/ODataConventionalIdMetadataBuilder.cs @@ -14,6 +14,7 @@ namespace Microsoft.OData.Evaluation using Microsoft.OData.Metadata; using Microsoft.OData.UriParser; using Microsoft.OData.Edm; + using Microsoft.OData.Core; #endregion /// @@ -181,7 +182,7 @@ private Uri ComputeIdForContainment() if (odataPath == null || odataPath.Count == 0) { - throw new ODataException(Strings.ODataMetadataBuilder_MissingParentIdOrContextUrl); + throw new ODataException(SRResources.ODataMetadataBuilder_MissingParentIdOrContextUrl); } uri = this.GetContainingEntitySetUri(uri, odataPath); diff --git a/src/Microsoft.OData.Core/Evaluation/ODataConventionalUriBuilder.cs b/src/Microsoft.OData.Core/Evaluation/ODataConventionalUriBuilder.cs index 4a8138ce04..0ca3dfddc0 100644 --- a/src/Microsoft.OData.Core/Evaluation/ODataConventionalUriBuilder.cs +++ b/src/Microsoft.OData.Core/Evaluation/ODataConventionalUriBuilder.cs @@ -9,6 +9,7 @@ using System.Diagnostics; using System.Linq; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Json; namespace Microsoft.OData.Evaluation @@ -257,7 +258,7 @@ private static object ValidateKeyValue(string keyPropertyName, object keyPropert { if (keyPropertyValue == null) { - throw new ODataException(Strings.ODataConventionalUriBuilder_NullKeyValue(keyPropertyName, entityTypeName)); + throw new ODataException(Error.Format(SRResources.ODataConventionalUriBuilder_NullKeyValue, keyPropertyName, entityTypeName)); } return keyPropertyValue; @@ -276,7 +277,7 @@ private void AppendKeyExpression(StringBuilder builder, ICollection p.Key, p => ValidateKeyValue(p.Key, p.Value, entityTypeName)); diff --git a/src/Microsoft.OData.Core/Evaluation/ODataMetadataContext.cs b/src/Microsoft.OData.Core/Evaluation/ODataMetadataContext.cs index 796fe03b69..e283e643a6 100644 --- a/src/Microsoft.OData.Core/Evaluation/ODataMetadataContext.cs +++ b/src/Microsoft.OData.Core/Evaluation/ODataMetadataContext.cs @@ -9,6 +9,7 @@ namespace Microsoft.OData.Evaluation using System; using System.Collections.Generic; using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.OData.Metadata; @@ -204,7 +205,7 @@ public Uri MetadataDocumentUri { if (this.metadataDocumentUri == null) { - throw new ODataException(Strings.ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload(ODataAnnotationNames.ODataContext)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload, ODataAnnotationNames.ODataContext)); } Debug.Assert(this.metadataDocumentUri.IsAbsoluteUri, "this.metadataDocumentUri.IsAbsoluteUri"); diff --git a/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataBuilder.cs b/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataBuilder.cs index d30727a2b6..303036ebc3 100644 --- a/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataBuilder.cs +++ b/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataBuilder.cs @@ -16,6 +16,7 @@ namespace Microsoft.OData.Evaluation using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.OData.Json; + using Microsoft.OData.Core; #endregion /// @@ -144,13 +145,13 @@ internal virtual IEnumerable GetProperties(IEnumerable t is ODataResourceValue)) { - throw new ODataException(Strings.ODataResource_PropertyValueCannotBeODataResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataResource_PropertyValueCannotBeODataResourceValue, property.Name)); } return true; diff --git a/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataContext.cs b/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataContext.cs index 6c910152c8..823d652bab 100644 --- a/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataContext.cs +++ b/src/Microsoft.OData.Core/Evaluation/ODataResourceMetadataContext.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData.Evaluation using System.Diagnostics; using System.Linq; using Microsoft.OData; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Edm.Vocabularies.V1; @@ -248,7 +249,7 @@ private static bool TryGetPrimitiveOrEnumPropertyValue(ODataResourceBase resourc { if (isRequired) { - throw new ODataException(Strings.EdmValueUtils_PropertyDoesntExist(GetResourceTypeName(resource, entityType), propertyName)); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, GetResourceTypeName(resource, entityType), propertyName)); } else { @@ -274,7 +275,7 @@ private static object GetPrimitiveOrEnumPropertyValue(ODataResourceBase resource object propertyValue = (propertyInfo as ODataProperty)?.Value; if (propertyValue == null && validateNotNull) { - throw new ODataException(Strings.ODataResourceMetadataContext_NullKeyValue(propertyInfo.Name, GetResourceTypeName(resource, entityType))); + throw new ODataException(Error.Format(SRResources.ODataResourceMetadataContext_NullKeyValue, propertyInfo.Name, GetResourceTypeName(resource, entityType))); } if (propertyValue is ODataValue && !(propertyValue is ODataEnumValue)) @@ -284,7 +285,7 @@ private static object GetPrimitiveOrEnumPropertyValue(ODataResourceBase resource return propertyValue; } - throw new ODataException(Strings.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues(propertyInfo.Name, GetResourceTypeName(resource, entityType))); + throw new ODataException(Error.Format(SRResources.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues, propertyInfo.Name, GetResourceTypeName(resource, entityType))); } return propertyValue; @@ -304,7 +305,7 @@ private static bool ValidateEntityTypeHasKeyProperties(IList ComputeETagPropertiesFromAnnotation( IEdmStructuralProperty property = this.actualResourceType.StructuralProperties().FirstOrDefault(p => p.Name == pathExpression.PathSegments.LastOrDefault()); if (property == null) { - throw new ODataException(Strings.EdmValueUtils_PropertyDoesntExist(this.ActualResourceTypeName, pathExpression.PathSegments.LastOrDefault())); + throw new ODataException(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, this.ActualResourceTypeName, pathExpression.PathSegments.LastOrDefault())); } yield return property; diff --git a/src/Microsoft.OData.Core/ExceptionUtils.cs b/src/Microsoft.OData.Core/ExceptionUtils.cs index 4f5c2283f0..58ec0a878b 100644 --- a/src/Microsoft.OData.Core/ExceptionUtils.cs +++ b/src/Microsoft.OData.Core/ExceptionUtils.cs @@ -7,6 +7,7 @@ #if ODATA_CLIENT namespace Microsoft.OData.Client.ALinq.UriParser #else +using Microsoft.OData.Core; namespace Microsoft.OData #endif { @@ -80,7 +81,7 @@ internal static void CheckArgumentStringNotEmpty(string value, string parameterN if (value != null && value.Length == 0) { #if !ODATA_CLIENT - throw new ArgumentException(Strings.ExceptionUtils_ArgumentStringEmpty, parameterName); + throw new ArgumentException(SRResources.ExceptionUtils_ArgumentStringEmpty, parameterName); #endif } } @@ -98,7 +99,7 @@ internal static void CheckArgumentStringNotNullOrEmpty([ValidatedNotNull] string if (string.IsNullOrEmpty(value)) { #if !ODATA_CLIENT - throw new ArgumentNullException(parameterName, Strings.ExceptionUtils_ArgumentStringNullOrEmpty); + throw new ArgumentNullException(parameterName, SRResources.ExceptionUtils_ArgumentStringNullOrEmpty); #endif } } @@ -116,7 +117,7 @@ internal static void CheckIntegerNotNegative(int value, string parameterName) if (value < 0) { #if !ODATA_CLIENT - throw new ArgumentOutOfRangeException(parameterName, Strings.ExceptionUtils_CheckIntegerNotNegative(value)); + throw new ArgumentOutOfRangeException(parameterName, Error.Format(SRResources.ExceptionUtils_CheckIntegerNotNegative, value)); #endif } } @@ -134,7 +135,7 @@ internal static void CheckIntegerPositive(int value, string parameterName) if (value <= 0) { #if !ODATA_CLIENT - throw new ArgumentOutOfRangeException(parameterName, Strings.ExceptionUtils_CheckIntegerPositive(value)); + throw new ArgumentOutOfRangeException(parameterName, Error.Format(SRResources.ExceptionUtils_CheckIntegerPositive, value)); #endif } } @@ -152,7 +153,7 @@ internal static void CheckLongPositive(long value, string parameterName) if (value <= 0) { #if !ODATA_CLIENT - throw new ArgumentOutOfRangeException(parameterName, Strings.ExceptionUtils_CheckLongPositive(value)); + throw new ArgumentOutOfRangeException(parameterName, Error.Format(SRResources.ExceptionUtils_CheckLongPositive, value)); #endif } } @@ -178,7 +179,7 @@ internal static void CheckArgumentCollectionNotNullOrEmpty(ICollection val { #if !ODATA_CLIENT // TODO: STRINGS The string is fine; just rename it to just ArgumentEmpty - throw new ArgumentException(Strings.ExceptionUtils_ArgumentStringEmpty, parameterName); + throw new ArgumentException(SRResources.ExceptionUtils_ArgumentStringEmpty, parameterName); #endif } } diff --git a/src/Microsoft.OData.Core/HttpHeaderValueLexer.cs b/src/Microsoft.OData.Core/HttpHeaderValueLexer.cs index 8baeb59eee..e9510d52f7 100644 --- a/src/Microsoft.OData.Core/HttpHeaderValueLexer.cs +++ b/src/Microsoft.OData.Core/HttpHeaderValueLexer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Diagnostics; @@ -278,7 +279,7 @@ private HttpHeaderValueLexer ReadNextTokenOrQuotedString() // Instead of testing whether result is null or empty, we check to see if the index have moved forward because we can encounter the empty quoted string "". if (index == this.startIndexOfNextItem) { - throw new ODataException(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem)); + throw new ODataException(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem)); } if (isQuotedString) @@ -299,7 +300,7 @@ private HttpHeaderToken ReadNextToken() HttpHeaderValueLexer item = this.ReadNextTokenOrQuotedString(); if (item.Type == HttpHeaderValueItemType.QuotedString) { - throw new ODataException(Strings.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem)); + throw new ODataException(Error.Format(SRResources.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString, this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem)); } return (HttpHeaderToken)item; @@ -316,7 +317,7 @@ private HttpHeaderSeparator ReadNextSeparator() ReadOnlySpan span = separator.Span; if (!span.Equals(ElementSeparator, StringComparison.Ordinal) && !span.Equals(ParameterSeparator, StringComparison.Ordinal) && !span.Equals(ValueSeparator, StringComparison.Ordinal)) { - throw new ODataException(Strings.HttpHeaderValueLexer_UnrecognizedSeparator(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, separator)); + throw new ODataException(Error.Format(SRResources.HttpHeaderValueLexer_UnrecognizedSeparator, this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, separator)); } return new HttpHeaderSeparator(this.httpHeaderName, this.httpHeaderValue, separator, this.startIndexOfNextItem + 1); @@ -466,7 +467,7 @@ internal override HttpHeaderValueLexer ReadNext() return separator; } - throw new ODataException(Strings.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, separator.Value)); + throw new ODataException(Error.Format(SRResources.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString, this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, separator.Value)); } } @@ -534,7 +535,7 @@ internal override HttpHeaderValueLexer ReadNext() { if (this.EndOfHeaderValue()) { - throw new ODataException(Strings.HttpHeaderValueLexer_EndOfFileAfterSeparator(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, this.originalText)); + throw new ODataException(Error.Format(SRResources.HttpHeaderValueLexer_EndOfFileAfterSeparator, this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, this.originalText)); } // Token or quoted-string can come after '='. i.e. token ['=' (token | quoted-string)] diff --git a/src/Microsoft.OData.Core/HttpUtils.cs b/src/Microsoft.OData.Core/HttpUtils.cs index 3d9e0b097c..be6bc3dbff 100644 --- a/src/Microsoft.OData.Core/HttpUtils.cs +++ b/src/Microsoft.OData.Core/HttpUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -29,13 +30,13 @@ internal static IList> ReadMimeType(string contentT { if (String.IsNullOrEmpty(contentType)) { - throw new ODataContentTypeException(Strings.HttpUtils_ContentTypeMissing); + throw new ODataContentTypeException(SRResources.HttpUtils_ContentTypeMissing); } IList> mediaTypes = ReadMediaTypes(contentType); if (mediaTypes.Count != 1) { - throw new ODataContentTypeException(Strings.HttpUtils_NoOrMoreThanOneContentTypeSpecified(contentType)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_NoOrMoreThanOneContentTypeSpecified, contentType)); } ODataMediaType mediaType = mediaTypes[0].Key; @@ -207,7 +208,7 @@ internal static void ReadQualityValue(string text, ref int textIndex, out int qu qualityValue = 1; break; default: - throw new ODataContentTypeException(Strings.HttpUtils_InvalidQualityValueStartChar(text, digit)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_InvalidQualityValueStartChar, text, digit)); } if (textIndex < text.Length && text[textIndex] == '.') @@ -236,7 +237,7 @@ internal static void ReadQualityValue(string text, ref int textIndex, out int qu if (qualityValue > 1000) { // Too high of a value in qvalue. - throw new ODataContentTypeException(Strings.HttpUtils_InvalidQualityValue(qualityValue / 1000, text)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_InvalidQualityValue, qualityValue / 1000, text)); } } else @@ -259,7 +260,7 @@ internal static void ValidateHttpMethod(string httpMethodString) && string.CompareOrdinal(httpMethodString, ODataConstants.MethodPost) != 0 && string.CompareOrdinal(httpMethodString, ODataConstants.MethodPut) != 0) { - throw new ODataException(Strings.HttpUtils_InvalidHttpMethodString(httpMethodString)); + throw new ODataException(Error.Format(SRResources.HttpUtils_InvalidHttpMethodString, httpMethodString)); } } @@ -468,7 +469,7 @@ internal static ReadOnlyMemory ReadTokenOrQuotedStringValue(string headerN if (textIndex >= headerText.Length) { - throw createException(Strings.HttpUtils_EscapeCharAtEnd(headerName, headerText, textIndex, currentChar)); + throw createException(Error.Format(SRResources.HttpUtils_EscapeCharAtEnd, headerName, headerText, textIndex, currentChar)); } currentChar = headerText[textIndex]; // only save the char after '\'? not unescape it? or it's never used? @@ -477,7 +478,7 @@ internal static ReadOnlyMemory ReadTokenOrQuotedStringValue(string headerN { if (!IsValidInQuotedHeaderValue(currentChar)) { - throw createException(Strings.HttpUtils_InvalidCharacterInQuotedParameterValue(headerName, headerText, textIndex, currentChar)); + throw createException(Error.Format(SRResources.HttpUtils_InvalidCharacterInQuotedParameterValue, headerName, headerText, textIndex, currentChar)); } } @@ -491,7 +492,7 @@ internal static ReadOnlyMemory ReadTokenOrQuotedStringValue(string headerN if (currentChar != '\"') { - throw createException(Strings.HttpUtils_ClosingQuoteNotFound(headerName, headerText, textIndex)); + throw createException(Error.Format(SRResources.HttpUtils_ClosingQuoteNotFound, headerName, headerText, textIndex)); } if (parameterValue != null) @@ -521,7 +522,7 @@ private static ReadOnlyMemory ReadTokenValue(string headerName, string hea currentChar = headerText[textIndex]; if (currentChar == '\\' || currentChar == '\"') { - throw createException(Strings.HttpUtils_EscapeCharWithoutQuotes(headerName, headerText, textIndex, currentChar)); + throw createException(Error.Format(SRResources.HttpUtils_EscapeCharWithoutQuotes, headerName, headerText, textIndex, currentChar)); } else if (!IsHttpToken(currentChar)) { @@ -592,7 +593,7 @@ private static IEnumerable AcceptCharsetParts(string headerValue) if (commaRequired) { // Comma missing between charset elements. - throw new ODataContentTypeException(Strings.HttpUtils_MissingSeparatorBetweenCharsets(headerValue)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MissingSeparatorBetweenCharsets, headerValue)); } headerStart = headerIndex; @@ -602,7 +603,7 @@ private static IEnumerable AcceptCharsetParts(string headerValue) if (headerNameEnd == headerIndex) { // Invalid (empty) charset name. - throw new ODataContentTypeException(Strings.HttpUtils_InvalidCharsetName(headerValue)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_InvalidCharsetName, headerValue)); } if (endReached) @@ -620,7 +621,7 @@ private static IEnumerable AcceptCharsetParts(string headerValue) if (ReadLiteral(headerValue, headerNameEnd, ";q=")) { // Unexpected end of qvalue. - throw new ODataContentTypeException(Strings.HttpUtils_UnexpectedEndOfQValue(headerValue)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_UnexpectedEndOfQValue, headerValue)); } headerEnd = headerNameEnd + 3; @@ -635,7 +636,7 @@ private static IEnumerable AcceptCharsetParts(string headerValue) else { // Invalid separator character. - throw new ODataContentTypeException(Strings.HttpUtils_InvalidSeparatorBetweenCharsets(headerValue)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_InvalidSeparatorBetweenCharsets, headerValue)); } } @@ -676,7 +677,7 @@ private static IList> ReadMediaTypes(string if (text[textIndex] != ';') { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeRequiresSemicolonBeforeParameter(text)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeRequiresSemicolonBeforeParameter, text)); } textIndex++; @@ -713,17 +714,17 @@ private static void ReadMediaTypeParameter(string text, ref int textIndex, ref L if (parameterName.Length == 0) { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeMissingParameterName); + throw new ODataContentTypeException(SRResources.HttpUtils_MediaTypeMissingParameterName); } if (eof) { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeMissingParameterValue(parameterName)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeMissingParameterValue, parameterName)); } if (text[textIndex] != '=') { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeMissingParameterValue(parameterName)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeMissingParameterValue, parameterName)); } textIndex++; @@ -758,12 +759,12 @@ private static void ReadMediaTypeAndSubtype(string mediaTypeName, ref int textIn int textStart = textIndex; if (ReadToken(mediaTypeName, ref textIndex)) { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeUnspecified(mediaTypeName)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeUnspecified, mediaTypeName)); } if (mediaTypeName[textIndex] != '/') { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeRequiresSlash(mediaTypeName)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeRequiresSlash, mediaTypeName)); } type = mediaTypeName.Substring(textStart, textIndex - textStart); @@ -774,7 +775,7 @@ private static void ReadMediaTypeAndSubtype(string mediaTypeName, ref int textIn if (textIndex == subTypeStart) { - throw new ODataContentTypeException(Strings.HttpUtils_MediaTypeRequiresSubType(mediaTypeName)); + throw new ODataContentTypeException(Error.Format(SRResources.HttpUtils_MediaTypeRequiresSubType, mediaTypeName)); } subType = mediaTypeName.Substring(subTypeStart, textIndex - subTypeStart); @@ -866,7 +867,7 @@ private static int DigitToInt32(char c) return -1; } - throw new ODataException(Strings.HttpUtils_CannotConvertCharToInt(c)); + throw new ODataException(Error.Format(SRResources.HttpUtils_CannotConvertCharToInt, c)); } /// @@ -893,7 +894,7 @@ private static bool ReadLiteral(string text, int textIndex, string literal) if (String.Compare(text, textIndex, literal, 0, literal.Length, StringComparison.Ordinal) != 0) { // Failed to find expected literal. - throw new ODataException(Strings.HttpUtils_ExpectedLiteralNotFoundInString(literal, textIndex, text)); + throw new ODataException(Error.Format(SRResources.HttpUtils_ExpectedLiteralNotFoundInString, literal, textIndex, text)); } return textIndex + literal.Length == text.Length; diff --git a/src/Microsoft.OData.Core/Json/JsonFullMetadataLevel.cs b/src/Microsoft.OData.Core/Json/JsonFullMetadataLevel.cs index bf16fc104b..ca730873ea 100644 --- a/src/Microsoft.OData.Core/Json/JsonFullMetadataLevel.cs +++ b/src/Microsoft.OData.Core/Json/JsonFullMetadataLevel.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData.Json using System; using System.Collections.Generic; using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; @@ -56,7 +57,7 @@ private Uri NonNullMetadataDocumentUri { if (this.metadataDocumentUri == null) { - throw new ODataException(Strings.ODataOutputContext_MetadataDocumentUriMissing); + throw new ODataException(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } return this.metadataDocumentUri; diff --git a/src/Microsoft.OData.Core/Json/JsonInstanceAnnotationWriter.cs b/src/Microsoft.OData.Core/Json/JsonInstanceAnnotationWriter.cs index 44661357bf..7a147cec92 100644 --- a/src/Microsoft.OData.Core/Json/JsonInstanceAnnotationWriter.cs +++ b/src/Microsoft.OData.Core/Json/JsonInstanceAnnotationWriter.cs @@ -12,9 +12,9 @@ namespace Microsoft.OData using System.Diagnostics; using System.Threading.Tasks; using Microsoft.OData.Edm; + using Microsoft.OData.Core; using Microsoft.OData.Json; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; #endregion /// @@ -171,7 +171,7 @@ internal void WriteInstanceAnnotation( if (expectedType != null && !expectedType.IsNullable) { throw new ODataException( - ODataErrorStrings.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation( + Error.Format(SRResources.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation, instanceAnnotation.Name, expectedType.FullName())); } @@ -384,7 +384,7 @@ internal async Task WriteInstanceAnnotationAsync( if (expectedType != null && !expectedType.IsNullable) { throw new ODataException( - ODataErrorStrings.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation( + Error.Format(SRResources.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation, annotationName, expectedType.FullName())); } @@ -495,7 +495,7 @@ private void WriteAndTrackInstanceAnnotation( if (!instanceAnnotationNames.Add(annotation.Name)) { - throw new ODataException(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection(annotation.Name)); + throw new ODataException(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, annotation.Name)); } if (!tracker.IsAnnotationWritten(annotation.Name) @@ -550,7 +550,7 @@ private async Task WriteAndTrackInstanceAnnotationAsync( { if (!instanceAnnotationNames.Add(annotation.Name)) { - throw new ODataException(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection(annotation.Name)); + throw new ODataException(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, annotation.Name)); } if (!tracker.IsAnnotationWritten(annotation.Name) diff --git a/src/Microsoft.OData.Core/Json/JsonReader.cs b/src/Microsoft.OData.Core/Json/JsonReader.cs index 8591c99e3d..bf79be8840 100644 --- a/src/Microsoft.OData.Core/Json/JsonReader.cs +++ b/src/Microsoft.OData.Core/Json/JsonReader.cs @@ -16,6 +16,7 @@ namespace Microsoft.OData.Json using System.Text; using System.Threading.Tasks; using Microsoft.OData.Buffers; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -211,7 +212,7 @@ public virtual object GetValue() { if (this.readingStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotAccessValueInStreamState); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotAccessValueInStreamState); } if (this.canStream) @@ -279,7 +280,7 @@ public virtual bool Read() { if (this.readingStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCallReadInStreamState); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCallReadInStreamState); } if (this.canStream) @@ -345,13 +346,13 @@ public virtual bool Read() case ScopeType.Root: if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Root)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Root)); } if (currentScope.ValueCount > 0) { // We already found the top-level value, so fail - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MultipleTopLevelValues); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_MultipleTopLevelValues); } // We expect a "value" - start array, start object or primitive value @@ -361,7 +362,7 @@ public virtual bool Read() case ScopeType.Array: if (commaFound && currentScope.ValueCount == 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Array)); } // We might see end of array here @@ -372,7 +373,7 @@ public virtual bool Read() // End of array is only valid when there was no comma before it. if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Array)); } this.PopScope(); @@ -382,7 +383,7 @@ public virtual bool Read() if (!commaFound && currentScope.ValueCount > 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingComma, ScopeType.Array)); } // We expect element which is a "value" - start array, start object or primitive value @@ -392,7 +393,7 @@ public virtual bool Read() case ScopeType.Object: if (commaFound && currentScope.ValueCount == 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Object)); } // We might see end of object here @@ -403,7 +404,7 @@ public virtual bool Read() // End of object is only valid when there was no comma before it. if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Object)); } this.PopScope(); @@ -414,7 +415,7 @@ public virtual bool Read() { if (!commaFound && currentScope.ValueCount > 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingComma, ScopeType.Object)); } // We expect a property here @@ -425,7 +426,7 @@ public virtual bool Read() case ScopeType.Property: if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Property)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Property)); } // We expect the property value, which is a "value" - start array, start object or primitive value @@ -433,7 +434,7 @@ public virtual bool Read() break; default: - throw JsonReaderExtensions.CreateException(Strings.General_InternalError(InternalErrorCodes.JsonReader_Read)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.JsonReader_Read)); } Debug.Assert( @@ -451,7 +452,7 @@ public Stream CreateReadStream() { if (!this.canStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCreateReadStream); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCreateReadStream); } this.canStream = false; @@ -476,7 +477,7 @@ public TextReader CreateTextReader() { if (!this.canStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCreateTextReader); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCreateTextReader); } this.canStream = false; @@ -521,7 +522,7 @@ public virtual async Task GetValueAsync() { if (this.readingStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotAccessValueInStreamState); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotAccessValueInStreamState); } if (this.canStream) @@ -578,7 +579,7 @@ public virtual async Task ReadAsync() { if (this.readingStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCallReadInStreamState); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCallReadInStreamState); } if (this.canStream) @@ -644,13 +645,13 @@ public virtual async Task ReadAsync() case ScopeType.Root: if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Root)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Root)); } if (currentScope.ValueCount > 0) { // We already found the top-level value, so fail - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MultipleTopLevelValues); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_MultipleTopLevelValues); } // We expect a "value" - start array, start object or primitive value @@ -661,7 +662,7 @@ public virtual async Task ReadAsync() case ScopeType.Array: if (commaFound && currentScope.ValueCount == 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Array)); } // We might see end of array here @@ -672,7 +673,7 @@ public virtual async Task ReadAsync() // End of array is only valid when there was no comma before it. if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Array)); } this.PopScope(); @@ -682,7 +683,7 @@ public virtual async Task ReadAsync() if (!commaFound && currentScope.ValueCount > 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingComma(ScopeType.Array)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingComma, ScopeType.Array)); } // We expect element which is a "value" - start array, start object or primitive value @@ -693,7 +694,7 @@ public virtual async Task ReadAsync() case ScopeType.Object: if (commaFound && currentScope.ValueCount == 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Object)); } // We might see end of object here @@ -704,7 +705,7 @@ public virtual async Task ReadAsync() // End of object is only valid when there was no comma before it. if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Object)); } this.PopScope(); @@ -715,7 +716,7 @@ public virtual async Task ReadAsync() { if (!commaFound && currentScope.ValueCount > 0) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingComma(ScopeType.Object)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingComma, ScopeType.Object)); } // We expect a property here @@ -727,7 +728,7 @@ public virtual async Task ReadAsync() case ScopeType.Property: if (commaFound) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedComma(ScopeType.Property)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedComma, ScopeType.Property)); } // We expect the property value, which is a "value" - start array, start object or primitive value @@ -736,7 +737,7 @@ public virtual async Task ReadAsync() break; default: - throw JsonReaderExtensions.CreateException(Strings.General_InternalError(InternalErrorCodes.JsonReader_Read)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.JsonReader_Read)); } Debug.Assert( @@ -755,7 +756,7 @@ public async Task CreateReadStreamAsync() { if (!this.canStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCreateReadStream); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCreateReadStream); } this.canStream = false; @@ -783,7 +784,7 @@ public async Task CreateTextReaderAsync() { if (!this.canStream) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_CannotCreateTextReader); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_CannotCreateTextReader); } this.canStream = false; @@ -915,7 +916,7 @@ private JsonNodeType ParseValue() else { // Unknown token - fail. - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedToken); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnrecognizedToken); } } @@ -941,13 +942,13 @@ private JsonNodeType ParseProperty() if (string.IsNullOrEmpty((string)this.nodeValue)) { // The name can't be empty. - throw JsonReaderExtensions.CreateException(Strings.JsonReader_InvalidPropertyNameOrUnexpectedComma((string)this.nodeValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_InvalidPropertyNameOrUnexpectedComma, (string)this.nodeValue)); } if (!this.SkipWhitespaces() || this.characterBuffer[this.tokenStartIndex] != ':') { // We need the colon character after the property name - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingColon((string)this.nodeValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingColon, (string)this.nodeValue)); } // Consume the colon. @@ -1039,7 +1040,7 @@ private string ParseStringPrimitiveValue(out bool hasLeadingBackslash) // Escape sequence - we need at least two characters, the backslash and the one character after it. if (!this.EnsureAvailableCharacters(2)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\")); } // To simplify the code, consume the character after the \ as well, since that is the start of the escape sequence. @@ -1075,20 +1076,20 @@ private string ParseStringPrimitiveValue(out bool hasLeadingBackslash) // We need 4 hex characters if (!this.EnsureAvailableCharacters(4)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } string unicodeHexValue = this.ConsumeTokenToString(4); int characterValue; if (!Int32.TryParse(unicodeHexValue, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out characterValue)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\u" + unicodeHexValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\u" + unicodeHexValue)); } valueBuilder.Append((char)characterValue); break; default: - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\" + character)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\" + character)); } } else if (character == openingQuoteCharacter) @@ -1118,7 +1119,7 @@ private string ParseStringPrimitiveValue(out bool hasLeadingBackslash) } } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedEndOfString); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnexpectedEndOfString); } /// @@ -1137,7 +1138,7 @@ private object ParseNullPrimitiveValue() if (!string.Equals(token, JsonConstants.JsonNullLiteral, StringComparison.Ordinal)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedToken(token)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedToken, token)); } return null; @@ -1167,7 +1168,7 @@ private object ParseBooleanPrimitiveValue() return true; } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedToken(token)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedToken, token)); } /// @@ -1227,7 +1228,7 @@ private object ParseNumberPrimitiveValue() return doubleValue; } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_InvalidNumberFormat(numberString)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_InvalidNumberFormat, numberString)); } /// @@ -1327,7 +1328,7 @@ private int ReadChars(char[] chars, int offset, int maxLength) this.tokenStartIndex++; if (!this.EnsureAvailableCharacters(1)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } character = this.characterBuffer[this.tokenStartIndex]; @@ -1363,7 +1364,7 @@ private int ReadChars(char[] chars, int offset, int maxLength) // We need 4 hex characters if (!this.EnsureAvailableCharacters(4)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } int characterValue = ParseUnicodeHexValue(); @@ -1373,7 +1374,7 @@ private int ReadChars(char[] chars, int offset, int maxLength) advance = false; break; default: - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\" + character)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\" + character)); } } @@ -1389,7 +1390,7 @@ private int ReadChars(char[] chars, int offset, int maxLength) // we reached the end of the file without finding a closing quote character if (charsRead < maxLength) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedEndOfString); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnexpectedEndOfString); } return charsRead; @@ -1418,7 +1419,7 @@ private bool EndOfInput() if (this.scopes.Count > 1) { // Not all open scopes were closed. - throw JsonReaderExtensions.CreateException(Strings.JsonReader_EndOfInputWithOpenScope); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_EndOfInputWithOpenScope); } Debug.Assert( @@ -1657,7 +1658,7 @@ private async Task ParseValueAsync() else { // Unknown token - fail. - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedToken); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnrecognizedToken); } } @@ -1684,13 +1685,13 @@ private async Task ParsePropertyAsync() if (string.IsNullOrEmpty((string)this.nodeValue)) { // The name can't be empty. - throw JsonReaderExtensions.CreateException(Strings.JsonReader_InvalidPropertyNameOrUnexpectedComma((string)this.nodeValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_InvalidPropertyNameOrUnexpectedComma, (string)this.nodeValue)); } if (!await this.SkipWhitespacesAsync().ConfigureAwait(false) || this.characterBuffer[this.tokenStartIndex] != ':') { // We need the colon character after the property name - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MissingColon((string)this.nodeValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_MissingColon, (string)this.nodeValue)); } // Consume the colon. @@ -1771,7 +1772,7 @@ private async Task> ParseStringPrimitiveValueAsync() // Escape sequence - we need at least two characters, the backslash and the one character after it. if (!await this.EnsureAvailableCharactersAsync(2).ConfigureAwait(false)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\")); } // To simplify the code, consume the character after the \ as well, since that is the start of the escape sequence. @@ -1807,20 +1808,20 @@ private async Task> ParseStringPrimitiveValueAsync() // We need 4 hex characters if (!await this.EnsureAvailableCharactersAsync(4).ConfigureAwait(false)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } string unicodeHexValue = this.ConsumeTokenToString(4); int characterValue; if (!Int32.TryParse(unicodeHexValue, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out characterValue)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\u" + unicodeHexValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\u" + unicodeHexValue)); } valueBuilder.Append((char)characterValue); break; default: - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\" + character)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\" + character)); } } else if (character == openingQuoteCharacter) @@ -1851,7 +1852,7 @@ private async Task> ParseStringPrimitiveValueAsync() } } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedEndOfString); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnexpectedEndOfString); } /// @@ -1871,7 +1872,7 @@ private async Task ParseNullPrimitiveValueAsync() if (!string.Equals(token, JsonConstants.JsonNullLiteral, StringComparison.Ordinal)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedToken(token)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedToken, token)); } return null; @@ -1902,7 +1903,7 @@ private async Task ParseBooleanPrimitiveValueAsync() return true; } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedToken(token)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnexpectedToken, token)); } /// @@ -1963,7 +1964,7 @@ private async Task ParseNumberPrimitiveValueAsync() return doubleValue; } - throw JsonReaderExtensions.CreateException(Strings.JsonReader_InvalidNumberFormat(numberString)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_InvalidNumberFormat, numberString)); } /// @@ -2067,7 +2068,7 @@ private async Task ReadCharsAsync(char[] chars, int offset, int maxLength) this.tokenStartIndex++; if (!await this.EnsureAvailableCharactersAsync(1).ConfigureAwait(false)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } character = this.characterBuffer[this.tokenStartIndex]; @@ -2103,7 +2104,7 @@ private async Task ReadCharsAsync(char[] chars, int offset, int maxLength) // We need 4 hex characters if (!await this.EnsureAvailableCharactersAsync(4).ConfigureAwait(false)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\uXXXX")); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\uXXXX")); } int characterValue = ParseUnicodeHexValue(); @@ -2113,7 +2114,7 @@ private async Task ReadCharsAsync(char[] chars, int offset, int maxLength) advance = false; break; default: - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\" + character)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\" + character)); } } @@ -2129,7 +2130,7 @@ private async Task ReadCharsAsync(char[] chars, int offset, int maxLength) // we reached the end of the file without finding a closing quote character if (charsRead < maxLength) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnexpectedEndOfString); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_UnexpectedEndOfString); } return charsRead; @@ -2243,7 +2244,7 @@ private void CopyInputToBuffer() // We need to grow the buffer. Double the size of the buffer. if (this.characterBuffer.Length == int.MaxValue) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_MaxBufferReached); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_MaxBufferReached); } int newBufferSize = this.characterBuffer.Length * 2; @@ -2287,7 +2288,7 @@ private int ParseUnicodeHexValue() int characterValue; if (!Int32.TryParse(unicodeHexValue, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out characterValue)) { - throw JsonReaderExtensions.CreateException(Strings.JsonReader_UnrecognizedEscapeSequence("\\u" + unicodeHexValue)); + throw JsonReaderExtensions.CreateException(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, "\\u" + unicodeHexValue)); } return characterValue; diff --git a/src/Microsoft.OData.Core/Json/JsonReaderExtensions.cs b/src/Microsoft.OData.Core/Json/JsonReaderExtensions.cs index e55279e5a5..84a997b0bc 100644 --- a/src/Microsoft.OData.Core/Json/JsonReaderExtensions.cs +++ b/src/Microsoft.OData.Core/Json/JsonReaderExtensions.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Diagnostics; @@ -130,7 +131,7 @@ internal static string ReadStringValue(this IJsonReader jsonReader) return stringValue; } - throw CreateException(Strings.JsonReaderExtensions_CannotReadValueAsString(value)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsString, value)); } /// @@ -160,7 +161,7 @@ internal static string ReadStringValue(this IJsonReader jsonReader, string prope return stringValue; } - throw CreateException(Strings.JsonReaderExtensions_CannotReadPropertyValueAsString(value, propertyName)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadPropertyValueAsString, value, propertyName)); } /// @@ -191,7 +192,7 @@ internal static string ReadStringValue(this IJsonReader jsonReader, string prope return (double)decimalValue; } - throw CreateException(Strings.JsonReaderExtensions_CannotReadValueAsDouble(value)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsDouble, value)); } /// @@ -234,7 +235,7 @@ internal static void SkipValue(this IJsonReader jsonReader) { // Not all open scopes were closed: // "Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed." - throw JsonReaderExtensions.CreateException(Strings.JsonReader_EndOfInputWithOpenScope); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_EndOfInputWithOpenScope); } } @@ -308,7 +309,7 @@ internal static void SkipValue(this IJsonReader jsonReader, StringBuilder jsonRa { // Not all open scopes were closed: // "Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed." - throw JsonReaderExtensions.CreateException(Strings.JsonReader_EndOfInputWithOpenScope); + throw JsonReaderExtensions.CreateException(SRResources.JsonReader_EndOfInputWithOpenScope); } jsonWriter.Flush(); @@ -584,11 +585,11 @@ internal static async Task ReadStringValueAsync(this IJsonReader jsonRea if (!string.IsNullOrEmpty(propertyName)) { - throw CreateException(Strings.JsonReaderExtensions_CannotReadPropertyValueAsString(value, propertyName)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadPropertyValueAsString, value, propertyName)); } else { - throw CreateException(Strings.JsonReaderExtensions_CannotReadValueAsString(value)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsString, value)); } } @@ -637,7 +638,7 @@ internal static async Task ReadUriValueAsync(this IJsonReader jsonReader) return (double)decimalValue; } - throw CreateException(Strings.JsonReaderExtensions_CannotReadValueAsDouble(value)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsDouble, value)); } /// @@ -682,7 +683,7 @@ internal static async Task SkipValueAsync(this IJsonReader jsonReader) { // Not all open scopes were closed: // "Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed." - throw CreateException(Strings.JsonReader_EndOfInputWithOpenScope); + throw CreateException(SRResources.JsonReader_EndOfInputWithOpenScope); } } @@ -766,7 +767,7 @@ await jsonWriter.WriteNameAsync(propertyName) { // Not all open scopes were closed: // "Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed." - throw CreateException(Strings.JsonReader_EndOfInputWithOpenScope); + throw CreateException(SRResources.JsonReader_EndOfInputWithOpenScope); } await jsonWriter.FlushAsync() @@ -947,7 +948,7 @@ private static void ValidateNodeType(this IJsonReader jsonReader, JsonNodeType e if (jsonReader.NodeType != expectedNodeType) { - throw CreateException(Strings.JsonReaderExtensions_UnexpectedNodeDetected(expectedNodeType, jsonReader.NodeType)); + throw CreateException(Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetected, expectedNodeType, jsonReader.NodeType)); } } diff --git a/src/Microsoft.OData.Core/Json/JsonValueUtils.cs b/src/Microsoft.OData.Core/Json/JsonValueUtils.cs index 87c2150036..6b0f18c892 100644 --- a/src/Microsoft.OData.Core/Json/JsonValueUtils.cs +++ b/src/Microsoft.OData.Core/Json/JsonValueUtils.cs @@ -15,6 +15,7 @@ namespace Microsoft.OData.Json using System.Text; using System.Xml; using Microsoft.OData.Buffers; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -249,7 +250,7 @@ internal static string FormatDateTimeOffset(DateTimeOffset value, ODataJsonDateT return FormatDateTimeAsJsonTicksString(value); } default: - throw new ODataException(Strings.ODataJsonWriter_UnsupportedDateTimeFormat); + throw new ODataException(SRResources.ODataJsonWriter_UnsupportedDateTimeFormat); } } diff --git a/src/Microsoft.OData.Core/Json/JsonWriterExtensions.Async.cs b/src/Microsoft.OData.Core/Json/JsonWriterExtensions.Async.cs index 00e544f096..bc8c54dc8c 100644 --- a/src/Microsoft.OData.Core/Json/JsonWriterExtensions.Async.cs +++ b/src/Microsoft.OData.Core/Json/JsonWriterExtensions.Async.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Json using System.Threading.Tasks; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces internal static partial class JsonWriterExtensions @@ -153,7 +153,7 @@ internal static Task WritePrimitiveValueAsync(this IJsonWriter jsonWriter, objec } return TaskUtils.GetFaultedTask( - new ODataException(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(value.GetType().FullName))); + new ODataException(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, value.GetType().FullName))); } /// @@ -218,7 +218,7 @@ async Task WriteODataCollectionValueAsync( } else { - throw new ODataException(ODataErrorStrings.ODataJsonWriter_UnsupportedValueInCollection); + throw new ODataException(SRResources.ODataJsonWriter_UnsupportedValueInCollection); } } @@ -227,7 +227,7 @@ async Task WriteODataCollectionValueAsync( } return TaskUtils.GetFaultedTask( - new ODataException(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(odataValue.GetType().FullName))); + new ODataException(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, odataValue.GetType().FullName))); } /// diff --git a/src/Microsoft.OData.Core/Json/JsonWriterExtensions.cs b/src/Microsoft.OData.Core/Json/JsonWriterExtensions.cs index 686be70805..8dff6a534c 100644 --- a/src/Microsoft.OData.Core/Json/JsonWriterExtensions.cs +++ b/src/Microsoft.OData.Core/Json/JsonWriterExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.OData.Json using System.Diagnostics; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -168,7 +168,7 @@ internal static void WritePrimitiveValue(this IJsonWriter jsonWriter, object val return; } - throw new ODataException(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(value.GetType().FullName)); + throw new ODataException(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, value.GetType().FullName)); } /// @@ -221,7 +221,7 @@ internal static void WriteODataValue(this IJsonWriter jsonWriter, ODataValue oda } else { - throw new ODataException(ODataErrorStrings.ODataJsonWriter_UnsupportedValueInCollection); + throw new ODataException(SRResources.ODataJsonWriter_UnsupportedValueInCollection); } } @@ -231,7 +231,7 @@ internal static void WriteODataValue(this IJsonWriter jsonWriter, ODataValue oda } throw new ODataException( - ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(odataValue.GetType().FullName)); + Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, odataValue.GetType().FullName)); } /// diff --git a/src/Microsoft.OData.Core/Json/ODataAnnotationNames.cs b/src/Microsoft.OData.Core/Json/ODataAnnotationNames.cs index 40ce49be79..bbcefaffd7 100644 --- a/src/Microsoft.OData.Core/Json/ODataAnnotationNames.cs +++ b/src/Microsoft.OData.Core/Json/ODataAnnotationNames.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.Json using System; using System.Collections.Generic; using System.Diagnostics; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -152,7 +152,7 @@ internal static void ValidateIsCustomAnnotationName(string annotationName) // All other reserved OData instance annotations should fail. if (KnownODataAnnotationNames.Contains(annotationName)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, annotationName)); } Debug.Assert(!IsODataAnnotationName(annotationName), "Unknown names under the odata. namespace should be skipped by ODataJsonDeserializer.ParseProperty()."); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchAtomicGroupCache.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchAtomicGroupCache.cs index ebd5cd6386..d328ffa1bf 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchAtomicGroupCache.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchAtomicGroupCache.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; @@ -106,7 +107,7 @@ internal bool AddMessageIdAndGroupId(string messageId, string groupId) } else { - throw new ODataException(Strings.ODataBatchReader_MessageIdPositionedIncorrectly(messageId, groupId)); + throw new ODataException(Error.Format(SRResources.ODataBatchReader_MessageIdPositionedIncorrectly, messageId, groupId)); } return isChangesetStart; diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchBodyContentReaderStream.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchBodyContentReaderStream.cs index b907db05be..7869ae1632 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchBodyContentReaderStream.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchBodyContentReaderStream.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; @@ -111,7 +112,7 @@ internal bool PopulateBodyContent(IJsonReader jsonReader, string contentTypeHead break; default: - throw new ODataException(Strings.ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader(contentType)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader, contentType)); } isStreamPopulated = true; @@ -202,7 +203,7 @@ await WriteBinaryContentAsync(encoded) break; default: - throw new ODataException(Strings.ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader(contentType)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader, contentType)); } isStreamPopulated = true; @@ -442,7 +443,7 @@ private static void WriteCurrentJsonObject(IJsonReader reader, IJsonWriter jsonW default: { - throw new ODataException(Strings.ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType(reader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType, reader.NodeType)); } } @@ -570,7 +571,7 @@ await jsonWriter.EndArrayScopeAsync() break; default: - throw new ODataException(Strings.ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType(reader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType, reader.NodeType)); } await reader.ReadNextAsync() diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchPayloadItemPropertiesCache.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchPayloadItemPropertiesCache.cs index 591e028070..d1c89ecb56 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchPayloadItemPropertiesCache.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchPayloadItemPropertiesCache.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; @@ -215,7 +216,7 @@ private void ScanJsonProperties() // Throw an ODataException, if a duplicate json property was detected if (jsonProperties.ContainsKey(propertyName)) { - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch, propertyName)); } switch (propertyName) @@ -270,7 +271,7 @@ private void ScanJsonProperties() // Throw an ODataException, if a duplicate header was detected if (headers.ContainsKeyOrdinal(headerName)) { - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch(headerName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch, headerName)); } // Remember the Content-Type header value. @@ -304,7 +305,7 @@ private void ScanJsonProperties() break; default: - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch, propertyName)); } } @@ -366,7 +367,7 @@ await this.jsonReader.ReadStartObjectAsync() // Throw an ODataException, if a duplicate json property was detected if (jsonProperties.ContainsKey(propertyName)) { - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch, propertyName)); } switch (propertyName) @@ -422,7 +423,7 @@ await this.jsonReader.ReadStartObjectAsync() // Throw an ODataException, if a duplicate header was detected if (headers.ContainsKeyOrdinal(headerName)) { - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch(headerName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch, headerName)); } // Remember the Content-Type header value. @@ -456,7 +457,7 @@ await bodyContentStream.PopulateCachedBodyContentAsync(contentTypeHeader) break; default: - throw new ODataException(Strings.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch, propertyName)); } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchReader.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchReader.cs index 9361ddca74..96d351152f 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchReader.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchReader.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; @@ -358,7 +359,7 @@ protected override void ValidateDependsOnIds(string contentId, IEnumerable dependsOnIds, string atomic // Self reference to atomicityGroup is not allowed. if (dependsOnId.Equals(atomicityGroupId, StringComparison.Ordinal)) { - throw new ODataException(Strings.ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed( + throw new ODataException(Error.Format(SRResources.ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed, dependsOnId, atomicityGroupId)); } @@ -474,7 +475,7 @@ private void ValidateDependsOnId(IEnumerable dependsOnIds, string atomic // Self reference is not allowed. if (dependsOnId.Equals(requestId, StringComparison.Ordinal)) { - throw new ODataException(Strings.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed( + throw new ODataException(Error.Format(SRResources.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed, dependsOnId, requestId)); } @@ -484,7 +485,7 @@ private void ValidateDependsOnId(IEnumerable dependsOnIds, string atomic string groupId = this.atomicGroups.GetGroupId(dependsOnId); if (groupId != null && !groupId.Equals(this.atomicGroups.GetGroupId(requestId), StringComparison.Ordinal)) { - throw new ODataException(Strings.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed( + throw new ODataException(Error.Format(SRResources.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed, dependsOnId, groupId)); } @@ -510,7 +511,7 @@ private void DetectReaderMode() } else { - throw new ODataException(Strings.ODataBatchReader_JsonBatchTopLevelPropertyMissing); + throw new ODataException(SRResources.ODataBatchReader_JsonBatchTopLevelPropertyMissing); } } @@ -535,7 +536,7 @@ private void HandleNewAtomicGroupStart(string messageId, string groupId) { if (this.atomicGroups.IsGroupId(groupId)) { - throw new ODataException(Strings.ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed(groupId)); + throw new ODataException(Error.Format(SRResources.ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed, groupId)); } // Add the request Id to the new group. @@ -635,7 +636,7 @@ await this.batchStream.JsonReader.ReadStartObjectAsync() } else { - throw new ODataException(Strings.ODataBatchReader_JsonBatchTopLevelPropertyMissing); + throw new ODataException(SRResources.ODataBatchReader_JsonBatchTopLevelPropertyMissing); } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchReaderStream.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchReaderStream.cs index 52a2fc5eb7..aaceb93767 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchReaderStream.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchReaderStream.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -96,7 +97,7 @@ internal override int ReadWithLength(byte[] userBuffer, int userBufferOffset, in // We cannot fully satisfy the read request since there are not enough bytes in the stream. // This means that the content length of the stream was incorrect; this should never happen // since the caller should already have checked this. - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStreamBuffer_ReadWithLength)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStreamBuffer_ReadWithLength)); } else { diff --git a/src/Microsoft.OData.Core/Json/ODataJsonBatchWriter.cs b/src/Microsoft.OData.Core/Json/ODataJsonBatchWriter.cs index 6a8b11aeba..73592ba4a4 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonBatchWriter.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonBatchWriter.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; @@ -224,7 +225,7 @@ public override void OnInStreamError() // The OData protocol spec does not define the behavior when an exception is encountered outside of a batch operation. The batch writer // should not allow WriteError in this case. Note that WCF DS Server does serialize the error in XML format when it encounters one outside of a // batch operation. - throw new ODataException(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch); + throw new ODataException(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch); } public override async Task OnInStreamErrorAsync() @@ -237,7 +238,7 @@ await this.jsonWriter.FlushAsync() // The OData protocol spec does not define the behavior when an exception is encountered outside of a batch operation. The batch writer // should not allow WriteError in this case. Note that WCF DS Server does serialize the error in XML format when it encounters one outside of a // batch operation. - throw new ODataException(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch); + throw new ODataException(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch); } /// @@ -303,7 +304,7 @@ protected override void ValidateDependsOnIds(string contentId, IEnumerable // already exists. Convert and throw ODataException. - throw new ODataException(Strings.ODataBatchWriter_DuplicateContentIDsNotAllowed(contentId), ae); + throw new ODataException(Error.Format(SRResources.ODataBatchWriter_DuplicateContentIDsNotAllowed, contentId), ae); } // Add reverse lookup when current request is part of atomic group. diff --git a/src/Microsoft.OData.Core/Json/ODataJsonCollectionDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonCollectionDeserializer.cs index 0353e5a202..b18b2c90f7 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonCollectionDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonCollectionDeserializer.cs @@ -11,8 +11,8 @@ namespace Microsoft.OData.Json using System.Diagnostics; using System.Threading.Tasks; using Microsoft.OData.Edm; + using Microsoft.OData.Core; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; #endregion Namespaces /// @@ -89,7 +89,7 @@ internal ODataCollectionStart ReadCollectionStart( case PropertyParsingResult.ODataInstanceAnnotation: if (!IsValidODataAnnotationOfCollection(propertyName)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } this.JsonReader.SkipValue(); @@ -100,13 +100,13 @@ internal ODataCollectionStart ReadCollectionStart( break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (!string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName(propertyName, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, propertyName, ODataJsonConstants.ODataValuePropertyName)); } string payloadTypeName = ValidateDataPropertyTypeNameAnnotation(collectionStartPropertyAndAnnotationCollector, propertyName); @@ -115,12 +115,12 @@ internal ODataCollectionStart ReadCollectionStart( string itemTypeName = EdmLibraryExtensions.GetCollectionItemTypeName(payloadTypeName); if (itemTypeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_InvalidCollectionTypeName(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_InvalidCollectionTypeName, payloadTypeName)); } EdmTypeKind targetTypeKind; ODataTypeAnnotation typeAnnotation; - Func typeKindFromPayloadFunc = () => { throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart_TypeKindFromPayloadFunc)); }; + Func typeKindFromPayloadFunc = () => { throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart_TypeKindFromPayloadFunc)); }; actualItemTypeRef = this.ReaderValidator.ResolvePayloadTypeNameAndComputeTargetType( EdmTypeKind.None, /*expectStructuredType*/ null, @@ -144,10 +144,10 @@ internal ODataCollectionStart ReadCollectionStart( break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart)); } }); @@ -157,14 +157,14 @@ internal ODataCollectionStart ReadCollectionStart( if (collectionStart == null) { // No collection property found; there should be exactly one property in the collection wrapper that does not have a reserved name. - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } } // at this point the reader is positioned on the start array node for the collection contents if (this.JsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart, this.JsonReader.NodeType)); } this.JsonReader.AssertNotBuffering(); @@ -255,7 +255,7 @@ internal void ReadCollectionEnd(bool isReadingNestedPayload) case PropertyParsingResult.ODataInstanceAnnotation: if (!IsValidODataAnnotationOfCollection(propertyName)) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionEnd(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, propertyName)); } this.JsonReader.SkipValue(); @@ -264,13 +264,13 @@ internal void ReadCollectionEnd(bool isReadingNestedPayload) case PropertyParsingResult.PropertyWithoutValue: // fall through case PropertyParsingResult.PropertyWithValue: // fall through case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionEnd(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, propertyName)); case PropertyParsingResult.EndOfObject: break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionEnd)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionEnd)); } }); } @@ -343,7 +343,7 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.ODataInstanceAnnotation: if (!IsValidODataAnnotationOfCollection(propertyName)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } await this.JsonReader.SkipValueAsync() @@ -356,13 +356,13 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (!string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName(propertyName, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, propertyName, ODataJsonConstants.ODataValuePropertyName)); } string payloadTypeName = ValidateDataPropertyTypeNameAnnotation(collectionStartPropertyAndAnnotationCollector, propertyName); @@ -371,14 +371,14 @@ await this.JsonReader.SkipValueAsync() string itemTypeName = EdmLibraryExtensions.GetCollectionItemTypeName(payloadTypeName); if (itemTypeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_InvalidCollectionTypeName(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_InvalidCollectionTypeName, payloadTypeName)); } EdmTypeKind targetTypeKind; ODataTypeAnnotation typeAnnotation; Func typeKindFromPayloadFunc = () => { - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart_TypeKindFromPayloadFunc)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart_TypeKindFromPayloadFunc)); }; actualItemTypeRef = this.ReaderValidator.ResolvePayloadTypeNameAndComputeTargetType( @@ -404,11 +404,11 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: throw new ODataException( - ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart)); + Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionStart)); } }).ConfigureAwait(false); @@ -419,14 +419,14 @@ await this.JsonReader.SkipValueAsync() { // No collection property found; there should be exactly one property in the collection wrapper that does not have a reserved name. throw new ODataException( - ODataErrorStrings.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } } // at this point the reader is positioned on the start array node for the collection contents if (this.JsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart, this.JsonReader.NodeType)); } this.JsonReader.AssertNotBuffering(); @@ -526,7 +526,7 @@ await this.JsonReader.SkipValueAsync() case PropertyParsingResult.ODataInstanceAnnotation: if (!IsValidODataAnnotationOfCollection(propertyName)) { - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionEnd(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, propertyName)); } await this.JsonReader.SkipValueAsync() @@ -536,14 +536,14 @@ await this.JsonReader.SkipValueAsync() case PropertyParsingResult.PropertyWithoutValue: // fall through case PropertyParsingResult.PropertyWithValue: // fall through case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionEnd(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, propertyName)); case PropertyParsingResult.EndOfObject: break; default: throw new ODataException( - ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionEnd)); + Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonCollectionDeserializer_ReadCollectionEnd)); } }).ConfigureAwait(false); } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonContextUriParser.cs b/src/Microsoft.OData.Core/Json/ODataJsonContextUriParser.cs index a2bff0f6a8..510ddbedd8 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonContextUriParser.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonContextUriParser.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Json using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -48,7 +48,7 @@ private ODataJsonContextUriParser(IEdmModel model, Uri contextUriFromPayload) if (!model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonContextUriParser_NoModel); + throw new ODataException(SRResources.ODataJsonContextUriParser_NoModel); } this.model = model; @@ -77,7 +77,7 @@ internal static ODataJsonContextUriParseResult Parse( { if (contextUriFromPayload == null) { - throw new ODataException(ODataErrorStrings.ODataJsonContextUriParser_NullMetadataDocumentUri); + throw new ODataException(SRResources.ODataJsonContextUriParser_NullMetadataDocumentUri); } // Create a context URI from the payload string. @@ -86,7 +86,7 @@ internal static ODataJsonContextUriParseResult Parse( { if (baseUri == null) { - throw new ODataException(ODataErrorStrings.ODataJsonContextUriParser_InvalidContextUrl(contextUriFromPayload)); + throw new ODataException(Error.Format(SRResources.ODataJsonContextUriParser_InvalidContextUrl, contextUriFromPayload)); } else { @@ -97,7 +97,7 @@ internal static ODataJsonContextUriParseResult Parse( { if (string.IsNullOrEmpty(navigationSource?.Name)) { - throw new ODataException(ODataErrorStrings.ODataJsonContextUriParser_InvalidContextUrl(contextUriFromPayload)); + throw new ODataException(Error.Format(SRResources.ODataJsonContextUriParser_InvalidContextUrl, contextUriFromPayload)); } else { @@ -117,7 +117,7 @@ internal static ODataJsonContextUriParseResult Parse( if (!Uri.TryCreate(baseUri, contextUriFromPayload, out contextUri)) { - throw new ODataException(ODataErrorStrings.ODataJsonContextUriParser_InvalidContextUrl(contextUriFromPayload)); + throw new ODataException(Error.Format(SRResources.ODataJsonContextUriParser_InvalidContextUrl, contextUriFromPayload)); } } } @@ -253,7 +253,7 @@ private void ParseContextUri(ODataPayloadKind expectedPayloadKind, Func ReadAndValidateAnnotationAsLongForIeee754CompatibleAsy if ((value is string) ^ this.JsonReader.IsIeee754Compatible) { - throw new ODataException(Strings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter(Metadata.EdmConstants.EdmInt64TypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, Metadata.EdmConstants.EdmInt64TypeName)); } return (long)ODataJsonReaderUtils.ConvertValue( @@ -767,7 +768,7 @@ internal async Task ReadContextUriAnnotationAsync( return null; } - throw new ODataException(Strings.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); + throw new ODataException(SRResources.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); } // Must make sure the input odata.context has a '@' prefix @@ -782,7 +783,7 @@ internal async Task ReadContextUriAnnotationAsync( return null; } - throw new ODataException(Strings.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); + throw new ODataException(SRResources.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); } if (propertyAndAnnotationCollector != null) @@ -972,7 +973,7 @@ private PropertyParsingResult ParseProperty( { if (ODataJsonReaderUtils.IsAnnotationProperty(parsedPropertyName)) { - throw new ODataException(Strings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue(lastPropertyAnnotationNameFound, parsedPropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, lastPropertyAnnotationNameFound, parsedPropertyName)); } return PropertyParsingResult.PropertyWithoutValue; @@ -1046,7 +1047,7 @@ private PropertyParsingResult ParseProperty( { if (ODataJsonReaderUtils.IsAnnotationProperty(parsedPropertyName)) { - throw new ODataException(Strings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue(lastPropertyAnnotationNameFound, parsedPropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, lastPropertyAnnotationNameFound, parsedPropertyName)); } return PropertyParsingResult.PropertyWithoutValue; @@ -1067,7 +1068,7 @@ private void ProcessPropertyAnnotation(string annotatedPropertyName, string anno // We don't currently support annotation targeting an instance annotation except for the @odata.type property annotation. if (ODataJsonReaderUtils.IsAnnotationProperty(annotatedPropertyName) && !string.Equals(annotationName, ODataAnnotationNames.ODataType, StringComparison.Ordinal)) { - throw new ODataException(Strings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation(annotationName, annotatedPropertyName, ODataAnnotationNames.ODataType)); + throw new ODataException(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, annotationName, annotatedPropertyName, ODataAnnotationNames.ODataType)); } ReadODataOrCustomInstanceAnnotationValue(annotatedPropertyName, annotationName, propertyAndAnnotationCollector, readPropertyAnnotationValue); @@ -1287,7 +1288,7 @@ await this.JsonReader.ReadAsync() { if (ODataJsonReaderUtils.IsAnnotationProperty(parsedPropertyName)) { - throw new ODataException(Strings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue( + throw new ODataException(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, lastPropertyAnnotationNameFound, parsedPropertyName)); } @@ -1382,7 +1383,7 @@ await this.ProcessPropertyAnnotationAsync( if (ODataJsonReaderUtils.IsAnnotationProperty(parsedPropertyName)) { throw new ODataException( - Strings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue( + Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, lastPropertyAnnotationNameFound, parsedPropertyName)); } @@ -1412,7 +1413,7 @@ private Task ProcessPropertyAnnotationAsync( && !string.Equals(annotationName, ODataAnnotationNames.ODataType, StringComparison.Ordinal)) { return TaskUtils.GetFaultedTask( - new ODataException(Strings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation( + new ODataException(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, annotationName, annotatedPropertyName, ODataAnnotationNames.ODataType))); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonEntityReferenceLinkDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonEntityReferenceLinkDeserializer.cs index 734b9e86b5..e78b07640c 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonEntityReferenceLinkDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonEntityReferenceLinkDeserializer.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Json using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -217,7 +217,7 @@ private void ReadEntityReferenceLinksAnnotations(ODataEntityReferenceLinks links { // OData property annotations are not supported on entity reference links. Func propertyAnnotationValueReader = - annotationName => { throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks); }; + annotationName => { throw new ODataException(SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks); }; bool foundValueProperty = false; this.ReadPropertyCustomAnnotationValue = this.ReadCustomInstanceAnnotationValue; @@ -245,7 +245,7 @@ private void ReadEntityReferenceLinksAnnotations(ODataEntityReferenceLinks links } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } break; @@ -265,7 +265,7 @@ private void ReadEntityReferenceLinksAnnotations(ODataEntityReferenceLinks links if (!string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) { // We did not find a supported link collection property; fail. - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound, propertyName, ODataJsonConstants.ODataValuePropertyName)); } // We found the link collection property and are done parsing property annotations; @@ -275,16 +275,16 @@ private void ReadEntityReferenceLinksAnnotations(ODataEntityReferenceLinks links case PropertyParsingResult.PropertyWithoutValue: // If we find a property without a value it means that we did not find the entity reference links property (yet) // but an invalid property annotation - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadEntityReferenceLinksAnnotations)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadEntityReferenceLinksAnnotations)); } }); @@ -297,7 +297,7 @@ private void ReadEntityReferenceLinksAnnotations(ODataEntityReferenceLinks links if (forLinksStart) { // We did not find the 'value' property. - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } this.AssertJsonCondition(JsonNodeType.EndObject); @@ -364,7 +364,7 @@ private ODataEntityReferenceLink ReadSingleEntityReferenceLink(PropertyAndAnnota if (this.JsonReader.NodeType != JsonNodeType.StartObject) { // entity reference link has to be an object - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue, this.JsonReader.NodeType)); } this.JsonReader.ReadStartObject(); @@ -376,7 +376,7 @@ private ODataEntityReferenceLink ReadSingleEntityReferenceLink(PropertyAndAnnota // Entity reference links use instance annotations. Fail if we find a property annotation. Func propertyAnnotationValueReader = - annotationName => { throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink(annotationName)); }; + annotationName => { throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink, annotationName)); }; while (this.JsonReader.NodeType == JsonNodeType.Property) { @@ -397,18 +397,18 @@ private ODataEntityReferenceLink ReadSingleEntityReferenceLink(PropertyAndAnnota case PropertyParsingResult.ODataInstanceAnnotation: if (!string.Equals(ODataAnnotationNames.ODataId, propertyName, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink(propertyName, ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink, propertyName, ODataAnnotationNames.ODataId)); } else if (entityReferenceLink[0] != null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink, ODataAnnotationNames.ODataId)); } // read the value of the 'odata.id' annotation string urlString = this.JsonReader.ReadStringValue(ODataAnnotationNames.ODataId); if (urlString == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull, ODataAnnotationNames.ODataId)); } entityReferenceLink[0] = new ODataEntityReferenceLink @@ -423,7 +423,7 @@ private ODataEntityReferenceLink ReadSingleEntityReferenceLink(PropertyAndAnnota case PropertyParsingResult.CustomInstanceAnnotation: if (entityReferenceLink[0] == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } Debug.Assert(!string.IsNullOrEmpty(propertyName), "!string.IsNullOrEmpty(propertyName)"); @@ -439,23 +439,23 @@ private ODataEntityReferenceLink ReadSingleEntityReferenceLink(PropertyAndAnnota case PropertyParsingResult.PropertyWithValue: case PropertyParsingResult.PropertyWithoutValue: // entity reference link is denoted by odata.id annotation - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadSingleEntityReferenceLink)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadSingleEntityReferenceLink)); } }); } if (entityReferenceLink[0] == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } // end of the entity reference link object @@ -555,7 +555,7 @@ private async Task ReadEntityReferenceLinksAnnotationsAsync( Func> propertyAnnotationValueReaderDelegate = annotationName => { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks); + throw new ODataException(SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks); }; bool foundValueProperty = false; @@ -592,7 +592,7 @@ await this.JsonReader.ReadAsync() } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } break; @@ -613,7 +613,7 @@ await this.JsonReader.ReadAsync() if (!string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) { // We did not find a supported link collection property; fail. - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound, propertyName, ODataJsonConstants.ODataValuePropertyName)); } // We found the link collection property and are done parsing property annotations; @@ -623,16 +623,16 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.PropertyWithoutValue: // If we find a property without a value it means that we did not find the entity reference links property (yet) // but an invalid property annotation - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadEntityReferenceLinksAnnotations)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadEntityReferenceLinksAnnotations)); } }).ConfigureAwait(false); @@ -645,7 +645,7 @@ await this.JsonReader.ReadAsync() if (forLinksStart) { // We did not find the 'value' property. - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } this.AssertJsonCondition(JsonNodeType.EndObject); @@ -679,7 +679,7 @@ private async Task ReadSingleEntityReferenceLinkAsync( if (this.JsonReader.NodeType != JsonNodeType.StartObject) { // entity reference link has to be an object - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue, this.JsonReader.NodeType)); } await this.JsonReader.ReadStartObjectAsync() @@ -694,7 +694,7 @@ await this.JsonReader.ReadStartObjectAsync() Func> propertyAnnotationValueReaderDelegate = annotationName => { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink, annotationName)); }; while (this.JsonReader.NodeType == JsonNodeType.Property) @@ -717,11 +717,11 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.ODataInstanceAnnotation: if (!string.Equals(ODataAnnotationNames.ODataId, propertyName, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink(propertyName, ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink, propertyName, ODataAnnotationNames.ODataId)); } else if (entityReferenceLink[0] != null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink, ODataAnnotationNames.ODataId)); } // read the value of the 'odata.id' annotation @@ -729,7 +729,7 @@ await this.JsonReader.ReadAsync() .ConfigureAwait(false); if (urlString == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull, ODataAnnotationNames.ODataId)); } entityReferenceLink[0] = new ODataEntityReferenceLink @@ -744,7 +744,7 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.CustomInstanceAnnotation: if (entityReferenceLink[0] == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } Debug.Assert(!string.IsNullOrEmpty(propertyName), "!string.IsNullOrEmpty(propertyName)"); @@ -761,23 +761,23 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.PropertyWithValue: case PropertyParsingResult.PropertyWithoutValue: // entity reference link is denoted by odata.id annotation - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadSingleEntityReferenceLink)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonEntityReferenceLinkDeserializer_ReadSingleEntityReferenceLink)); } }).ConfigureAwait(false); } if (entityReferenceLink[0] == null) { - throw new ODataException(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + throw new ODataException(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } // end of the entity reference link object diff --git a/src/Microsoft.OData.Core/Json/ODataJsonErrorDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonErrorDeserializer.cs index 7a590dfcf9..05f9090aa1 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonErrorDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonErrorDeserializer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -130,12 +131,12 @@ private ODataError ReadTopLevelErrorImplementation() if (!string.Equals(ODataJsonConstants.ODataErrorPropertyName, propertyName, StringComparison.Ordinal)) { // we only allow a single 'error' property for a top-level error object - throw new ODataException(Strings.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty, propertyName)); } if (error != null) { - throw new ODataException(Strings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(ODataJsonConstants.ODataErrorPropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName, ODataJsonConstants.ODataErrorPropertyName)); } error = new ODataError(); @@ -192,12 +193,12 @@ private void ReadJsonObjectInErrorPayload(Action @@ -412,7 +413,7 @@ private void ReadPropertyValueInODataErrorObject(ODataError error, string proper { // we only allow a 'code', 'message', 'target', 'details, and 'innererror' properties // in the value of the 'error' property or custom instance annotations - throw new ODataException(Strings.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty, propertyName)); } break; @@ -496,12 +497,12 @@ private async Task ReadTopLevelErrorImplementationAsync() if (!string.Equals(ODataJsonConstants.ODataErrorPropertyName, propertyName, StringComparison.Ordinal)) { // We only allow a single 'error' property for a top-level error object - throw new ODataException(Strings.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty, propertyName)); } if (error != null) { - throw new ODataException(Strings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(ODataJsonConstants.ODataErrorPropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName, ODataJsonConstants.ODataErrorPropertyName)); } error = new ODataError(); @@ -565,13 +566,13 @@ await this.JsonReader.ReadAsync() switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(Strings.ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload, propertyName)); case PropertyParsingResult.CustomInstanceAnnotation: await readPropertyWithValueDelegate(propertyName, propertyAndAnnotationCollector) .ConfigureAwait(false); break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(Strings.ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError, propertyName)); case PropertyParsingResult.PropertyWithValue: await readPropertyWithValueDelegate(propertyName, propertyAndAnnotationCollector) .ConfigureAwait(false); @@ -580,7 +581,7 @@ await readPropertyWithValueDelegate(propertyName, propertyAndAnnotationCollector break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }).ConfigureAwait(false); } @@ -623,7 +624,7 @@ private async Task ReadErrorPropertyAnnotationValueAsync(string property if (typeName == null) { - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_InvalidTypeName(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, propertyAnnotationName)); } this.AssertJsonCondition(JsonNodeType.Property, JsonNodeType.EndObject); @@ -632,7 +633,7 @@ private async Task ReadErrorPropertyAnnotationValueAsync(string property return typeName; } - throw new ODataException(Strings.ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload, propertyAnnotationName)); } /// @@ -814,7 +815,7 @@ private async Task ReadPropertyValueInODataErrorObjectAsync(ODataError error, st { // We only allow a 'code', 'message', 'target', 'details, and 'innererror' properties // in the value of the 'error' property or custom instance annotations - throw new ODataException(Strings.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty, propertyName)); } break; diff --git a/src/Microsoft.OData.Core/Json/ODataJsonInputContext.cs b/src/Microsoft.OData.Core/Json/ODataJsonInputContext.cs index 41bfebef63..d2a0ecd324 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonInputContext.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonInputContext.cs @@ -17,7 +17,7 @@ namespace Microsoft.OData.Json using System.Text; using System.Threading.Tasks; // ReSharper disable RedundantUsingDirective - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; // ReSharper restore RedundantUsingDirective #endregion Namespaces @@ -646,7 +646,7 @@ private void VerifyCanCreateParameterReader(IEdmOperation operation) if (operation == null) { - throw new ArgumentNullException(nameof(operation), ODataErrorStrings.ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader("operation")); + throw new ArgumentNullException(nameof(operation), Error.Format(SRResources.ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader, "operation")); } } @@ -667,7 +667,7 @@ private void VerifyCanCreateODataReader(IEdmNavigationSource navigationSource, I // TODO: check for entity only if (navigationSource == null && (structuredType != null && structuredType.IsODataEntityTypeKind())) { - throw new ODataException(ODataErrorStrings.ODataJsonInputContext_NoEntitySetForRequest); + throw new ODataException(SRResources.ODataJsonInputContext_NoEntitySetForRequest); } } @@ -676,7 +676,7 @@ private void VerifyCanCreateODataReader(IEdmNavigationSource navigationSource, I IEdmEntityType entitySetElementType = this.EdmTypeResolver.GetElementType(navigationSource); if (navigationSource != null && structuredType != null && !structuredType.IsOrInheritsFrom(entitySetElementType)) { - throw new ODataException(ODataErrorStrings.ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType(structuredType.FullTypeName(), entitySetElementType.FullName(), navigationSource.FullNavigationSourceName())); + throw new ODataException(Error.Format(SRResources.ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType, structuredType.FullTypeName(), entitySetElementType.FullName(), navigationSource.FullNavigationSourceName())); } } @@ -693,7 +693,7 @@ private void VerifyCanCreateCollectionReader(IEdmTypeReference expectedItemTypeR if (expectedItemTypeReference == null) { - throw new ODataException(ODataErrorStrings.ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests); + throw new ODataException(SRResources.ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests); } } } @@ -729,7 +729,7 @@ private void VerifyCanDetectPayloadKind() { if (!this.ReadingResponse) { - throw new ODataException(ODataErrorStrings.ODataJsonInputContext_PayloadKindDetectionForRequest); + throw new ODataException(SRResources.ODataJsonInputContext_PayloadKindDetectionForRequest); } } @@ -740,7 +740,7 @@ private void VerifyUserModel() { if (!this.Model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonInputContext_ModelRequiredForReading); + throw new ODataException(SRResources.ODataJsonInputContext_ModelRequiredForReading); } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonOutputContext.cs b/src/Microsoft.OData.Core/Json/ODataJsonOutputContext.cs index c6a3ef9115..27a7143347 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonOutputContext.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonOutputContext.cs @@ -14,6 +14,7 @@ namespace Microsoft.OData.Json using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -909,7 +910,7 @@ private static IJsonWriter CreateJsonWriter( if (jsonWriter == null) { - throw new ODataException(Strings.ODataMessageWriter_JsonWriterFactory_ReturnedNull(isIeee754Compatible, encoding.WebName)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_JsonWriterFactory_ReturnedNull, isIeee754Compatible, encoding.WebName)); } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonParameterDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonParameterDeserializer.cs index 0989e70e2b..443714feef 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonParameterDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonParameterDeserializer.cs @@ -11,8 +11,7 @@ namespace Microsoft.OData.Json using System.Diagnostics; using System.Threading.Tasks; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; - + using Microsoft.OData.Core; #endregion Namespaces /// @@ -23,14 +22,14 @@ internal sealed class ODataJsonParameterDeserializer : ODataJsonPropertyAndValue /// OData property annotation reader for parameter payloads. /// OData property annotations are not supported in parameter payloads. private static readonly Func propertyAnnotationValueReader = - annotationName => { throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_PropertyAnnotationForParameters); }; + annotationName => { throw new ODataException(SRResources.ODataJsonParameterDeserializer_PropertyAnnotationForParameters); }; /// OData property annotation asynchronous reader for parameter payloads. private static readonly Func> propertyAnnotationValueReaderAsync = annotationName => { // Throw exception since property annotations are not supported in parameter payloads. - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_PropertyAnnotationForParameters); + throw new ODataException(SRResources.ODataJsonParameterDeserializer_PropertyAnnotationForParameters); }; /// The Json parameter reader. @@ -81,7 +80,7 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota { case PropertyParsingResult.ODataInstanceAnnotation: // OData instance annotations are not supported in parameter payloads. - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, parameterName)); case PropertyParsingResult.CustomInstanceAnnotation: this.JsonReader.SkipValue(); @@ -89,13 +88,13 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters, parameterName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, parameterName)); case PropertyParsingResult.PropertyWithValue: IEdmTypeReference parameterTypeReference = this.parameterReader.GetParameterTypeReference(parameterName); @@ -110,7 +109,7 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota IEdmPrimitiveTypeReference primitiveTypeReference = parameterTypeReference.AsPrimitive(); if (primitiveTypeReference.PrimitiveKind() == EdmPrimitiveTypeKind.Stream) { - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType(parameterName, primitiveTypeReference.PrimitiveKind())); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType, parameterName, primitiveTypeReference.PrimitiveKind())); } parameterValue = this.ReadNonEntityValue( @@ -167,7 +166,7 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota parameterValue = this.JsonReader.ReadPrimitiveValue(); if (parameterValue != null) { - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_NullCollectionExpected(JsonNodeType.PrimitiveValue, parameterValue)); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_NullCollectionExpected, JsonNodeType.PrimitiveValue, parameterValue)); } state = ODataParameterReaderState.Value; @@ -184,7 +183,7 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota break; default: - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_UnsupportedParameterTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_UnsupportedParameterTypeKind, parameterName, parameterTypeReference.TypeKind())); } parameterRead = true; @@ -195,7 +194,7 @@ internal bool ReadNextParameter(PropertyAndAnnotationCollector propertyAndAnnota break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonParameterDeserializer_ReadNextParameter)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonParameterDeserializer_ReadNextParameter)); } }); @@ -265,7 +264,7 @@ await this.JsonReader.ReadAsync() { case PropertyParsingResult.ODataInstanceAnnotation: // OData instance annotations are not supported in parameter payloads. - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, parameterName)); case PropertyParsingResult.CustomInstanceAnnotation: await this.JsonReader.SkipValueAsync() @@ -274,13 +273,13 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters, parameterName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, parameterName)); case PropertyParsingResult.PropertyWithValue: IEdmTypeReference parameterTypeReference = this.parameterReader.GetParameterTypeReference(parameterName); @@ -297,7 +296,7 @@ await this.JsonReader.SkipValueAsync() if (primitiveTypeReference.PrimitiveKind() == EdmPrimitiveTypeKind.Stream) { - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType(parameterName, primitiveTypeReference.PrimitiveKind())); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType, parameterName, primitiveTypeReference.PrimitiveKind())); } parameterValue = await this.ReadNonEntityValueAsync( @@ -355,7 +354,7 @@ await this.JsonReader.SkipValueAsync() .ConfigureAwait(false); if (parameterValue != null) { - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_NullCollectionExpected(JsonNodeType.PrimitiveValue, parameterValue)); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_NullCollectionExpected, JsonNodeType.PrimitiveValue, parameterValue)); } state = ODataParameterReaderState.Value; @@ -372,7 +371,7 @@ await this.JsonReader.SkipValueAsync() break; default: - throw new ODataException(ODataErrorStrings.ODataJsonParameterDeserializer_UnsupportedParameterTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataJsonParameterDeserializer_UnsupportedParameterTypeKind, parameterName, parameterTypeReference.TypeKind())); } parameterRead = true; @@ -383,7 +382,7 @@ await this.JsonReader.SkipValueAsync() break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonParameterDeserializer_ReadNextParameter)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonParameterDeserializer_ReadNextParameter)); } }).ConfigureAwait(false); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonPropertyAndValueDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonPropertyAndValueDeserializer.cs index ea25dfde78..fe375f574b 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonPropertyAndValueDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonPropertyAndValueDeserializer.cs @@ -15,7 +15,7 @@ namespace Microsoft.OData.Json using System.Threading.Tasks; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -279,7 +279,7 @@ internal static IEdmTypeReference ResolveUntypedType( TypeUtils.ParseQualifiedTypeName(payloadTypeName, out namespaceName, out name, out isCollection); if (isCollection) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected, payloadTypeName)); } typeReference = new EdmTypeDefinition(namespaceName, name, typeReference.PrimitiveKind()).ToTypeReference(/*isNullable*/ true); @@ -293,7 +293,7 @@ internal static IEdmTypeReference ResolveUntypedType( TypeUtils.ParseQualifiedTypeName(payloadTypeName, out namespaceName, out name, out isCollection); if (isCollection) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected, payloadTypeName)); } return new EdmUntypedStructuredType(namespaceName, name).ToTypeReference(/*isNullable*/ true); @@ -307,7 +307,7 @@ internal static IEdmTypeReference ResolveUntypedType( TypeUtils.ParseQualifiedTypeName(payloadTypeName, out namespaceName, out name, out isCollection); if (!isCollection) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected, payloadTypeName)); } return new EdmCollectionType(new EdmUntypedStructuredType(namespaceName, name).ToTypeReference(/*isNullable*/ true)).ToTypeReference(/*isNullable*/true); @@ -582,7 +582,7 @@ protected static void ValidateExpandedNestedResourceInfoPropertyValue( { if (isCollection == false) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource(nodeType, propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource, nodeType, propertyName)); } } else if ((nodeType == JsonNodeType.PrimitiveValue && jsonReader.GetValue() == null) || nodeType == JsonNodeType.StartObject) @@ -597,7 +597,7 @@ protected static void ValidateExpandedNestedResourceInfoPropertyValue( } else { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource(nodeType, propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource, nodeType, propertyName)); } } @@ -605,7 +605,7 @@ protected static void ValidateExpandedNestedResourceInfoPropertyValue( else { Debug.Assert(nodeType == JsonNodeType.PrimitiveValue, "nodeType == JsonNodeType.PrimitiveValue"); - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadNestedResource(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadNestedResource, propertyName)); } } @@ -663,7 +663,7 @@ protected static ODataJsonReaderNestedResourceInfo ReadNonExpandedResourceNested // Check the odata.type annotation for the complex property, it should show inside the complex object. if (ValidateDataPropertyTypeNameAnnotation(resourceState.PropertyAndAnnotationCollector, nestedResourceInfo.Name) != null) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation(ODataAnnotationNames.ODataType)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation, ODataAnnotationNames.ODataType)); } return ODataJsonReaderNestedResourceInfo.CreateResourceReaderNestedResourceInfo(nestedResourceInfo, complexProperty, nestedResourceType); @@ -720,7 +720,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest default: if (messageReaderSettings.ThrowOnUndeclaredPropertyForNonOpenType) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation(nestedResourceInfo.Name, propertyAnnotation.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation, nestedResourceInfo.Name, propertyAnnotation.Key)); } break; @@ -800,7 +800,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest case ODataAnnotationNames.ODataDeltaLink: // Delta links are not supported on expanded resource sets. default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation(nestedResourceInfo.Name, propertyAnnotation.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation, nestedResourceInfo.Name, propertyAnnotation.Key)); } } @@ -873,12 +873,12 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest LinkedList entityReferenceLinksList = propertyAnnotation.Value as LinkedList; if (entityReferenceLinksList != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation(nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation, nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); } if (isExpanded) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue(nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue, nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); } Debug.Assert( @@ -888,7 +888,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest break; default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation( + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation, nestedResourceInfo.Name, propertyAnnotation.Key, ODataAnnotationNames.ODataBind)); @@ -934,7 +934,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest ODataEntityReferenceLink entityReferenceLink = propertyAnnotation.Value as ODataEntityReferenceLink; if (entityReferenceLink != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation(nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation, nestedResourceInfo.Name, ODataAnnotationNames.ODataBind)); } Debug.Assert( @@ -944,7 +944,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest break; default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation( + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation, nestedResourceInfo.Name, propertyAnnotation.Key, ODataAnnotationNames.ODataBind)); @@ -1130,7 +1130,7 @@ protected string ReadODataTypeAnnotationValue() string typeName = ReaderUtils.AddEdmPrefixOfTypeName(ReaderUtils.RemovePrefixOfTypeName(this.JsonReader.ReadStringValue())); if (typeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTypeName(typeName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, typeName)); } this.AssertJsonCondition(JsonNodeType.Property, JsonNodeType.EndObject); @@ -1155,7 +1155,7 @@ protected object ReadTypePropertyAnnotationValue(string propertyAnnotationName) return typeName; } - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyAnnotationName)); } /// @@ -1219,7 +1219,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(prop break; default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation(propertyName, propertyAnnotation.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation, propertyName, propertyAnnotation.Key)); } } @@ -1323,7 +1323,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec bool isReordering = this.JsonReader is ReorderingJsonReader; Func propertyAnnotationReaderForTopLevelProperty = - annotationName => { throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation(annotationName)); }; + annotationName => { throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, annotationName)); }; // Read through all top-level properties, ignore the ones with reserved names (i.e., reserved // characters in their name) and throw if we find none or more than one properties without reserved name. @@ -1357,7 +1357,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec if (!object.ReferenceEquals(missingPropertyValue, propertyValue)) { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty(ODataAnnotationNames.ODataType, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty, ODataAnnotationNames.ODataType, ODataJsonConstants.ODataValuePropertyName)); } payloadTypeName = this.ReadODataTypeAnnotationValue(); @@ -1365,7 +1365,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } break; @@ -1379,7 +1379,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) @@ -1398,7 +1398,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec else { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName(propertyName, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, propertyName, ODataJsonConstants.ODataValuePropertyName)); } break; @@ -1407,7 +1407,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }); } @@ -1415,7 +1415,7 @@ private ODataProperty ReadTopLevelPropertyImplementation(IEdmTypeReference expec if (object.ReferenceEquals(missingPropertyValue, propertyValue)) { // No property found; there should be exactly one property in the top-level property wrapper that does not have a reserved name. - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload); + throw new ODataException(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload); } } } @@ -1450,7 +1450,7 @@ private IEdmTypeReference UpdateExpectedTypeBasedOnContextUri(IEdmTypeReference IEdmType typeFromContextUri = this.ContextUriParseResult.EdmType; if (expectedPropertyTypeReference != null && !expectedPropertyTypeReference.Definition.IsAssignableFrom(typeFromContextUri)) { - throw new ODataException(ODataErrorStrings.ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType, UriUtils.UriToString(this.ContextUriParseResult.ContextUri), typeFromContextUri.FullTypeName(), expectedPropertyTypeReference.FullName())); @@ -1561,7 +1561,7 @@ private object ReadTypeDefinitionValue(bool insideJsonObjectValue, IEdmTypeDefin } catch (OverflowException) { - throw new ODataException(ODataErrorStrings.EdmLibraryExtensions_ValueOverflowForUnderlyingType(result, expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_ValueOverflowForUnderlyingType, result, expectedValueTypeReference.FullName())); } } @@ -1601,7 +1601,7 @@ private object ReadPrimitiveValue(bool insideJsonObjectValue, IEdmPrimitiveTypeR { // We manually throw JSON exception here to get a nicer error message (we expect primitive value and got object). // Otherwise the ReadPrimitiveValue would fail with something like "expected primitive value but found property/end object" which is rather confusing. - throw new ODataException(ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName(JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); + throw new ODataException(Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); } result = this.JsonReader.ReadPrimitiveValue(); @@ -1613,7 +1613,7 @@ private object ReadPrimitiveValue(bool insideJsonObjectValue, IEdmPrimitiveTypeR { if ((result is string) ^ this.JsonReader.IsIeee754Compatible) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter(expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, expectedValueTypeReference.FullName())); } } @@ -1654,7 +1654,7 @@ private object ReadEnumValue(bool insideJsonObjectValue, IEdmEnumTypeReference e { // We manually throw JSON exception here to get a nicer error message (we expect primitive value and got object). // Otherwise the ReadPrimitiveValue would fail with something like "expected primitive value but found property/end object" which is rather confusing. - throw new ODataException(ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName(JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); + throw new ODataException(Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); } string enumStr = this.JsonReader.ReadStringValue(); @@ -1686,7 +1686,7 @@ private ODataResourceValue ReadResourceValue( { string typeName = structuredTypeReference != null ? structuredTypeReference.FullName() : payloadTypeName; throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty(propertyName, this.JsonReader.NodeType, typeName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty, propertyName, this.JsonReader.NodeType, typeName)); } this.JsonReader.Read(); @@ -1745,11 +1745,11 @@ private ODataResourceValue ReadResourceValue( case PropertyParsingResult.ODataInstanceAnnotation: // odata.* if (string.Equals(ODataAnnotationNames.ODataType, propertyName, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst); + throw new ODataException(SRResources.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst); } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } case PropertyParsingResult.CustomInstanceAnnotation: // custom instance annotation @@ -1762,7 +1762,7 @@ private ODataResourceValue ReadResourceValue( break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: // Any other property is data @@ -1811,7 +1811,7 @@ private ODataResourceValue ReadResourceValue( break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }); } @@ -1938,7 +1938,7 @@ private object ReadNonEntityValueImplementation( if (targetTypeKind != EdmTypeKind.Collection || isDynamicProperty != true) { // A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values. - throw new ODataException(ODataErrorStrings.ReaderValidationUtils_NullNamedValueForNonNullableType(propertyName, targetTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, propertyName, targetTypeReference.FullName())); } } @@ -1959,7 +1959,7 @@ private object ReadNonEntityValueImplementation( // for primitive values are property annotations, not instance annotations inside the value. if (typeNameFoundInPayload) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue(ODataAnnotationNames.ODataType)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue, ODataAnnotationNames.ODataType)); } result = this.ReadPrimitiveValue( @@ -1998,7 +1998,7 @@ private object ReadNonEntityValueImplementation( { // We manually throw JSON exception here to get a nicer error message (we expect array value and got object). // Otherwise the ReadCollectionValue would fail with something like "expected array value but found property/end object" which is rather confusing. - throw new ODataException(ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName(JsonNodeType.StartArray, JsonNodeType.StartObject, propertyName)); + throw new ODataException(Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.StartArray, JsonNodeType.StartObject, propertyName)); } result = this.ReadCollectionValue( @@ -2020,7 +2020,7 @@ private object ReadNonEntityValueImplementation( break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonPropertyAndValueDeserializer_ReadPropertyValue)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonPropertyAndValueDeserializer_ReadPropertyValue)); } // If we have no expected type make sure the collection items are of the same kind and specify the same name. @@ -2149,7 +2149,7 @@ private bool IsTopLevel6xNullValue() object nullAnnotationValue = this.JsonReader.ReadPrimitiveValue(); if (!(nullAnnotationValue is bool) || (bool)nullAnnotationValue == false) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation(ODataAnnotationNames.ODataNull, ODataJsonConstants.ODataNullAnnotationTrueValue)); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation, ODataAnnotationNames.ODataNull, ODataJsonConstants.ODataNullAnnotationTrueValue)); } } @@ -2165,7 +2165,7 @@ private void ValidateNoPropertyInNullPayload(PropertyAndAnnotationCollector prop Debug.Assert(propertyAndAnnotationCollector != null, "propertyAndAnnotationCollector != null"); // we use the ParseProperty method to ignore custom annotations. - Func propertyAnnotationReaderForTopLevelNull = annotationName => { throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation(annotationName)); }; + Func propertyAnnotationReaderForTopLevelNull = annotationName => { throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, annotationName)); }; while (this.JsonReader.NodeType == JsonNodeType.Property) { this.ProcessProperty( @@ -2182,23 +2182,23 @@ private void ValidateNoPropertyInNullPayload(PropertyAndAnnotationCollector prop switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); case PropertyParsingResult.CustomInstanceAnnotation: this.JsonReader.SkipValue(); break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }); } @@ -2380,7 +2380,7 @@ protected static async Task ValidateExpandedNestedResourceInfoPropertyValueAsync { if (isCollection == false) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource(nodeType, propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource, nodeType, propertyName)); } } else if ( @@ -2401,7 +2401,7 @@ protected static async Task ValidateExpandedNestedResourceInfoPropertyValueAsync } else { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource(nodeType, propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource, nodeType, propertyName)); } } @@ -2409,7 +2409,7 @@ protected static async Task ValidateExpandedNestedResourceInfoPropertyValueAsync else { Debug.Assert(nodeType == JsonNodeType.PrimitiveValue, "nodeType == JsonNodeType.PrimitiveValue"); - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadNestedResource(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadNestedResource, propertyName)); } } @@ -2436,7 +2436,8 @@ protected async Task ReadODataTypeAnnotationValueAsync() await this.JsonReader.ReadStringValueAsync().ConfigureAwait(false))); if (typeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTypeName(typeName)); + // TODO: It's meaningless to output an error message using "typeName == null". Should use the original JSON value to construct the error message. + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, typeName)); } this.AssertJsonCondition(JsonNodeType.Property, JsonNodeType.EndObject); @@ -2499,7 +2500,7 @@ protected async Task ReadTypePropertyAnnotationValueAsync(string propert return typeName; } - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyAnnotationName)); } /// @@ -2618,7 +2619,7 @@ await this.ValidateNoPropertyInNullPayloadAsync(propertyAndAnnotationCollector) Func> readTopLevelPropertyAnnotationValueDelegate = (annotationName) => { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, annotationName)); }; // Read through all top-level properties, ignore the ones with reserved names (i.e., reserved @@ -2655,7 +2656,7 @@ await this.JsonReader.SkipValueAsync() if (!object.ReferenceEquals(missingPropertyValue, propertyValue)) { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty(ODataAnnotationNames.ODataType, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty, ODataAnnotationNames.ODataType, ODataJsonConstants.ODataValuePropertyName)); } payloadTypeName = await this.ReadODataTypeAnnotationValueAsync() @@ -2664,7 +2665,7 @@ await this.JsonReader.SkipValueAsync() } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } break; @@ -2680,7 +2681,7 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) @@ -2699,7 +2700,7 @@ await this.JsonReader.SkipValueAsync() else { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName(propertyName, ODataJsonConstants.ODataValuePropertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, propertyName, ODataJsonConstants.ODataValuePropertyName)); } break; @@ -2708,7 +2709,7 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }).ConfigureAwait(false); } @@ -2716,7 +2717,7 @@ await this.JsonReader.SkipValueAsync() if (object.ReferenceEquals(missingPropertyValue, propertyValue)) { // No property found; there should be exactly one property in the top-level property wrapper that does not have a reserved name. - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload); + throw new ODataException(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload); } } } @@ -2847,7 +2848,7 @@ private async Task ReadTypeDefinitionValueAsync( } catch (OverflowException) { - throw new ODataException(ODataErrorStrings.EdmLibraryExtensions_ValueOverflowForUnderlyingType(result, expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_ValueOverflowForUnderlyingType, result, expectedValueTypeReference.FullName())); } } @@ -2897,7 +2898,7 @@ private async Task ReadPrimitiveValueAsync( // Otherwise the ReadPrimitiveValueAsync would fail with something like // "expected primitive value but found property/end object" which is rather confusing. throw new ODataException( - ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName( + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); @@ -2913,7 +2914,7 @@ private async Task ReadPrimitiveValueAsync( { if ((result is string) ^ this.JsonReader.IsIeee754Compatible) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter(expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, expectedValueTypeReference.FullName())); } } @@ -2964,7 +2965,7 @@ private async Task ReadEnumValueAsync( // Otherwise the ReadPrimitiveValue would fail with something like // "expected primitive value but found property/end object" which is rather confusing. throw new ODataException( - ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName( + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, propertyName)); @@ -3004,7 +3005,7 @@ private async Task ReadResourceValueAsync( { string typeName = structuredTypeReference != null ? structuredTypeReference.FullName() : payloadTypeName; throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty(propertyName, this.JsonReader.NodeType, typeName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty, propertyName, this.JsonReader.NodeType, typeName)); } await this.JsonReader.ReadAsync() @@ -3069,11 +3070,11 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.ODataInstanceAnnotation: // odata.* if (string.Equals(ODataAnnotationNames.ODataType, propertyName, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst); + throw new ODataException(SRResources.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst); } else { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); } case PropertyParsingResult.CustomInstanceAnnotation: // custom instance annotation @@ -3089,7 +3090,7 @@ await this.JsonReader.ReadAsync() case PropertyParsingResult.PropertyWithoutValue: throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty(propertyName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: // Any other property is data @@ -3139,7 +3140,7 @@ await this.JsonReader.ReadAsync() break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }).ConfigureAwait(false); } @@ -3277,7 +3278,7 @@ await this.JsonReader.GetValueAsync().ConfigureAwait(false), if (targetTypeKind != EdmTypeKind.Collection || isDynamicProperty != true) { // A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values. - throw new ODataException(ODataErrorStrings.ReaderValidationUtils_NullNamedValueForNonNullableType(propertyName, targetTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, propertyName, targetTypeReference.FullName())); } } @@ -3298,7 +3299,7 @@ await this.JsonReader.GetValueAsync().ConfigureAwait(false), // for primitive values are property annotations, not instance annotations inside the value. if (typeNameFoundInPayload) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue(ODataAnnotationNames.ODataType)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue, ODataAnnotationNames.ODataType)); } result = await this.ReadPrimitiveValueAsync( @@ -3341,7 +3342,7 @@ await this.JsonReader.GetValueAsync().ConfigureAwait(false), // Otherwise the ReadCollectionValue would fail with something like // "expected array value but found property/end object" which is rather confusing. throw new ODataException( - ODataErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName( + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, JsonNodeType.StartArray, JsonNodeType.StartObject, propertyName)); @@ -3367,7 +3368,7 @@ await this.JsonReader.GetValueAsync().ConfigureAwait(false), break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonPropertyAndValueDeserializer_ReadPropertyValue)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonPropertyAndValueDeserializer_ReadPropertyValue)); } // If we have no expected type make sure the collection items are of the same kind and specify the same name. @@ -3530,7 +3531,7 @@ await this.JsonReader.ReadNextAsync() if (!(nullAnnotationValue is bool) || (bool)nullAnnotationValue == false) { throw new ODataException( - ODataErrorStrings.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation( + Error.Format(SRResources.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation, ODataAnnotationNames.ODataNull, ODataJsonConstants.ODataNullAnnotationTrueValue)); } @@ -3552,7 +3553,7 @@ private async Task ValidateNoPropertyInNullPayloadAsync(PropertyAndAnnotationCol Func> readTopLevelPropertyAnnotationValueDelegate = (annotationName) => { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, annotationName)); }; while (this.JsonReader.NodeType == JsonNodeType.Property) @@ -3572,7 +3573,7 @@ await this.JsonReader.ReadAsync() switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyName)); case PropertyParsingResult.CustomInstanceAnnotation: await this.JsonReader.SkipValueAsync() @@ -3580,16 +3581,16 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload, propertyName)); case PropertyParsingResult.EndOfObject: break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }).ConfigureAwait(false); } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonPropertySerializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonPropertySerializer.cs index f70f31f638..71c34dab4e 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonPropertySerializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonPropertySerializer.cs @@ -13,6 +13,7 @@ namespace Microsoft.OData.Json using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; #endregion Namespaces @@ -195,7 +196,7 @@ internal void WriteProperty( { if (isTopLevel) { - throw new ODataException(Strings.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue, property.Name)); } this.WriteResourceProperty(property, resourceValue, isOpenPropertyType); @@ -209,7 +210,7 @@ internal void WriteProperty( { if (collectionValue.Items != null && collectionValue.Items.Any(i => i is ODataResourceValue)) { - throw new ODataException(Strings.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue, property.Name)); } } @@ -416,7 +417,7 @@ await this.WriteEnumPropertyAsync(enumValue, isOpenPropertyType) { if (isTopLevel) { - throw new ODataException(Strings.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue, property.Name)); } await this.WriteResourcePropertyAsync(property, resourceValue, isOpenPropertyType) @@ -431,7 +432,7 @@ await this.WriteResourcePropertyAsync(property, resourceValue, isOpenPropertyTyp { if (collectionValue.Items != null && collectionValue.Items.Any(i => i is ODataResourceValue)) { - throw new ODataException(Strings.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue, property.Name)); } } @@ -662,7 +663,7 @@ private void WriteNullProperty( // ... // If the property is single-valued and has the null value, the service responds with 204 No Content. // ... - throw new ODataException(Strings.ODataMessageWriter_CannotWriteTopLevelNull); + throw new ODataException(SRResources.ODataMessageWriter_CannotWriteTopLevelNull); } } else @@ -1100,7 +1101,7 @@ await this.JsonWriter.WriteValueAsync(true) // ... // If the property is single-valued and has the null value, the service responds with 204 No Content. // ... - throw new ODataException(Strings.ODataMessageWriter_CannotWriteTopLevelNull); + throw new ODataException(SRResources.ODataMessageWriter_CannotWriteTopLevelNull); } } else diff --git a/src/Microsoft.OData.Core/Json/ODataJsonReader.cs b/src/Microsoft.OData.Core/Json/ODataJsonReader.cs index 570ab11e3c..0373c9ec28 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonReader.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonReader.cs @@ -17,7 +17,7 @@ namespace Microsoft.OData.Json using Microsoft.OData.Evaluation; using Microsoft.OData.Metadata; using Microsoft.OData.UriParser; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -1738,7 +1738,7 @@ private void ReadResourceSetStart(ODataResourceSet resourceSet, SelectedProperti && jsonReader.NodeType != JsonNodeType.PrimitiveValue && jsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet(jsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, jsonReader.NodeType)); } this.EnterScope(new JsonResourceSetScope(resourceSet, this.CurrentNavigationSource, @@ -1812,7 +1812,7 @@ private void ReadExpandedNestedResourceInfoStart(ODataNestedResourceInfo nestedR if (nullValueReadBehaviorKind == ODataNullValueBehaviorKind.Default) { throw new ODataException( - Strings.ReaderValidationUtils_NullNamedValueForNonNullableType(nestedResourceInfo.Name, + Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, nestedResourceInfo.Name, structuralProperty.Type.FullName())); } } @@ -1896,7 +1896,7 @@ private void ReadResourceSetItemStart(PropertyAndAnnotationCollector propertyAnd } else { - throw new ODataException(Strings.ODataJsonReader_UnexpectedPrimitiveValueForODataResource); + throw new ODataException(SRResources.ODataJsonReader_UnexpectedPrimitiveValueForODataResource); } } else @@ -2056,7 +2056,7 @@ private void ReadDeltaResourceSetStart(ODataDeltaResourceSet deltaResourceSet, S IJsonReader jsonReader = this.jsonResourceDeserializer.JsonReader; if (jsonReader.NodeType != JsonNodeType.EndArray && jsonReader.NodeType != JsonNodeType.StartObject) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet(jsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, jsonReader.NodeType)); } Debug.Assert(this.CurrentResourceType is IEdmEntityType, "Delta resource type is not an entity"); @@ -2144,7 +2144,7 @@ private void ReadNextResourceSetItem() if (resourceType?.TypeKind == EdmTypeKind.Entity && !resourceType.IsOpen()) { throw new ODataException( - ODataErrorStrings.ODataJsonReader_CannotReadResourcesOfResourceSet( + Error.Format(SRResources.ODataJsonReader_CannotReadResourcesOfResourceSet, this.jsonResourceDeserializer.JsonReader.NodeType)); } @@ -2178,7 +2178,7 @@ private void ReadNextResourceSetItem() break; default: throw new ODataException( - ODataErrorStrings.ODataJsonReader_CannotReadResourcesOfResourceSet( + Error.Format(SRResources.ODataJsonReader_CannotReadResourcesOfResourceSet, this.jsonResourceDeserializer.JsonReader.NodeType)); } } @@ -3257,7 +3257,7 @@ await this.jsonResourceDeserializer.ReadResourceSetContentStartAsync() && jsonReader.NodeType != JsonNodeType.PrimitiveValue && jsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet(jsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, jsonReader.NodeType)); } this.EnterScope(new JsonResourceSetScope( @@ -3338,7 +3338,7 @@ await this.jsonResourceDeserializer.JsonReader.GetValueAsync().ConfigureAwait(fa if (nullValueReadBehaviorKind == ODataNullValueBehaviorKind.Default) { - throw new ODataException(Strings.ReaderValidationUtils_NullNamedValueForNonNullableType( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, nestedResourceInfo.Name, structuralProperty.Type.FullName())); } @@ -3417,7 +3417,7 @@ private async Task ReadResourceSetItemStartAsync(PropertyAndAnnotationCollector } else { - throw new ODataException(Strings.ODataJsonReader_UnexpectedPrimitiveValueForODataResource); + throw new ODataException(SRResources.ODataJsonReader_UnexpectedPrimitiveValueForODataResource); } } else @@ -3612,7 +3612,7 @@ await this.ReadResourceSetEndAsync() case JsonNodeType.PrimitiveValue: if (resourceType?.TypeKind == EdmTypeKind.Entity && !resourceType.IsOpen()) { - throw new ODataException(ODataErrorStrings.ODataJsonReader_CannotReadResourcesOfResourceSet( + throw new ODataException(Error.Format(SRResources.ODataJsonReader_CannotReadResourcesOfResourceSet, this.jsonResourceDeserializer.JsonReader.NodeType)); } @@ -3654,7 +3654,7 @@ await this.ReadResourceSetItemStartAsync( break; default: - throw new ODataException(ODataErrorStrings.ODataJsonReader_CannotReadResourcesOfResourceSet( + throw new ODataException(Error.Format(SRResources.ODataJsonReader_CannotReadResourcesOfResourceSet, this.jsonResourceDeserializer.JsonReader.NodeType)); } } @@ -3678,7 +3678,7 @@ await this.jsonResourceDeserializer.ReadResourceSetContentStartAsync() IJsonReader jsonReader = this.jsonResourceDeserializer.JsonReader; if (jsonReader.NodeType != JsonNodeType.EndArray && jsonReader.NodeType != JsonNodeType.StartObject) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet(jsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, jsonReader.NodeType)); } Debug.Assert(this.CurrentResourceType is IEdmEntityType, "Delta resource type is not an entity"); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonReaderCoreUtils.cs b/src/Microsoft.OData.Core/Json/ODataJsonReaderCoreUtils.cs index ab25fa2e3f..e1b6c23f6f 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonReaderCoreUtils.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonReaderCoreUtils.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.Json using System.Diagnostics; using Microsoft.Spatial; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; using System.Threading.Tasks; #endregion Namespaces @@ -73,7 +73,7 @@ internal static ISpatial ReadSpatialValue( if (spatialValue == null) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue); + throw new ODataException(SRResources.ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue); } return spatialValue; @@ -174,7 +174,7 @@ internal static async Task ReadSpatialValueAsync( if (spatialValue == null) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue); + throw new ODataException(SRResources.ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue); } return spatialValue; diff --git a/src/Microsoft.OData.Core/Json/ODataJsonReaderUtils.cs b/src/Microsoft.OData.Core/Json/ODataJsonReaderUtils.cs index a6749e9ddb..8cf216c719 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonReaderUtils.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonReaderUtils.cs @@ -11,8 +11,7 @@ namespace Microsoft.OData.Json using System.Diagnostics; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; - using ODataPlatformHelper = Microsoft.OData.PlatformHelper; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -176,7 +175,7 @@ internal static void ValidateAnnotationValue(object propertyValue, string annota if (propertyValue == null) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_AnnotationWithNullValue(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_AnnotationWithNullValue, annotationName)); } } @@ -227,7 +226,7 @@ internal static string GetPayloadTypeName(object payloadItem) return resource.TypeName; } - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonReader_ReadResourceStart)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonReader_ReadResourceStart)); } } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonResourceDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonResourceDeserializer.cs index 5342885a9f..c6eaace36a 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonResourceDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonResourceDeserializer.cs @@ -18,7 +18,7 @@ namespace Microsoft.OData.Json using Microsoft.OData.Edm.Vocabularies.V1; using Microsoft.OData.Evaluation; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -53,7 +53,7 @@ internal void ReadResourceSetContentStart() if (this.JsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart, this.JsonReader.NodeType)); } this.JsonReader.ReadStartArray(); @@ -177,7 +177,7 @@ internal ODataDeletedResource ReadDeletedResource() object value = this.JsonReader.GetValue(); if (value != null) { - throw new ODataException(Strings.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject(value)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject, value)); } } @@ -187,7 +187,7 @@ internal ODataDeletedResource ReadDeletedResource() // A deleted object must have at least either the odata id annotation or the key values if (this.JsonReader.NodeType != JsonNodeType.Property) { - throw new ODataException(Strings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); + throw new ODataException(SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); } // If the next property is the id property - read it. @@ -264,7 +264,7 @@ internal ODataDeletedResource ReadDeletedEntry() if (this.JsonReader.NodeType == JsonNodeType.StartObject || this.JsonReader.NodeType == JsonNodeType.StartArray) { - throw new ODataException(Strings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); + throw new ODataException(SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); } // Ignore unknown primitive properties in a 4.0 deleted entry @@ -590,14 +590,14 @@ internal void ReadTopLevelResourceSetAnnotations(ODataResourceSetBase resourceSe } else { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet, propertyName, ODataJsonConstants.ODataValuePropertyName)); } break; case PropertyParsingResult.PropertyWithoutValue: // If we find a property without a value it means that we did not find the resource set property (yet) // but an invalid property annotation - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet, propertyName)); case PropertyParsingResult.EndOfObject: break; @@ -605,14 +605,14 @@ internal void ReadTopLevelResourceSetAnnotations(ODataResourceSetBase resourceSe case PropertyParsingResult.MetadataReferenceProperty: if (!(resourceSet is ODataResourceSet)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } this.ReadMetadataReferencePropertyValue((ODataResourceSet)resourceSet, propertyName); break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonResourceDeserializer_ReadTopLevelResourceSetAnnotations)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonResourceDeserializer_ReadTopLevelResourceSetAnnotations)); } }); @@ -634,7 +634,7 @@ internal void ReadTopLevelResourceSetAnnotations(ODataResourceSetBase resourceSe if (forResourceSetStart && !readAllResourceSetProperties) { // We did not find any properties or only instance annotations. - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } } @@ -751,14 +751,14 @@ internal object ReadEntryPropertyAnnotationValue(string propertyAnnotationName) this.JsonReader.Read(); if (entityReferenceLinks.Count == 0) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_EmptyBindArray(ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_EmptyBindArray, ODataAnnotationNames.ODataBind)); } return entityReferenceLinks; case ODataAnnotationNames.ODataDeltaLink: // Delta links are not supported on expanded resource sets. default: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyAnnotationName)); } } @@ -792,12 +792,12 @@ internal object ReadEntryInstanceAnnotation(string annotationName, bool anyPrope // We already read the odata.type if it was the first property in ReadResourceStart, so any other occurrence means // that it was not the first property. - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst); + throw new ODataException(SRResources.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst); case ODataAnnotationNames.ODataId: // 'odata.id' if (anyPropertyFound) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, annotationName)); } return this.ReadAnnotationStringValueAsUri(annotationName); @@ -805,7 +805,7 @@ internal object ReadEntryInstanceAnnotation(string annotationName, bool anyPrope case ODataAnnotationNames.ODataETag: // 'odata.etag' if (anyPropertyFound) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, annotationName)); } return this.ReadAndValidateAnnotationStringValue(annotationName); @@ -822,7 +822,7 @@ internal object ReadEntryInstanceAnnotation(string annotationName, bool anyPrope case ODataAnnotationNames.ODataRemoved: // 'odata.removed' { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); + throw new ODataException(SRResources.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); } default: @@ -1014,7 +1014,7 @@ internal ODataJsonReaderNestedInfo ReadPropertyWithoutValue(IODataJsonReaderReso if (!readerNestedResourceInfo.HasEntityReferenceLink) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink(propertyName, ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink, propertyName, ODataAnnotationNames.ODataBind)); } } @@ -1112,7 +1112,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(nest break; default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation(nestedResourceInfo.Name, propertyAnnotation.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation, nestedResourceInfo.Name, propertyAnnotation.Key)); } } @@ -1137,7 +1137,7 @@ private void ReadExpandedResourceSetAnnotationsAtResourceSetEnd(ODataResourceSet { if (!this.ReadingResponse) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation(propertyName, annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, propertyName, annotationName)); } // Read over the property name. @@ -1148,7 +1148,7 @@ private void ReadExpandedResourceSetAnnotationsAtResourceSetEnd(ODataResourceSet case ODataAnnotationNames.ODataNextLink: if (resourceSet.NextPageLink != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation(ODataAnnotationNames.ODataNextLink, expandedNestedResourceInfo.NestedResourceInfo.Name)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, ODataAnnotationNames.ODataNextLink, expandedNestedResourceInfo.NestedResourceInfo.Name)); } // Read the property value. @@ -1158,7 +1158,7 @@ private void ReadExpandedResourceSetAnnotationsAtResourceSetEnd(ODataResourceSet case ODataAnnotationNames.ODataCount: if (resourceSet.Count != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation(ODataAnnotationNames.ODataCount, expandedNestedResourceInfo.NestedResourceInfo.Name)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, ODataAnnotationNames.ODataCount, expandedNestedResourceInfo.NestedResourceInfo.Name)); } // Read the property value. @@ -1167,7 +1167,7 @@ private void ReadExpandedResourceSetAnnotationsAtResourceSetEnd(ODataResourceSet case ODataAnnotationNames.ODataDeltaLink: // Delta links are not supported on expanded resource sets. default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet(annotationName, expandedNestedResourceInfo.NestedResourceInfo.Name)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet, annotationName, expandedNestedResourceInfo.NestedResourceInfo.Name)); } } } @@ -1751,7 +1751,7 @@ private ODataJsonReaderNestedInfo ReadUndeclaredProperty(IODataJsonReaderResourc // Property without a value can't be ignored if we don't know what it is. if (!propertyWithValue) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType, propertyName)); } // Validate that the property doesn't have unrecognized annotations @@ -1864,7 +1864,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(stre break; default: - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation(streamPropertyName, propertyAnnotation.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation, streamPropertyName, propertyAnnotation.Key)); } } @@ -1873,7 +1873,7 @@ in resourceState.PropertyAndAnnotationCollector.GetODataPropertyAnnotations(stre { if (streamInfo.ETag != null || streamInfo.EditLink != null || streamInfo.ReadLink != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_StreamPropertyInRequest(streamPropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_StreamPropertyInRequest, streamPropertyName)); } } } @@ -1899,7 +1899,7 @@ private void ReadSingleOperationValue(IODataJsonOperationsDeserializerContext re if (readerContext.JsonReader.NodeType != JsonNodeType.StartObject) { - throw new ODataException(ODataErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue(metadataReferencePropertyName, readerContext.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, metadataReferencePropertyName, readerContext.JsonReader.NodeType)); } // read over the start-object node of the metadata object for the operations @@ -1930,7 +1930,7 @@ private void ReadSingleOperationValue(IODataJsonOperationsDeserializerContext re case JsonConstants.ODataOperationTitleName: if (operation.Title != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(operationPropertyName, metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } string titleString = readerContext.JsonReader.ReadStringValue(JsonConstants.ODataOperationTitleName); @@ -1941,7 +1941,7 @@ private void ReadSingleOperationValue(IODataJsonOperationsDeserializerContext re case JsonConstants.ODataOperationTargetName: if (operation.Target != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(operationPropertyName, metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } string targetString = readerContext.JsonReader.ReadStringValue(JsonConstants.ODataOperationTargetName); @@ -1959,7 +1959,7 @@ private void ReadSingleOperationValue(IODataJsonOperationsDeserializerContext re if (operation.Target == null && insideArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty(metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, metadataReferencePropertyName)); } // read the end-object node of the target / title pair @@ -1985,7 +1985,7 @@ private void ReadSingleOperationValue(ODataResourceSet resourceSet, string metad if (this.JsonReader.NodeType != JsonNodeType.StartObject) { - throw new ODataException(ODataErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue(metadataReferencePropertyName, this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, metadataReferencePropertyName, this.JsonReader.NodeType)); } // read over the start-object node of the metadata object for the operations @@ -2016,7 +2016,7 @@ private void ReadSingleOperationValue(ODataResourceSet resourceSet, string metad case JsonConstants.ODataOperationTitleName: if (operation.Title != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(operationPropertyName, metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } string titleString = this.JsonReader.ReadStringValue(JsonConstants.ODataOperationTitleName); @@ -2027,7 +2027,7 @@ private void ReadSingleOperationValue(ODataResourceSet resourceSet, string metad case JsonConstants.ODataOperationTargetName: if (operation.Target != null) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(operationPropertyName, metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } string targetString = this.JsonReader.ReadStringValue(JsonConstants.ODataOperationTargetName); @@ -2045,7 +2045,7 @@ private void ReadSingleOperationValue(ODataResourceSet resourceSet, string metad if (operation.Target == null && insideArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty(metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, metadataReferencePropertyName)); } // read the end-object node of the target / title pair @@ -2227,7 +2227,7 @@ private void ValidateCanReadMetadataReferenceProperty() { if (!this.ReadingResponse) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest); + throw new ODataException(SRResources.ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest); } } @@ -2319,7 +2319,7 @@ internal async Task ReadResourceSetContentStartAsync() if (this.JsonReader.NodeType != JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart(this.JsonReader.NodeType)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart, this.JsonReader.NodeType)); } await this.JsonReader.ReadStartArrayAsync() @@ -2463,7 +2463,7 @@ await this.JsonReader.ReadAsync() else if ((removedValue = await this.JsonReader.GetValueAsync().ConfigureAwait(false)) != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject(removedValue)); + Error.Format(SRResources.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject, removedValue)); } // Read over end object or null value @@ -2473,7 +2473,7 @@ await this.JsonReader.ReadAsync() // A deleted object must have at least either the odata id annotation or the key values if (this.JsonReader.NodeType != JsonNodeType.Property) { - throw new ODataException(ODataErrorStrings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); + throw new ODataException(SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); } // If the next property is the id property - read it. @@ -2561,7 +2561,7 @@ await this.JsonReader.ReadAsync() if (this.JsonReader.NodeType == JsonNodeType.StartObject || this.JsonReader.NodeType == JsonNodeType.StartArray) { - throw new ODataException(ODataErrorStrings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); + throw new ODataException(SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); } // Ignore unknown primitive properties in a 4.0 deleted entry @@ -2905,14 +2905,14 @@ await this.JsonReader.SkipValueAsync() } else { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet, propertyName, ODataJsonConstants.ODataValuePropertyName)); } break; case PropertyParsingResult.PropertyWithoutValue: // If we find a property without a value it means that we did not find the resource set property (yet) // but an invalid property annotation - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet, propertyName)); case PropertyParsingResult.EndOfObject: break; @@ -2920,7 +2920,7 @@ await this.JsonReader.SkipValueAsync() case PropertyParsingResult.MetadataReferenceProperty: if (!(resourceSet is ODataResourceSet)) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } await this.ReadMetadataReferencePropertyValueAsync((ODataResourceSet)resourceSet, propertyName) @@ -2928,7 +2928,7 @@ await this.ReadMetadataReferencePropertyValueAsync((ODataResourceSet)resourceSet break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.ODataJsonResourceDeserializer_ReadTopLevelResourceSetAnnotations)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataJsonResourceDeserializer_ReadTopLevelResourceSetAnnotations)); } }).ConfigureAwait(false); @@ -2950,7 +2950,7 @@ await this.ReadMetadataReferencePropertyValueAsync((ODataResourceSet)resourceSet if (forResourceSetStart && !readAllResourceSetProperties) { // We did not find any properties or only instance annotations. - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound, ODataJsonConstants.ODataValuePropertyName)); } } @@ -3083,14 +3083,14 @@ await this.JsonReader.ReadAsync() .ConfigureAwait(false); if (entityReferenceLinks.Count == 0) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_EmptyBindArray(ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_EmptyBindArray, ODataAnnotationNames.ODataBind)); } return entityReferenceLinks; case ODataAnnotationNames.ODataDeltaLink: // Delta links are not supported on expanded resource sets. default: - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(propertyAnnotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, propertyAnnotationName)); } } @@ -3132,13 +3132,13 @@ internal async Task ReadEntryInstanceAnnotationAsync( // We already read the odata.type if it was the first property in ReadResourceStart, so any other occurrence means // that it was not the first property. - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst); + throw new ODataException(SRResources.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst); case ODataAnnotationNames.ODataId: // 'odata.id' if (anyPropertyFound) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty(annotationName)); + Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, annotationName)); } return await this.ReadAnnotationStringValueAsUriAsync(annotationName) @@ -3148,7 +3148,7 @@ internal async Task ReadEntryInstanceAnnotationAsync( if (anyPropertyFound) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty(annotationName)); + Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, annotationName)); } return await this.ReadAndValidateAnnotationStringValueAsync(annotationName) @@ -3168,7 +3168,7 @@ internal async Task ReadEntryInstanceAnnotationAsync( case ODataAnnotationNames.ODataRemoved: // 'odata.removed' { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); + throw new ODataException(SRResources.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); } default: @@ -3288,7 +3288,7 @@ internal async Task ReadPropertyWithoutValueAsync(IOD if (!readerNestedResourceInfo.HasEntityReferenceLink) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink(propertyName, ODataAnnotationNames.ODataBind)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink, propertyName, ODataAnnotationNames.ODataBind)); } } @@ -3370,7 +3370,7 @@ private async Task ReadExpandedResourceSetAnnotationsAtResourceSetEndAsync( if (!this.ReadingResponse) { throw new ODataException( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation(propertyName, annotationName)); + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, propertyName, annotationName)); } // Read over the property name. @@ -3383,7 +3383,7 @@ await this.JsonReader.ReadAsync() if (resourceSet.NextPageLink != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation( + Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, ODataAnnotationNames.ODataNextLink, expandedNestedResourceInfo.NestedResourceInfo.Name)); } @@ -3397,7 +3397,7 @@ await this.JsonReader.ReadAsync() if (resourceSet.Count != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation( + Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, ODataAnnotationNames.ODataCount, expandedNestedResourceInfo.NestedResourceInfo.Name)); } @@ -3410,7 +3410,7 @@ await this.JsonReader.ReadAsync() case ODataAnnotationNames.ODataDeltaLink: // Delta links are not supported on expanded resource sets. default: throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet( + Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet, annotationName, expandedNestedResourceInfo.NestedResourceInfo.Name)); } @@ -3986,7 +3986,7 @@ await this.JsonReader.SkipValueAsync() // Property without a value can't be ignored if we don't know what it is. if (!propertyWithValue) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType, propertyName)); } // Validate that the property doesn't have unrecognized annotations @@ -4039,7 +4039,7 @@ private async Task ReadSingleOperationValueAsync( if (readerContext.JsonReader.NodeType != JsonNodeType.StartObject) { throw new ODataException( - ODataErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue( + Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, metadataReferencePropertyName, readerContext.JsonReader.NodeType)); } @@ -4078,7 +4078,7 @@ await readerContext.JsonReader.ReadEndObjectAsync() if (operation.Title != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation( + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } @@ -4093,7 +4093,7 @@ await readerContext.JsonReader.ReadEndObjectAsync() if (operation.Target != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation( + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } @@ -4115,7 +4115,7 @@ await readerContext.JsonReader.SkipValueAsync() if (operation.Target == null && insideArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty(metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, metadataReferencePropertyName)); } // read the end-object node of the target / title pair @@ -4144,7 +4144,7 @@ private async Task ReadSingleOperationValueAsync(ODataResourceSet resourceSet, s if (this.JsonReader.NodeType != JsonNodeType.StartObject) { throw new ODataException( - ODataErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue(metadataReferencePropertyName, this.JsonReader.NodeType)); + Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, metadataReferencePropertyName, this.JsonReader.NodeType)); } // read over the start-object node of the metadata object for the operations @@ -4181,7 +4181,7 @@ await this.JsonReader.ReadEndObjectAsync() if (operation.Title != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation( + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } @@ -4196,7 +4196,7 @@ await this.JsonReader.ReadEndObjectAsync() if (operation.Target != null) { throw new ODataException( - ODataErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation( + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, operationPropertyName, metadataReferencePropertyName)); } @@ -4218,7 +4218,7 @@ await this.JsonReader.SkipValueAsync() if (operation.Target == null && insideArray) { - throw new ODataException(ODataErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty(metadataReferencePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, metadataReferencePropertyName)); } // Read the end-object node of the target / title pair diff --git a/src/Microsoft.OData.Core/Json/ODataJsonResourceSerializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonResourceSerializer.cs index c13dedeed3..50ac30406d 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonResourceSerializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonResourceSerializer.cs @@ -9,6 +9,7 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; namespace Microsoft.OData.Json @@ -771,14 +772,14 @@ private void ValidateOperationMetadataGroup(IGrouping op if (operations.Count() > 1 && operations.Any(o => o.Target == null)) { - throw new ODataException(Strings.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget(operations.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget, operations.Key)); } foreach (IGrouping operationsByTarget in operations.GroupBy(this.GetOperationTargetUriString)) { if (operationsByTarget.Count() > 1) { - throw new ODataException(Strings.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget(operations.Key, operationsByTarget.Key)); + throw new ODataException(Error.Format(SRResources.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget, operations.Key, operationsByTarget.Key)); } } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonSerializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonSerializer.cs index 1862892771..bbc656a51f 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonSerializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonSerializer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -363,7 +364,7 @@ internal string UriToString(Uri uri) // TODO: Check if it is dead code to be removed. if (metadataDocumentUri == null) { - throw new ODataException(Strings.ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata(UriUtils.UriToString(resultUri))); + throw new ODataException(Error.Format(SRResources.ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata, UriUtils.UriToString(resultUri))); } resultUri = UriUtils.UriToAbsoluteUri(metadataDocumentUri, uri); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentDeserializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentDeserializer.cs index fbb8f009f2..edeb8924f2 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentDeserializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentDeserializer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -124,7 +125,7 @@ private ODataServiceDocument ReadServiceDocumentImplementation(PropertyAndAnnota while (this.JsonReader.NodeType == JsonNodeType.Property) { // Property annotations are not allowed on the 'value' property, so fail if we see one. - Func readPropertyAnnotationInServiceDoc = annotationName => { throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument(annotationName, ODataJsonConstants.ODataValuePropertyName)); }; + Func readPropertyAnnotationInServiceDoc = annotationName => { throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument, annotationName, ODataJsonConstants.ODataValuePropertyName)); }; this.ProcessProperty( propertyAndAnnotationCollector, @@ -140,14 +141,14 @@ private ODataServiceDocument ReadServiceDocumentImplementation(PropertyAndAnnota switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument, propertyName, ODataJsonConstants.ODataValuePropertyName)); case PropertyParsingResult.CustomInstanceAnnotation: this.JsonReader.SkipValue(); break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) @@ -155,7 +156,7 @@ private ODataServiceDocument ReadServiceDocumentImplementation(PropertyAndAnnota // Fail if we've already processed a 'value' property. if (serviceDocumentElements[0] != null) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument, ODataJsonConstants.ODataValuePropertyName)); } serviceDocumentElements[0] = new List(); @@ -180,7 +181,7 @@ private ODataServiceDocument ReadServiceDocumentImplementation(PropertyAndAnnota } else { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument(propertyName, ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument, propertyName, ODataJsonConstants.ODataValuePropertyName)); } break; @@ -188,14 +189,14 @@ private ODataServiceDocument ReadServiceDocumentImplementation(PropertyAndAnnota break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }); } if (serviceDocumentElements[0] == null) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument(ODataJsonConstants.ODataValuePropertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument, ODataJsonConstants.ODataValuePropertyName)); } // Read over the end object (nothing else can happen after all properties have been read) @@ -234,7 +235,7 @@ private ODataServiceDocumentElement ReadServiceDocumentElement(PropertyAndAnnota // OData property annotations are not supported in service document element objects. Func propertyAnnotationValueReader = annotationName => { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement, annotationName)); }; this.ProcessProperty( @@ -251,17 +252,17 @@ private ODataServiceDocumentElement ReadServiceDocumentElement(PropertyAndAnnota switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement, propertyName)); case PropertyParsingResult.CustomInstanceAnnotation: this.JsonReader.SkipValue(); break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataServiceDocumentElementName, propertyName, StringComparison.Ordinal)) @@ -291,7 +292,7 @@ private ODataServiceDocumentElement ReadServiceDocumentElement(PropertyAndAnnota } else { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement, propertyName, ODataJsonConstants.ODataServiceDocumentElementName, ODataJsonConstants.ODataServiceDocumentElementUrlName)); @@ -346,7 +347,7 @@ private async Task ReadServiceDocumentImplementationAsync( // Property annotations are not allowed on the 'value' property, so fail if we see one. Func> readPropertyAnnotationInServiceDocumentAsync = annotationName => { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument, annotationName, ODataJsonConstants.ODataValuePropertyName)); }; @@ -366,7 +367,7 @@ await this.JsonReader.ReadAsync() switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument, propertyName, ODataJsonConstants.ODataValuePropertyName)); @@ -376,7 +377,7 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataValuePropertyName, propertyName, StringComparison.Ordinal)) @@ -384,7 +385,7 @@ await this.JsonReader.SkipValueAsync() // Fail if we've already processed a 'value' property. if (serviceDocumentElements[0] != null) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument, ODataJsonConstants.ODataValuePropertyName)); } @@ -413,7 +414,7 @@ await this.JsonReader.ReadEndArrayAsync() } else { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument, propertyName, ODataJsonConstants.ODataValuePropertyName)); } @@ -423,14 +424,14 @@ await this.JsonReader.ReadEndArrayAsync() break; case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); } }).ConfigureAwait(false); } if (serviceDocumentElements[0] == null) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument, ODataJsonConstants.ODataValuePropertyName)); } @@ -478,7 +479,7 @@ await this.JsonReader.ReadStartObjectAsync() // OData property annotations are not supported in service document element objects. Func> propertyAnnotationValueReaderAsync = annotationName => { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement(annotationName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement, annotationName)); }; await this.ProcessPropertyAsync( @@ -496,7 +497,7 @@ await this.JsonReader.ReadAsync() switch (propertyParsingResult) { case PropertyParsingResult.ODataInstanceAnnotation: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement, propertyName)); case PropertyParsingResult.CustomInstanceAnnotation: await this.JsonReader.SkipValueAsync() @@ -504,10 +505,10 @@ await this.JsonReader.SkipValueAsync() break; case PropertyParsingResult.PropertyWithoutValue: - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, propertyName)); case PropertyParsingResult.MetadataReferenceProperty: - throw new ODataException(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, propertyName)); case PropertyParsingResult.PropertyWithValue: if (string.Equals(ODataJsonConstants.ODataServiceDocumentElementName, propertyName, StringComparison.Ordinal)) @@ -541,7 +542,7 @@ await this.JsonReader.SkipValueAsync() } else { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement( + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement, propertyName, ODataJsonConstants.ODataServiceDocumentElementName, ODataJsonConstants.ODataServiceDocumentElementUrlName)); @@ -613,7 +614,7 @@ private static void ValidateServiceDocumentElementHasNoRepeatedProperty(string p if (propertyValues[0] != null) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement(property)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement, property)); } } @@ -628,7 +629,7 @@ private static void ValidateServiceDocumentElementHasRequiredProperty(string pro if (string.IsNullOrEmpty(propertyValues[0])) { - throw new ODataException(Strings.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement(property)); + throw new ODataException(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement, property)); } } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentSerializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentSerializer.cs index 56cca97835..bb5ffa8af7 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentSerializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonServiceDocumentSerializer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -74,7 +75,7 @@ internal void WriteServiceDocument(ODataServiceDocument serviceDocument) { if (functionImportInfo == null) { - throw new ODataException(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem); + throw new ODataException(SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem); } if (!functionImportsWritten.Contains(functionImportInfo.Name)) @@ -187,7 +188,7 @@ await thisParam.WriteServiceDocumentElementAsync(singletonInfo, ODataJsonConstan { if (functionImportInfo == null) { - throw new ODataException(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem); + throw new ODataException(SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem); } if (!functionImportsWritten.Contains(functionImportInfo.Name)) diff --git a/src/Microsoft.OData.Core/Json/ODataJsonValidationUtils.cs b/src/Microsoft.OData.Core/Json/ODataJsonValidationUtils.cs index c93a64a3bb..be94ab7d37 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonValidationUtils.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonValidationUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -41,12 +42,12 @@ internal static void ValidateMetadataReferencePropertyName(Uri metadataDocumentU !ODataJsonUtils.IsMetadataReferenceProperty(propertyName) || propertyName[propertyName.Length - 1] == ODataConstants.ContextUriFragmentIndicator) { - throw new ODataException(Strings.ValidationUtils_InvalidMetadataReferenceProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, propertyName)); } if (IsOpenMetadataReferencePropertyName(metadataDocumentUri, propertyName)) { - throw new ODataException(Strings.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported(propertyName, UriUtils.UriToString(metadataDocumentUri))); + throw new ODataException(Error.Format(SRResources.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, propertyName, UriUtils.UriToString(metadataDocumentUri))); } } @@ -101,7 +102,7 @@ internal static void ValidateOperationPropertyValueIsNotNull(object propertyValu if (propertyValue == null) { - throw new ODataException(Strings.ODataJsonValidationUtils_OperationPropertyCannotBeNull(propertyName, metadata)); + throw new ODataException(Error.Format(SRResources.ODataJsonValidationUtils_OperationPropertyCannotBeNull, propertyName, metadata)); } } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonValueSerializer.cs b/src/Microsoft.OData.Core/Json/ODataJsonValueSerializer.cs index 3e9c533056..ab95ac8ea5 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonValueSerializer.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonValueSerializer.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Json using System.Threading.Tasks; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -124,7 +124,7 @@ public virtual void WriteResourceValue( // In requests, we allow the property type reference to be null if the type name is specified in the OM if (metadataTypeReference == null && !this.WritingResponse && typeName == null && this.Model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); + throw new ODataException(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); } // Resolve the type name to the type; if no type name is specified we will use the type inferred from metadata. @@ -189,7 +189,7 @@ public virtual void WriteCollectionValue( Debug.Assert(metadataTypeReference == null, "Never expect a metadata type for top-level properties."); if (typeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonValueSerializer_MissingTypeNameOnCollection); + throw new ODataException(SRResources.ODataJsonValueSerializer_MissingTypeNameOnCollection); } } else @@ -197,7 +197,7 @@ public virtual void WriteCollectionValue( // In requests, we allow the metadata type reference to be null if the type name is specified in the OM if (metadataTypeReference == null && !this.WritingResponse && typeName == null && this.Model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); + throw new ODataException(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); } } @@ -374,7 +374,7 @@ public virtual void WriteUntypedValue( if (string.IsNullOrEmpty(value.RawValue)) { - throw new ODataException(ODataErrorStrings.ODataJsonValueSerializer_MissingRawValueOnUntyped); + throw new ODataException(SRResources.ODataJsonValueSerializer_MissingRawValueOnUntyped); } this.JsonWriter.WriteRawValue(value.RawValue); @@ -451,7 +451,7 @@ public virtual async Task WriteResourceValueAsync( // In requests, we allow the property type reference to be null if the type name is specified in the OM if (metadataTypeReference == null && !this.WritingResponse && typeName == null && this.Model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); + throw new ODataException(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); } // Resolve the type name to the type; if no type name is specified we will use the type inferred from metadata. @@ -519,7 +519,7 @@ public virtual async Task WriteCollectionValueAsync( Debug.Assert(metadataTypeReference == null, "Never expect a metadata type for top-level properties."); if (typeName == null) { - throw new ODataException(ODataErrorStrings.ODataJsonValueSerializer_MissingTypeNameOnCollection); + throw new ODataException(SRResources.ODataJsonValueSerializer_MissingTypeNameOnCollection); } } else @@ -527,7 +527,7 @@ public virtual async Task WriteCollectionValueAsync( // In requests, we allow the metadata type reference to be null if the type name is specified in the OM if (metadataTypeReference == null && !this.WritingResponse && typeName == null && this.Model.IsUserModel()) { - throw new ODataException(ODataErrorStrings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); + throw new ODataException(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); } } @@ -714,7 +714,7 @@ public virtual Task WriteUntypedValueAsync( if (string.IsNullOrEmpty(value.RawValue)) { - throw new ODataException(ODataErrorStrings.ODataJsonValueSerializer_MissingRawValueOnUntyped); + throw new ODataException(SRResources.ODataJsonValueSerializer_MissingRawValueOnUntyped); } return this.JsonWriter.WriteRawValueAsync(value.RawValue); diff --git a/src/Microsoft.OData.Core/Json/ODataJsonWriter.cs b/src/Microsoft.OData.Core/Json/ODataJsonWriter.cs index 22267b5959..671ae24808 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonWriter.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonWriter.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Microsoft.OData.Metadata; @@ -779,7 +780,7 @@ protected override void StartDeletedResource(ODataDeletedResource resource) // Writing a nested deleted resource if (this.Version == null || this.Version < ODataVersion.V401) { - throw new ODataException(Strings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); + throw new ODataException(SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); } else { @@ -1056,7 +1057,7 @@ protected override void WriteEntityReferenceInNavigationLinkContent(ODataNestedR if (nestedResourceScope.ResourceSetWritten) { - throw new ODataException(Strings.ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest); + throw new ODataException(SRResources.ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest); } if (!nestedResourceScope.EntityReferenceLinkWritten) @@ -1799,7 +1800,7 @@ protected override async Task StartDeletedResourceAsync(ODataDeletedResource res // Writing a nested deleted resource if (this.Version == null || this.Version < ODataVersion.V401) { - throw new ODataException(Strings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); + throw new ODataException(SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); } else { @@ -2151,7 +2152,7 @@ protected override async Task WriteEntityReferenceInNavigationLinkContentAsync( if (nestedResourceScope.ResourceSetWritten) { - throw new ODataException(Strings.ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest); + throw new ODataException(SRResources.ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest); } if (!nestedResourceScope.EntityReferenceLinkWritten) @@ -2621,7 +2622,7 @@ private void ValidateNoCustomInstanceAnnotationsForExpandedResourceSet(ODataReso if (resourceSet.InstanceAnnotations.Count > 0) { - throw new ODataException(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + throw new ODataException(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); } } diff --git a/src/Microsoft.OData.Core/Json/ODataJsonWriterUtils.cs b/src/Microsoft.OData.Core/Json/ODataJsonWriterUtils.cs index df0b8e2214..399a975fe7 100644 --- a/src/Microsoft.OData.Core/Json/ODataJsonWriterUtils.cs +++ b/src/Microsoft.OData.Core/Json/ODataJsonWriterUtils.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Json using System.Text; using System.Threading.Tasks; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -140,14 +140,14 @@ internal static void ODataValueToString(StringBuilder sb, ODataValue value) else { // For unsupported primitive values (e.g. spatial values) - sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(valueAsObject.GetType().FullName))).Append('"'); + sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, valueAsObject.GetType().FullName))).Append('"'); } return; } // Subclasses of ODataValue that are not supported in ODataInnerError.Properties dictionary - sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(value.GetType().FullName))).Append('"'); + sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, value.GetType().FullName))).Append('"'); } /// @@ -380,7 +380,7 @@ private static void ODataCollectionValueToString(StringBuilder sb, ODataCollecti } else { - sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(ODataErrorStrings.ODataJsonWriter_UnsupportedValueType(item.GetType().FullName))).Append('"'); + sb.Append('"').Append(JsonValueUtils.GetEscapedJsonString(Error.Format(SRResources.ODataJsonWriter_UnsupportedValueType, item.GetType().FullName))).Append('"'); } } diff --git a/src/Microsoft.OData.Core/Json/PooledByteBufferWriter.cs b/src/Microsoft.OData.Core/Json/PooledByteBufferWriter.cs index 7c7d693193..d273e5d5df 100644 --- a/src/Microsoft.OData.Core/Json/PooledByteBufferWriter.cs +++ b/src/Microsoft.OData.Core/Json/PooledByteBufferWriter.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Buffers; using System.Diagnostics; @@ -203,7 +204,7 @@ private void CheckAndResizeBuffer(int sizeHint) // If the size still exceeds the max size, then give up and throw an OOM. if ((uint)newSize > MaximumBufferSize) { - throw new OutOfMemoryException(Strings.ODataMessageWriter_Buffer_Maximum_Size_Exceeded(newSize)); + throw new OutOfMemoryException(Error.Format(SRResources.ODataMessageWriter_Buffer_Maximum_Size_Exceeded, newSize)); } } diff --git a/src/Microsoft.OData.Core/Json/ReorderingJsonReader.cs b/src/Microsoft.OData.Core/Json/ReorderingJsonReader.cs index 296ede61aa..df6de9a5c6 100644 --- a/src/Microsoft.OData.Core/Json/ReorderingJsonReader.cs +++ b/src/Microsoft.OData.Core/Json/ReorderingJsonReader.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Json { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -47,7 +48,7 @@ public override Stream CreateReadStream() } catch (FormatException) { - throw new ODataException(Strings.JsonReader_InvalidBinaryFormat(this.GetValue())); + throw new ODataException(Error.Format(SRResources.JsonReader_InvalidBinaryFormat, this.GetValue())); } this.Read(); @@ -64,7 +65,7 @@ public override TextReader CreateTextReader() if (this.NodeType == JsonNodeType.Property) { // reading JSON - throw new ODataException(Strings.JsonReader_CannotCreateTextReader); + throw new ODataException(SRResources.JsonReader_CannotCreateTextReader); } TextReader result = new StringReader(this.GetValue() == null ? "" : (string)this.GetValue()); @@ -112,7 +113,7 @@ public override async Task CreateReadStreamAsync() } catch (FormatException) { - throw new ODataException(Strings.JsonReader_InvalidBinaryFormat(value)); + throw new ODataException(Error.Format(SRResources.JsonReader_InvalidBinaryFormat, value)); } await this.ReadAsync() @@ -133,7 +134,7 @@ public override async Task CreateTextReaderAsync() if (this.NodeType == JsonNodeType.Property) { // reading JSON - throw new ODataException(Strings.JsonReader_CannotCreateTextReader); + throw new ODataException(SRResources.JsonReader_CannotCreateTextReader); } TextReader result; @@ -518,7 +519,7 @@ private static void ProcessProperty(string jsonPropertyName, out string property else { // unexpected instance annotation name - throw new ODataException(Microsoft.OData.Strings.JsonReaderExtensions_UnexpectedInstanceAnnotationName(jsonPropertyName)); + throw new ODataException(Error.Format(SRResources.JsonReaderExtensions_UnexpectedInstanceAnnotationName, jsonPropertyName)); } } } diff --git a/src/Microsoft.OData.Core/MediaTypeUtils.cs b/src/Microsoft.OData.Core/MediaTypeUtils.cs index 806eee4fa5..dc47779e8f 100644 --- a/src/Microsoft.OData.Core/MediaTypeUtils.cs +++ b/src/Microsoft.OData.Core/MediaTypeUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Concurrent; @@ -126,7 +127,7 @@ internal static ODataFormat GetContentTypeFromSettings( IList supportedMediaTypes = mediaTypeResolver.GetMediaTypeFormats(payloadKind).ToList(); if (supportedMediaTypes == null || supportedMediaTypes.Count == 0) { - throw new ODataContentTypeException(Strings.MediaTypeUtils_DidNotFindMatchingMediaType(null, settings.AcceptableMediaTypes)); + throw new ODataContentTypeException(Error.Format(SRResources.MediaTypeUtils_DidNotFindMatchingMediaType, null, settings.AcceptableMediaTypes)); } if (settings.UseFormat == true) @@ -163,7 +164,7 @@ internal static ODataFormat GetContentTypeFromSettings( { // We're calling the ToArray here since not all platforms support the string.Join which takes IEnumerable. string supportedTypesAsString = String.Join(", ", supportedMediaTypes.Select(mt => mt.MediaType.ToText()).ToArray()); - throw new ODataContentTypeException(Strings.MediaTypeUtils_DidNotFindMatchingMediaType(supportedTypesAsString, settings.AcceptableMediaTypes)); + throw new ODataContentTypeException(Error.Format(SRResources.MediaTypeUtils_DidNotFindMatchingMediaType, supportedTypesAsString, settings.AcceptableMediaTypes)); } selectedMediaTypeWithFormat = supportedMediaTypes[matchInfo.TargetTypeIndex]; @@ -331,7 +332,7 @@ internal static void CheckMediaTypeForWildCards(ODataMediaType mediaType) if (HttpUtils.CompareMediaTypeNames(MimeConstants.MimeStar, mediaType.Type) || HttpUtils.CompareMediaTypeNames(MimeConstants.MimeStar, mediaType.SubType)) { - throw new ODataContentTypeException(Strings.ODataMessageReader_WildcardInContentType(mediaType.FullTypeName)); + throw new ODataContentTypeException(Error.Format(SRResources.ODataMessageReader_WildcardInContentType, mediaType.FullTypeName)); } } @@ -352,7 +353,7 @@ internal static string AlterContentTypeForJsonPadding(string contentType) return contentType.Remove(0, MimeConstants.MimeTextPlain.Length).Insert(0, MimeConstants.TextJavaScript); } - throw new ODataException(Strings.ODataMessageWriter_JsonPaddingOnInvalidContentType(contentType)); + throw new ODataException(Error.Format(SRResources.ODataMessageWriter_JsonPaddingOnInvalidContentType, contentType)); } /// @@ -406,7 +407,7 @@ internal static ODataFormat GetFormatFromContentType(string contentTypeName, ODa // We're calling the ToArray here since not all platforms support the string.Join which takes IEnumerable. var str = String.Join(", ", mediaTypeResolver.GetMediaTypeFormats(supportedPayloadKinds[0]).ToList().Select(x => x.MediaType)); string supportedTypesAsString = String.Join(", ", supportedPayloadKinds.SelectMany(pk => mediaTypeResolver.GetMediaTypeFormats(pk).Select(mt => mt.MediaType.ToText())).ToArray()); - throw new ODataContentTypeException(Strings.MediaTypeUtils_CannotDetermineFormatFromContentType(str, contentTypeName)); + throw new ODataContentTypeException(Error.Format(SRResources.MediaTypeUtils_CannotDetermineFormatFromContentType, str, contentTypeName)); } /// @@ -432,7 +433,7 @@ private static ODataMediaType ParseContentType(string contentTypeHeader, out str IList> specifiedTypes = HttpUtils.MediaTypesFromString(contentTypeHeader); if (specifiedTypes.Count != 1) { - throw new ODataContentTypeException(Strings.MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified(contentTypeHeader)); + throw new ODataContentTypeException(Error.Format(SRResources.MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified, contentTypeHeader)); } ODataMediaType contentType = specifiedTypes[0].Key; @@ -465,7 +466,7 @@ private static ODataMediaType GetDefaultMediaType( } } - throw new ODataException(Strings.ODataUtils_DidNotFindDefaultMediaType(specifiedFormat)); + throw new ODataException(Error.Format(SRResources.ODataUtils_DidNotFindDefaultMediaType, specifiedFormat)); } /// diff --git a/src/Microsoft.OData.Core/MessageStreamWrapper.cs b/src/Microsoft.OData.Core/MessageStreamWrapper.cs index dedd6b5e9b..2ddf14e789 100644 --- a/src/Microsoft.OData.Core/MessageStreamWrapper.cs +++ b/src/Microsoft.OData.Core/MessageStreamWrapper.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System.Diagnostics; using System.IO; using System.Threading; @@ -264,7 +265,7 @@ private void IncreaseTotalBytesRead(int bytesRead) this.totalBytesRead += bytesRead < 0 ? 0 : bytesRead; if (this.totalBytesRead > this.maxBytesToBeRead) { - throw new ODataException(Strings.MessageStreamWrappingStream_ByteLimitExceeded(this.totalBytesRead, this.maxBytesToBeRead)); + throw new ODataException(Error.Format(SRResources.MessageStreamWrappingStream_ByteLimitExceeded, this.totalBytesRead, this.maxBytesToBeRead)); } } } diff --git a/src/Microsoft.OData.Core/Metadata/BufferingXmlReader.cs b/src/Microsoft.OData.Core/Metadata/BufferingXmlReader.cs index 8f22f20e08..40a92b7c93 100644 --- a/src/Microsoft.OData.Core/Metadata/BufferingXmlReader.cs +++ b/src/Microsoft.OData.Core/Metadata/BufferingXmlReader.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Metadata { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -454,7 +455,7 @@ public override bool Read() if (this.documentBaseUri == null) { // If there's no document base URI we need to fail since there's no way to create an absolute URI now. - throw new ODataException(Strings.ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified(xmlBaseAttributeValue)); + throw new ODataException(Error.Format(SRResources.ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified, xmlBaseAttributeValue)); } newBaseUri = UriUtils.UriToAbsoluteUri(this.documentBaseUri, newBaseUri); @@ -775,7 +776,7 @@ public override bool MoveToAttribute(string name) public override void ResolveEntity() { // We don't support entity references, and we should never get a reader which does. - throw new InvalidOperationException(Strings.ODataException_GeneralError); + throw new InvalidOperationException(SRResources.ODataException_GeneralError); } /// diff --git a/src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs b/src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs index 63e3b218f7..33434a40f0 100644 --- a/src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs +++ b/src/Microsoft.OData.Core/Metadata/EdmLibraryExtensions.cs @@ -22,13 +22,12 @@ namespace Microsoft.OData.Metadata using ErrorStrings = Microsoft.OData.Service.Strings; #endif #if ODATA_CLIENT - using ErrorStrings = Microsoft.OData.Client.Strings; + using Microsoft.OData.Client; #endif #if !ODATA_SERVICE && !ODATA_CLIENT using Microsoft.OData.Json; using Microsoft.OData.UriParser; - using ErrorStrings = Microsoft.OData.Strings; - using PlatformHelper = Microsoft.OData.PlatformHelper; + using Microsoft.OData.Core; #endif #endregion Namespaces @@ -734,7 +733,7 @@ internal static bool IsAssignableFrom(this IEdmType baseType, IEdmType subtype) return baseType.IsEquivalentTo(subtype); default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_IsAssignableFrom_Type)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_IsAssignableFrom_Type)); } } @@ -900,7 +899,7 @@ internal static IEdmPrimitiveType BaseType(this IEdmPrimitiveType type) return EdmCoreModel.Instance.GetPrimitiveType(EdmPrimitiveTypeKind.GeometryCollection); default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_BaseType)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_BaseType)); } } @@ -980,7 +979,7 @@ internal static object ConvertToUnderlyingTypeIfUIntValue(this IEdmModel model, } catch (OverflowException) { - throw new ODataException(ErrorStrings.EdmLibraryExtensions_ValueOverflowForUnderlyingType(value, expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_ValueOverflowForUnderlyingType, value, expectedTypeReference.FullName())); } } @@ -1240,7 +1239,7 @@ internal static IEdmTypeReference Clone(this IEdmTypeReference typeReference, bo return new EdmSpatialTypeReference(primitiveType, nullable, spatialTypeReference.SpatialReferenceIdentifier); default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_Clone_PrimitiveTypeKind)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_Clone_PrimitiveTypeKind)); } case EdmTypeKind.Entity: @@ -1260,7 +1259,7 @@ internal static IEdmTypeReference Clone(this IEdmTypeReference typeReference, bo case EdmTypeKind.None: // fall through default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_Clone_TypeKind)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_Clone_TypeKind)); } } @@ -1458,7 +1457,7 @@ internal static bool IsAssignableFrom(this IEdmPrimitiveType baseType, IEdmPrimi return subTypeKind == EdmPrimitiveTypeKind.GeometryMultiPoint; default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_IsAssignableFrom_Primitive)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_IsAssignableFrom_Primitive)); } } @@ -1634,7 +1633,7 @@ internal static IEdmTypeReference ToTypeReference(this IEdmType type, bool nulla return new EdmTypeDefinitionReference((IEdmTypeDefinition)type, nullable); case EdmTypeKind.None: default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_ToTypeReference)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_ToTypeReference)); } } @@ -1834,7 +1833,7 @@ private static IEnumerable ValidateOperationGroupReturnsOnlyOnKin { if (operation.SchemaElementKind != operationKind) { - throw new ODataException(ErrorStrings.EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid(operationNameWithoutParameterTypes)); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid, operationNameWithoutParameterTypes)); } } @@ -1896,7 +1895,7 @@ private static string GetCollectionItemTypeName(string typeName, bool isNested) { if (isNested) { - throw new ODataException(ErrorStrings.ValidationUtils_NestedCollectionsAreNotSupported); + throw new ODataException(SRResources.ValidationUtils_NestedCollectionsAreNotSupported); } string innerTypeName = typeName.Substring(collectionTypeQualifierLength + 1, typeName.Length - (collectionTypeQualifierLength + 2)); @@ -2022,12 +2021,12 @@ private static void EnsureOperationBoundWithBindingParameter(this IEdmOperation { if (!operation.IsBound) { - throw new ODataException(ErrorStrings.EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid(operation.Name)); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid, operation.Name)); } if (!operation.Parameters.Any()) { - throw new ODataException(ErrorStrings.EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid(operation.Name)); + throw new ODataException(Error.Format(SRResources.EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid, operation.Name)); } } #endif @@ -2086,7 +2085,7 @@ private static EdmPrimitiveTypeReference ToTypeReference(IEdmPrimitiveType primi case EdmPrimitiveTypeKind.GeometryCollection: return new EdmSpatialTypeReference(primitiveType, nullable); default: - throw new ODataException(ErrorStrings.General_InternalError(InternalErrorCodesCommon.EdmLibraryExtensions_PrimitiveTypeReference)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodesCommon.EdmLibraryExtensions_PrimitiveTypeReference)); } } diff --git a/src/Microsoft.OData.Core/Metadata/EdmTypeWriterResolver.cs b/src/Microsoft.OData.Core/Metadata/EdmTypeWriterResolver.cs index 6cdc47c826..c2ef3c42ca 100644 --- a/src/Microsoft.OData.Core/Metadata/EdmTypeWriterResolver.cs +++ b/src/Microsoft.OData.Core/Metadata/EdmTypeWriterResolver.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData.Metadata using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -55,7 +56,7 @@ internal override IEdmTypeReference GetReturnType(IEdmOperationImport operationI /// The representing the return type fo the . internal override IEdmTypeReference GetReturnType(IEnumerable functionImportGroup) { - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.EdmTypeWriterResolver_GetReturnTypeForOperationImportGroup)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.EdmTypeWriterResolver_GetReturnTypeForOperationImportGroup)); } /// diff --git a/src/Microsoft.OData.Core/Metadata/MetadataUtils.cs b/src/Microsoft.OData.Core/Metadata/MetadataUtils.cs index e73b95eec9..6cde76006c 100644 --- a/src/Microsoft.OData.Core/Metadata/MetadataUtils.cs +++ b/src/Microsoft.OData.Core/Metadata/MetadataUtils.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; @@ -112,7 +113,7 @@ internal static IEdmType ResolveTypeName( if (resolvedType == null) { // If a type resolver is specified it must never return null. - throw new ODataException(Strings.MetadataUtils_ResolveTypeName(typeName)); + throw new ODataException(Error.Format(SRResources.MetadataUtils_ResolveTypeName, typeName)); } } else @@ -168,7 +169,7 @@ internal static IList CalculateBindableOperationsForType(IEdmType throw; } - throw new ODataException(Strings.MetadataUtils_CalculateBindableOperationsForType(bindingType.FullTypeName()), exc); + throw new ODataException(Error.Format(SRResources.MetadataUtils_CalculateBindableOperationsForType, bindingType.FullTypeName()), exc); } IList operationsFound = operations as IList; diff --git a/src/Microsoft.OData.Core/Metadata/ODataXmlErrorDeserializer.cs b/src/Microsoft.OData.Core/Metadata/ODataXmlErrorDeserializer.cs index fd67a9e45c..2da99e7143 100644 --- a/src/Microsoft.OData.Core/Metadata/ODataXmlErrorDeserializer.cs +++ b/src/Microsoft.OData.Core/Metadata/ODataXmlErrorDeserializer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Metadata { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -161,7 +162,7 @@ private static void VerifyErrorElementNotFound( if ((elementsFoundBitField & elementFoundBitMask) == elementFoundBitMask) { - throw new ODataException(Strings.ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName(elementName)); + throw new ODataException(Error.Format(SRResources.ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName, elementName)); } elementsFoundBitField |= elementFoundBitMask; @@ -185,7 +186,7 @@ private static void VerifyInnerErrorElementNotFound( if ((elementsFoundBitField & elementFoundBitMask) == elementFoundBitMask) { - throw new ODataException(Strings.ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName(elementName)); + throw new ODataException(Error.Format(SRResources.ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName, elementName)); } elementsFoundBitField |= elementFoundBitMask; diff --git a/src/Microsoft.OData.Core/Metadata/XmlReaderExtensions.cs b/src/Microsoft.OData.Core/Metadata/XmlReaderExtensions.cs index c499342b97..50e43ec6ec 100644 --- a/src/Microsoft.OData.Core/Metadata/XmlReaderExtensions.cs +++ b/src/Microsoft.OData.Core/Metadata/XmlReaderExtensions.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.Metadata { + using Microsoft.OData.Core; #region Namespaces using System.Diagnostics; using System.Text; @@ -110,7 +111,7 @@ internal static string ReadElementContentValue(this XmlReader reader) break; default: - throw new ODataException(Strings.XmlReaderExtension_InvalidNodeInStringValue(reader.NodeType)); + throw new ODataException(Error.Format(SRResources.XmlReaderExtension_InvalidNodeInStringValue, reader.NodeType)); } } diff --git a/src/Microsoft.OData.Core/Microsoft.OData.Core.cs b/src/Microsoft.OData.Core/Microsoft.OData.Core.cs deleted file mode 100644 index 92e3fbceb3..0000000000 --- a/src/Microsoft.OData.Core/Microsoft.OData.Core.cs +++ /dev/null @@ -1,936 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -using System; -using System.Globalization; -using System.Reflection; -using System.Resources; -using System.Threading; - -namespace Microsoft.OData -{ - /// - /// AutoGenerated resource class. Usage: - /// - /// string s = TextRes.GetString(TextRes.MyIdentifier); - /// - internal sealed class TextRes { - internal const string ExceptionUtils_ArgumentStringEmpty = "ExceptionUtils_ArgumentStringEmpty"; - internal const string ODataRequestMessage_AsyncNotAvailable = "ODataRequestMessage_AsyncNotAvailable"; - internal const string ODataRequestMessage_StreamTaskIsNull = "ODataRequestMessage_StreamTaskIsNull"; - internal const string ODataRequestMessage_MessageStreamIsNull = "ODataRequestMessage_MessageStreamIsNull"; - internal const string ODataResponseMessage_AsyncNotAvailable = "ODataResponseMessage_AsyncNotAvailable"; - internal const string ODataResponseMessage_StreamTaskIsNull = "ODataResponseMessage_StreamTaskIsNull"; - internal const string ODataResponseMessage_MessageStreamIsNull = "ODataResponseMessage_MessageStreamIsNull"; - internal const string AsyncBufferedStream_WriterDisposedWithoutFlush = "AsyncBufferedStream_WriterDisposedWithoutFlush"; - internal const string ODataOutputContext_UnsupportedPayloadKindForFormat = "ODataOutputContext_UnsupportedPayloadKindForFormat"; - internal const string ODataInputContext_UnsupportedPayloadKindForFormat = "ODataInputContext_UnsupportedPayloadKindForFormat"; - internal const string ODataOutputContext_MetadataDocumentUriMissing = "ODataOutputContext_MetadataDocumentUriMissing"; - internal const string ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata = "ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata"; - internal const string ODataWriter_RelativeUriUsedWithoutBaseUriSpecified = "ODataWriter_RelativeUriUsedWithoutBaseUriSpecified"; - internal const string ODataWriter_StreamPropertiesMustBePropertiesOfODataResource = "ODataWriter_StreamPropertiesMustBePropertiesOfODataResource"; - internal const string ODataWriterCore_InvalidStateTransition = "ODataWriterCore_InvalidStateTransition"; - internal const string ODataWriterCore_InvalidTransitionFromStart = "ODataWriterCore_InvalidTransitionFromStart"; - internal const string ODataWriterCore_InvalidTransitionFromResource = "ODataWriterCore_InvalidTransitionFromResource"; - internal const string ODataWriterCore_InvalidTransitionFrom40DeletedResource = "ODataWriterCore_InvalidTransitionFrom40DeletedResource"; - internal const string ODataWriterCore_InvalidTransitionFromNullResource = "ODataWriterCore_InvalidTransitionFromNullResource"; - internal const string ODataWriterCore_InvalidTransitionFromResourceSet = "ODataWriterCore_InvalidTransitionFromResourceSet"; - internal const string ODataWriterCore_InvalidTransitionFromExpandedLink = "ODataWriterCore_InvalidTransitionFromExpandedLink"; - internal const string ODataWriterCore_InvalidTransitionFromCompleted = "ODataWriterCore_InvalidTransitionFromCompleted"; - internal const string ODataWriterCore_InvalidTransitionFromError = "ODataWriterCore_InvalidTransitionFromError"; - internal const string ODataJsonDeltaWriter_InvalidTransitionFromNestedResource = "ODataJsonDeltaWriter_InvalidTransitionFromNestedResource"; - internal const string ODataJsonDeltaWriter_InvalidTransitionToNestedResource = "ODataJsonDeltaWriter_InvalidTransitionToNestedResource"; - internal const string ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState = "ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState"; - internal const string ODataWriterCore_WriteEndCalledInInvalidState = "ODataWriterCore_WriteEndCalledInInvalidState"; - internal const string ODataWriterCore_StreamNotDisposed = "ODataWriterCore_StreamNotDisposed"; - internal const string ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties = "ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties"; - internal const string ODataWriterCore_QueryCountInRequest = "ODataWriterCore_QueryCountInRequest"; - internal const string ODataWriterCore_QueryNextLinkInRequest = "ODataWriterCore_QueryNextLinkInRequest"; - internal const string ODataWriterCore_QueryDeltaLinkInRequest = "ODataWriterCore_QueryDeltaLinkInRequest"; - internal const string ODataWriterCore_CannotWriteDeltaWithResourceSetWriter = "ODataWriterCore_CannotWriteDeltaWithResourceSetWriter"; - internal const string ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry = "ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry"; - internal const string ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter = "ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter"; - internal const string ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter = "ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter"; - internal const string ODataWriterCore_SyncCallOnAsyncWriter = "ODataWriterCore_SyncCallOnAsyncWriter"; - internal const string ODataWriterCore_AsyncCallOnSyncWriter = "ODataWriterCore_AsyncCallOnSyncWriter"; - internal const string ODataWriterCore_EntityReferenceLinkWithoutNavigationLink = "ODataWriterCore_EntityReferenceLinkWithoutNavigationLink"; - internal const string ODataWriterCore_DeferredLinkInRequest = "ODataWriterCore_DeferredLinkInRequest"; - internal const string ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent = "ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent"; - internal const string ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet = "ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet"; - internal const string ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement = "ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement"; - internal const string DuplicatePropertyNamesNotAllowed = "DuplicatePropertyNamesNotAllowed"; - internal const string DuplicateAnnotationNotAllowed = "DuplicateAnnotationNotAllowed"; - internal const string DuplicateAnnotationForPropertyNotAllowed = "DuplicateAnnotationForPropertyNotAllowed"; - internal const string DuplicateAnnotationForInstanceAnnotationNotAllowed = "DuplicateAnnotationForInstanceAnnotationNotAllowed"; - internal const string PropertyAnnotationAfterTheProperty = "PropertyAnnotationAfterTheProperty"; - internal const string ValueUtils_CannotConvertValueToPrimitive = "ValueUtils_CannotConvertValueToPrimitive"; - internal const string ODataJsonWriter_UnsupportedValueType = "ODataJsonWriter_UnsupportedValueType"; - internal const string ODataJsonWriter_UnsupportedValueInCollection = "ODataJsonWriter_UnsupportedValueInCollection"; - internal const string ODataJsonWriter_UnsupportedDateTimeFormat = "ODataJsonWriter_UnsupportedDateTimeFormat"; - internal const string ODataException_GeneralError = "ODataException_GeneralError"; - internal const string ODataErrorException_GeneralError = "ODataErrorException_GeneralError"; - internal const string ODataUriParserException_GeneralError = "ODataUriParserException_GeneralError"; - internal const string ODataUrlValidationError_SelectRequired = "ODataUrlValidationError_SelectRequired"; - internal const string ODataUrlValidationError_InvalidRule = "ODataUrlValidationError_InvalidRule"; - internal const string ODataMessageWriter_WriterAlreadyUsed = "ODataMessageWriter_WriterAlreadyUsed"; - internal const string ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed = "ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed"; - internal const string ODataMessageWriter_ErrorPayloadInRequest = "ODataMessageWriter_ErrorPayloadInRequest"; - internal const string ODataMessageWriter_ServiceDocumentInRequest = "ODataMessageWriter_ServiceDocumentInRequest"; - internal const string ODataMessageWriter_MetadataDocumentInRequest = "ODataMessageWriter_MetadataDocumentInRequest"; - internal const string ODataMessageWriter_DeltaInRequest = "ODataMessageWriter_DeltaInRequest"; - internal const string ODataMessageWriter_AsyncInRequest = "ODataMessageWriter_AsyncInRequest"; - internal const string ODataMessageWriter_CannotWriteTopLevelNull = "ODataMessageWriter_CannotWriteTopLevelNull"; - internal const string ODataMessageWriter_CannotWriteNullInRawFormat = "ODataMessageWriter_CannotWriteNullInRawFormat"; - internal const string ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind = "ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind"; - internal const string ODataMessageWriter_IncompatiblePayloadKinds = "ODataMessageWriter_IncompatiblePayloadKinds"; - internal const string ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty = "ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty"; - internal const string ODataMessageWriter_WriteErrorAlreadyCalled = "ODataMessageWriter_WriteErrorAlreadyCalled"; - internal const string ODataMessageWriter_CannotWriteInStreamErrorForRawValues = "ODataMessageWriter_CannotWriteInStreamErrorForRawValues"; - internal const string ODataMessageWriter_CannotWriteMetadataWithoutModel = "ODataMessageWriter_CannotWriteMetadataWithoutModel"; - internal const string ODataMessageWriter_CannotSpecifyOperationWithoutModel = "ODataMessageWriter_CannotSpecifyOperationWithoutModel"; - internal const string ODataMessageWriter_JsonPaddingOnInvalidContentType = "ODataMessageWriter_JsonPaddingOnInvalidContentType"; - internal const string ODataMessageWriter_NonCollectionType = "ODataMessageWriter_NonCollectionType"; - internal const string ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue = "ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue"; - internal const string ODataMessageWriter_JsonWriterFactory_ReturnedNull = "ODataMessageWriter_JsonWriterFactory_ReturnedNull"; - internal const string ODataMessageWriter_Buffer_Maximum_Size_Exceeded = "ODataMessageWriter_Buffer_Maximum_Size_Exceeded"; - internal const string ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth = "ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth"; - internal const string ODataCollectionWriterCore_InvalidTransitionFromStart = "ODataCollectionWriterCore_InvalidTransitionFromStart"; - internal const string ODataCollectionWriterCore_InvalidTransitionFromCollection = "ODataCollectionWriterCore_InvalidTransitionFromCollection"; - internal const string ODataCollectionWriterCore_InvalidTransitionFromItem = "ODataCollectionWriterCore_InvalidTransitionFromItem"; - internal const string ODataCollectionWriterCore_WriteEndCalledInInvalidState = "ODataCollectionWriterCore_WriteEndCalledInInvalidState"; - internal const string ODataCollectionWriterCore_SyncCallOnAsyncWriter = "ODataCollectionWriterCore_SyncCallOnAsyncWriter"; - internal const string ODataCollectionWriterCore_AsyncCallOnSyncWriter = "ODataCollectionWriterCore_AsyncCallOnSyncWriter"; - internal const string ODataBatch_InvalidHttpMethodForChangeSetRequest = "ODataBatch_InvalidHttpMethodForChangeSetRequest"; - internal const string ODataBatchOperationHeaderDictionary_KeyNotFound = "ODataBatchOperationHeaderDictionary_KeyNotFound"; - internal const string ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys = "ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys"; - internal const string ODataParameterWriter_InStreamErrorNotSupported = "ODataParameterWriter_InStreamErrorNotSupported"; - internal const string ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage = "ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage"; - internal const string ODataParameterWriterCore_SyncCallOnAsyncWriter = "ODataParameterWriterCore_SyncCallOnAsyncWriter"; - internal const string ODataParameterWriterCore_AsyncCallOnSyncWriter = "ODataParameterWriterCore_AsyncCallOnSyncWriter"; - internal const string ODataParameterWriterCore_CannotWriteStart = "ODataParameterWriterCore_CannotWriteStart"; - internal const string ODataParameterWriterCore_CannotWriteParameter = "ODataParameterWriterCore_CannotWriteParameter"; - internal const string ODataParameterWriterCore_CannotWriteEnd = "ODataParameterWriterCore_CannotWriteEnd"; - internal const string ODataParameterWriterCore_CannotWriteInErrorOrCompletedState = "ODataParameterWriterCore_CannotWriteInErrorOrCompletedState"; - internal const string ODataParameterWriterCore_DuplicatedParameterNameNotAllowed = "ODataParameterWriterCore_DuplicatedParameterNameNotAllowed"; - internal const string ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind = "ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind"; - internal const string ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType = "ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType"; - internal const string ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind = "ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind"; - internal const string ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind = "ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind"; - internal const string ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind = "ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind"; - internal const string ODataParameterWriterCore_ParameterNameNotFoundInOperation = "ODataParameterWriterCore_ParameterNameNotFoundInOperation"; - internal const string ODataParameterWriterCore_MissingParameterInParameterPayload = "ODataParameterWriterCore_MissingParameterInParameterPayload"; - internal const string ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState = "ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState"; - internal const string ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet = "ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet"; - internal const string ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet = "ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet"; - internal const string ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet = "ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet"; - internal const string ODataBatchWriter_InvalidTransitionFromStart = "ODataBatchWriter_InvalidTransitionFromStart"; - internal const string ODataBatchWriter_InvalidTransitionFromBatchStarted = "ODataBatchWriter_InvalidTransitionFromBatchStarted"; - internal const string ODataBatchWriter_InvalidTransitionFromChangeSetStarted = "ODataBatchWriter_InvalidTransitionFromChangeSetStarted"; - internal const string ODataBatchWriter_InvalidTransitionFromOperationCreated = "ODataBatchWriter_InvalidTransitionFromOperationCreated"; - internal const string ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested = "ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested"; - internal const string ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed = "ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed"; - internal const string ODataBatchWriter_InvalidTransitionFromChangeSetCompleted = "ODataBatchWriter_InvalidTransitionFromChangeSetCompleted"; - internal const string ODataBatchWriter_InvalidTransitionFromBatchCompleted = "ODataBatchWriter_InvalidTransitionFromBatchCompleted"; - internal const string ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse = "ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse"; - internal const string ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest = "ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest"; - internal const string ODataBatchWriter_MaxBatchSizeExceeded = "ODataBatchWriter_MaxBatchSizeExceeded"; - internal const string ODataBatchWriter_MaxChangeSetSizeExceeded = "ODataBatchWriter_MaxChangeSetSizeExceeded"; - internal const string ODataBatchWriter_SyncCallOnAsyncWriter = "ODataBatchWriter_SyncCallOnAsyncWriter"; - internal const string ODataBatchWriter_AsyncCallOnSyncWriter = "ODataBatchWriter_AsyncCallOnSyncWriter"; - internal const string ODataBatchWriter_DuplicateContentIDsNotAllowed = "ODataBatchWriter_DuplicateContentIDsNotAllowed"; - internal const string ODataBatchWriter_CannotWriteInStreamErrorForBatch = "ODataBatchWriter_CannotWriteInStreamErrorForBatch"; - internal const string ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified = "ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified"; - internal const string ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified = "ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified"; - internal const string ODataBatchOperationMessage_VerifyNotCompleted = "ODataBatchOperationMessage_VerifyNotCompleted"; - internal const string ODataBatchOperationStream_Disposed = "ODataBatchOperationStream_Disposed"; - internal const string ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse = "ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse"; - internal const string ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest = "ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest"; - internal const string ODataBatchReader_InvalidStateForCreateOperationRequestMessage = "ODataBatchReader_InvalidStateForCreateOperationRequestMessage"; - internal const string ODataBatchReader_OperationRequestMessageAlreadyCreated = "ODataBatchReader_OperationRequestMessageAlreadyCreated"; - internal const string ODataBatchReader_OperationResponseMessageAlreadyCreated = "ODataBatchReader_OperationResponseMessageAlreadyCreated"; - internal const string ODataBatchReader_InvalidStateForCreateOperationResponseMessage = "ODataBatchReader_InvalidStateForCreateOperationResponseMessage"; - internal const string ODataBatchReader_CannotUseReaderWhileOperationStreamActive = "ODataBatchReader_CannotUseReaderWhileOperationStreamActive"; - internal const string ODataBatchReader_SyncCallOnAsyncReader = "ODataBatchReader_SyncCallOnAsyncReader"; - internal const string ODataBatchReader_AsyncCallOnSyncReader = "ODataBatchReader_AsyncCallOnSyncReader"; - internal const string ODataBatchReader_ReadOrReadAsyncCalledInInvalidState = "ODataBatchReader_ReadOrReadAsyncCalledInInvalidState"; - internal const string ODataBatchReader_MaxBatchSizeExceeded = "ODataBatchReader_MaxBatchSizeExceeded"; - internal const string ODataBatchReader_MaxChangeSetSizeExceeded = "ODataBatchReader_MaxChangeSetSizeExceeded"; - internal const string ODataBatchReader_NoMessageWasCreatedForOperation = "ODataBatchReader_NoMessageWasCreatedForOperation"; - internal const string ODataBatchReader_ReaderModeNotInitilized = "ODataBatchReader_ReaderModeNotInitilized"; - internal const string ODataBatchReader_JsonBatchTopLevelPropertyMissing = "ODataBatchReader_JsonBatchTopLevelPropertyMissing"; - internal const string ODataBatchReader_DuplicateContentIDsNotAllowed = "ODataBatchReader_DuplicateContentIDsNotAllowed"; - internal const string ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed = "ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed"; - internal const string ODataBatchReader_RequestPropertyMissing = "ODataBatchReader_RequestPropertyMissing"; - internal const string ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed = "ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed"; - internal const string ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed = "ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed"; - internal const string ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed = "ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed"; - internal const string ODataBatchReader_DependsOnIdNotFound = "ODataBatchReader_DependsOnIdNotFound"; - internal const string ODataBatchReader_AbsoluteURINotMatchingBaseUri = "ODataBatchReader_AbsoluteURINotMatchingBaseUri"; - internal const string ODataBatchReader_ReferenceIdNotIncludedInDependsOn = "ODataBatchReader_ReferenceIdNotIncludedInDependsOn"; - internal const string ODataBatch_GroupIdOrChangeSetIdCannotBeNull = "ODataBatch_GroupIdOrChangeSetIdCannotBeNull"; - internal const string ODataBatchReader_MessageIdPositionedIncorrectly = "ODataBatchReader_MessageIdPositionedIncorrectly"; - internal const string ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull = "ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull"; - internal const string ODataBatchReaderStream_InvalidHeaderSpecified = "ODataBatchReaderStream_InvalidHeaderSpecified"; - internal const string ODataBatchReaderStream_InvalidRequestLine = "ODataBatchReaderStream_InvalidRequestLine"; - internal const string ODataBatchReaderStream_InvalidResponseLine = "ODataBatchReaderStream_InvalidResponseLine"; - internal const string ODataBatchReaderStream_InvalidHttpVersionSpecified = "ODataBatchReaderStream_InvalidHttpVersionSpecified"; - internal const string ODataBatchReaderStream_NonIntegerHttpStatusCode = "ODataBatchReaderStream_NonIntegerHttpStatusCode"; - internal const string ODataBatchReaderStream_MissingContentTypeHeader = "ODataBatchReaderStream_MissingContentTypeHeader"; - internal const string ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader = "ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader"; - internal const string ODataBatchReaderStream_InvalidContentTypeSpecified = "ODataBatchReaderStream_InvalidContentTypeSpecified"; - internal const string ODataBatchReaderStream_InvalidContentLengthSpecified = "ODataBatchReaderStream_InvalidContentLengthSpecified"; - internal const string ODataBatchReaderStream_DuplicateHeaderFound = "ODataBatchReaderStream_DuplicateHeaderFound"; - internal const string ODataBatchReaderStream_NestedChangesetsAreNotSupported = "ODataBatchReaderStream_NestedChangesetsAreNotSupported"; - internal const string ODataBatchReaderStream_MultiByteEncodingsNotSupported = "ODataBatchReaderStream_MultiByteEncodingsNotSupported"; - internal const string ODataBatchReaderStream_UnexpectedEndOfInput = "ODataBatchReaderStream_UnexpectedEndOfInput"; - internal const string ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached = "ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached"; - internal const string ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch = "ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch"; - internal const string ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch = "ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch"; - internal const string ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch = "ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch"; - internal const string ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType = "ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType"; - internal const string ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader = "ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader"; - internal const string ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse = "ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse"; - internal const string ODataAsyncWriter_CannotCreateResponseMoreThanOnce = "ODataAsyncWriter_CannotCreateResponseMoreThanOnce"; - internal const string ODataAsyncWriter_SyncCallOnAsyncWriter = "ODataAsyncWriter_SyncCallOnAsyncWriter"; - internal const string ODataAsyncWriter_AsyncCallOnSyncWriter = "ODataAsyncWriter_AsyncCallOnSyncWriter"; - internal const string ODataAsyncWriter_CannotWriteInStreamErrorForAsync = "ODataAsyncWriter_CannotWriteInStreamErrorForAsync"; - internal const string ODataAsyncReader_InvalidHeaderSpecified = "ODataAsyncReader_InvalidHeaderSpecified"; - internal const string ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse = "ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse"; - internal const string ODataAsyncReader_InvalidResponseLine = "ODataAsyncReader_InvalidResponseLine"; - internal const string ODataAsyncReader_InvalidHttpVersionSpecified = "ODataAsyncReader_InvalidHttpVersionSpecified"; - internal const string ODataAsyncReader_NonIntegerHttpStatusCode = "ODataAsyncReader_NonIntegerHttpStatusCode"; - internal const string ODataAsyncReader_DuplicateHeaderFound = "ODataAsyncReader_DuplicateHeaderFound"; - internal const string ODataAsyncReader_MultiByteEncodingsNotSupported = "ODataAsyncReader_MultiByteEncodingsNotSupported"; - internal const string ODataAsyncReader_InvalidNewLineEncountered = "ODataAsyncReader_InvalidNewLineEncountered"; - internal const string ODataAsyncReader_UnexpectedEndOfInput = "ODataAsyncReader_UnexpectedEndOfInput"; - internal const string ODataAsyncReader_SyncCallOnAsyncReader = "ODataAsyncReader_SyncCallOnAsyncReader"; - internal const string ODataAsyncReader_AsyncCallOnSyncReader = "ODataAsyncReader_AsyncCallOnSyncReader"; - internal const string HttpUtils_MediaTypeUnspecified = "HttpUtils_MediaTypeUnspecified"; - internal const string HttpUtils_MediaTypeRequiresSlash = "HttpUtils_MediaTypeRequiresSlash"; - internal const string HttpUtils_MediaTypeRequiresSubType = "HttpUtils_MediaTypeRequiresSubType"; - internal const string HttpUtils_MediaTypeMissingParameterValue = "HttpUtils_MediaTypeMissingParameterValue"; - internal const string HttpUtils_MediaTypeMissingParameterName = "HttpUtils_MediaTypeMissingParameterName"; - internal const string HttpUtils_EscapeCharWithoutQuotes = "HttpUtils_EscapeCharWithoutQuotes"; - internal const string HttpUtils_EscapeCharAtEnd = "HttpUtils_EscapeCharAtEnd"; - internal const string HttpUtils_ClosingQuoteNotFound = "HttpUtils_ClosingQuoteNotFound"; - internal const string HttpUtils_InvalidCharacterInQuotedParameterValue = "HttpUtils_InvalidCharacterInQuotedParameterValue"; - internal const string HttpUtils_ContentTypeMissing = "HttpUtils_ContentTypeMissing"; - internal const string HttpUtils_MediaTypeRequiresSemicolonBeforeParameter = "HttpUtils_MediaTypeRequiresSemicolonBeforeParameter"; - internal const string HttpUtils_InvalidQualityValueStartChar = "HttpUtils_InvalidQualityValueStartChar"; - internal const string HttpUtils_InvalidQualityValue = "HttpUtils_InvalidQualityValue"; - internal const string HttpUtils_CannotConvertCharToInt = "HttpUtils_CannotConvertCharToInt"; - internal const string HttpUtils_MissingSeparatorBetweenCharsets = "HttpUtils_MissingSeparatorBetweenCharsets"; - internal const string HttpUtils_InvalidSeparatorBetweenCharsets = "HttpUtils_InvalidSeparatorBetweenCharsets"; - internal const string HttpUtils_InvalidCharsetName = "HttpUtils_InvalidCharsetName"; - internal const string HttpUtils_UnexpectedEndOfQValue = "HttpUtils_UnexpectedEndOfQValue"; - internal const string HttpUtils_ExpectedLiteralNotFoundInString = "HttpUtils_ExpectedLiteralNotFoundInString"; - internal const string HttpUtils_InvalidHttpMethodString = "HttpUtils_InvalidHttpMethodString"; - internal const string HttpUtils_NoOrMoreThanOneContentTypeSpecified = "HttpUtils_NoOrMoreThanOneContentTypeSpecified"; - internal const string HttpHeaderValueLexer_UnrecognizedSeparator = "HttpHeaderValueLexer_UnrecognizedSeparator"; - internal const string HttpHeaderValueLexer_TokenExpectedButFoundQuotedString = "HttpHeaderValueLexer_TokenExpectedButFoundQuotedString"; - internal const string HttpHeaderValueLexer_FailedToReadTokenOrQuotedString = "HttpHeaderValueLexer_FailedToReadTokenOrQuotedString"; - internal const string HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString = "HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString"; - internal const string HttpHeaderValueLexer_EndOfFileAfterSeparator = "HttpHeaderValueLexer_EndOfFileAfterSeparator"; - internal const string MediaType_EncodingNotSupported = "MediaType_EncodingNotSupported"; - internal const string MediaTypeUtils_DidNotFindMatchingMediaType = "MediaTypeUtils_DidNotFindMatchingMediaType"; - internal const string MediaTypeUtils_CannotDetermineFormatFromContentType = "MediaTypeUtils_CannotDetermineFormatFromContentType"; - internal const string MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified = "MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified"; - internal const string MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads = "MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads"; - internal const string ExpressionLexer_ExpectedLiteralToken = "ExpressionLexer_ExpectedLiteralToken"; - internal const string ODataUriUtils_ConvertToUriLiteralUnsupportedType = "ODataUriUtils_ConvertToUriLiteralUnsupportedType"; - internal const string ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel = "ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel"; - internal const string ODataUriUtils_ConvertFromUriLiteralOverflowNumber = "ODataUriUtils_ConvertFromUriLiteralOverflowNumber"; - internal const string ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure = "ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure"; - internal const string ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure = "ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure"; - internal const string ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType = "ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType"; - internal const string ODataUtils_CannotConvertValueToRawString = "ODataUtils_CannotConvertValueToRawString"; - internal const string ODataUtils_DidNotFindDefaultMediaType = "ODataUtils_DidNotFindDefaultMediaType"; - internal const string ODataUtils_UnsupportedVersionHeader = "ODataUtils_UnsupportedVersionHeader"; - internal const string ODataUtils_MaxProtocolVersionExceeded = "ODataUtils_MaxProtocolVersionExceeded"; - internal const string ODataUtils_UnsupportedVersionNumber = "ODataUtils_UnsupportedVersionNumber"; - internal const string ODataUtils_ModelDoesNotHaveContainer = "ODataUtils_ModelDoesNotHaveContainer"; - internal const string ReaderUtils_EnumerableModified = "ReaderUtils_EnumerableModified"; - internal const string ReaderValidationUtils_NullValueForNonNullableType = "ReaderValidationUtils_NullValueForNonNullableType"; - internal const string ReaderValidationUtils_NullValueForNullableType = "ReaderValidationUtils_NullValueForNullableType"; - internal const string ReaderValidationUtils_NullNamedValueForNonNullableType = "ReaderValidationUtils_NullNamedValueForNonNullableType"; - internal const string ReaderValidationUtils_NullNamedValueForNullableType = "ReaderValidationUtils_NullNamedValueForNullableType"; - internal const string ReaderValidationUtils_EntityReferenceLinkMissingUri = "ReaderValidationUtils_EntityReferenceLinkMissingUri"; - internal const string ReaderValidationUtils_ValueWithoutType = "ReaderValidationUtils_ValueWithoutType"; - internal const string ReaderValidationUtils_ResourceWithoutType = "ReaderValidationUtils_ResourceWithoutType"; - internal const string ReaderValidationUtils_CannotConvertPrimitiveValue = "ReaderValidationUtils_CannotConvertPrimitiveValue"; - internal const string ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute = "ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute"; - internal const string ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest = "ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest"; - internal const string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet = "ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet"; - internal const string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType = "ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType"; - internal const string ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames = "ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames"; - internal const string ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes = "ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes"; - internal const string ReaderValidationUtils_NonMatchingPropertyNames = "ReaderValidationUtils_NonMatchingPropertyNames"; - internal const string ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType = "ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType"; - internal const string ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType = "ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType"; - internal const string ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint = "ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint"; - internal const string ODataMessageReader_ReaderAlreadyUsed = "ODataMessageReader_ReaderAlreadyUsed"; - internal const string ODataMessageReader_ErrorPayloadInRequest = "ODataMessageReader_ErrorPayloadInRequest"; - internal const string ODataMessageReader_ServiceDocumentInRequest = "ODataMessageReader_ServiceDocumentInRequest"; - internal const string ODataMessageReader_MetadataDocumentInRequest = "ODataMessageReader_MetadataDocumentInRequest"; - internal const string ODataMessageReader_DeltaInRequest = "ODataMessageReader_DeltaInRequest"; - internal const string ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata = "ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata"; - internal const string ODataMessageReader_EntitySetSpecifiedWithoutMetadata = "ODataMessageReader_EntitySetSpecifiedWithoutMetadata"; - internal const string ODataMessageReader_OperationImportSpecifiedWithoutMetadata = "ODataMessageReader_OperationImportSpecifiedWithoutMetadata"; - internal const string ODataMessageReader_OperationSpecifiedWithoutMetadata = "ODataMessageReader_OperationSpecifiedWithoutMetadata"; - internal const string ODataMessageReader_ExpectedCollectionTypeWrongKind = "ODataMessageReader_ExpectedCollectionTypeWrongKind"; - internal const string ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind = "ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind"; - internal const string ODataMessageReader_ExpectedPropertyTypeEntityKind = "ODataMessageReader_ExpectedPropertyTypeEntityKind"; - internal const string ODataMessageReader_ExpectedPropertyTypeStream = "ODataMessageReader_ExpectedPropertyTypeStream"; - internal const string ODataMessageReader_ExpectedValueTypeWrongKind = "ODataMessageReader_ExpectedValueTypeWrongKind"; - internal const string ODataMessageReader_NoneOrEmptyContentTypeHeader = "ODataMessageReader_NoneOrEmptyContentTypeHeader"; - internal const string ODataMessageReader_WildcardInContentType = "ODataMessageReader_WildcardInContentType"; - internal const string ODataMessageReader_GetFormatCalledBeforeReadingStarted = "ODataMessageReader_GetFormatCalledBeforeReadingStarted"; - internal const string ODataMessageReader_DetectPayloadKindMultipleTimes = "ODataMessageReader_DetectPayloadKindMultipleTimes"; - internal const string ODataMessageReader_PayloadKindDetectionRunning = "ODataMessageReader_PayloadKindDetectionRunning"; - internal const string ODataMessageReader_PayloadKindDetectionInServerMode = "ODataMessageReader_PayloadKindDetectionInServerMode"; - internal const string ODataMessageReader_ParameterPayloadInResponse = "ODataMessageReader_ParameterPayloadInResponse"; - internal const string ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks = "ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks"; - internal const string ODataAsyncResponseMessage_MustNotModifyMessage = "ODataAsyncResponseMessage_MustNotModifyMessage"; - internal const string ODataMessage_MustNotModifyMessage = "ODataMessage_MustNotModifyMessage"; - internal const string ODataReaderCore_SyncCallOnAsyncReader = "ODataReaderCore_SyncCallOnAsyncReader"; - internal const string ODataReaderCore_AsyncCallOnSyncReader = "ODataReaderCore_AsyncCallOnSyncReader"; - internal const string ODataReaderCore_ReadOrReadAsyncCalledInInvalidState = "ODataReaderCore_ReadOrReadAsyncCalledInInvalidState"; - internal const string ODataReaderCore_CreateReadStreamCalledInInvalidState = "ODataReaderCore_CreateReadStreamCalledInInvalidState"; - internal const string ODataReaderCore_CreateTextReaderCalledInInvalidState = "ODataReaderCore_CreateTextReaderCalledInInvalidState"; - internal const string ODataReaderCore_ReadCalledWithOpenStream = "ODataReaderCore_ReadCalledWithOpenStream"; - internal const string ODataReaderCore_NoReadCallsAllowed = "ODataReaderCore_NoReadCallsAllowed"; - internal const string ODataWriterCore_PropertyValueAlreadyWritten = "ODataWriterCore_PropertyValueAlreadyWritten"; - internal const string ODataJsonReader_CannotReadResourcesOfResourceSet = "ODataJsonReader_CannotReadResourcesOfResourceSet"; - internal const string ODataJsonReaderUtils_CannotConvertInt32 = "ODataJsonReaderUtils_CannotConvertInt32"; - internal const string ODataJsonReaderUtils_CannotConvertDouble = "ODataJsonReaderUtils_CannotConvertDouble"; - internal const string ODataJsonReaderUtils_CannotConvertBoolean = "ODataJsonReaderUtils_CannotConvertBoolean"; - internal const string ODataJsonReaderUtils_CannotConvertDecimal = "ODataJsonReaderUtils_CannotConvertDecimal"; - internal const string ODataJsonReaderUtils_CannotConvertDateTime = "ODataJsonReaderUtils_CannotConvertDateTime"; - internal const string ODataJsonReaderUtils_CannotConvertDateTimeOffset = "ODataJsonReaderUtils_CannotConvertDateTimeOffset"; - internal const string ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter = "ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter"; - internal const string ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName = "ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName"; - internal const string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget = "ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget"; - internal const string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget = "ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget"; - internal const string ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty = "ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty"; - internal const string ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty = "ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty"; - internal const string ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState = "ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState"; - internal const string ODataCollectionReaderCore_SyncCallOnAsyncReader = "ODataCollectionReaderCore_SyncCallOnAsyncReader"; - internal const string ODataCollectionReaderCore_AsyncCallOnSyncReader = "ODataCollectionReaderCore_AsyncCallOnSyncReader"; - internal const string ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState = "ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState"; - internal const string ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState = "ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState"; - internal const string ODataParameterReaderCore_SyncCallOnAsyncReader = "ODataParameterReaderCore_SyncCallOnAsyncReader"; - internal const string ODataParameterReaderCore_AsyncCallOnSyncReader = "ODataParameterReaderCore_AsyncCallOnSyncReader"; - internal const string ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall = "ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall"; - internal const string ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall = "ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall"; - internal const string ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState = "ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState"; - internal const string ODataParameterReaderCore_CreateReaderAlreadyCalled = "ODataParameterReaderCore_CreateReaderAlreadyCalled"; - internal const string ODataParameterReaderCore_ParameterNameNotInMetadata = "ODataParameterReaderCore_ParameterNameNotInMetadata"; - internal const string ODataParameterReaderCore_DuplicateParametersInPayload = "ODataParameterReaderCore_DuplicateParametersInPayload"; - internal const string ODataParameterReaderCore_ParametersMissingInPayload = "ODataParameterReaderCore_ParametersMissingInPayload"; - internal const string ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata = "ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata"; - internal const string ValidationUtils_ActionsAndFunctionsMustSpecifyTarget = "ValidationUtils_ActionsAndFunctionsMustSpecifyTarget"; - internal const string ValidationUtils_EnumerableContainsANullItem = "ValidationUtils_EnumerableContainsANullItem"; - internal const string ValidationUtils_AssociationLinkMustSpecifyName = "ValidationUtils_AssociationLinkMustSpecifyName"; - internal const string ValidationUtils_AssociationLinkMustSpecifyUrl = "ValidationUtils_AssociationLinkMustSpecifyUrl"; - internal const string ValidationUtils_TypeNameMustNotBeEmpty = "ValidationUtils_TypeNameMustNotBeEmpty"; - internal const string ValidationUtils_PropertyDoesNotExistOnType = "ValidationUtils_PropertyDoesNotExistOnType"; - internal const string ValidationUtils_ResourceMustSpecifyUrl = "ValidationUtils_ResourceMustSpecifyUrl"; - internal const string ValidationUtils_ResourceMustSpecifyName = "ValidationUtils_ResourceMustSpecifyName"; - internal const string ValidationUtils_ServiceDocumentElementUrlMustNotBeNull = "ValidationUtils_ServiceDocumentElementUrlMustNotBeNull"; - internal const string ValidationUtils_NonPrimitiveTypeForPrimitiveValue = "ValidationUtils_NonPrimitiveTypeForPrimitiveValue"; - internal const string ValidationUtils_UnsupportedPrimitiveType = "ValidationUtils_UnsupportedPrimitiveType"; - internal const string ValidationUtils_IncompatiblePrimitiveItemType = "ValidationUtils_IncompatiblePrimitiveItemType"; - internal const string ValidationUtils_NonNullableCollectionElementsMustNotBeNull = "ValidationUtils_NonNullableCollectionElementsMustNotBeNull"; - internal const string ValidationUtils_InvalidCollectionTypeName = "ValidationUtils_InvalidCollectionTypeName"; - internal const string ValidationUtils_UnrecognizedTypeName = "ValidationUtils_UnrecognizedTypeName"; - internal const string ValidationUtils_IncorrectTypeKind = "ValidationUtils_IncorrectTypeKind"; - internal const string ValidationUtils_IncorrectTypeKindNoTypeName = "ValidationUtils_IncorrectTypeKindNoTypeName"; - internal const string ValidationUtils_IncorrectValueTypeKind = "ValidationUtils_IncorrectValueTypeKind"; - internal const string ValidationUtils_LinkMustSpecifyName = "ValidationUtils_LinkMustSpecifyName"; - internal const string ValidationUtils_MismatchPropertyKindForStreamProperty = "ValidationUtils_MismatchPropertyKindForStreamProperty"; - internal const string ValidationUtils_NestedCollectionsAreNotSupported = "ValidationUtils_NestedCollectionsAreNotSupported"; - internal const string ValidationUtils_StreamReferenceValuesNotSupportedInCollections = "ValidationUtils_StreamReferenceValuesNotSupportedInCollections"; - internal const string ValidationUtils_IncompatibleType = "ValidationUtils_IncompatibleType"; - internal const string ValidationUtils_OpenCollectionProperty = "ValidationUtils_OpenCollectionProperty"; - internal const string ValidationUtils_OpenStreamProperty = "ValidationUtils_OpenStreamProperty"; - internal const string ValidationUtils_InvalidCollectionTypeReference = "ValidationUtils_InvalidCollectionTypeReference"; - internal const string ValidationUtils_ResourceWithMediaResourceAndNonMLEType = "ValidationUtils_ResourceWithMediaResourceAndNonMLEType"; - internal const string ValidationUtils_ResourceWithoutMediaResourceAndMLEType = "ValidationUtils_ResourceWithoutMediaResourceAndMLEType"; - internal const string ValidationUtils_ResourceTypeNotAssignableToExpectedType = "ValidationUtils_ResourceTypeNotAssignableToExpectedType"; - internal const string ValidationUtils_NavigationPropertyExpected = "ValidationUtils_NavigationPropertyExpected"; - internal const string ValidationUtils_InvalidBatchBoundaryDelimiterLength = "ValidationUtils_InvalidBatchBoundaryDelimiterLength"; - internal const string ValidationUtils_RecursionDepthLimitReached = "ValidationUtils_RecursionDepthLimitReached"; - internal const string ValidationUtils_MaxDepthOfNestedEntriesExceeded = "ValidationUtils_MaxDepthOfNestedEntriesExceeded"; - internal const string ValidationUtils_NullCollectionItemForNonNullableType = "ValidationUtils_NullCollectionItemForNonNullableType"; - internal const string ValidationUtils_PropertiesMustNotContainReservedChars = "ValidationUtils_PropertiesMustNotContainReservedChars"; - internal const string ValidationUtils_WorkspaceResourceMustNotContainNullItem = "ValidationUtils_WorkspaceResourceMustNotContainNullItem"; - internal const string ValidationUtils_InvalidMetadataReferenceProperty = "ValidationUtils_InvalidMetadataReferenceProperty"; - internal const string WriterValidationUtils_PropertyMustNotBeNull = "WriterValidationUtils_PropertyMustNotBeNull"; - internal const string WriterValidationUtils_PropertiesMustHaveNonEmptyName = "WriterValidationUtils_PropertiesMustHaveNonEmptyName"; - internal const string WriterValidationUtils_MissingTypeNameWithMetadata = "WriterValidationUtils_MissingTypeNameWithMetadata"; - internal const string WriterValidationUtils_NextPageLinkInRequest = "WriterValidationUtils_NextPageLinkInRequest"; - internal const string WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink = "WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink"; - internal const string WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType = "WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType"; - internal const string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink = "WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink"; - internal const string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag = "WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag"; - internal const string WriterValidationUtils_StreamReferenceValueEmptyContentType = "WriterValidationUtils_StreamReferenceValueEmptyContentType"; - internal const string WriterValidationUtils_EntriesMustHaveNonEmptyId = "WriterValidationUtils_EntriesMustHaveNonEmptyId"; - internal const string WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute = "WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute"; - internal const string WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull = "WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull"; - internal const string WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull = "WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull"; - internal const string WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType = "WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType"; - internal const string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent = "WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent"; - internal const string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent = "WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent"; - internal const string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata = "WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata"; - internal const string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata = "WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata"; - internal const string WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata = "WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata"; - internal const string WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata = "WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata"; - internal const string WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue = "WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue"; - internal const string WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue = "WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue"; - internal const string WriterValidationUtils_StreamPropertiesMustNotHaveNullValue = "WriterValidationUtils_StreamPropertiesMustNotHaveNullValue"; - internal const string WriterValidationUtils_OperationInRequest = "WriterValidationUtils_OperationInRequest"; - internal const string WriterValidationUtils_AssociationLinkInRequest = "WriterValidationUtils_AssociationLinkInRequest"; - internal const string WriterValidationUtils_StreamPropertyInRequest = "WriterValidationUtils_StreamPropertyInRequest"; - internal const string WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute = "WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute"; - internal const string WriterValidationUtils_NavigationLinkMustSpecifyUrl = "WriterValidationUtils_NavigationLinkMustSpecifyUrl"; - internal const string WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection = "WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection"; - internal const string WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage = "WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage"; - internal const string WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint = "WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint"; - internal const string XmlReaderExtension_InvalidNodeInStringValue = "XmlReaderExtension_InvalidNodeInStringValue"; - internal const string XmlReaderExtension_InvalidRootNode = "XmlReaderExtension_InvalidRootNode"; - internal const string ODataMetadataInputContext_ErrorReadingMetadata = "ODataMetadataInputContext_ErrorReadingMetadata"; - internal const string ODataMetadataOutputContext_ErrorWritingMetadata = "ODataMetadataOutputContext_ErrorWritingMetadata"; - internal const string ODataMetadataOutputContext_NotSupportJsonMetadata = "ODataMetadataOutputContext_NotSupportJsonMetadata"; - internal const string ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified = "ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified"; - internal const string ODataPropertyAndValueDeserializer_InvalidCollectionElement = "ODataPropertyAndValueDeserializer_InvalidCollectionElement"; - internal const string ODataPropertyAndValueDeserializer_NavigationPropertyInProperties = "ODataPropertyAndValueDeserializer_NavigationPropertyInProperties"; - internal const string JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation = "JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation"; - internal const string EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid = "EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid"; - internal const string EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid = "EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid"; - internal const string EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid = "EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid"; - internal const string EdmLibraryExtensions_ValueOverflowForUnderlyingType = "EdmLibraryExtensions_ValueOverflowForUnderlyingType"; - internal const string ODataXmlResourceDeserializer_ContentWithWrongType = "ODataXmlResourceDeserializer_ContentWithWrongType"; - internal const string ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName = "ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName"; - internal const string ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName = "ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName"; - internal const string CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind = "CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind"; - internal const string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind = "CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind"; - internal const string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName = "CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName"; - internal const string ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes = "ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes"; - internal const string MessageStreamWrappingStream_ByteLimitExceeded = "MessageStreamWrappingStream_ByteLimitExceeded"; - internal const string MetadataUtils_ResolveTypeName = "MetadataUtils_ResolveTypeName"; - internal const string MetadataUtils_CalculateBindableOperationsForType = "MetadataUtils_CalculateBindableOperationsForType"; - internal const string EdmValueUtils_UnsupportedPrimitiveType = "EdmValueUtils_UnsupportedPrimitiveType"; - internal const string EdmValueUtils_IncorrectPrimitiveTypeKind = "EdmValueUtils_IncorrectPrimitiveTypeKind"; - internal const string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName = "EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName"; - internal const string EdmValueUtils_CannotConvertTypeToClrValue = "EdmValueUtils_CannotConvertTypeToClrValue"; - internal const string ODataEdmStructuredValue_UndeclaredProperty = "ODataEdmStructuredValue_UndeclaredProperty"; - internal const string ODataMetadataBuilder_MissingEntitySetUri = "ODataMetadataBuilder_MissingEntitySetUri"; - internal const string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix = "ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix"; - internal const string ODataMetadataBuilder_MissingEntityInstanceUri = "ODataMetadataBuilder_MissingEntityInstanceUri"; - internal const string ODataMetadataBuilder_MissingParentIdOrContextUrl = "ODataMetadataBuilder_MissingParentIdOrContextUrl"; - internal const string ODataMetadataBuilder_UnknownEntitySet = "ODataMetadataBuilder_UnknownEntitySet"; - internal const string ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType = "ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType"; - internal const string ODataJsonInputContext_PayloadKindDetectionForRequest = "ODataJsonInputContext_PayloadKindDetectionForRequest"; - internal const string ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader = "ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader"; - internal const string ODataJsonInputContext_NoEntitySetForRequest = "ODataJsonInputContext_NoEntitySetForRequest"; - internal const string ODataJsonInputContext_ModelRequiredForReading = "ODataJsonInputContext_ModelRequiredForReading"; - internal const string ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests = "ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests"; - internal const string ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty = "ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty"; - internal const string ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation = "ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation"; - internal const string ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue = "ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue"; - internal const string ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest = "ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest"; - internal const string ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet = "ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet"; - internal const string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest = "ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest"; - internal const string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest = "ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest"; - internal const string ODataResourceTypeContext_MetadataOrSerializationInfoMissing = "ODataResourceTypeContext_MetadataOrSerializationInfoMissing"; - internal const string ODataResourceTypeContext_ODataResourceTypeNameMissing = "ODataResourceTypeContext_ODataResourceTypeNameMissing"; - internal const string ODataContextUriBuilder_ValidateDerivedType = "ODataContextUriBuilder_ValidateDerivedType"; - internal const string ODataContextUriBuilder_TypeNameMissingForTopLevelCollection = "ODataContextUriBuilder_TypeNameMissingForTopLevelCollection"; - internal const string ODataContextUriBuilder_UnsupportedPayloadKind = "ODataContextUriBuilder_UnsupportedPayloadKind"; - internal const string ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource = "ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource"; - internal const string ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet = "ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet"; - internal const string ODataContextUriBuilder_ODataUriMissingForIndividualProperty = "ODataContextUriBuilder_ODataUriMissingForIndividualProperty"; - internal const string ODataContextUriBuilder_TypeNameMissingForProperty = "ODataContextUriBuilder_TypeNameMissingForProperty"; - internal const string ODataContextUriBuilder_ODataPathInvalidForContainedElement = "ODataContextUriBuilder_ODataPathInvalidForContainedElement"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties = "ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation = "ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation = "ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedProperty = "ODataJsonPropertyAndValueDeserializer_UnexpectedProperty"; - internal const string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload = "ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload"; - internal const string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName = "ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName"; - internal const string ODataJsonPropertyAndValueDeserializer_InvalidTypeName = "ODataJsonPropertyAndValueDeserializer_InvalidTypeName"; - internal const string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty = "ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty"; - internal const string ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty = "ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty"; - internal const string ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation = "ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation"; - internal const string ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst = "ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation = "ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation"; - internal const string ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty = "ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty"; - internal const string ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue = "ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue"; - internal const string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue = "ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue"; - internal const string ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty = "ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty"; - internal const string ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload = "ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload"; - internal const string ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected = "ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected"; - internal const string ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected = "ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected"; - internal const string ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty = "ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty"; - internal const string ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue = "ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue"; - internal const string ODataJsonReader_UnexpectedPrimitiveValueForODataResource = "ODataJsonReader_UnexpectedPrimitiveValueForODataResource"; - internal const string ODataJsonReaderUtils_AnnotationWithNullValue = "ODataJsonReaderUtils_AnnotationWithNullValue"; - internal const string ODataJsonReaderUtils_InvalidValueForODataNullAnnotation = "ODataJsonReaderUtils_InvalidValueForODataNullAnnotation"; - internal const string JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection = "JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection"; - internal const string ODataJsonContextUriParser_NullMetadataDocumentUri = "ODataJsonContextUriParser_NullMetadataDocumentUri"; - internal const string ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind = "ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind"; - internal const string ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName = "ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName"; - internal const string ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption = "ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption"; - internal const string ODataJsonContextUriParser_NoModel = "ODataJsonContextUriParser_NoModel"; - internal const string ODataJsonContextUriParser_InvalidContextUrl = "ODataJsonContextUriParser_InvalidContextUrl"; - internal const string ODataJsonContextUriParser_LastSegmentIsKeySegment = "ODataJsonContextUriParser_LastSegmentIsKeySegment"; - internal const string ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute = "ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute"; - internal const string ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject = "ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject"; - internal const string ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst = "ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst"; - internal const string ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty = "ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty"; - internal const string ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload = "ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload"; - internal const string ODataJsonResourceDeserializer_CannotReadResourceSetContentStart = "ODataJsonResourceDeserializer_CannotReadResourceSetContentStart"; - internal const string ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound = "ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound"; - internal const string ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet = "ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet"; - internal const string ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet = "ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet"; - internal const string ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet = "ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet"; - internal const string ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType = "ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType"; - internal const string ODataJsonResourceDeserializer_StreamPropertyInRequest = "ODataJsonResourceDeserializer_StreamPropertyInRequest"; - internal const string ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_StreamPropertyWithValue = "ODataJsonResourceDeserializer_StreamPropertyWithValue"; - internal const string ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_CannotReadSingletonNestedResource = "ODataJsonResourceDeserializer_CannotReadSingletonNestedResource"; - internal const string ODataJsonResourceDeserializer_CannotReadCollectionNestedResource = "ODataJsonResourceDeserializer_CannotReadCollectionNestedResource"; - internal const string ODataJsonResourceDeserializer_CannotReadNestedResource = "ODataJsonResourceDeserializer_CannotReadNestedResource"; - internal const string ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation = "ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation"; - internal const string ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet = "ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet"; - internal const string ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation = "ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation = "ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation = "ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation"; - internal const string ODataJsonResourceDeserializer_EmptyBindArray = "ODataJsonResourceDeserializer_EmptyBindArray"; - internal const string ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink = "ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink"; - internal const string ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue = "ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue"; - internal const string ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType = "ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType"; - internal const string ODataJsonResourceDeserializer_OperationIsNotActionOrFunction = "ODataJsonResourceDeserializer_OperationIsNotActionOrFunction"; - internal const string ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation = "ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation"; - internal const string ODataJsonResourceDeserializer_OperationMissingTargetProperty = "ODataJsonResourceDeserializer_OperationMissingTargetProperty"; - internal const string ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest = "ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest"; - internal const string ODataJsonValidationUtils_OperationPropertyCannotBeNull = "ODataJsonValidationUtils_OperationPropertyCannotBeNull"; - internal const string ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported = "ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported"; - internal const string ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation = "ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation"; - internal const string ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload = "ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload"; - internal const string ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound = "ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound"; - internal const string ODataJsonCollectionDeserializer_CannotReadCollectionContentStart = "ODataJsonCollectionDeserializer_CannotReadCollectionContentStart"; - internal const string ODataJsonCollectionDeserializer_CannotReadCollectionEnd = "ODataJsonCollectionDeserializer_CannotReadCollectionEnd"; - internal const string ODataJsonCollectionDeserializer_InvalidCollectionTypeName = "ODataJsonCollectionDeserializer_InvalidCollectionTypeName"; - internal const string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue = "ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue"; - internal const string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink = "ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink"; - internal const string ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink = "ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink"; - internal const string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink = "ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink"; - internal const string ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty = "ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty"; - internal const string ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink = "ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink"; - internal const string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull = "ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull"; - internal const string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks = "ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks"; - internal const string ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound = "ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound"; - internal const string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks = "ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks"; - internal const string ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound = "ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound"; - internal const string ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull = "ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull"; - internal const string ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue = "ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue"; - internal const string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument = "ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument"; - internal const string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement = "ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement"; - internal const string ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument = "ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument"; - internal const string ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement = "ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement"; - internal const string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument = "ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument"; - internal const string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument = "ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument"; - internal const string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement = "ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement"; - internal const string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement = "ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement"; - internal const string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement = "ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement"; - internal const string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument = "ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument"; - internal const string ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty = "ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty"; - internal const string ODataJsonParameterDeserializer_PropertyAnnotationForParameters = "ODataJsonParameterDeserializer_PropertyAnnotationForParameters"; - internal const string ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters = "ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters"; - internal const string ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType = "ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType"; - internal const string ODataJsonParameterDeserializer_NullCollectionExpected = "ODataJsonParameterDeserializer_NullCollectionExpected"; - internal const string ODataJsonParameterDeserializer_UnsupportedParameterTypeKind = "ODataJsonParameterDeserializer_UnsupportedParameterTypeKind"; - internal const string SelectedPropertiesNode_StarSegmentNotLastSegment = "SelectedPropertiesNode_StarSegmentNotLastSegment"; - internal const string SelectedPropertiesNode_StarSegmentAfterTypeSegment = "SelectedPropertiesNode_StarSegmentAfterTypeSegment"; - internal const string ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload = "ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload"; - internal const string ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload = "ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload"; - internal const string ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError = "ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError"; - internal const string ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty = "ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty"; - internal const string ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties = "ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties"; - internal const string ODataConventionalUriBuilder_NullKeyValue = "ODataConventionalUriBuilder_NullKeyValue"; - internal const string ODataResourceMetadataContext_EntityTypeWithNoKeyProperties = "ODataResourceMetadataContext_EntityTypeWithNoKeyProperties"; - internal const string ODataResourceMetadataContext_NullKeyValue = "ODataResourceMetadataContext_NullKeyValue"; - internal const string ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues = "ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues"; - internal const string ODataResource_PropertyValueCannotBeODataResourceValue = "ODataResource_PropertyValueCannotBeODataResourceValue"; - internal const string EdmValueUtils_NonPrimitiveValue = "EdmValueUtils_NonPrimitiveValue"; - internal const string EdmValueUtils_PropertyDoesntExist = "EdmValueUtils_PropertyDoesntExist"; - internal const string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull = "ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull"; - internal const string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType = "ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType"; - internal const string ODataInstanceAnnotation_NeedPeriodInName = "ODataInstanceAnnotation_NeedPeriodInName"; - internal const string ODataInstanceAnnotation_ReservedNamesNotAllowed = "ODataInstanceAnnotation_ReservedNamesNotAllowed"; - internal const string ODataInstanceAnnotation_BadTermName = "ODataInstanceAnnotation_BadTermName"; - internal const string ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue = "ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue"; - internal const string ODataJsonValueSerializer_MissingTypeNameOnCollection = "ODataJsonValueSerializer_MissingTypeNameOnCollection"; - internal const string ODataJsonValueSerializer_MissingRawValueOnUntyped = "ODataJsonValueSerializer_MissingRawValueOnUntyped"; - internal const string InstanceAnnotation_MissingTermAttributeOnAnnotationElement = "InstanceAnnotation_MissingTermAttributeOnAnnotationElement"; - internal const string InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType = "InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType"; - internal const string InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement = "InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement"; - internal const string InstanceAnnotation_MultipleAttributeValueNotationAttributes = "InstanceAnnotation_MultipleAttributeValueNotationAttributes"; - internal const string AnnotationFilterPattern_InvalidPatternMissingDot = "AnnotationFilterPattern_InvalidPatternMissingDot"; - internal const string AnnotationFilterPattern_InvalidPatternEmptySegment = "AnnotationFilterPattern_InvalidPatternEmptySegment"; - internal const string AnnotationFilterPattern_InvalidPatternWildCardInSegment = "AnnotationFilterPattern_InvalidPatternWildCardInSegment"; - internal const string AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment = "AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment"; - internal const string SyntacticTree_UriMustBeAbsolute = "SyntacticTree_UriMustBeAbsolute"; - internal const string SyntacticTree_MaxDepthInvalid = "SyntacticTree_MaxDepthInvalid"; - internal const string SyntacticTree_InvalidSkipQueryOptionValue = "SyntacticTree_InvalidSkipQueryOptionValue"; - internal const string SyntacticTree_InvalidTopQueryOptionValue = "SyntacticTree_InvalidTopQueryOptionValue"; - internal const string SyntacticTree_InvalidCountQueryOptionValue = "SyntacticTree_InvalidCountQueryOptionValue"; - internal const string SyntacticTree_InvalidIndexQueryOptionValue = "SyntacticTree_InvalidIndexQueryOptionValue"; - internal const string QueryOptionUtils_QueryParameterMustBeSpecifiedOnce = "QueryOptionUtils_QueryParameterMustBeSpecifiedOnce"; - internal const string UriBuilder_NotSupportedClrLiteral = "UriBuilder_NotSupportedClrLiteral"; - internal const string UriBuilder_NotSupportedQueryToken = "UriBuilder_NotSupportedQueryToken"; - internal const string UriQueryExpressionParser_TooDeep = "UriQueryExpressionParser_TooDeep"; - internal const string UriQueryExpressionParser_ExpressionExpected = "UriQueryExpressionParser_ExpressionExpected"; - internal const string UriQueryExpressionParser_OpenParenExpected = "UriQueryExpressionParser_OpenParenExpected"; - internal const string UriQueryExpressionParser_CloseParenOrCommaExpected = "UriQueryExpressionParser_CloseParenOrCommaExpected"; - internal const string UriQueryExpressionParser_CloseParenOrOperatorExpected = "UriQueryExpressionParser_CloseParenOrOperatorExpected"; - internal const string UriQueryExpressionParser_IllegalQueryOptioninDollarCount = "UriQueryExpressionParser_IllegalQueryOptioninDollarCount"; - internal const string UriQueryExpressionParser_CannotCreateStarTokenFromNonStar = "UriQueryExpressionParser_CannotCreateStarTokenFromNonStar"; - internal const string UriQueryExpressionParser_RangeVariableAlreadyDeclared = "UriQueryExpressionParser_RangeVariableAlreadyDeclared"; - internal const string UriQueryExpressionParser_AsExpected = "UriQueryExpressionParser_AsExpected"; - internal const string UriQueryExpressionParser_WithExpected = "UriQueryExpressionParser_WithExpected"; - internal const string UriQueryExpressionParser_UnrecognizedWithMethod = "UriQueryExpressionParser_UnrecognizedWithMethod"; - internal const string UriQueryExpressionParser_PropertyPathExpected = "UriQueryExpressionParser_PropertyPathExpected"; - internal const string UriQueryExpressionParser_KeywordOrIdentifierExpected = "UriQueryExpressionParser_KeywordOrIdentifierExpected"; - internal const string UriQueryExpressionParser_InnerMostExpandRequireFilter = "UriQueryExpressionParser_InnerMostExpandRequireFilter"; - internal const string UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri = "UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri"; - internal const string UriQueryPathParser_SyntaxError = "UriQueryPathParser_SyntaxError"; - internal const string UriQueryPathParser_TooManySegments = "UriQueryPathParser_TooManySegments"; - internal const string UriQueryPathParser_InvalidEscapeUri = "UriQueryPathParser_InvalidEscapeUri"; - internal const string UriUtils_DateTimeOffsetInvalidFormat = "UriUtils_DateTimeOffsetInvalidFormat"; - internal const string SelectionItemBinder_NonNavigationPathToken = "SelectionItemBinder_NonNavigationPathToken"; - internal const string MetadataBinder_ParameterAliasValueExpressionNotSingleValue = "MetadataBinder_ParameterAliasValueExpressionNotSingleValue"; - internal const string MetadataBinder_UnsupportedQueryTokenKind = "MetadataBinder_UnsupportedQueryTokenKind"; - internal const string MetadataBinder_PropertyNotDeclared = "MetadataBinder_PropertyNotDeclared"; - internal const string MetadataBinder_InvalidIdentifierInQueryOption = "MetadataBinder_InvalidIdentifierInQueryOption"; - internal const string MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue = "MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue"; - internal const string MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared = "MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared"; - internal const string MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties = "MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties"; - internal const string MetadataBinder_DuplicitKeyPropertyInKeyValues = "MetadataBinder_DuplicitKeyPropertyInKeyValues"; - internal const string MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues = "MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues"; - internal const string MetadataBinder_CannotConvertToType = "MetadataBinder_CannotConvertToType"; - internal const string MetadataBinder_FilterExpressionNotSingleValue = "MetadataBinder_FilterExpressionNotSingleValue"; - internal const string MetadataBinder_OrderByExpressionNotSingleValue = "MetadataBinder_OrderByExpressionNotSingleValue"; - internal const string MetadataBinder_PropertyAccessWithoutParentParameter = "MetadataBinder_PropertyAccessWithoutParentParameter"; - internal const string MetadataBinder_BinaryOperatorOperandNotSingleValue = "MetadataBinder_BinaryOperatorOperandNotSingleValue"; - internal const string MetadataBinder_UnaryOperatorOperandNotSingleValue = "MetadataBinder_UnaryOperatorOperandNotSingleValue"; - internal const string MetadataBinder_LeftOperandNotSingleValue = "MetadataBinder_LeftOperandNotSingleValue"; - internal const string MetadataBinder_RightOperandNotCollectionValue = "MetadataBinder_RightOperandNotCollectionValue"; - internal const string MetadataBinder_PropertyAccessSourceNotSingleValue = "MetadataBinder_PropertyAccessSourceNotSingleValue"; - internal const string MetadataBinder_CountSegmentNextTokenNotCollectionValue = "MetadataBinder_CountSegmentNextTokenNotCollectionValue"; - internal const string MetadataBinder_IncompatibleOperandsError = "MetadataBinder_IncompatibleOperandsError"; - internal const string MetadataBinder_IncompatibleOperandError = "MetadataBinder_IncompatibleOperandError"; - internal const string MetadataBinder_UnknownFunction = "MetadataBinder_UnknownFunction"; - internal const string MetadataBinder_FunctionArgumentNotSingleValue = "MetadataBinder_FunctionArgumentNotSingleValue"; - internal const string MetadataBinder_NoApplicableFunctionFound = "MetadataBinder_NoApplicableFunctionFound"; - internal const string MetadataBinder_BoundNodeCannotBeNull = "MetadataBinder_BoundNodeCannotBeNull"; - internal const string MetadataBinder_TopRequiresNonNegativeInteger = "MetadataBinder_TopRequiresNonNegativeInteger"; - internal const string MetadataBinder_SkipRequiresNonNegativeInteger = "MetadataBinder_SkipRequiresNonNegativeInteger"; - internal const string MetadataBinder_QueryOptionsBindStateCannotBeNull = "MetadataBinder_QueryOptionsBindStateCannotBeNull"; - internal const string MetadataBinder_QueryOptionsBindMethodCannotBeNull = "MetadataBinder_QueryOptionsBindMethodCannotBeNull"; - internal const string MetadataBinder_HierarchyNotFollowed = "MetadataBinder_HierarchyNotFollowed"; - internal const string MetadataBinder_LambdaParentMustBeCollection = "MetadataBinder_LambdaParentMustBeCollection"; - internal const string MetadataBinder_ParameterNotInScope = "MetadataBinder_ParameterNotInScope"; - internal const string MetadataBinder_NavigationPropertyNotFollowingSingleEntityType = "MetadataBinder_NavigationPropertyNotFollowingSingleEntityType"; - internal const string MetadataBinder_AnyAllExpressionNotSingleValue = "MetadataBinder_AnyAllExpressionNotSingleValue"; - internal const string MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands = "MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands"; - internal const string MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument = "MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument"; - internal const string MetadataBinder_CastOrIsOfCollectionsNotSupported = "MetadataBinder_CastOrIsOfCollectionsNotSupported"; - internal const string MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease = "MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease"; - internal const string MetadataBinder_IllegalSegmentType = "MetadataBinder_IllegalSegmentType"; - internal const string MetadataBinder_QueryOptionNotApplicable = "MetadataBinder_QueryOptionNotApplicable"; - internal const string StringItemShouldBeQuoted = "StringItemShouldBeQuoted"; - internal const string StreamItemInvalidPrimitiveKind = "StreamItemInvalidPrimitiveKind"; - internal const string ApplyBinder_AggregateExpressionIncompatibleTypeForMethod = "ApplyBinder_AggregateExpressionIncompatibleTypeForMethod"; - internal const string ApplyBinder_UnsupportedAggregateMethod = "ApplyBinder_UnsupportedAggregateMethod"; - internal const string ApplyBinder_UnsupportedAggregateKind = "ApplyBinder_UnsupportedAggregateKind"; - internal const string ApplyBinder_AggregateExpressionNotSingleValue = "ApplyBinder_AggregateExpressionNotSingleValue"; - internal const string ApplyBinder_GroupByPropertyNotPropertyAccessValue = "ApplyBinder_GroupByPropertyNotPropertyAccessValue"; - internal const string ApplyBinder_UnsupportedType = "ApplyBinder_UnsupportedType"; - internal const string ApplyBinder_UnsupportedGroupByChild = "ApplyBinder_UnsupportedGroupByChild"; - internal const string AggregateTransformationNode_UnsupportedAggregateExpressions = "AggregateTransformationNode_UnsupportedAggregateExpressions"; - internal const string FunctionCallBinder_CannotFindASuitableOverload = "FunctionCallBinder_CannotFindASuitableOverload"; - internal const string FunctionCallBinder_UriFunctionMustHaveHaveNullParent = "FunctionCallBinder_UriFunctionMustHaveHaveNullParent"; - internal const string FunctionCallBinder_CallingFunctionOnOpenProperty = "FunctionCallBinder_CallingFunctionOnOpenProperty"; - internal const string FunctionCallParser_DuplicateParameterOrEntityKeyName = "FunctionCallParser_DuplicateParameterOrEntityKeyName"; - internal const string ODataUriParser_InvalidCount = "ODataUriParser_InvalidCount"; - internal const string CastBinder_ChildTypeIsNotEntity = "CastBinder_ChildTypeIsNotEntity"; - internal const string CastBinder_EnumOnlyCastToOrFromString = "CastBinder_EnumOnlyCastToOrFromString"; - internal const string Binder_IsNotValidEnumConstant = "Binder_IsNotValidEnumConstant"; - internal const string BatchReferenceSegment_InvalidContentID = "BatchReferenceSegment_InvalidContentID"; - internal const string SelectExpandBinder_UnknownPropertyType = "SelectExpandBinder_UnknownPropertyType"; - internal const string SelectExpandBinder_InvalidIdentifierAfterWildcard = "SelectExpandBinder_InvalidIdentifierAfterWildcard"; - internal const string SelectExpandBinder_InvalidQueryOptionNestedSelection = "SelectExpandBinder_InvalidQueryOptionNestedSelection"; - internal const string SelectExpandBinder_SystemTokenInSelect = "SelectExpandBinder_SystemTokenInSelect"; - internal const string SelectionItemBinder_NoExpandForSelectedProperty = "SelectionItemBinder_NoExpandForSelectedProperty"; - internal const string SelectExpandPathBinder_FollowNonTypeSegment = "SelectExpandPathBinder_FollowNonTypeSegment"; - internal const string SelectBinder_MultiLevelPathInSelect = "SelectBinder_MultiLevelPathInSelect"; - internal const string ExpandItemBinder_TraversingANonNormalizedTree = "ExpandItemBinder_TraversingANonNormalizedTree"; - internal const string ExpandItemBinder_CannotFindType = "ExpandItemBinder_CannotFindType"; - internal const string ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty = "ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty"; - internal const string ExpandItemBinder_TypeSegmentNotFollowedByPath = "ExpandItemBinder_TypeSegmentNotFollowedByPath"; - internal const string ExpandItemBinder_PathTooDeep = "ExpandItemBinder_PathTooDeep"; - internal const string ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath = "ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath"; - internal const string ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType = "ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType"; - internal const string ExpandItemBinder_InvaidSegmentInExpand = "ExpandItemBinder_InvaidSegmentInExpand"; - internal const string Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity = "Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity"; - internal const string Nodes_NonentityParameterQueryNodeWithEntityType = "Nodes_NonentityParameterQueryNodeWithEntityType"; - internal const string Nodes_CollectionNavigationNode_MustHaveManyMultiplicity = "Nodes_CollectionNavigationNode_MustHaveManyMultiplicity"; - internal const string Nodes_PropertyAccessShouldBeNonEntityProperty = "Nodes_PropertyAccessShouldBeNonEntityProperty"; - internal const string Nodes_PropertyAccessTypeShouldNotBeCollection = "Nodes_PropertyAccessTypeShouldNotBeCollection"; - internal const string Nodes_PropertyAccessTypeMustBeCollection = "Nodes_PropertyAccessTypeMustBeCollection"; - internal const string Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease = "Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease"; - internal const string Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum = "Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum"; - internal const string Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity = "Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity"; - internal const string Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum = "Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum"; - internal const string Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType = "Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType"; - internal const string ExpandTreeNormalizer_NonPathInPropertyChain = "ExpandTreeNormalizer_NonPathInPropertyChain"; - internal const string SelectTreeNormalizer_MultipleSelecTermWithSamePathFound = "SelectTreeNormalizer_MultipleSelecTermWithSamePathFound"; - internal const string UriExpandParser_TermIsNotValidForStar = "UriExpandParser_TermIsNotValidForStar"; - internal const string UriExpandParser_TermIsNotValidForStarRef = "UriExpandParser_TermIsNotValidForStarRef"; - internal const string UriExpandParser_ParentStructuredTypeIsNull = "UriExpandParser_ParentStructuredTypeIsNull"; - internal const string UriExpandParser_TermWithMultipleStarNotAllowed = "UriExpandParser_TermWithMultipleStarNotAllowed"; - internal const string UriSelectParser_TermIsNotValid = "UriSelectParser_TermIsNotValid"; - internal const string UriSelectParser_InvalidTopOption = "UriSelectParser_InvalidTopOption"; - internal const string UriSelectParser_InvalidSkipOption = "UriSelectParser_InvalidSkipOption"; - internal const string UriSelectParser_InvalidCountOption = "UriSelectParser_InvalidCountOption"; - internal const string UriSelectParser_InvalidLevelsOption = "UriSelectParser_InvalidLevelsOption"; - internal const string UriSelectParser_SystemTokenInSelectExpand = "UriSelectParser_SystemTokenInSelectExpand"; - internal const string UriParser_MissingExpandOption = "UriParser_MissingExpandOption"; - internal const string UriParser_EmptyParenthesis = "UriParser_EmptyParenthesis"; - internal const string UriParser_MissingSelectOption = "UriParser_MissingSelectOption"; - internal const string UriParser_RelativeUriMustBeRelative = "UriParser_RelativeUriMustBeRelative"; - internal const string UriParser_NeedServiceRootForThisOverload = "UriParser_NeedServiceRootForThisOverload"; - internal const string UriParser_UriMustBeAbsolute = "UriParser_UriMustBeAbsolute"; - internal const string UriParser_NegativeLimit = "UriParser_NegativeLimit"; - internal const string UriParser_ExpandCountExceeded = "UriParser_ExpandCountExceeded"; - internal const string UriParser_ExpandDepthExceeded = "UriParser_ExpandDepthExceeded"; - internal const string UriParser_TypeInvalidForSelectExpand = "UriParser_TypeInvalidForSelectExpand"; - internal const string UriParser_ContextHandlerCanNotBeNull = "UriParser_ContextHandlerCanNotBeNull"; - internal const string UriParserMetadata_MultipleMatchingPropertiesFound = "UriParserMetadata_MultipleMatchingPropertiesFound"; - internal const string UriParserMetadata_MultipleMatchingNavigationSourcesFound = "UriParserMetadata_MultipleMatchingNavigationSourcesFound"; - internal const string UriParserMetadata_MultipleMatchingTypesFound = "UriParserMetadata_MultipleMatchingTypesFound"; - internal const string UriParserMetadata_MultipleMatchingKeysFound = "UriParserMetadata_MultipleMatchingKeysFound"; - internal const string UriParserMetadata_MultipleMatchingParametersFound = "UriParserMetadata_MultipleMatchingParametersFound"; - internal const string UriValidator_ValidatorMustUseSameModelAsParser = "UriValidator_ValidatorMustUseSameModelAsParser"; - internal const string PathParser_EntityReferenceNotSupported = "PathParser_EntityReferenceNotSupported"; - internal const string PathParser_CannotUseValueOnCollection = "PathParser_CannotUseValueOnCollection"; - internal const string PathParser_TypeMustBeRelatedToSet = "PathParser_TypeMustBeRelatedToSet"; - internal const string PathParser_TypeCastOnlyAllowedAfterStructuralCollection = "PathParser_TypeCastOnlyAllowedAfterStructuralCollection"; - internal const string PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint = "PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint"; - internal const string ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink = "ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink"; - internal const string ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty = "ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty"; - internal const string ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment = "ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment"; - internal const string ODataExpandPath_InvalidExpandPathSegment = "ODataExpandPath_InvalidExpandPathSegment"; - internal const string ODataSelectPath_CannotOnlyHaveTypeSegment = "ODataSelectPath_CannotOnlyHaveTypeSegment"; - internal const string ODataSelectPath_InvalidSelectPathSegmentType = "ODataSelectPath_InvalidSelectPathSegmentType"; - internal const string ODataSelectPath_OperationSegmentCanOnlyBeLastSegment = "ODataSelectPath_OperationSegmentCanOnlyBeLastSegment"; - internal const string ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment = "ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment"; - internal const string RequestUriProcessor_TargetEntitySetNotFound = "RequestUriProcessor_TargetEntitySetNotFound"; - internal const string RequestUriProcessor_FoundInvalidFunctionImport = "RequestUriProcessor_FoundInvalidFunctionImport"; - internal const string OperationSegment_ReturnTypeForMultipleOverloads = "OperationSegment_ReturnTypeForMultipleOverloads"; - internal const string OperationSegment_CannotReturnNull = "OperationSegment_CannotReturnNull"; - internal const string FunctionOverloadResolver_NoSingleMatchFound = "FunctionOverloadResolver_NoSingleMatchFound"; - internal const string FunctionOverloadResolver_MultipleActionOverloads = "FunctionOverloadResolver_MultipleActionOverloads"; - internal const string FunctionOverloadResolver_MultipleActionImportOverloads = "FunctionOverloadResolver_MultipleActionImportOverloads"; - internal const string FunctionOverloadResolver_MultipleOperationImportOverloads = "FunctionOverloadResolver_MultipleOperationImportOverloads"; - internal const string FunctionOverloadResolver_MultipleOperationOverloads = "FunctionOverloadResolver_MultipleOperationOverloads"; - internal const string FunctionOverloadResolver_FoundInvalidOperation = "FunctionOverloadResolver_FoundInvalidOperation"; - internal const string FunctionOverloadResolver_FoundInvalidOperationImport = "FunctionOverloadResolver_FoundInvalidOperationImport"; - internal const string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload = "CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload"; - internal const string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature = "CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature"; - internal const string CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists = "CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists"; - internal const string RequestUriProcessor_InvalidValueForEntitySegment = "RequestUriProcessor_InvalidValueForEntitySegment"; - internal const string RequestUriProcessor_InvalidValueForKeySegment = "RequestUriProcessor_InvalidValueForKeySegment"; - internal const string RequestUriProcessor_CannotApplyFilterOnSingleEntities = "RequestUriProcessor_CannotApplyFilterOnSingleEntities"; - internal const string RequestUriProcessor_CannotApplyEachOnSingleEntities = "RequestUriProcessor_CannotApplyEachOnSingleEntities"; - internal const string RequestUriProcessor_FilterPathSegmentSyntaxError = "RequestUriProcessor_FilterPathSegmentSyntaxError"; - internal const string RequestUriProcessor_NoNavigationSourceFound = "RequestUriProcessor_NoNavigationSourceFound"; - internal const string RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment = "RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment"; - internal const string RequestUriProcessor_EmptySegmentInRequestUrl = "RequestUriProcessor_EmptySegmentInRequestUrl"; - internal const string RequestUriProcessor_SyntaxError = "RequestUriProcessor_SyntaxError"; - internal const string RequestUriProcessor_CountOnRoot = "RequestUriProcessor_CountOnRoot"; - internal const string RequestUriProcessor_FilterOnRoot = "RequestUriProcessor_FilterOnRoot"; - internal const string RequestUriProcessor_EachOnRoot = "RequestUriProcessor_EachOnRoot"; - internal const string RequestUriProcessor_RefOnRoot = "RequestUriProcessor_RefOnRoot"; - internal const string RequestUriProcessor_MustBeLeafSegment = "RequestUriProcessor_MustBeLeafSegment"; - internal const string RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment = "RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment"; - internal const string RequestUriProcessor_MissingSegmentAfterLink = "RequestUriProcessor_MissingSegmentAfterLink"; - internal const string RequestUriProcessor_CountNotSupported = "RequestUriProcessor_CountNotSupported"; - internal const string RequestUriProcessor_CannotQueryCollections = "RequestUriProcessor_CannotQueryCollections"; - internal const string RequestUriProcessor_SegmentDoesNotSupportKeyPredicates = "RequestUriProcessor_SegmentDoesNotSupportKeyPredicates"; - internal const string RequestUriProcessor_ValueSegmentAfterScalarPropertySegment = "RequestUriProcessor_ValueSegmentAfterScalarPropertySegment"; - internal const string RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType = "RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType"; - internal const string OpenNavigationPropertiesNotSupportedOnOpenTypes = "OpenNavigationPropertiesNotSupportedOnOpenTypes"; - internal const string BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation = "BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation"; - internal const string DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion = "DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion"; - internal const string BadRequest_KeyCountMismatch = "BadRequest_KeyCountMismatch"; - internal const string BadRequest_KeyMismatch = "BadRequest_KeyMismatch"; - internal const string BadRequest_KeyOrAlternateKeyMismatch = "BadRequest_KeyOrAlternateKeyMismatch"; - internal const string RequestUriProcessor_KeysMustBeNamed = "RequestUriProcessor_KeysMustBeNamed"; - internal const string RequestUriProcessor_ResourceNotFound = "RequestUriProcessor_ResourceNotFound"; - internal const string RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset = "RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset"; - internal const string RequestUriProcessor_Forbidden = "RequestUriProcessor_Forbidden"; - internal const string RequestUriProcessor_OperationSegmentBoundToANonEntityType = "RequestUriProcessor_OperationSegmentBoundToANonEntityType"; - internal const string RequestUriProcessor_NoBoundEscapeFunctionSupported = "RequestUriProcessor_NoBoundEscapeFunctionSupported"; - internal const string RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter = "RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter"; - internal const string RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter = "RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter"; - internal const string General_InternalError = "General_InternalError"; - internal const string ExceptionUtils_CheckIntegerNotNegative = "ExceptionUtils_CheckIntegerNotNegative"; - internal const string ExceptionUtils_CheckIntegerPositive = "ExceptionUtils_CheckIntegerPositive"; - internal const string ExceptionUtils_CheckLongPositive = "ExceptionUtils_CheckLongPositive"; - internal const string ExceptionUtils_ArgumentStringNullOrEmpty = "ExceptionUtils_ArgumentStringNullOrEmpty"; - internal const string ExpressionToken_OnlyRefAllowWithStarInExpand = "ExpressionToken_OnlyRefAllowWithStarInExpand"; - internal const string ExpressionToken_DollarCountNotAllowedInSelect = "ExpressionToken_DollarCountNotAllowedInSelect"; - internal const string ExpressionToken_NoPropAllowedAfterDollarCount = "ExpressionToken_NoPropAllowedAfterDollarCount"; - internal const string ExpressionToken_NoPropAllowedAfterRef = "ExpressionToken_NoPropAllowedAfterRef"; - internal const string ExpressionToken_NoSegmentAllowedBeforeStarInExpand = "ExpressionToken_NoSegmentAllowedBeforeStarInExpand"; - internal const string ExpressionToken_IdentifierExpected = "ExpressionToken_IdentifierExpected"; - internal const string ExpressionLexer_UnterminatedStringLiteral = "ExpressionLexer_UnterminatedStringLiteral"; - internal const string ExpressionLexer_InvalidCharacter = "ExpressionLexer_InvalidCharacter"; - internal const string ExpressionLexer_SyntaxError = "ExpressionLexer_SyntaxError"; - internal const string ExpressionLexer_UnterminatedLiteral = "ExpressionLexer_UnterminatedLiteral"; - internal const string ExpressionLexer_DigitExpected = "ExpressionLexer_DigitExpected"; - internal const string ExpressionLexer_UnbalancedBracketExpression = "ExpressionLexer_UnbalancedBracketExpression"; - internal const string ExpressionLexer_InvalidNumericString = "ExpressionLexer_InvalidNumericString"; - internal const string ExpressionLexer_InvalidEscapeSequence = "ExpressionLexer_InvalidEscapeSequence"; - internal const string UriQueryExpressionParser_UnrecognizedLiteral = "UriQueryExpressionParser_UnrecognizedLiteral"; - internal const string UriQueryExpressionParser_UnrecognizedLiteralWithReason = "UriQueryExpressionParser_UnrecognizedLiteralWithReason"; - internal const string UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue = "UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue"; - internal const string UriPrimitiveTypeParsers_FailedToParseStringToGeography = "UriPrimitiveTypeParsers_FailedToParseStringToGeography"; - internal const string UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists = "UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists"; - internal const string UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists = "UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists"; - internal const string UriParserHelper_InvalidPrefixLiteral = "UriParserHelper_InvalidPrefixLiteral"; - internal const string CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists = "CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists"; - internal const string ValueParser_InvalidDuration = "ValueParser_InvalidDuration"; - internal const string PlatformHelper_DateTimeOffsetMustContainTimeZone = "PlatformHelper_DateTimeOffsetMustContainTimeZone"; - internal const string JsonReader_UnexpectedComma = "JsonReader_UnexpectedComma"; - internal const string JsonReader_ArrayClosureMismatch = "JsonReader_ArrayClosureMismatch"; - internal const string JsonReader_MultipleTopLevelValues = "JsonReader_MultipleTopLevelValues"; - internal const string JsonReader_EndOfInputWithOpenScope = "JsonReader_EndOfInputWithOpenScope"; - internal const string JsonReader_UnexpectedToken = "JsonReader_UnexpectedToken"; - internal const string JsonReader_UnrecognizedToken = "JsonReader_UnrecognizedToken"; - internal const string JsonReader_MissingColon = "JsonReader_MissingColon"; - internal const string JsonReader_UnrecognizedEscapeSequence = "JsonReader_UnrecognizedEscapeSequence"; - internal const string JsonReader_UnexpectedEndOfString = "JsonReader_UnexpectedEndOfString"; - internal const string JsonReader_InvalidNumberFormat = "JsonReader_InvalidNumberFormat"; - internal const string JsonReader_InvalidBinaryFormat = "JsonReader_InvalidBinaryFormat"; - internal const string JsonReader_MissingComma = "JsonReader_MissingComma"; - internal const string JsonReader_InvalidPropertyNameOrUnexpectedComma = "JsonReader_InvalidPropertyNameOrUnexpectedComma"; - internal const string JsonReader_MaxBufferReached = "JsonReader_MaxBufferReached"; - internal const string JsonReader_CannotAccessValueInStreamState = "JsonReader_CannotAccessValueInStreamState"; - internal const string JsonReader_CannotCallReadInStreamState = "JsonReader_CannotCallReadInStreamState"; - internal const string JsonReader_CannotCreateReadStream = "JsonReader_CannotCreateReadStream"; - internal const string JsonReader_CannotCreateTextReader = "JsonReader_CannotCreateTextReader"; - internal const string JsonReaderExtensions_UnexpectedNodeDetected = "JsonReaderExtensions_UnexpectedNodeDetected"; - internal const string JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName = "JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName"; - internal const string JsonReaderExtensions_CannotReadPropertyValueAsString = "JsonReaderExtensions_CannotReadPropertyValueAsString"; - internal const string JsonReaderExtensions_CannotReadValueAsString = "JsonReaderExtensions_CannotReadValueAsString"; - internal const string JsonReaderExtensions_CannotReadValueAsDouble = "JsonReaderExtensions_CannotReadValueAsDouble"; - internal const string JsonReaderExtensions_UnexpectedInstanceAnnotationName = "JsonReaderExtensions_UnexpectedInstanceAnnotationName"; - internal const string BufferUtils_InvalidBufferOrSize = "BufferUtils_InvalidBufferOrSize"; - internal const string ServiceProviderExtensions_NoServiceRegistered = "ServiceProviderExtensions_NoServiceRegistered"; - internal const string TypeUtils_TypeNameIsNotQualified = "TypeUtils_TypeNameIsNotQualified"; - - static TextRes loader = null; - ResourceManager resources; - - internal TextRes() - { - resources = new System.Resources.ResourceManager("Microsoft.OData.Core", this.GetType().GetTypeInfo().Assembly); - } - - private static TextRes GetLoader() - { - if (loader == null) - { - TextRes sr = new TextRes(); - Interlocked.CompareExchange(ref loader, sr, null); - } - - return loader; - } - - private static CultureInfo Culture - { - get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; } - } - - public static ResourceManager Resources - { - get - { - return GetLoader().resources; - } - } - - public static string GetString(string name, params object[] args) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - string res = sys.resources.GetString(name, TextRes.Culture); - - if (args != null && args.Length > 0) - { - for (int i = 0; i < args.Length; i ++) - { - String value = args[i] as String; - if (value != null && value.Length > 1024) - { - args[i] = value.Substring(0, 1024 - 3) + "..."; - } - } - return String.Format(CultureInfo.CurrentCulture, res, args); - } - else - { - return res; - } - } - - public static string GetString(string name) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - return sys.resources.GetString(name, TextRes.Culture); - } - - public static string GetString(string name, out bool usedFallback) - { - // always false for this version of gensr - usedFallback = false; - return GetString(name); - } - } -} diff --git a/src/Microsoft.OData.Core/Microsoft.OData.Core.csproj b/src/Microsoft.OData.Core/Microsoft.OData.Core.csproj index feedf238a3..b212de9b6b 100644 --- a/src/Microsoft.OData.Core/Microsoft.OData.Core.csproj +++ b/src/Microsoft.OData.Core/Microsoft.OData.Core.csproj @@ -19,19 +19,6 @@ $(WarningsAsErrors);RS0017;RS0025 - - - Microsoft.OData.Core - true - true - internal - true - Microsoft.OData.Core.TextRes - false - true - - - @@ -40,11 +27,6 @@ - - - - - @@ -77,17 +59,6 @@ - - - - TextTemplatingFileGenerator - Microsoft.OData.Core.cs - - - TextTemplatingFileGenerator - Parameterized.Microsoft.OData.Core.cs - - @@ -100,4 +71,19 @@ + + + True + True + SRResources.resx + + + + + + ResXFileCodeGenerator + SRResources.Designer.cs + + + diff --git a/src/Microsoft.OData.Core/Microsoft.OData.Core.tt b/src/Microsoft.OData.Core/Microsoft.OData.Core.tt deleted file mode 100644 index 313734bd13..0000000000 --- a/src/Microsoft.OData.Core/Microsoft.OData.Core.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\ResourceClassGenerator2.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Core"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Core.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Core/Microsoft.OData.Core.txt b/src/Microsoft.OData.Core/Microsoft.OData.Core.txt deleted file mode 100644 index 06eb12826f..0000000000 --- a/src/Microsoft.OData.Core/Microsoft.OData.Core.txt +++ /dev/null @@ -1,1000 +0,0 @@ - -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone -; See ResourceManager documentation and the ResGen tool. - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Error Messages - -ExceptionUtils_ArgumentStringEmpty=Value cannot be empty. - -ODataRequestMessage_AsyncNotAvailable=An asynchronous operation was requested on an IODataRequestMessage instance. For asynchronous operations to succeed, the request message instance must implement IODataRequestMessageAsync. -ODataRequestMessage_StreamTaskIsNull=The IODataRequestMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null. -ODataRequestMessage_MessageStreamIsNull=The IODataRequestMessage.GetStream or IODataRequestMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream. -ODataResponseMessage_AsyncNotAvailable=An asynchronous operation was requested on an IODataResponseMessage instance. For asynchronous operations to succeed, the response message instance must implement IODataResponseMessageAsync. -ODataResponseMessage_StreamTaskIsNull=The IODataResponseMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null. -ODataResponseMessage_MessageStreamIsNull=The IODataResponseMessage.GetStream or IODataResponseMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream. - -AsyncBufferedStream_WriterDisposedWithoutFlush=A writer or stream has been disposed with data still in the buffer. You must call Flush or FlushAsync before calling Dispose when some data has already been written. - -ODataOutputContext_UnsupportedPayloadKindForFormat=The format '{0}' does not support writing a payload of kind '{1}'. - -ODataInputContext_UnsupportedPayloadKindForFormat=The format '{0}' does not support reading a payload of kind '{1}'. - -ODataOutputContext_MetadataDocumentUriMissing=The ServiceRoot property in ODataMessageWriterSettings.ODataUri must be set when writing a payload. - -ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata=A relative URI value '{0}' was specified in the data to write, but the metadata document URI or the metadata for the item to be written was not specified for the writer. The metadata document URI and the metadata for the item to be written must be provided to the writer when using relative URI values. - -ODataWriter_RelativeUriUsedWithoutBaseUriSpecified=A relative URI value '{0}' was specified in the data to write, but a base URI was not specified for the writer. A base URI must be set when using relative URI values. -ODataWriter_StreamPropertiesMustBePropertiesOfODataResource=The property '{0}' is a stream property, but it is not a property of an ODataResource instance. In OData, stream properties must be properties of ODataResource instances. - -ODataWriterCore_InvalidStateTransition=An invalid state transition has been detected in an OData writer. Cannot transition from state '{0}' to state '{1}'. -ODataWriterCore_InvalidTransitionFromStart=Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set. -ODataWriterCore_InvalidTransitionFromResource=Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a property or a nested resource. -ODataWriterCore_InvalidTransitionFrom40DeletedResource=Cannot transition from state '{0}' to state '{1}' when writing an OData 4.0 payload. To write content to a deleted resource, please specify ODataVersion 4.01 or greater in MessageWriterSettings. -ODataWriterCore_InvalidTransitionFromNullResource=Cannot transition from state '{0}' to state '{1}'. You must first call ODataWriter.WriteEnd to finish writing a null ODataResource. -ODataWriterCore_InvalidTransitionFromResourceSet=Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a resource. -ODataWriterCore_InvalidTransitionFromExpandedLink=Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set. -ODataWriterCore_InvalidTransitionFromCompleted=Cannot transition from state '{0}' to state '{1}'. Nothing further can be written once the writer has completed. -ODataWriterCore_InvalidTransitionFromError=Cannot transition from state '{0}' to state '{1}'. Nothing can be written once the writer entered the error state. -ODataJsonDeltaWriter_InvalidTransitionFromNestedResource=Cannot transition from state '{0}' to state '{1}'. State transition is not allowed while writing an expanded navigation property, complex property or complex collection property. -ODataJsonDeltaWriter_InvalidTransitionToNestedResource=Cannot transition from state '{0}' to state '{1}'. Nested resource can only be written within a delta resource. -ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState=WriteStart(expandedResourceSet) was called in an invalid state ('{0}'); WriteStart(expandedResourceSet) is only supported in state 'ExpandedNavigationProperty'. -ODataWriterCore_WriteEndCalledInInvalidState=ODataWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Resource', 'ResourceSet', 'NavigationLink', and 'NavigationLinkWithContent'. -ODataWriterCore_StreamNotDisposed=ODataWriter.Write or ODataWriter.WriteEnd was called while streaming a value. Stream or TextWriter must be disposed before calling additional methods on ODataWriter. - -ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties=No Id or key properties were found. A resource in a delta payload requires an ID or key properties be specified. -ODataWriterCore_QueryCountInRequest=The ODataResourceSet.Count must be null for request payloads. Query counts are only supported in responses. -ODataWriterCore_QueryNextLinkInRequest=The NextPageLink must be null for request payloads. Next page links are only supported in responses. -ODataWriterCore_QueryDeltaLinkInRequest=The DeltaLink must be null for request payloads. Delta links are only supported in responses. -ODataWriterCore_CannotWriteDeltaWithResourceSetWriter=Cannot write a deleted resource, link, deleted link, or nested delta resource set within a resource set; they must be written within a delta resource set. -ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry=Nested content is not allowed in an OData 4.0 deleted entry. For content in deleted entries, please specify OData 4.01 or greater. -ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter=Cannot write a top-level resource set with a writer that was created to write a top-level resource. -ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter=Cannot write a top-level resource with a writer that was created to write a top-level resource set. -ODataWriterCore_SyncCallOnAsyncWriter=A synchronous operation was called on an asynchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous. -ODataWriterCore_AsyncCallOnSyncWriter=An asynchronous operation was called on a synchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous. -ODataWriterCore_EntityReferenceLinkWithoutNavigationLink=An entity reference link was written without a surrounding navigation link. The WriteEntityReferenceLink or WriteEntityReferenceLinkAsync methods can only be used when writing the content of a navigation link. -ODataWriterCore_DeferredLinkInRequest=A deferred link was written into a request. In requests, each nested resource info must have a resource set, resource, or entity reference link written into it. -ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent=More than one item was written into the content of a nested resource. In OData, a nested resource can only contain more than one item in its content when ODataNestedResourceInfo.IsCollection set to true, and the writer is writing a request. -ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet=The ODataResourceSet.DeltaLink property must be null for expanded resource sets. Delta link is not supported on expanded resource sets. -ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement=The Path property in ODataMessageWriterSettings.ODataUri must be set when writing contained elements. - -DuplicatePropertyNamesNotAllowed=Multiple properties with the name '{0}' were detected in a resource or a complex value. In OData, duplicate property names are not allowed. -DuplicateAnnotationNotAllowed=Multiple annotations with the name '{0}' were detected. In OData, duplicate annotations are not allowed. -DuplicateAnnotationForPropertyNotAllowed=Multiple annotations with the name '{0}' were detected for the property with name '{1}'. In OData, duplicate annotations are not allowed. -DuplicateAnnotationForInstanceAnnotationNotAllowed=Multiple annotations with the name '{0}' were detected for the instance annotation with name '{1}'. In OData, duplicate annotations are not allowed. -PropertyAnnotationAfterTheProperty=An annotation with name '{0}' for property '{1}' was detected after the property, or after an annotation for another property. In OData, annotations for a property must be in a single group and must appear before the property they annotate. - -ValueUtils_CannotConvertValueToPrimitive=Cannot convert a value of type '{0}' to the string representation of a primitive value. - -ODataJsonWriter_UnsupportedValueType=The value of type '{0}' is not supported and cannot be converted to a JSON representation. -ODataJsonWriter_UnsupportedValueInCollection=Unable to serialize an object in a collection as it is not a supported ODataValue. -ODataJsonWriter_UnsupportedDateTimeFormat=The specified ODataJsonDateTimeFormat is not supported. - -ODataException_GeneralError=An error occurred while processing the OData message. -ODataErrorException_GeneralError=An error was read from the payload. See the 'Error' property for more details. -ODataUriParserException_GeneralError=An error occurred while parsing part of the URI. - -ODataUrlValidationError_SelectRequired='{0}' is missing a $select clause. All property paths, expands, and selects of complex types should include a $select statement. -ODataUrlValidationError_InvalidRule=Exception thrown by invalid rule {0}. {1} - -ODataMessageWriter_WriterAlreadyUsed=The ODataMessageWriter has already been used to write a message payload. An ODataMessageWriter can only be used once to write a payload for a given message. -ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed=Top-level entity reference link collection payloads are not allowed in requests. -ODataMessageWriter_ErrorPayloadInRequest=An error cannot be written to a request payload. Errors are only supported in responses. -ODataMessageWriter_ServiceDocumentInRequest=A service document cannot be written to request payloads. Service documents are only supported in responses. -ODataMessageWriter_MetadataDocumentInRequest=A metadata document cannot be written to request payloads. Metadata documents are only supported in responses. -ODataMessageWriter_DeltaInRequest=Cannot write delta in request payload. -ODataMessageWriter_AsyncInRequest=Cannot write async in request payload. -ODataMessageWriter_CannotWriteTopLevelNull=Cannot write the value 'null' in top level property; return 204 instead. -ODataMessageWriter_CannotWriteNullInRawFormat=Cannot write the value 'null' in raw format. -ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind=Cannot set message headers for the invalid payload kind '{0}'. -ODataMessageWriter_IncompatiblePayloadKinds=The payload kind '{0}' used in the last call to ODataUtils.SetHeadersForPayload is incompatible with the payload being written, which is of kind '{1}'. -ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty=The stream property '{0}' cannot be written to the payload as a top level property. -ODataMessageWriter_WriteErrorAlreadyCalled=The WriteError method or the WriteErrorAsync method on the ODataMessageWriter has already been called to write an error payload. Only a single error payload can be written with each ODataMessageWriter instance. -ODataMessageWriter_CannotWriteInStreamErrorForRawValues=The WriteError method or the WriteErrorAsync method on ODataMessageWriter cannot be called after the WriteValue method or the WriteValueAsync method is called. In OData, writing an in-stream error for raw values is not supported. -ODataMessageWriter_CannotWriteMetadataWithoutModel=No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings in order to write a metadata document. -ODataMessageWriter_CannotSpecifyOperationWithoutModel=No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings when CreateODataParameterWriter is called with a non-null operation. -ODataMessageWriter_JsonPaddingOnInvalidContentType=A JsonPaddingFunctionName was specified, but the content-type '{0}' is not supported with Json Padding. -ODataMessageWriter_NonCollectionType=The type '{0}' specified as the collection's item type is not primitive, enum or complex. An ODataCollectionWriter can only write collections of primitive, enum or complex values. -ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue=Not allowed to write top level property '{0}' with 'ODataResourceValue' or collection of resource value. -ODataMessageWriter_JsonWriterFactory_ReturnedNull=The provided implementation of IJsonWriterFactory returned null for arguments: isIeee754Compatible '{0}', encoding '{1}'. The factory should return a concrete IJsonWriter implementation. -ODataMessageWriter_Buffer_Maximum_Size_Exceeded=The requested buffer capacity {0} exceeds the max buffer size. -ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth=Both startResourceXmlCustomizationCallback and endResourceXmlCustomizationCallback must be either null or non-null. - - -ODataCollectionWriterCore_InvalidTransitionFromStart=Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write the collection or to write nothing at all. -ODataCollectionWriterCore_InvalidTransitionFromCollection=Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or to write the end of the collection. -ODataCollectionWriterCore_InvalidTransitionFromItem=Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or the end of the collection. -ODataCollectionWriterCore_WriteEndCalledInInvalidState=ODataCollectionWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Start', 'Collection', and 'Item'. -ODataCollectionWriterCore_SyncCallOnAsyncWriter=A synchronous operation was called on an asynchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous. -ODataCollectionWriterCore_AsyncCallOnSyncWriter=An asynchronous operation was called on a synchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous. - -ODataBatch_InvalidHttpMethodForChangeSetRequest=An invalid HTTP method '{0}' was detected for a request in a change set. Requests in change sets only support the HTTP methods 'POST', 'PUT', 'DELETE', and 'PATCH'. - -ODataBatchOperationHeaderDictionary_KeyNotFound=The header with name '{0}' was not present in the header collection of the batch operation. -ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys=Multiple headers with names that match '{0}', when using a case insensitive comparison, have been added. When case-insensitive header names are used, at most one header can be added for each name. - -ODataParameterWriter_InStreamErrorNotSupported=Writing an in-stream error is not supported when writing a parameter payload. -ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage=CreateParameterWriter was called on a response message. A parameter payload is only allowed in a request message. - -ODataParameterWriterCore_SyncCallOnAsyncWriter=A synchronous operation was called on an asynchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous. -ODataParameterWriterCore_AsyncCallOnSyncWriter=An asynchronous operation was called on a synchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous. -ODataParameterWriterCore_CannotWriteStart=WriteStart can only be called once, and it must be called before writing anything else. -ODataParameterWriterCore_CannotWriteParameter=WriteValue and CreateCollectionWriter can only be called after WriteStart and before WriteEnd; they cannot be called until the previously created sub-writer is completed. -ODataParameterWriterCore_CannotWriteEnd=WriteEnd can only be called after WriteStart and after the previously created sub-writer has completed. -ODataParameterWriterCore_CannotWriteInErrorOrCompletedState=The writer is in either the 'Error' or 'Completed' state. No further writes can be performed on this writer. -ODataParameterWriterCore_DuplicatedParameterNameNotAllowed=The parameter '{0}' has already been written. Duplicate parameter names are not allowed in the parameter payload. -ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind=The parameter '{0}' is of Edm type kind '{1}'. You cannot call WriteValue on a parameter that is not of Edm type kinds 'Primitive' or 'Enum'. -ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType=The value for parameter '{0}' is of type '{1}'. WriteValue can only write null, ODataEnumValue and primitive types that are not Stream type. -ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind=The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateCollectionWriter on a parameter that is not of Edm type kind 'Collection'. -ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind=The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceWriter on a parameter that is not of Edm type kind 'Entity' or 'Complex'. -ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind=The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceSetWriter on a parameter that is not of Edm type kind 'Collection(Entity)' or 'Collection(Complex)'. -ODataParameterWriterCore_ParameterNameNotFoundInOperation=The name '{0}' is not a recognized parameter name for operation '{1}'. -ODataParameterWriterCore_MissingParameterInParameterPayload=The parameters {0} of the operation '{1}' could not be found when writing the parameter payload. All parameters present in the operation must be written to the parameter payload. - -ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState=ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync was called while a stream being used to write operation content, obtained from the operation message by using GetStream or GetStreamAsync, was still active. This is not allowed. ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync can only be called when an active stream for the operation content does not exist. -ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet=An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndBatch with an active change set; you must first call ODataBatchWriter.WriteEndChangeset. -ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet=An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteStartChangeset with an active change set; you must first call ODataBatchWriter.WriteEndChangeset. -ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet=An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndChangeset without an active change set; you must first call ODataBatchWriter.WriteStartChangeset. -ODataBatchWriter_InvalidTransitionFromStart=An invalid method call on ODataBatchWriter was detected. After creating the writer, the only valid methods are ODataBatchWriter.WriteStartBatch and ODataBatchWriter.FlushAsync. -ODataBatchWriter_InvalidTransitionFromBatchStarted=An invalid method call on ODataBatchWriter was detected. After calling WriteStartBatch, the only valid methods on ODataBatchWriter are WriteStartChangeset, CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndBatch, and FlushAsync. -ODataBatchWriter_InvalidTransitionFromChangeSetStarted=An invalid method call on ODataBatchWriter was detected. After calling WriteStartChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndChangeset, and FlushAsync. -ODataBatchWriter_InvalidTransitionFromOperationCreated=An invalid method call on ODataBatchWriter was detected. After calling CreateOperationRequestMessage or CreateOperationResponseMessage, the only valid methods on ODataBatchWriter are WriteStartChangeset, WriteEndChangeset, WriteEndBatch, and FlushAsync. -ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested=An invalid method call on ODataBatchWriter was detected. You cannot use the batch writer while another writer is writing the content of an operation. Dispose the stream for the operation before continuing to use the ODataBatchWriter. -ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed=An invalid method call on ODataBatchWriter was detected. After writing the content of an operation, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndChangeset, WriteEndBatch and FlushAsync. -ODataBatchWriter_InvalidTransitionFromChangeSetCompleted=An invalid method call on ODataBatchWriter was detected. After calling WriteEndChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndBatch, and FlushAsync. -ODataBatchWriter_InvalidTransitionFromBatchCompleted=An invalid method call on ODataBatchWriter was detected. You can only call ODataBatchWriter.FlushAsync after ODataBatchWriter.WriteEndBatch has been called. -ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse=When writing a batch response, you cannot create a batch operation request message. -ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest=When writing a batch request, you cannot create a batch operation response message. -ODataBatchWriter_MaxBatchSizeExceeded=The current batch message contains too many parts. Only batch messages with a maximum number of '{0}' query operations and change sets are allowed. -ODataBatchWriter_MaxChangeSetSizeExceeded=The current change set contains too many operations. Only change sets with a maximum number of '{0}' operations are allowed. -ODataBatchWriter_SyncCallOnAsyncWriter=A synchronous operation was called on an asynchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous. -ODataBatchWriter_AsyncCallOnSyncWriter=An asynchronous operation was called on a synchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous. -ODataBatchWriter_DuplicateContentIDsNotAllowed=The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01. -ODataBatchWriter_CannotWriteInStreamErrorForBatch=The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when a batch is being written by using ODataBatchWriter. In OData, writing an in-stream error for a batch payload is not supported. - -ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified=The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. -ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified=The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. When the relative URI is a reference to a content ID, the content ID does not exist in the current change set. - -ODataBatchOperationMessage_VerifyNotCompleted=An attempt to change the properties of the message or to retrieve the payload stream for the message has failed. Either the payload stream has already been requested or the processing of the message has been completed. In both cases, no more changes can be made to the message. - -ODataBatchOperationStream_Disposed=Cannot access a closed stream. - -ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse=When reading a batch response, you cannot create a batch operation request message. -ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest=When reading a batch request, you cannot create a batch operation response message. -ODataBatchReader_InvalidStateForCreateOperationRequestMessage=The method CreateOperationRequestMessage was called in state '{0}', which is not allowed. CreateOperationRequestMessage can only be called in state 'Operation'. -ODataBatchReader_OperationRequestMessageAlreadyCreated=A request message for the operation has already been created. You cannot create a request message for the same operation multiple times. -ODataBatchReader_OperationResponseMessageAlreadyCreated=A response message for the operation has already been created. You cannot create a response message for the same operation multiple times. -ODataBatchReader_InvalidStateForCreateOperationResponseMessage=The method CreateOperationResponseMessage was called in state '{0}', which is not allowed. CreateOperationResponseMessage can only be called in state 'Operation'. -ODataBatchReader_CannotUseReaderWhileOperationStreamActive=You cannot use a batch reader while the stream for the content of an operation is still active. You must first dispose the operation stream before further calls to the batch reader are made. -ODataBatchReader_SyncCallOnAsyncReader=A synchronous operation was called on an asynchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous. -ODataBatchReader_AsyncCallOnSyncReader=An asynchronous operation was called on a synchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous. -ODataBatchReader_ReadOrReadAsyncCalledInInvalidState=ODataBatchReader.ReadAsync or ODataBatchReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. -ODataBatchReader_MaxBatchSizeExceeded=The current batch message contains too many parts. A maximum number of '{0}' query operations and change sets are allowed in a batch message. -ODataBatchReader_MaxChangeSetSizeExceeded=The current change set contains too many operations. A maximum number of '{0}' operations are allowed in a change set. -ODataBatchReader_NoMessageWasCreatedForOperation=An operation was detected, but no message was created for it. You must create a message for every operation found in a batch or change set. -ODataBatchReader_ReaderModeNotInitilized=Reader mode is not setup correctly. -ODataBatchReader_JsonBatchTopLevelPropertyMissing=Json batch format requires top level property name 'requests' or 'response' but it is missing. -ODataBatchReader_DuplicateContentIDsNotAllowed=The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01. -ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed=The atomicityGroup ID [{0}] was found duplicated in the batch request. AtomicityGroup IDs have to be adjacent, otherwise would be detected as duplicated. -ODataBatchReader_RequestPropertyMissing=Request property [{0}] is required but is missing. -ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed=The dependsOn request Id [{0}] is same as atomicityGroup property value [{1}], and is not allowed. -ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed=The dependsOn request Id [{0}] is same as id property value [{1}], and it is not allowed. -ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed=The dependsOn request Id [{0}] is part of atomic group [{1}]. Therefore dependsOn property should refer to atomic group Id [{1}] instead. -ODataBatchReader_DependsOnIdNotFound=The dependsOn Id: [{0}] in request [{1}] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed. -ODataBatchReader_AbsoluteURINotMatchingBaseUri=Absolute URI {0} is not start with the base URI [{1}] specified by the operation message. -ODataBatchReader_ReferenceIdNotIncludedInDependsOn=Request Id reference [{0}] in Uri [{1}] is not found in effective depends-on-Ids [{2}] of the request. -ODataBatch_GroupIdOrChangeSetIdCannotBeNull=Group id or changeset GUID cannot be null. -ODataBatchReader_MessageIdPositionedIncorrectly=Message with id [{0}] is positioned incorrectly: all messages of same groupId [{1}] must be adjacent. -ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull=Changeset boundary must have been set by now. - -ODataBatchReaderStream_InvalidHeaderSpecified=The message header '{0}' is invalid. The header value must be of the format '
:
'. -ODataBatchReaderStream_InvalidRequestLine=The request line '{0}' is invalid. The request line at the start of each operation must be of the format 'HttpMethod RequestUrl HttpVersion'. -ODataBatchReaderStream_InvalidResponseLine=The response line '{0}' is invalid. The response line at the start of each operation must be of the format 'HttpVersion StatusCode StatusCodeString'. -ODataBatchReaderStream_InvalidHttpVersionSpecified=The HTTP version '{0}' used in a batch operation request or response is not valid. The value must be '{1}'. -ODataBatchReaderStream_NonIntegerHttpStatusCode= The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value. -ODataBatchReaderStream_MissingContentTypeHeader=The 'Content-Type' header is missing. The 'Content-Type' header must be specified for each MIME part of a batch message. -ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader=A missing or invalid '{0}' header was found. The '{0}' header must be specified for each batch operation, and its value must be '{1}'. -ODataBatchReaderStream_InvalidContentTypeSpecified=The '{0}' header value '{1}' is invalid. When this is the start of the change set, the value must be '{2}'; otherwise it must be '{3}'. -ODataBatchReaderStream_InvalidContentLengthSpecified=The content length header '{0}' is not valid. The content length header must be a valid Int32 literal and must be greater than or equal to 0. -ODataBatchReaderStream_DuplicateHeaderFound=The header '{0}' was specified multiple times. Each header must appear only once in a batch part. -ODataBatchReaderStream_NestedChangesetsAreNotSupported=Nested change sets in a batch payload are not supported. -ODataBatchReaderStream_MultiByteEncodingsNotSupported=Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for operation payloads. They are not supported in batch or change set parts. -ODataBatchReaderStream_UnexpectedEndOfInput=Encountered an unexpected end of input while reading the batch payload. - -ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached=Too many white spaces after a boundary delimiter and before the terminating line resource set. For security reasons, the total number of characters for a boundary including white spaces must not exceed {0}. - -ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch=Unknown property name '{0}' for message in batch. -ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch=Duplicate property name '{0}' for request in batch. -ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch=Duplicate header name '{0}' for request in batch. - -ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType=Unexpected reader.NodeType: {0}. -ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader=Unknown/undefined type, new type that needs to be supported: {0}? - -ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse=When not writing an async response, you cannot create an async response message. -ODataAsyncWriter_CannotCreateResponseMoreThanOnce=You cannot create an async response message more than once. -ODataAsyncWriter_SyncCallOnAsyncWriter=A synchronous operation was called on an asynchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous. -ODataAsyncWriter_AsyncCallOnSyncWriter=An asynchronous operation was called on a synchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous. -ODataAsyncWriter_CannotWriteInStreamErrorForAsync=The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when an async message is being written by using ODataAsyncWriter. In OData, writing an in-stream error for an async payload is not supported. - -ODataAsyncReader_InvalidHeaderSpecified=The message header '{0}' is invalid. The header value must be of the format '
:
'. -ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse=When not reading an async response, you cannot create an async response message. -ODataAsyncReader_InvalidResponseLine=The response line '{0}' is invalid. The response line at the start of the async response must be of the format 'HttpVersion StatusCode StatusCodeString'. -ODataAsyncReader_InvalidHttpVersionSpecified=The HTTP version '{0}' used in an async response is not valid. The value must be '{1}'. -ODataAsyncReader_NonIntegerHttpStatusCode=The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value. -ODataAsyncReader_DuplicateHeaderFound=The header '{0}' was specified multiple times. Each header must appear only once. -ODataAsyncReader_MultiByteEncodingsNotSupported=Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for async payloads. They are not supported in batch or change set parts. -ODataAsyncReader_InvalidNewLineEncountered=Invalid new line '{0}' encountered. Should be '\r\n'. -ODataAsyncReader_UnexpectedEndOfInput=Encountered an unexpected end of input while reading the async payload. Could be due to calling CreateResponseMessage() more than once. -ODataAsyncReader_SyncCallOnAsyncReader=A synchronous operation was called on an asynchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous. -ODataAsyncReader_AsyncCallOnSyncReader=An asynchronous operation was called on a synchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous. - -HttpUtils_MediaTypeUnspecified=The MIME type '{0}' is invalid or unspecified. -HttpUtils_MediaTypeRequiresSlash=The MIME type '{0}' requires a '/' character between type and subtype, such as 'text/plain'. -HttpUtils_MediaTypeRequiresSubType=The MIME type '{0}' requires a subtype definition. -HttpUtils_MediaTypeMissingParameterValue=The MIME type is missing a parameter value for a parameter with the name '{0}'. -HttpUtils_MediaTypeMissingParameterName=The MIME type is missing a parameter name for a parameter definition. -HttpUtils_EscapeCharWithoutQuotes=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the escape character '{3}' is not inside a quoted-string. -HttpUtils_EscapeCharAtEnd=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because it terminates with the escape character '{3}'. In a quoted-string, the escape characters must always be followed by a character. -HttpUtils_ClosingQuoteNotFound=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the closing quote character was not found for the quoted-string. -HttpUtils_InvalidCharacterInQuotedParameterValue=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the character '{3}' is not allowed in a quoted-string. For more information, see RFC 2616, Sections 3.6 and 2.2. -HttpUtils_ContentTypeMissing=The value for the Content-Type header is missing. -HttpUtils_MediaTypeRequiresSemicolonBeforeParameter=The MIME type '{0}' requires a semi-colon character (';') before a parameter definition. -HttpUtils_InvalidQualityValueStartChar=An invalid quality value was detected in the header string '{0}'; quality values must start with '0' or '1' but not with '{1}'. -HttpUtils_InvalidQualityValue=An invalid quality value '{0}' was detected in the header string '{1}'; quality values must be in the range [0, 1]. -HttpUtils_CannotConvertCharToInt=An error occurred when converting the character '{0}' to an integer. -HttpUtils_MissingSeparatorBetweenCharsets=The separator ',' was missing between charset values in the header '{0}'. -HttpUtils_InvalidSeparatorBetweenCharsets=A separator character was missing between charset values in the header '{0}'. -HttpUtils_InvalidCharsetName=An invalid (empty) charset name found in the header '{0}'. -HttpUtils_UnexpectedEndOfQValue=An unexpected end of the q-Value was detected in the header '{0}'. -HttpUtils_ExpectedLiteralNotFoundInString=The expected literal '{0}' was not found at position '{1}' in the string '{2}'. -HttpUtils_InvalidHttpMethodString=The string '{0}' cannot be converted into a supported HTTP method. The only supported HTTP methods are GET, DELETE, PUT, POST and PATCH. -HttpUtils_NoOrMoreThanOneContentTypeSpecified=The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type. - -HttpHeaderValueLexer_UnrecognizedSeparator=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a recognized separator. The supported separators are ',', ';', and '='. -HttpHeaderValueLexer_TokenExpectedButFoundQuotedString=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token is expected but a quoted-string is found instead. -HttpHeaderValueLexer_FailedToReadTokenOrQuotedString=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token or a quoted-string is expected at this position but were not found. -HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a valid separator after a quoted-string. -HttpHeaderValueLexer_EndOfFileAfterSeparator=An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the header value should not end with the separator '{3}'. - -MediaType_EncodingNotSupported=The character set '{0}' is not supported. - -MediaTypeUtils_DidNotFindMatchingMediaType=A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) '{0}' do not match any of the acceptable MIME types '{1}'. -MediaTypeUtils_CannotDetermineFormatFromContentType=A supported MIME type could not be found that matches the content type of the response. None of the supported type(s) '{0}' matches the content type '{1}'. -MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified=The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type. -MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads=The content type '{0}' specifies a batch payload; however, the payload either does not include a batch boundary or includes more than one boundary. In OData, batch payload content types must specify exactly one batch boundary in the '{1}' parameter of the content type. - -ExpressionLexer_ExpectedLiteralToken=Expected literal type token but found token '{0}'. - - -ODataUriUtils_ConvertToUriLiteralUnsupportedType=The type '{0}' is not supported when converting to a URI literal. -ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel=An IEdmTypeReference must be provided with a matching IEdmModel. No model was provided. -ODataUriUtils_ConvertFromUriLiteralOverflowNumber=The overflow exception caught for expected type '{0}'. '{1}'. -ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure=Type verification failed. Expected type '{0}' but received the value '{1}'. -ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure=Type verification failed. Expected type '{0}' but received non-matching null value with associated type '{1}'. -ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType=Type verification failed. Expected non-nullable type '{0}' but received a null value. - -ODataUtils_CannotConvertValueToRawString=The value of type '{0}' could not be converted to a raw string. -ODataUtils_DidNotFindDefaultMediaType=A default MIME type could not be found for the requested payload in format '{0}'. -ODataUtils_UnsupportedVersionHeader=The value '{0}' of the OData-Version HTTP header is invalid. Only '4.0' and '4.01' are supported as values for the OData-Version header. -ODataUtils_MaxProtocolVersionExceeded=An OData version of {0} was specified and the maximum supported OData version is {1}. -ODataUtils_UnsupportedVersionNumber=An invalid enum value was specified for the version number. -ODataUtils_ModelDoesNotHaveContainer=The provided model does not contain an entity container. - -ReaderUtils_EnumerableModified=The value returned by the '{0}' property cannot be modified until the end of the owning resource is reported by the reader. - -ReaderValidationUtils_NullValueForNonNullableType=A null value was found with the expected type '{0}[Nullable=False]'. The expected type '{0}[Nullable=False]' does not allow null values. -ReaderValidationUtils_NullValueForNullableType=A null value was found for a collection of type '{0}[Nullable=True]. Collection-valued properties with Nullable=True can contain null values, but collection-valued properties cannot themselves be null. -ReaderValidationUtils_NullNamedValueForNonNullableType=A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values. -ReaderValidationUtils_NullNamedValueForNullableType=A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=True]'. The expected type '{1}[Nullable=True]' cannot be null but it can have null values. -ReaderValidationUtils_EntityReferenceLinkMissingUri=No URI value was found for an entity reference link. A single URI value was expected. -ReaderValidationUtils_ValueWithoutType=A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value. -ReaderValidationUtils_ResourceWithoutType=A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified. -ReaderValidationUtils_CannotConvertPrimitiveValue=Cannot convert the literal '{0}' to the expected type '{1}'. -ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute=The base URI '{0}' specified in ODataMessageReaderSettings.BaseUri is invalid; it must be either null or an absolute URI. -ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest=The ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds is not set to ODataUndeclaredPropertyBehaviorKinds.None. When reading request payloads, the ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds property must be set to ODataUndeclaredPropertyBehaviorKinds.None; other values are not supported. -ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet=The context URI '{0}' references the entity set with name '{1}'; however, the name of the expected entity set is '{2}' and does not match the entity set referenced in the context URI. -ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType=The context URI '{0}' references the entity type with name '{1}'; however, the name of the expected entity type is '{2}' which is not compatible with the entity type with name '{1}'. -ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames=The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the name of the expected property is '{3}'. -ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes=The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the declaring type of the expected property is '{3}'. -ReaderValidationUtils_NonMatchingPropertyNames=The property or operation import name '{0}' was read from the payload; however, the name of the expected property or operation import is '{1}'. -ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType=The context URI '{0}' references the type '{1}'; however the expected type is '{2}'. -ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType=The context URI '{0}' refers to the item type '{1}' which is not assignable to the expected item type '{2}'. -ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint=The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'. - -ODataMessageReader_ReaderAlreadyUsed=The ODataMessageReader has already been used to read a message payload. An ODataMessageReader can only be used once to read a payload for a given message. -ODataMessageReader_ErrorPayloadInRequest=A top-level error cannot be read from request payloads. Top-level errors are only supported in responses. -ODataMessageReader_ServiceDocumentInRequest=A service document cannot be read from request payloads. Service documents are only supported in responses. -ODataMessageReader_MetadataDocumentInRequest=A metadata document cannot be read from request payloads. Metadata documents are only supported in responses. -ODataMessageReader_DeltaInRequest=Delta are only supported in responses. -ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata=The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The expected type can only be specified if metadata is made available to the reader. -ODataMessageReader_EntitySetSpecifiedWithoutMetadata=The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The entity set can only be specified if metadata is made available to the reader. -ODataMessageReader_OperationImportSpecifiedWithoutMetadata=The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation import can only be specified if metadata is made available to the reader. -ODataMessageReader_OperationSpecifiedWithoutMetadata=The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation can only be specified if metadata is made available to the reader. -ODataMessageReader_ExpectedCollectionTypeWrongKind=The expected type for a collection reader is of kind '{0}'. Only types of Primitive or ComplexType kind can be specified as the expected type for a collection reader. -ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind=The expected type for property reading is of entity collection kind. Top-level properties can only be of primitive, complex, primitive collection or complex collection kind. -ODataMessageReader_ExpectedPropertyTypeEntityKind=The expected type for property reading is of entity kind. Top-level properties cannot be of entity type. -ODataMessageReader_ExpectedPropertyTypeStream=The expected type for property reading is Edm.Stream. Top-level properties cannot be of stream type. -ODataMessageReader_ExpectedValueTypeWrongKind=The expected type for a value is of kind '{0}'. Only types of Primitive kind can be specified as the expected type for reading a value. -ODataMessageReader_NoneOrEmptyContentTypeHeader=A missing or empty content type header was found when trying to read a message. The content type header is required. -ODataMessageReader_WildcardInContentType=The wildcard '*' was detected in the value '{0}' of the content type header. The value of the content type header cannot contain wildcards. -ODataMessageReader_GetFormatCalledBeforeReadingStarted=GetFormat was called before reading was started. GetFormat can only be called after a read method was called or a reader was created. -ODataMessageReader_DetectPayloadKindMultipleTimes=DetectPayloadKind or DetectPayloadKindAsync was called more than once; DetectPayloadKind or DetectPayloadKindAsync can only be called once. -ODataMessageReader_PayloadKindDetectionRunning=Payload kind detection has not completed. Read or create methods cannot be called on the ODataMessageReader before payload kind detection is complete. -ODataMessageReader_PayloadKindDetectionInServerMode=The ODataMessageReader is using the server behavior for WCF Data Services, as specified in its settings. Payload kind detection is not supported when using the WCF Data services server behavior. -ODataMessageReader_ParameterPayloadInResponse=A parameter payload cannot be read from a response payload. Parameter payloads are only supported in requests. -ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks=The navigation property '{0}' with singleton cardinality on type '{1}' was specified for reading a collection of entity reference links. A navigation property with collection cardinality has to be provided. - -ODataAsyncResponseMessage_MustNotModifyMessage=An attempt was made to modify the message. The message cannot be modified. -ODataMessage_MustNotModifyMessage=An attempt was made to modify the message. The message cannot be modified. - - -ODataReaderCore_SyncCallOnAsyncReader=A synchronous operation was called on an asynchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous. -ODataReaderCore_AsyncCallOnSyncReader=An asynchronous operation was called on a synchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous. -ODataReaderCore_ReadOrReadAsyncCalledInInvalidState=ODataReader.ReadAsync or ODataReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. -ODataReaderCore_CreateReadStreamCalledInInvalidState=CreateReadStream was called in an invalid state. CreateReadStream can only be called once in ReaderState.Stream. -ODataReaderCore_CreateTextReaderCalledInInvalidState=CreateTextReader was called in an invalid state. CreateTextReader can only be called once in ReaderState.Stream. -ODataReaderCore_ReadCalledWithOpenStream=Read called with an open stream or textreader. Please close any open streams or text readers before calling Read. -ODataReaderCore_NoReadCallsAllowed=Calling Read or ReadAsync on an ODataReader instance is not allowed in state '{0}'. -ODataWriterCore_PropertyValueAlreadyWritten=Attempted to write a value for a property {0} whose value has already been written. -ODataJsonReader_CannotReadResourcesOfResourceSet=A node of type '{0}' was read from the JSON reader when trying to read the resources of a resource set. A 'StartObject' or 'EndArray' node was expected. - -ODataJsonReaderUtils_CannotConvertInt32=Cannot convert a value of type 'Edm.Int32' to the expected target type '{0}'. -ODataJsonReaderUtils_CannotConvertDouble=Cannot convert a value of type 'Edm.Double' to the expected target type '{0}'. -ODataJsonReaderUtils_CannotConvertBoolean=Cannot convert a value of type 'Edm.Boolean' to the expected target type '{0}'. -ODataJsonReaderUtils_CannotConvertDecimal=Cannot convert a value of type 'Edm.Decimal' to the expected target type '{0}'. -ODataJsonReaderUtils_CannotConvertDateTime=Cannot convert a value of type 'Edm.DateTime' to the expected target type '{0}'. -ODataJsonReaderUtils_CannotConvertDateTimeOffset=Cannot convert a value of type 'Edm.DateTimeOffset' to the expected target type '{0}'. -ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter=Cannot convert a value to target type '{0}' because of conflict between input format string/number and parameter 'IEEE754Compatible' false/true. -ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName=Multiple '{0}' properties were found in an error or inner error object. In OData, an error or inner error must have at most one '{0}' property. - -ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget=Multiple operations have the same 'Metadata' property value of '{0}'. The 'Target' property value of these operations must be set to a non-null value. -ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget=Multiple operations have the same 'Metadata' property value of '{0}' and the same 'Target' property value of '{1}'. When multiple operations have the same 'Metadata' property value, their 'Target' property values must be unique. - -ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty=A property with name '{0}' was found in the error object when reading a top-level error. In OData, a top-level error object must have exactly one property with name 'error'. -ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty=A property with name '{0}' was found in the message value of a top-level error. In OData, the message value of a top-level error value can only have properties with name 'lang' or 'value'. - - -ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState=ODataCollectionReader.ReadAsync or ODataCollectionReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. -ODataCollectionReaderCore_SyncCallOnAsyncReader=A synchronous operation was called on an asynchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous. -ODataCollectionReaderCore_AsyncCallOnSyncReader=An asynchronous operation was called on a synchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous. -ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState=The current state of the collection reader is '{0}'; however, the expected item type of a collection reader can only be set in state '{1}'. - -ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState=ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. -ODataParameterReaderCore_SyncCallOnAsyncReader=A synchronous operation was called on an asynchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous. -ODataParameterReaderCore_AsyncCallOnSyncReader=An asynchronous operation was called on a synchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous. -ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall=ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state. '{1}' must be called in this state, and the created reader must be in the 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called. -ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall=ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state and '{1}' was called but the created reader is not in the 'Completed' state. The created reader must be in 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called. -ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState=You cannot call the method '{0}' in state '{1}'. -ODataParameterReaderCore_CreateReaderAlreadyCalled=The '{0}' method has already been called for the parameter '{1}'. Only one create reader method call is allowed for each resource, resource set, or collection parameter. -ODataParameterReaderCore_ParameterNameNotInMetadata=The parameter '{0}' in the request payload is not a valid parameter for the operation '{1}'. -ODataParameterReaderCore_DuplicateParametersInPayload=Multiple parameters with the name '{0}' were found in the request payload. -ODataParameterReaderCore_ParametersMissingInPayload=One or more parameters of the operation '{0}' are missing from the request payload. The missing parameters are: {1}. - - - - -ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata=The 'Metadata' property on an {0} must be set to a non-null value. -ValidationUtils_ActionsAndFunctionsMustSpecifyTarget=The 'Target' property on an {0} must be set to a non-null value. -ValidationUtils_EnumerableContainsANullItem=The '{0}' enumerable contains a null item. This enumerable cannot contain null items. -ValidationUtils_AssociationLinkMustSpecifyName=The 'Name' property on an ODataAssociationLink must be set to a non-empty string. -ValidationUtils_AssociationLinkMustSpecifyUrl=The 'Url' property on an ODataAssociationLink must be set to a non-null value that represents the association or associations the link references. -ValidationUtils_TypeNameMustNotBeEmpty=An empty type name was found; the name of a type cannot be an empty string. -ValidationUtils_PropertyDoesNotExistOnType=The property '{0}' does not exist on type '{1}'. Make sure to only use property names that are defined by the type or mark the type as open type. -ValidationUtils_ResourceMustSpecifyUrl=The 'Url' property on a resource collection must be set to a non-null value. -ValidationUtils_ResourceMustSpecifyName=The 'Name' property on a resource collection with the 'Url' '{0}' must be set to a non-null value. -ValidationUtils_ServiceDocumentElementUrlMustNotBeNull=A service document element without a Url was detected; a service document element must have a non-null Url value. -ValidationUtils_NonPrimitiveTypeForPrimitiveValue=A primitive value was specified; however, a value of the non-primitive type '{0}' was expected. -ValidationUtils_UnsupportedPrimitiveType=Unsupported primitive type. A primitive type could not be determined for an instance of type '{0}'. -ValidationUtils_IncompatiblePrimitiveItemType=An incompatible primitive type '{0}[Nullable={1}]' was found for an item that was expected to be of type '{2}[Nullable={3}]'. -ValidationUtils_NonNullableCollectionElementsMustNotBeNull=A null value was detected in the items of a collection property value; non-nullable instances of collection types do not support null values as items. -ValidationUtils_InvalidCollectionTypeName=Type name '{0}' is an invalid collection type name; a collection type name must be in the format 'Collection()'. -ValidationUtils_UnrecognizedTypeName=A type named '{0}' could not be resolved by the model. When a model is available, each type name must resolve to a valid type. -ValidationUtils_IncorrectTypeKind=Incompatible type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. -ValidationUtils_IncorrectTypeKindNoTypeName=Incompatible type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. -ValidationUtils_IncorrectValueTypeKind=A value with type '{0}' was found, which is of kind '{1}'. Value can only be of kind 'Primitive', 'Complex' or 'Collection'. -ValidationUtils_LinkMustSpecifyName=The 'Name' property on an ODataNestedResourceInfo must be set to a non-empty string. -ValidationUtils_MismatchPropertyKindForStreamProperty=The property '{0}' cannot be a stream property because it is not of kind EdmPrimitiveTypeKind.Stream. -ValidationUtils_NestedCollectionsAreNotSupported=Nested collection instances are not allowed. -ValidationUtils_StreamReferenceValuesNotSupportedInCollections=An ODataStreamReferenceValue item was found in a collection property value, which is not allowed. Collection properties can only have primitive and complex values as items. -ValidationUtils_IncompatibleType=A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as '{0}', but the type specified in the metadata is '{1}'. -ValidationUtils_OpenCollectionProperty=An open collection property '{0}' was found. In OData, open collection properties are not supported. -ValidationUtils_OpenStreamProperty=An open stream property '{0}' was found. In OData, open stream properties are not supported. -ValidationUtils_InvalidCollectionTypeReference=An invalid collection type kind '{0}' was found. In OData, collection types must be of kind 'Collection'. -ValidationUtils_ResourceWithMediaResourceAndNonMLEType=A resource with type '{0}' was found with a media resource, but this entity type is not a media link resource (MLE). When the type is not an MLE entity, the resource cannot have a media resource. -ValidationUtils_ResourceWithoutMediaResourceAndMLEType=A resource with type '{0}' was found without a media resource, but this entity type is a media link resource (MLE). When the type is an MLE entity, the resource must have a media resource. -ValidationUtils_ResourceTypeNotAssignableToExpectedType=A resource with type '{0}' was found, but it is not assignable to the expected type '{1}'. The type specified in the resource must be equal to either the expected type or a derived type. -ValidationUtils_NavigationPropertyExpected=A property with name '{0}' on type '{1}' has kind '{2}', but it is expected to be of kind 'Navigation'. -ValidationUtils_InvalidBatchBoundaryDelimiterLength=The boundary delimiter '{0}' is invalid. A boundary delimiter must be non-null, be non-empty, and have a maximum of {1} characters. -ValidationUtils_RecursionDepthLimitReached=The maximum recursion depth limit was reached. The depth of nested values in a single property cannot exceed {0}. -ValidationUtils_MaxDepthOfNestedEntriesExceeded=The depth limit for entries in nested expanded navigation links was reached. The number of nested expanded entries cannot exceed {0}. -ValidationUtils_NullCollectionItemForNonNullableType=A null value was found in a collection, but the expected collection item type '{0}' does not allow null values. -ValidationUtils_PropertiesMustNotContainReservedChars=The property name '{0}' is invalid; property names must not contain any of the reserved characters {1}. -ValidationUtils_WorkspaceResourceMustNotContainNullItem=A null value was detected when enumerating the collections in a workspace. Workspace collections cannot be null. -ValidationUtils_InvalidMetadataReferenceProperty=Encountered a property '{0}' that was expected to be a reference to a location in the $metadata document but does not contain a '#' character or is otherwise not a valid metadata reference property. A metadata reference property must contain a '#' and be a valid absolute URI or begin with a '#' and be a valid URI fragment. - -WriterValidationUtils_PropertyMustNotBeNull=The 'ODataResource.Properties' enumerable contains a null item. This enumerable cannot contain null items. -WriterValidationUtils_PropertiesMustHaveNonEmptyName=An ODataProperty instance without a name was detected; an ODataProperty must have a non-null, non-empty name. -WriterValidationUtils_MissingTypeNameWithMetadata=No TypeName was found for an ODataResource of an open property, ODataResource or custom instance annotation, even though metadata was specified. If a model is passed to the writer, each complex value on an open property, resource or custom instance annotation must have a type name. -WriterValidationUtils_NextPageLinkInRequest=The ODataResourceSet.NextPageLink must be null for request payloads. A next link is only supported in responses. -WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink=A default stream ODataStreamReferenceValue was detected with a 'ContentType' property but without a ReadLink value. In OData, a default stream must either have both a content type and a read link, or neither of them. -WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType=A default stream ODataStreamReferenceValue was detected with a 'ReadLink' property but without a ContentType value. In OData, a default stream must either have both a content type and a read link, or neither of them. -WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink=An ODataStreamReferenceValue was detected with null values for both EditLink and ReadLink. In OData, a stream resource must have at least an edit link or a read link. -WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag=An ODataStreamReferenceValue was detected with an ETag but without an edit link. In OData, a stream resource must have an edit link to have an ETag. -WriterValidationUtils_StreamReferenceValueEmptyContentType=An ODataStreamReferenceValue was detected with an empty string 'ContentType' property. In OData, a stream resource must either have a non-empty content type or it must be null. -WriterValidationUtils_EntriesMustHaveNonEmptyId=A resource with an empty ID value was detected. In OData, a resource must either a non-empty ID value or no ID value. -WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute=The base URI '{0}' specified in ODataMessageWriterSettings.BaseUri is invalid; it must either be null or an absolute URI. -WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull=An ODataEntityReferenceLink with a null Url was detected; an ODataEntityReferenceLink must have a non-null Url. -WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull=The 'ODataEntityReferenceLinks.Links' enumerable contains a null item. This enumerable cannot contain null items. -WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType=The type '{0}' of a resource in an expanded link is not compatible with the element type '{1}' of the expanded link. Entries in an expanded link must have entity types that are assignable to the element type of the expanded link. -WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent=The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the actual payload is a resource. -WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent=The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the actual payload is a resource set. -WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata=The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the metadata declares it as a resource. -WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata=The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the metadata declares it as resource set. -WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata=The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource set, but the metadata declares it as a resource. -WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata=The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource, but the metadata declares it as resource set. -WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue=The collection property '{0}' has a null value, which is not allowed. In OData, collection properties cannot have null values. -WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue=The property '{0}[Nullable=False]' of type '{1}' has a null value, which is not allowed. -WriterValidationUtils_StreamPropertiesMustNotHaveNullValue=The stream property '{0}' has a null value, which is not allowed. In OData, stream properties cannot have null values. -WriterValidationUtils_OperationInRequest=An action or a function with metadata '{0}' was detected when writing a request; actions and functions are only supported in responses. -WriterValidationUtils_AssociationLinkInRequest=An association link with name '{0}' could not be written to the request payload. Association links are only supported in responses. -WriterValidationUtils_StreamPropertyInRequest=The stream property {0} in a request payload cannot contain etag, editLink, or readLink values. -WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute=The service document URI '{0}' specified is invalid; it must be either null or an absolute URI. -WriterValidationUtils_NavigationLinkMustSpecifyUrl=The ODataNestedResourceInfo.Url property on an navigation link '{0}' is null. The ODataNestedResourceInfo.Url property must be set to a non-null value that represents the entity or entities the navigation link references. -WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection=The ODataNestedResourceInfo.IsCollection property on a nested resource info '{0}' is null. The ODataNestedResourceInfo.IsCollection property must be specified when writing a nested resource into a request. -WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage=A JSON Padding function was specified on ODataMessageWriterSettings when trying to write a request message. JSON Padding is only for writing responses. -WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint=The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'. - -XmlReaderExtension_InvalidNodeInStringValue=An XML node of type '{0}' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes. -XmlReaderExtension_InvalidRootNode=An XML node of type '{0}' was found at the root level. The root level of an OData payload must contain a single XML element and no text nodes. - -ODataMetadataInputContext_ErrorReadingMetadata=The metadata document could not be read from the message content.\r\n{0} - -ODataMetadataOutputContext_ErrorWritingMetadata=The metadata document could not be written as specified.\r\n{0} -ODataMetadataOutputContext_NotSupportJsonMetadata=The JSON metadata is not supported at this platform. It's only supported at platform implementing .NETStardard 2.0. - -ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified=A relative URI value '{0}' was specified in the payload, but no base URI for it was found. When the payload contains a relative URI, there must be an xml:base in the payload or else a base URI must specified in the reader settings. - -ODataPropertyAndValueDeserializer_InvalidCollectionElement=The element with name '{0}' is not a valid collection item. The name of the collection item element must be 'element' and it must belong to the '{1}' namespace. -ODataPropertyAndValueDeserializer_NavigationPropertyInProperties=The property '{0}' on type '{1}' was found in the {{http://docs.oasis-open.org/odata/ns/metadata}}:properties element, and it is declared as a navigation property. - -JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation=Writing null value for the instance annotation '{0}' is not allowed. The instance annotation '{0}' has the expected type '{1}[Nullable=False]'. - -EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid=When resolving operations '{0}' the group returned has both actions and functions with an invalid IEdmModel. -EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid=Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return non-bound operations. -EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid=Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return bound operations without any parameters. -EdmLibraryExtensions_ValueOverflowForUnderlyingType=Value '{0}' was either too large or too small for a '{1}'. - -ODataXmlResourceDeserializer_ContentWithWrongType=The 'type' attribute on element {{http://www.w3.org/2005/Atom}}:content is either missing or has an invalid value '{0}'. Only 'application/xml' and 'application/atom+xml' are supported as the value of the 'type' attribute on the {{http://www.w3.org/2005/Atom}}:content element. - -ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName=Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in a top-level error value. In OData, the value of a top-level error value can have no more than one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element -ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName=Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in an inner error value. In OData, the value of an inner error value can have at most one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element. - -CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind=An invalid item type kind '{0}' was found. Items in a collection can only be of type kind 'Primitive' or 'Complex', but not of type kind '{0}'. -CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind=An item of type kind '{0}' was found in a collection that otherwise has items of type kind '{1}'. In OData, all items in a collection must have the same type kind. -CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName=An item with type name '{0}' was found in a collection of items with type name '{1}'. In OData, all items in a collection must have the same type name. - -ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes=A resource of type '{0}' was found in a resource set that otherwise has entries of type '{1}'. In OData, all entries in a resource set must have a common base type. - -MessageStreamWrappingStream_ByteLimitExceeded=The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of {0} bytes has been read from the stream; however a maximum of {1} bytes is allowed. - -MetadataUtils_ResolveTypeName=The custom type resolver set in ODataMessageWriterSettings.EnableWcfDataServicesClientBehavior returned 'null' when resolving the type '{0}'. When a custom type resolver is specified, it cannot return null. -MetadataUtils_CalculateBindableOperationsForType=The method 'FindDeclaredBoundOperations' on the IEdmModel has thrown an exception when looking for operations with a binding type {0}. See inner exception for more details. - -EdmValueUtils_UnsupportedPrimitiveType=The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type. -EdmValueUtils_IncorrectPrimitiveTypeKind=Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. -EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName=Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. -EdmValueUtils_CannotConvertTypeToClrValue=A value with primitive kind '{0}' cannot be converted into a primitive object value. - -ODataEdmStructuredValue_UndeclaredProperty=The property '{0}' is not declared on the non-open type '{1}'. - - -ODataMetadataBuilder_MissingEntitySetUri=The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required. -ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix=The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments. -ODataMetadataBuilder_MissingEntityInstanceUri=Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required. -ODataMetadataBuilder_MissingParentIdOrContextUrl=Parent id or contained context url is missing which is required to compute id for contained instance. Specify ODataUri in the ODataMessageWriterSettings or return parent id or context url in the payload. -ODataMetadataBuilder_UnknownEntitySet=The Id cannot be computed, since the navigation source '{0}' cannot be resolved to a known entity set from model. - -ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType=The entity type '{0}' is not compatible with the base type '{1}' of the provided entity set '{2}'. When an entity type is specified for an OData resource set or resource reader, it has to be the same or a subtype of the base type of the specified entity set. -ODataJsonInputContext_PayloadKindDetectionForRequest=ODataMessageReader.DetectPayloadKind was called for a request payload. Payload kind detection is only supported for responses in Json. -ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader=The parameter '{0}' is specified with a null value. For Json, the '{0}' argument to the 'CreateParameterReader' method cannot be null. -ODataJsonInputContext_NoEntitySetForRequest=Parsing Json resource sets or entries in requests without entity set is not supported. Pass in the entity set as a parameter to ODataMessageReader.CreateODataResourceReader or ODataMessageReader.CreateODataResourceSetReader method. -ODataJsonInputContext_ModelRequiredForReading=Parsing Json payloads without a model is only supported for error payloads. -ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests=An attempt to read a collection request payload without specifying a collection item type was detected. When reading collection payloads in requests, an expected item type has to be provided. - -ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty=The required instance annotation 'odata.context' was not found at the beginning of a response payload. -ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation=The annotation '{0}' was targeting the instance annotation '{1}'. Only the '{2}' annotation is allowed to target an instance annotation. -ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue=The annotation '{0}' is found targeting the instance annotation '{1}'. However the value for the instance annotation '{1}' is not found immediately after. In Json, an annotation targeting an instance annotation must be immediately followed by the value of the targeted instance annotation. - -ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest=An attempt to write an entity reference link inside a navigation link after a resource set has been written inside the same navigation link in a request was detected. In Json requests, all entity reference links inside a navigation link have to be written before all resource sets inside the same navigation link. -ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet=The ODataResourceSet.InstanceAnnotations collection must be empty for expanded resource sets. Custom instance annotations are not supported on expanded resource sets. - -ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest=Neither an expected type nor a type name in the OData object model was provided for a resource value. When writing a request payload, either an expected type or a type name has to be specified. -ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest=Neither an expected type nor a type name in the OData object model was provided for a collection property. When writing a request payload, either an expected type or a type name has to be specified. - -ODataResourceTypeContext_MetadataOrSerializationInfoMissing=When writing a JSON response, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResourceSerializationInfo must be set on the ODataResource or ODataResourceSet that is being written. -ODataResourceTypeContext_ODataResourceTypeNameMissing=When writing a JSON response in full metadata mode, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResource.TypeName must be set. - -ODataContextUriBuilder_ValidateDerivedType=The base type '{0}' of the entity set specified for writing a payload is not assignable from the specified entity type '{1}'. When an entity type is specified it has to be the same or derived from the base type of the entity set. -ODataContextUriBuilder_TypeNameMissingForTopLevelCollection=The collection type name for the top level collection is unknown. When writing a response, the item type must be passed to the ODataMessageWriter.CreateODataCollectionWriter method or the ODataCollectionStartSerializationInfo must be set on the ODataCollectionStart. -ODataContextUriBuilder_UnsupportedPayloadKind=Context URL for payload kind '{0}' is not supported. -ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource=The stream value must be a property of an ODataResource instance. -ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet=The navigationSource for resource or resource set is unknown or the Type is null. When writing a response, the navigation source or the type must be passed to the ODataMessageWriter.CreateODataResourceWriter/ODataMessageWriter.CreateODataResourceSetWriter method or the ODataResourceSerializationInfo must be set on the resource/resource set. -ODataContextUriBuilder_ODataUriMissingForIndividualProperty=The ODataMessageWriterSetting.ODataUri must be set when writing individual property. -ODataContextUriBuilder_TypeNameMissingForProperty=The type name for the top level property is unknown. When writing a response, the ODataValue must have a type name on itself or have a SerializationTypeNameAnnotation. -ODataContextUriBuilder_ODataPathInvalidForContainedElement=The Path property '{0}' of ODataMessageWriterSetting.ODataUri must end with the navigation property which the contained elements being written belong to. - -ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties=The annotation '{0}' was found. This annotation is either not recognized or not expected at the current position. -ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation=The property '{0}' has a property annotation '{1}'. This annotation is either not recognized or not expected at the current position. -ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation=An OData property annotation '{0}' was found. This property annotation is either not recognized or not expected at the current position. -ODataJsonPropertyAndValueDeserializer_UnexpectedProperty=A property with name '{0}' was found. This property is either not recognized or not expected at the current position. -ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload=No top-level properties were found. A top-level property or collection in Json must be represented as a JSON object with exactly one property which is not an annotation. -ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName=A top-level property with name '{0}' was found in the payload; however, property and collection payloads must always have a top-level property with name '{1}'. -ODataJsonPropertyAndValueDeserializer_InvalidTypeName=The 'odata.type' instance annotation value '{0}' is not a valid type name. The value of the 'odata.type' instance annotation must be a non-empty string. -ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty=One or more property annotations for property '{0}' were found in the top-level property or collection payload without the property to annotate. Top-level property and collection payloads must contain a single property, with optional annotations for this property. -ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty=One or more property annotations for property '{0}' were found in the resource value without the property to annotate. Resource values must only contain property annotations for existing properties. -ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation=A complex property with an '{0}' property annotation was found. Complex properties must not have the '{0}' property annotation, instead the '{0}' should be specified as an instance annotation in the complex value. -ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst=The 'odata.type' instance annotation in a resource object is not the first property of the object. In OData, the 'odata.type' instance annotation must be the first property of the resource object. -ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation=The property '{0}' has a property annotation '{1}'. Primitive, complex, collection or open properties can only have an 'odata.type' property annotation. -ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty=The property with name '{0}' was found after the data property with name '{1}'. If a type is specified for a data property, it must appear before the data property. -ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue=An '{0}' annotation was read inside a JSON object representing a primitive value; type annotations for primitive values have to be property annotations of the owning property. -ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue=A top-level property with an invalid primitive null value was found. In OData, top-level properties with null value have to be serialized as JSON object with an '{0}' annotation that has the value '{1}'. -ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty=Encountered a metadata reference property '{0}' in a scope other than a resource. In OData, a property name with a '#' character indicates a reference into the metadata and is only supported for describing operations bound to a resource. -ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload=The property with name '{0}' was found in a null payload. In OData, no properties or OData annotations can appear in a null payload. -ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected=A collection type of '{0}' was specified for a non-collection value. -ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected=A non-collection type of '{0}' was specified for a collection value. -ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty=The property with name '{0}' was found with a value node of type '{1}'; however, a resource value of type '{2}' was expected. - -ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue=The value specified for the spatial property was not valid. You must specify a valid spatial value. - -ODataJsonReader_UnexpectedPrimitiveValueForODataResource=If a primitive value is representing a resource, the resource must be null. -ODataJsonReaderUtils_AnnotationWithNullValue=The '{0}' instance or property annotation has a null value. In OData, the '{0}' instance or property annotation must have a non-null string value. -ODataJsonReaderUtils_InvalidValueForODataNullAnnotation=An '{0}' annotation was found with an invalid value. In OData, the only valid value for the '{0}' annotation is '{1}'. - -JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection=The InstanceAnnotations collection has more than one instance annotations with the name '{0}'. All instance annotation names must be unique within the collection. - -ODataJsonContextUriParser_NullMetadataDocumentUri=A null metadata document URI was found in the payload. Metadata document URIs must not be null. -ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind=The context URI '{0}' is not valid for the expected payload kind '{1}'. -ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName=The context URI '{0}' references the entity set or type '{1}'. However, no entity set or type with name '{1}' is declared in the metadata. -ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption=A '$select' query option was found for the payload kind '{0}'. In OData, a '$select' query option is only supported for payload kinds 'Resource' and 'ResourceSet'. -ODataJsonContextUriParser_NoModel=No model was specified for the ODataMessageReader. A message reader requires a model for Json payload to be specified in the ODataMessageReader constructor. -ODataJsonContextUriParser_InvalidContextUrl=The context URL '{0}' is invalid. -ODataJsonContextUriParser_LastSegmentIsKeySegment=Last segment in context URL '{0}' should not be KeySegment. -ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute=The top level context URL '{0}' should be an absolute Uri. - -ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject=Invalid primitive value '{0}' for @removed annotation. @removed annotation must be a JSON object, optionally containing a 'reason' property. -ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst=The 'odata.type' instance annotation in a resource object is preceded by an invalid property. In OData, the 'odata.type' instance annotation must be either the first property in the JSON object or the second if the 'odata.context' instance annotation is present. -ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty=The '{0}' instance annotation in a resource object is preceded by a property or property annotation. In OData, the '{0}' instance annotation must be before any property or property annotation in a resource object. -ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload=Encountered a deleted entity when reading a non-delta response payload. Deleted entities are only supported in request payloads and delta responses. -ODataJsonResourceDeserializer_CannotReadResourceSetContentStart=A node of type '{0}' was read from the JSON reader when trying to read the start of the content of a resource set; however, a node of type 'StartArray' was expected. -ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound=Did not find the required '{0}' property for the expected resource set. -ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet=A node of type '{0}' was read from the JSON reader when trying to read the entries of a typed resource set; however, a node of type 'StartObject' or 'EndArray', or a null value, was expected. -ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet=A property annotation for a property with name '{0}' was found when reading a top-level resource set. No property annotations, only instance annotations are allowed when reading top-level resource sets. -ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet=A property with name '{0}' was found when reading a top-level resource set. No properties other than the resource set property with name '{1}' are allowed. -ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType=A property '{0}' which only has property annotations in the payload but no property value is declared to be of type '{1}'. In OData, only navigation properties and named streams can be represented as properties without values. -ODataJsonResourceDeserializer_StreamPropertyInRequest=A stream property {0} was found in a Json request payload. Stream properties are only supported in responses. -ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation=The stream property '{0}' has a property annotation '{1}'. Stream property can only have the 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaEtag' and 'odata.mediaContentType' property annotations. -ODataJsonResourceDeserializer_StreamPropertyWithValue=A stream property '{0}' has a value in the payload. In OData, stream property must not have a value, it must only use property annotations. -ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation=The navigation property '{0}' has a property annotation '{1}'. Deferred navigation links can only have the 'odata.navigationLink' and 'odata.associationLink' property annotations. -ODataJsonResourceDeserializer_CannotReadSingletonNestedResource=A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartObject' node or 'PrimitiveValue' node with null value was expected. -ODataJsonResourceDeserializer_CannotReadCollectionNestedResource=A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartArray' node was expected. -ODataJsonResourceDeserializer_CannotReadNestedResource=A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property '{0}'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected. -ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation=The navigation property '{0}' has a property annotation '{1}'. Expanded resource navigation links can only have the 'odata.context', 'odata.navigationLink' and 'odata.associationLink' property annotations. -ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation=The navigation property '{0}' has a property annotation '{1}'. Expanded resource set navigation links can only have the 'odata.context', 'odata.navigationLink', 'odata.associationLink' and 'odata.nextLink' property annotations -ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation=The property '{0}' has a property annotation '{1}'. The complex collection property can only have the 'odata.count', 'odata.type' and 'odata.nextLink' property annotations. -ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation=Multiple property annotations '{0}' were found when reading the nested resource '{1}'. Only a single property annotation '{0}' can be specified for a nested resource. -ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet=A property annotation '{0}' was found after the property '{1}' it is annotating. Only the 'odata.nextLink' property annotation can be used after the property it is annotating. -ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation=The navigation property '{0}' has a property annotation '{1}'. Navigation links in request payloads can only have the '{2}' property annotation. -ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation=The resource reference navigation property '{0}' has a property annotation '{1}' with an array value. Resource reference navigation properties can only have a property annotation '{1}' with a string value. -ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation=The resource set reference navigation property '{0}' has a property annotation '{1}' with a string value. Resource set reference navigation properties can only have a property annotation '{1}' with an array value. -ODataJsonResourceDeserializer_EmptyBindArray=The value of '{0}' property annotation is an empty array. The '{0}' property annotation must have a non-empty array as its value. -ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink=The navigation property '{0}' has no expanded value and no '{1}' property annotation. Navigation property in request without expanded value must have the '{1}' property annotation. -ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue=The resource reference navigation property '{0}' has both the '{1}' property annotation as well as a value. Resource reference navigation properties can have either '{1}' property annotations or values, but not both. -ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType=An undeclared property '{0}' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values. -ODataJsonResourceDeserializer_OperationIsNotActionOrFunction=Encountered the operation '{0}' which can not be resolved to an ODataAction or ODataFunction. -ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation=Multiple '{0}' properties were found for an operation '{1}'. In OData, an operation can have at most one '{0}' property. -ODataJsonResourceDeserializer_OperationMissingTargetProperty=Multiple target bindings encountered for the operation '{0}' but the 'target' property was not found in an operation value. To differentiate between multiple target bindings, each operation value must have exactly one 'target' property. -ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest=A metadata reference property was found in a Json request payload. Metadata reference properties are only supported in responses. - -ODataJsonValidationUtils_OperationPropertyCannotBeNull=The '{0}' property of the operation '{1}' cannot have a null value. -ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported=Encountered a reference into metadata '{0}' which does not refer to the known metadata url '{1}'. Open metadata reference properties are not supported. - -ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation=A relative URI value '{0}' was specified in the payload, but the {1} annotation is missing from the payload. The payload must only contain absolute URIs or the {1} annotation must be on the payload. - -ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload=The {0} annotation is missing from the payload. - -ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound=When trying to read the start of a collection, the expected collection property with name '{0}' was not found. -ODataJsonCollectionDeserializer_CannotReadCollectionContentStart=A node of type '{0}' was read from the JSON reader when trying to read the items of a collection; however, a 'StartArray' node was expected. -ODataJsonCollectionDeserializer_CannotReadCollectionEnd=A property or annotation for a property with name '{0}' or an instance annotation with name '{0}' was found after reading the items of a top-level collection. No additional properties or annotations are allowed after the collection property. -ODataJsonCollectionDeserializer_InvalidCollectionTypeName=An 'odata.type' annotation with value '{0}' was found for a top-level collection payload; however, top-level collections must specify a collection type. - -ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue=A node of type '{0}' was read from the JSON reader when trying to read the start of an entity reference link. In Json, entity reference links must be objects. -ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink=A property annotation with name '{0}' was detected when reading an entity reference link; entity reference links do not support property annotations. -ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink=An instance annotation with name '{0}' or a property annotation for the property with name '{0}' was found when reading an entity reference link. No OData property or instance annotations are allowed when reading entity reference links. -ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink=A property with name '{0}' was found when reading an entity reference link. No properties other than the entity reference link property with name '{1}' are allowed. -ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty=The required property '{0}' for an entity reference link was not found. -ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink=Multiple '{0}' properties were found in an entity reference link object; however, a single '{0}' property was expected. -ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull=The '{0}' property of an entity reference link object cannot have a null value. -ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks=A property annotation was found for entity reference links; however, entity reference links only support instance annotations. -ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound=A property with name '{0}' or a property annotation for a property with name '{0}' was found when trying to read a collection of entity reference links; however, a property with name '{1}' was expected. -ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks=A property annotation for a property with name '{0}' was found when reading an entity reference links payload. No property annotations, only instance annotations are allowed when reading entity reference links. -ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound=Did not find the required '{0}' property for an entity reference links payload. - -ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull=The '{0}' property of an operation '{1}' in '{2}' cannot have a null value. -ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue=Found a node of type '{1}' when starting to read the '{0}' operations value, however a node of type 'StartObject' was expected. The '{0}' operations value must have an object value. - -ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument=Multiple '{0}' properties were found in a service document. In OData, a service document must have exactly one '{0}' property. -ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement=Multiple '{0}' properties were found in a service document element. In OData, a service document element must have exactly one '{0}' property. -ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument=No '{0}' property was found for a service document. In OData, a service document must have exactly one '{0}' property. -ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement=Encountered a service document element without a '{0}' property. In service documents, service document elements must contain a '{0}' property. -ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument=An unrecognized property annotation '{0}' was found in a '{1}' object in a service document. OData property annotations are not allowed in workspaces. -ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument=An unrecognized instance annotation '{0}' was found in a '{1}' object in a service document. OData instance annotations are not allowed in workspaces. -ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement=An unrecognized property annotation '{0}' was found in a service document element. OData property annotations are not allowed in service document elements. -ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement=An unrecognized instance annotation '{0}' was found in a service document element. OData instance annotations are not allowed in service document elements. -ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement=Encountered unexpected property '{0}' in a service document element. In service documents, service document element may only have '{1}' and '{2}' properties. -ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument=Encountered unexpected property '{0}' in a service document. The top level object of a service document may only have a '{1}' property. -ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty=Encountered a property annotation for the property '{0}' which wasn't immediately followed by the property. Property annotations must occur directly before the property being annotated. - -ODataJsonParameterDeserializer_PropertyAnnotationForParameters=An OData property annotation was found for a parameter payload; however, parameter payloads do not support OData property annotations. -ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters=One or more property annotations for property '{0}' were found in a parameter payload without the property to annotate. Parameter payloads must not contain property annotations for properties that are not in the payload. -ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType=The parameter '{0}' is of the '{1}' primitive type, which is not supported in Json. -ODataJsonParameterDeserializer_NullCollectionExpected=When trying to read a null collection parameter value in Json, a node of type '{0}' with the value '{1}' was read from the JSON reader; however, a primitive 'null' value was expected. -ODataJsonParameterDeserializer_UnsupportedParameterTypeKind=The parameter '{0}' is of an unsupported type kind '{1}'. Only primitive, enum, complex, primitive collection, enum collection and complex collection types are supported. - -SelectedPropertiesNode_StarSegmentNotLastSegment=When parsing a select clause a '*' segment was found before last segment of a property path. In OData, a '*' segment can only appear as last segment of a property path. -SelectedPropertiesNode_StarSegmentAfterTypeSegment=When parsing a select clause a '*' segment was found immediately after a type segment in a property path. In OData, a '*' segment cannot appear following a type segment. - -ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload=An OData property annotation '{0}' was found in an error payload; however, error payloads do not support OData property annotations. -ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload=An OData instance annotation '{0}' was found in an error payload; however, error payloads do not support OData instance annotations. -ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError=One or more property annotations for property '{0}' were found in an error payload without the property to annotate. Error payloads must not contain property annotations for properties that are not in the payload. -ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty=A property with name '{0}' was found in the error value of a top-level error. In OData, a top-level error value can only have properties with name 'code', 'message', or 'innererror', or custom instance annotations. - -ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties=The entity type '{0}' has no key properties. Entity types must define at least one key property. -ODataConventionalUriBuilder_NullKeyValue=The key property '{0}' on type '{1}' has a null value. Key properties must not have null values. - -ODataResourceMetadataContext_EntityTypeWithNoKeyProperties=An ODataResource of type '{0}' is found without key properties. When writing without a user model, each resource must contain at least one property whose 'ODataProperty.SerializationInfo.PropertyKind' set to 'ODataPropertyKind.Key'. When writing with a user model, the entity type '{0}' defined in the model must define at least one key property. -ODataResourceMetadataContext_NullKeyValue=The key property '{0}' on type '{1}' has a null value. Key properties must not have null values. -ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues=The property '{0}' on type '{1}' is a non-primitive value. All key and etag properties must be of primitive types. -ODataResource_PropertyValueCannotBeODataResourceValue=The value of a property '{0}' in ODataResource cannot be of type ODataResourceValue or collection of ODataResourceValue. - -EdmValueUtils_NonPrimitiveValue=The primitive property '{0}' on type '{1}' has a value which is not a primitive value. -EdmValueUtils_PropertyDoesntExist=The entity instance value of type '{0}' doesn't have a value for property '{1}'. To compute an entity's metadata, its key and concurrency-token property values must be provided. - -ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull=Cannot create an ODataPrimitiveValue from null; use ODataNullValue instead. -ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType=An ODataPrimitiveValue was instantiated with a value of type '{0}'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types. - -ODataInstanceAnnotation_NeedPeriodInName='{0}' is an invalid instance annotation name. An instance annotation name must contain a period that is not at the start or end of the name. -ODataInstanceAnnotation_ReservedNamesNotAllowed='{0}' is a reserved instance annotation name because it starts with '{1}'. Reserved names are not allowed for custom instance annotations. -ODataInstanceAnnotation_BadTermName='{0}' is an invalid instance annotation name. -ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue=The value of an instance annotation cannot be of type ODataStreamReferenceValue. - -ODataJsonValueSerializer_MissingTypeNameOnCollection=A type name was not provided for an instance of ODataCollectionValue. -ODataJsonValueSerializer_MissingRawValueOnUntyped=A raw value was not provided for an instance of ODataUntypedValue. - -InstanceAnnotation_MissingTermAttributeOnAnnotationElement=Encountered an 'annotation' element without a 'term' attribute. All 'annotation' elements must have a 'term' attribute. -InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType=The value of the 'type' attribute on an 'annotation' element was '{0}', which is incompatible with the '{1}' attribute. -InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement=Encountered the attribute '{0}' on a non-empty 'annotation' element. If attribute value notation is used to specify the annotation's value, then there can be no body to the element. -InstanceAnnotation_MultipleAttributeValueNotationAttributes=Encountered an 'annotation' element with more than one attribute from following set: 'int', 'string', 'decimal', 'float', and 'bool'. Only one such attribute may appear on an 'annotation' element. - -AnnotationFilterPattern_InvalidPatternMissingDot=The pattern '{0}' is not a valid pattern to match an annotation. It must contain at least one '.' separating the namespace and the name segments of an annotation. -AnnotationFilterPattern_InvalidPatternEmptySegment=The pattern '{0}' is not a valid pattern to match an annotation. It must not contain a namespace or name segment that is empty. -AnnotationFilterPattern_InvalidPatternWildCardInSegment=The pattern '{0}' is not a supported pattern to match an annotation. It must not contain '*' as part of a segment. -AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment=The pattern '{0}' is not a supported pattern to match an annotation. '*' must be the last segment of the pattern. - - -; URI PARSER -SyntacticTree_UriMustBeAbsolute=The specified URI '{0}' must be absolute. -SyntacticTree_MaxDepthInvalid=The maximum depth setting must be a number greater than zero. -SyntacticTree_InvalidSkipQueryOptionValue=Invalid value '{0}' for $skip query option found. The $skip query option requires a non-negative integer value. -SyntacticTree_InvalidTopQueryOptionValue=Invalid value '{0}' for $top query option found. The $top query option requires a non-negative integer value. -SyntacticTree_InvalidCountQueryOptionValue=Invalid value '{0}' for $count query option found. Valid values are '{1}'. -SyntacticTree_InvalidIndexQueryOptionValue=Invalid value '{0}' for $index query option found. The $index query option requires an integer value. - -QueryOptionUtils_QueryParameterMustBeSpecifiedOnce=Query option '{0}' was specified more than once, but it must be specified at most once. - -UriBuilder_NotSupportedClrLiteral=The CLR literal of type '{0}' is not supported to be written as a Uri part. -UriBuilder_NotSupportedQueryToken=QueryToken '{0}' is not supported to be written as a Uri part. - -UriQueryExpressionParser_TooDeep=Recursion depth exceeded allowed limit. -UriQueryExpressionParser_ExpressionExpected=Expression expected at position {0} in '{1}'. -UriQueryExpressionParser_OpenParenExpected='(' expected at position {0} in '{1}'. -UriQueryExpressionParser_CloseParenOrCommaExpected=')' or ',' expected at position {0} in '{1}'. -UriQueryExpressionParser_CloseParenOrOperatorExpected=')' or operator expected at position {0} in '{1}'. -UriQueryExpressionParser_IllegalQueryOptioninDollarCount=Only $filter and $search query options are allowed within $count. -UriQueryExpressionParser_CannotCreateStarTokenFromNonStar=Expecting a Star token but got: '{0}'. -UriQueryExpressionParser_RangeVariableAlreadyDeclared=The range variable '{0}' has already been declared. -UriQueryExpressionParser_AsExpected='as' expected at position {0} in '{1}'. -UriQueryExpressionParser_WithExpected='with' expected at position {0} in '{1}'. -UriQueryExpressionParser_UnrecognizedWithMethod=Unrecognized with '{0}' at '{1}' in '{2}'. -UriQueryExpressionParser_PropertyPathExpected=Expression expected at position {0} in '{1}'. -UriQueryExpressionParser_KeywordOrIdentifierExpected='{0}' expected at position {1} in '{2}'. -UriQueryExpressionParser_InnerMostExpandRequireFilter=The inner most expand transformation requires a filter transformation at position {0} in '{1}'. - -UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri=The URI '{0}' is not valid because it is not based on '{1}'. -UriQueryPathParser_SyntaxError=Bad Request: there was an error in the query syntax. -UriQueryPathParser_TooManySegments=Too many segments in URI. -UriQueryPathParser_InvalidEscapeUri=The URI part '{0}' is not valid because there's no leading escape character. - -UriUtils_DateTimeOffsetInvalidFormat=The DateTimeOffset text '{0}' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range. - -SelectionItemBinder_NonNavigationPathToken=Inner or start path segments must be navigation properties in $select. - -MetadataBinder_ParameterAliasValueExpressionNotSingleValue=The parameter alias value expression is not string value. -MetadataBinder_UnsupportedQueryTokenKind=An unsupported query token kind '{0}' was found. -MetadataBinder_PropertyNotDeclared=Could not find a property named '{1}' on type '{0}'. -MetadataBinder_InvalidIdentifierInQueryOption=Can not resolve the segment identifier '{0}' in query option. -MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue=Property '{0}' is not declared on type '{1}' or is not a key property. Only key properties can be used in key lookups. -MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared=Could not find a function named '{0}' with parameters '{1}'. -MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties=An unnamed key value was used in a key lookup on a type '{0}' which has more than one key property. Unnamed key value can only be used on a type with one key property. -MetadataBinder_DuplicitKeyPropertyInKeyValues=A key property '{0}' was found twice in a key lookup. Each key property can be specified just once in a key lookup. -MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues=A key lookup on type '{0}' didn't specify values for all key properties. All key properties must be specified in a key lookup. -MetadataBinder_CannotConvertToType=Expression of type '{0}' cannot be converted to type '{1}'. -MetadataBinder_FilterExpressionNotSingleValue=The $filter expression must evaluate to a single boolean value. -MetadataBinder_OrderByExpressionNotSingleValue=The $orderby expression must evaluate to a single value of primitive type. -MetadataBinder_PropertyAccessWithoutParentParameter=A PropertyAccessQueryToken without a parent was encountered outside of $filter or $orderby expression. The PropertyAccessQueryToken without a parent token is only allowed inside $filter or $orderby expressions. -MetadataBinder_BinaryOperatorOperandNotSingleValue=The operand for a binary operator '{0}' is not a single value. Binary operators require both operands to be single values. -MetadataBinder_UnaryOperatorOperandNotSingleValue=The operand for a unary operator '{0}' is not a single value. Unary operators require the operand to be a single value. -MetadataBinder_LeftOperandNotSingleValue=The left operand for the IN operation is not a single value. IN operations require the left operand to be a single value and the right operand to be a collection value. -MetadataBinder_RightOperandNotCollectionValue=The right operand for the IN operation is not a collection value. IN operations require the left operand to be a single value and the right operand to be a collection value. -MetadataBinder_PropertyAccessSourceNotSingleValue=The parent value for a property access of a property '{0}' is not a single value. Property access can only be applied to a single value. -MetadataBinder_CountSegmentNextTokenNotCollectionValue=The next token in a CountSegmentNode must be a collection. -MetadataBinder_IncompatibleOperandsError=A binary operator with incompatible types was detected. Found operand types '{0}' and '{1}' for operator kind '{2}'. -MetadataBinder_IncompatibleOperandError=A unary operator with an incompatible type was detected. Found operand type '{0}' for operator kind '{1}'. -MetadataBinder_UnknownFunction=An unknown function with name '{0}' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed. -MetadataBinder_FunctionArgumentNotSingleValue=The argument for an invocation of a function with name '{0}' is not a single value. All arguments for this function must be single values. -MetadataBinder_NoApplicableFunctionFound=No function signature for the function with name '{0}' matches the specified arguments. The function signatures considered are: {1}. -MetadataBinder_BoundNodeCannotBeNull=A token of kind '{0}' was bound to the value null; this is invalid. A query token must always be bound to a non-null query node. -MetadataBinder_TopRequiresNonNegativeInteger=The value '{0}' is not a non-negative integer value. In OData, the $top query option must specify a non-negative integer value. -MetadataBinder_SkipRequiresNonNegativeInteger=The value '{0}' is not a non-negative integer value. In OData, the $skip query option must specify a non-negative integer value. -MetadataBinder_QueryOptionsBindStateCannotBeNull=The bind state cannot be null. In OData, the bind state for query options should not be null and there should be query options in the object. -MetadataBinder_QueryOptionsBindMethodCannotBeNull=The bind method cannot be null. In OData, the processing of query options should have a corresponding bind method. -MetadataBinder_HierarchyNotFollowed=Encountered invalid type cast. '{0}' is not assignable from '{1}'. -MetadataBinder_LambdaParentMustBeCollection=Any/All may only be used following a collection. -MetadataBinder_ParameterNotInScope=The parameter '{0}' is not in scope. -MetadataBinder_NavigationPropertyNotFollowingSingleEntityType=A navigation property can only follow single entity nodes. -MetadataBinder_AnyAllExpressionNotSingleValue=The Any/All query expression must evaluate to a single boolean value. -MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands=The Cast or IsOf expression has an invalid number of operands: number of operands is '{0}' and it should be 1 or 2. -MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument=Cast or IsOf Function must have a type in its arguments. -MetadataBinder_CastOrIsOfCollectionsNotSupported=The Cast and IsOf functions do not support collection arguments or types. -MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease=Collection open properties are not supported in this release. -MetadataBinder_IllegalSegmentType=Can only bind segments that are Navigation, Structural, Complex, or Collections. We found a segment '{0}' that isn't any of those. Please revise the query. -MetadataBinder_QueryOptionNotApplicable=The '{0}' option cannot be applied to the query path. '{0}' can only be applied to a collection of entities. -StringItemShouldBeQuoted=String item should be single/double quoted: '{0}'. -StreamItemInvalidPrimitiveKind=Invalid PrimitiveTypeKind {0}. A Stream item must be of type binary or string, or none if unknown." -ApplyBinder_AggregateExpressionIncompatibleTypeForMethod=$apply/aggregate expression '{0}' operation does not support value type '{1}'. -ApplyBinder_UnsupportedAggregateMethod=$apply/aggregate does not support method '{0}'. -ApplyBinder_UnsupportedAggregateKind=$apply/aggregate expression token kind '{0}' not supported. -ApplyBinder_AggregateExpressionNotSingleValue=$apply/aggregate expression '{0}' must evaluate to a single value. -ApplyBinder_GroupByPropertyNotPropertyAccessValue=$apply/groupby grouping expression '{0}' must evaluate to a property access value. -ApplyBinder_UnsupportedType=$apply clause does not support type '{0}'. -ApplyBinder_UnsupportedGroupByChild=$apply/groupby not support '{0}' as child transformation - -AggregateTransformationNode_UnsupportedAggregateExpressions=There are unsupported aggregation expressions in the transformation node. - -FunctionCallBinder_CannotFindASuitableOverload=Cannot find a suitable overload for function '{0}' that takes '{1}' arguments. -FunctionCallBinder_UriFunctionMustHaveHaveNullParent=Found a Uri function '{0}' with a parent token. Uri functions cannot have parent tokens. -FunctionCallBinder_CallingFunctionOnOpenProperty=Found a function '{0}' on an open property. Functions on open properties are not supported. -FunctionCallParser_DuplicateParameterOrEntityKeyName=Parameter or entity key names must be unique. There is most likely an error in the model. - -ODataUriParser_InvalidCount='{0}' is not a valid count option. - -CastBinder_ChildTypeIsNotEntity=The child type '{0}' in a cast was not an entity type. Casts can only be performed on entity types. -CastBinder_EnumOnlyCastToOrFromString=Enumeration type value can only be casted to or from string. -Binder_IsNotValidEnumConstant=The string '{0}' is not a valid enumeration type constant. - -BatchReferenceSegment_InvalidContentID=Invalid content-id '{0}' for batch reference segment. - -SelectExpandBinder_UnknownPropertyType=Property '{0}' is of an unrecognized EdmPropertyKind. -SelectExpandBinder_InvalidIdentifierAfterWildcard=It's not allowed to append '{0}' after wildcard. -SelectExpandBinder_InvalidQueryOptionNestedSelection=It's not allowed to nest query options within '{0}' selection. -SelectExpandBinder_SystemTokenInSelect=Found a system token, '{0}', while parsing a select clause. -SelectionItemBinder_NoExpandForSelectedProperty=Only properties specified in $expand can be traversed in $select query options. Selected item was '{0}'. - -SelectExpandPathBinder_FollowNonTypeSegment=Trying to follow type segments on a segment that isn't a type. Segment was '{0}'. - -SelectBinder_MultiLevelPathInSelect=Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties. - -ExpandItemBinder_TraversingANonNormalizedTree=Trying to traverse a non-normalized expand tree. -ExpandItemBinder_CannotFindType=The type '{0}' is not defined in the model. -ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty=Property '{0}' on type '{1}' is not a navigation property or complex property. Only navigation properties can be expanded. -ExpandItemBinder_TypeSegmentNotFollowedByPath=Found a path within a select or expand query option that isn't ended by a non-type segment. -ExpandItemBinder_PathTooDeep=Trying to parse a type segment path that is too long. -ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath=Found a path traversing multiple navigation properties. Please rephrase the query such that each expand path contains only type segments and navigation properties. -ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType=The $level option on navigation property '{0}' is not allowed, because the related entity type '{1}' could not be cast to source entity type '{2}'. -ExpandItemBinder_InvaidSegmentInExpand=Segment '{0}' is not valid in expand path. Before navigation property, only type segment or entity or complex property can exist. - -Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity=The navigation property must have a target multiplicity of 'One' or 'ZeroOrOne' to create a SingleNavigationNode. -Nodes_NonentityParameterQueryNodeWithEntityType=An entity type '{0}' was given to NonEntityParameterQueryNode. Use EntityParameterQueryNode instead. -Nodes_CollectionNavigationNode_MustHaveManyMultiplicity=The navigation property must have a target multiplicity of 'Many' to create a CollectionNavigationNode. -Nodes_PropertyAccessShouldBeNonEntityProperty=A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is not structural. -Nodes_PropertyAccessTypeShouldNotBeCollection=A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is a collection. -Nodes_PropertyAccessTypeMustBeCollection=A node of this kind requires the associated property to be a structural, collection type, but property '{0}' is not a collection. -Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease=Only static Entity Set reference expressions are supported currently. -Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum=An instance of CollectionFunctionCallNode can only be created with a primitive, complex or enum collection type. For functions returning a collection of entities, use EntityCollectionFunctionCallNode instead. -Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity=An instance of EntityCollectionFunctionCallNode can only be created with an entity collection type. For functions returning a collection of primitive or complex values, use CollectionFunctionCallNode instead. -Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum=An instance of SingleValueFunctionCallNode can only be created with a primitive, complex or enum type. For functions returning a single entity, use SingleEntityFunctionCallNode instead. -Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType=An instance of InNode can only be created where the item types of the right operand '{0}' and the left operand '{1}' can be compared. - -ExpandTreeNormalizer_NonPathInPropertyChain=Found a segment that isn't a path while parsing the path within a select or expand query option. -SelectTreeNormalizer_MultipleSelecTermWithSamePathFound=Found multiple select terms with same select path '{0}' at one $select, please combine them together. - -UriExpandParser_TermIsNotValidForStar=Term '{0}' is not valid in a $expand expression, as only $level option is allowed when the expanded navigation property is star. -UriExpandParser_TermIsNotValidForStarRef=Term '{0}' is not valid in a $expand expression, no option is allowed when the expanded navigation property is */$ref. -UriExpandParser_ParentStructuredTypeIsNull=Cannot get parent structured type for term '{0}' to auto populate all navigation properties. -UriExpandParser_TermWithMultipleStarNotAllowed=Term '{0}' is not valid in a $expand expression as multiple stars are not allowed. -UriSelectParser_TermIsNotValid=Term '{0}' is not valid in a $select or $expand expression. -UriSelectParser_InvalidTopOption=Top option must be a non-negative integer, it is set to '{0}' instead. -UriSelectParser_InvalidSkipOption=Skip option must be a non-negative integer, it is set to '{0}' instead. -UriSelectParser_InvalidCountOption=Count option must be a boolean value, it is set to '{0}' instead. -UriSelectParser_InvalidLevelsOption=Levels option must be a non-negative integer or 'max', it is set to '{0}' instead. -UriSelectParser_SystemTokenInSelectExpand=Found system token '{0}' in select or expand clause '{1}'. -UriParser_MissingExpandOption=Missing expand option on navigation property '{0}'. If a parenthesis expression follows an expanded navigation property, then at least one expand option must be provided. -UriParser_EmptyParenthesis=Empty parenthesis not allowed. -UriParser_MissingSelectOption=Missing select option on property '{0}'. If a parenthesis expression follows a selected property, then at least one query option must be provided. -UriParser_RelativeUriMustBeRelative=Parameter 'relativeUri' must be a relative Uri if serviceRoot is not specified. -UriParser_NeedServiceRootForThisOverload=A service root URI must be provided to the ODataUriParser in order to use this method. -UriParser_UriMustBeAbsolute=The URI '{0}' must be an absolute URI. -UriParser_NegativeLimit=The limit must be greater than or equal to zero -UriParser_ExpandCountExceeded=The result of parsing $expand contained at least {0} items, but the maximum allowed is {1}. -UriParser_ExpandDepthExceeded=The result of parsing $expand was at least {0} items deep, but the maximum allowed is {1}. -UriParser_TypeInvalidForSelectExpand=The type '{0}' is not valid for $select or $expand, only structured types are allowed. -UriParser_ContextHandlerCanNotBeNull=The handler property for context '{0}' should not return null. -UriParserMetadata_MultipleMatchingPropertiesFound=More than one properties match the name '{0}' were found in type '{1}'. -UriParserMetadata_MultipleMatchingNavigationSourcesFound=More than one navigation sources match the name '{0}' were found in model. -UriParserMetadata_MultipleMatchingTypesFound=More than one types match the name '{0}' were found in model. -UriParserMetadata_MultipleMatchingKeysFound=More than one keys match the name '{0}' were found. -UriParserMetadata_MultipleMatchingParametersFound=More than one parameters match the name '{0}' were found. -UriValidator_ValidatorMustUseSameModelAsParser=The UrlValidator used to validate an ODataUri must use the same Model as the ODataUriParser. - -PathParser_EntityReferenceNotSupported=The request URI is not valid. $ref cannot be applied to the segment '{0}' since $ref can only follow an entity segment or entity collection segment. -PathParser_CannotUseValueOnCollection=$value cannot be applied to a collection. -PathParser_TypeMustBeRelatedToSet=The type '{0}' does not inherit from and is not a base type of '{1}'. The type of '{2}' must be related to the Type of the EntitySet. -PathParser_TypeCastOnlyAllowedAfterStructuralCollection=Type cast segment '{0}' after a collection which is not of entity or complex type is not allowed. -PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint=Type cast segment '{0}' on {1} '{2}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation. - -ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink=A resource set may contain a next page link, a delta link or neither, but must not contain both. - -ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty=The last segment, and only the last segment, can be a navigation property in $expand. -ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment=The last segment must be a navigation property or type segment in $expand. -ODataExpandPath_InvalidExpandPathSegment=Found a segment of type '{0} in an expand path, but only NavigationProperty, Property and Type segments are allowed. - -ODataSelectPath_CannotOnlyHaveTypeSegment=TypeSegment cannot be the only segment in a $select. -ODataSelectPath_InvalidSelectPathSegmentType=Found a segment of type '{0} in a select path, but only TypeSegment, NavigationPropertySegment, PropertySegment, OperationSegment or OpenPropertySegments are allowed. -ODataSelectPath_OperationSegmentCanOnlyBeLastSegment=An operation can only be the last segment in $select. -ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment=A navigation property can only be the last segment in $select. - -RequestUriProcessor_TargetEntitySetNotFound=The target Entity Set of Navigation Property '{0}' could not be found. This is most likely an error in the IEdmModel. -RequestUriProcessor_FoundInvalidFunctionImport=The function overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. - -OperationSegment_ReturnTypeForMultipleOverloads=No type could be computed for this Segment since there were multiple possible operations with varying return types. -OperationSegment_CannotReturnNull=The return type from the operation is not possible with the given entity set. - -FunctionOverloadResolver_NoSingleMatchFound=Unable to resolve function overloads to a single function. There was more than one function in the model with name '{0}' and parameter names '{1}'. -FunctionOverloadResolver_MultipleActionOverloads=Multiple action overloads were found with the same binding parameter for '{0}'. -FunctionOverloadResolver_MultipleActionImportOverloads=Multiple action import overloads were found with the same binding parameter for '{0}'. -FunctionOverloadResolver_MultipleOperationImportOverloads=Multiple action import and function import overloads for '{0}' were found. -FunctionOverloadResolver_MultipleOperationOverloads=Multiple action and function overloads for '{0}' were found. -FunctionOverloadResolver_FoundInvalidOperation=The operation overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. -FunctionOverloadResolver_FoundInvalidOperationImport=The operation import overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. - -CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload=The given custom function '{0}' already exists as a Built-In function. Consider use 'addAsOverloadToBuiltInFunction = true' parameter. -CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature=The given custom function '{0}' already exists as a Built-In function in one of it's overloads. Thus cannot override the Built-In function. -CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists=The given function name '{0}' already exists as a custom function with the same overload. - -RequestUriProcessor_InvalidValueForEntitySegment=The ODataPathSegment provided (Id = {0}) is not an EntitySetSegment. -RequestUriProcessor_InvalidValueForKeySegment=The KeySegment provided (Id = {0}) is either null, having no keys, or does not target a single resource. - -RequestUriProcessor_CannotApplyFilterOnSingleEntities=$filter path segment cannot be applied on single entities or singletons. Entity type: '{0}'. -RequestUriProcessor_CannotApplyEachOnSingleEntities=$each set-based operation cannot be applied on single entities or singletons. Entity type: '{0}'. -RequestUriProcessor_FilterPathSegmentSyntaxError=The $filter path segment must be in the form $filter(expression), where the expression resolves to a boolean. -RequestUriProcessor_NoNavigationSourceFound=There are no navigation sources found to apply '{0}'. -RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment=Only a single operation can follow $each. - -; Copied from the server, will be incrementally replaced. -RequestUriProcessor_EmptySegmentInRequestUrl=Empty segment encountered in request URL. Please make sure that a valid request URL is specified. -RequestUriProcessor_SyntaxError=Bad Request - Error in query syntax. -RequestUriProcessor_CountOnRoot=The request URI is not valid, the segment $count cannot be applied to the root of the service. -RequestUriProcessor_FilterOnRoot=The request URI is not valid, the segment $filter cannot be applied to the root of the service. -RequestUriProcessor_EachOnRoot=The request URI is not valid, the segment $each cannot be applied to the root of the service. -RequestUriProcessor_RefOnRoot=The request URI is not valid, the segment $ref cannot be applied to the root of the service. -RequestUriProcessor_MustBeLeafSegment=The request URI is not valid. The segment '{0}' must be the last segment in the URI because it is one of the following: $ref, $batch, $count, $value, $metadata, a named media resource, an action, a noncomposable function, an action import, a noncomposable function import, an operation with void return type, or an operation import with void return type. -RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment=The request URI is not valid. The segment '{0}' must refer to a navigation property since the previous segment identifier is '{1}'. -RequestUriProcessor_MissingSegmentAfterLink=The request URI is not valid. There must a segment specified after the '{0}' segment and the segment must refer to a entity resource. -RequestUriProcessor_CountNotSupported=The request URI is not valid. $count cannot be applied to the segment '{0}' since $count can only follow an entity set, a collection navigation property, a structural property of collection type, an operation returning collection type or an operation import returning collection type. -RequestUriProcessor_CannotQueryCollections=The request URI is not valid. Since the segment '{0}' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource. -RequestUriProcessor_SegmentDoesNotSupportKeyPredicates=The request URI is not valid. The segment '{0}' cannot include key predicates, however it may end with empty parenthesis. -RequestUriProcessor_ValueSegmentAfterScalarPropertySegment=The segment '{1}' in the request URI is not valid. The segment '{0}' refers to a primitive property, function, or service operation, so the only supported value from the next segment is '$value'. -RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType=The type '{0}' specified in the URI is neither a base type nor a sub-type of the previously-specified type '{1}'. -OpenNavigationPropertiesNotSupportedOnOpenTypes=Open navigation properties are not supported on OpenTypes. Property name: '{0}'. -BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation=Error processing request stream. In batch mode, a resource can be cross-referenced only for bind/unbind operations. -DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion=The response requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service is set to {1}. -BadRequest_KeyCountMismatch=The number of keys specified in the URI does not match number of key properties for the resource '{0}'. -BadRequest_KeyMismatch=The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared key of the resource '{0}'. -BadRequest_KeyOrAlternateKeyMismatch=The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared or alternate key properties for the resource '{0}'. -RequestUriProcessor_KeysMustBeNamed=Segments with multiple key values must specify them in 'name=value' form. -RequestUriProcessor_ResourceNotFound=Resource not found for the segment '{0}'. -RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset=Batched service action '{0}' cannot be invoked because it was bound to an entity created in the same changeset. -RequestUriProcessor_Forbidden=Forbidden -RequestUriProcessor_OperationSegmentBoundToANonEntityType=Found an operation bound to a non-entity type. -RequestUriProcessor_NoBoundEscapeFunctionSupported=The request URI is not valid. The bound function binding to '{0}' does not match the composability of the escape function in the URI. -RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter=The UrlEscape function '{0}' must have exactly one non-binding parameter of type 'Edm.String'. -RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter=A composable escape function must have a valid operation passed as a parameter. - -; Note: The below list of error messages are common to both the OData and the OData.Query project. -General_InternalError=An internal error '{0}' occurred. - -ExceptionUtils_CheckIntegerNotNegative=A non-negative integer value was expected, but the value '{0}' is not a valid non-negative integer. -ExceptionUtils_CheckIntegerPositive=A positive integer value was expected, but the value '{0}' is not a valid positive integer. -ExceptionUtils_CheckLongPositive=A positive long value was expected; however, the value '{0}' is not a valid positive long value. -ExceptionUtils_ArgumentStringNullOrEmpty=Value cannot be null or empty. - -ExpressionToken_OnlyRefAllowWithStarInExpand=Only $ref is allowed with star in $expand option. -ExpressionToken_DollarCountNotAllowedInSelect=$count is not allowed in $select option. -ExpressionToken_NoPropAllowedAfterDollarCount=No property is allowed after $count segment. -ExpressionToken_NoPropAllowedAfterRef=No property is allowed after $ref segment. -ExpressionToken_NoSegmentAllowedBeforeStarInExpand=No segment is allowed before star in $expand. -ExpressionToken_IdentifierExpected=An identifier was expected at position {0}. - -ExpressionLexer_UnterminatedStringLiteral=There is an unterminated string literal at position {0} in '{1}'. -ExpressionLexer_InvalidCharacter=Syntax error: character '{0}' is not valid at position {1} in '{2}'. -ExpressionLexer_SyntaxError=Syntax error at position {0} in '{1}'. -ExpressionLexer_UnterminatedLiteral=There is an unterminated literal at position {0} in '{1}'. -ExpressionLexer_DigitExpected=A digit was expected at position {0} in '{1}'. -ExpressionLexer_UnbalancedBracketExpression=Found an unbalanced bracket expression. -ExpressionLexer_InvalidNumericString=Numeric string '{0}' is not a valid Int32/Int64/Double/Decimal. -ExpressionLexer_InvalidEscapeSequence=An unrecognized escape sequence '\\{0}' was found at position {1} in '{2}'. - -UriQueryExpressionParser_UnrecognizedLiteral=Unrecognized '{0}' literal '{1}' at '{2}' in '{3}'. -UriQueryExpressionParser_UnrecognizedLiteralWithReason=Unrecognized '{0}' literal '{1}' at '{2}' in '{3}' with reason '{4}'. - -UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue=Failed to parse '{0}' of Edm type '{1}' to primitive type. -UriPrimitiveTypeParsers_FailedToParseStringToGeography=Failed to parse string to Geography. - -UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists=The given uri custom type parser already exists. -UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists=An existing custom UriTypeParser is already registered to the given EdmTypeReference '{0}'. - -UriParserHelper_InvalidPrefixLiteral=The given type prefix literal name '{0}' must contain letters or '.' only. - -CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists=The given type literal prefix '{0}' already exists as a custom uri type literal prefix. - -; NOTE: these error messages are copied from EdmLib because they appear in shared source files. -ValueParser_InvalidDuration=The value '{0}' is not a valid duration value. - -; Note: The below list of error messages are common to the ODataLib, EdmLib, Spatial, Server and Client projects. -PlatformHelper_DateTimeOffsetMustContainTimeZone=The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. - - -; Note: The below list of error messages are common to both the OData and the Spatial project. - -JsonReader_UnexpectedComma=Invalid JSON. An unexpected comma was found in scope '{0}'. A comma is only valid between properties of an object or between elements of an array. -JsonReader_ArrayClosureMismatch=Invalid JSON. A array closure mismatch occurred. A '{0}' was expected to match '{1}', but instead '{2}' was found. -JsonReader_MultipleTopLevelValues=Invalid JSON. More than one value was found at the root of the JSON content. JSON content can only have one value at the root level, which is an array, an object or a primitive value. -JsonReader_EndOfInputWithOpenScope=Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed. -JsonReader_UnexpectedToken=Invalid JSON. Unexpected token '{0}'. -JsonReader_UnrecognizedToken=Invalid JSON. A token was not recognized in the JSON content. -JsonReader_MissingColon=Invalid JSON. A colon character ':' is expected after the property name '{0}', but none was found. -JsonReader_UnrecognizedEscapeSequence=Invalid JSON. An unrecognized escape sequence '{0}' was found in a JSON string value. -JsonReader_UnexpectedEndOfString=Invalid JSON. Unexpected end of input reached while processing a JSON string value. -JsonReader_InvalidNumberFormat=Invalid JSON. The value '{0}' is not a valid number. -JsonReader_InvalidBinaryFormat=Invalid Binary value. The value '{0}' is not a valid Base64 encoded value. -JsonReader_MissingComma=Invalid JSON. A comma character ',' was expected in scope '{0}'. Every two elements in an array and properties of an object must be separated by commas. -JsonReader_InvalidPropertyNameOrUnexpectedComma=Invalid JSON. The property name '{0}' is not valid. The name of a property cannot be empty. -JsonReader_MaxBufferReached=Cannot increase the JSON reader buffer to hold the input JSON which has very long token. -JsonReader_CannotAccessValueInStreamState=Cannot access the Value property while streaming a value. Please dispose the StreamReader or TextReader before continuing. -JsonReader_CannotCallReadInStreamState=Cannot call Read while streaming a value. Please dispose the StreamReader or TextReader before continuing. -JsonReader_CannotCreateReadStream=Cannot create a Stream in the current state. A Stream can only be created for reading a JSON string value when positioned on, and before accessing, the value. -JsonReader_CannotCreateTextReader=Cannot create a TextReader in the current state. A TextReader can only be created for reading a JSON string value when positioned on, and before accessing, the value. - -JsonReaderExtensions_UnexpectedNodeDetected=An unexpected '{1}' node was found when reading from the JSON reader. A '{0}' node was expected. -JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName=An unexpected '{1}' node was found for property named '{2}' when reading from the JSON reader. A '{0}' node was expected. -JsonReaderExtensions_CannotReadPropertyValueAsString=Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value. -JsonReaderExtensions_CannotReadValueAsString=Cannot read the value '{0}' as a quoted JSON string value. -JsonReaderExtensions_CannotReadValueAsDouble=Cannot read the value '{0}' as a double numeric value. -JsonReaderExtensions_UnexpectedInstanceAnnotationName=An unexpected instance annotation name '{0}' was found when reading from the JSON reader, In OData, Instance annotation name must start with @. - -BufferUtils_InvalidBufferOrSize=The buffer from pool cannot be null or less than the required minimal size '{0}'. - -ServiceProviderExtensions_NoServiceRegistered=No service for type '{0}' has been registered. - -TypeUtils_TypeNameIsNotQualified=The value '{0}' is not a qualified type name. A qualified type name is expected. diff --git a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchFormat.cs b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchFormat.cs index 12b8e363b1..95ddb66386 100644 --- a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchFormat.cs +++ b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchFormat.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.MultipartMixed { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -152,7 +153,7 @@ internal override string GetContentType(ODataMediaType mediaType, Encoding encod if (boundaryParameters.Count() > 1) { throw new ODataContentTypeException( - Strings.MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified(mediaType.ToText())); + Error.Format(SRResources.MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified, mediaType.ToText())); } else if (boundaryParameters.Count() == 1) { diff --git a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchReader.cs b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchReader.cs index 0c7e15c33e..00c2081472 100644 --- a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchReader.cs +++ b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchReader.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.MultipartMixed { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -85,7 +86,7 @@ protected override ODataBatchOperationRequestMessage CreateOperationRequestMessa if (this.currentContentId == null) { - throw new ODataException(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(ODataConstants.ContentIdHeader)); + throw new ODataException(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, ODataConstants.ContentIdHeader)); } } } @@ -178,7 +179,7 @@ protected override ODataBatchReaderState ReadAtChangesetStartImplementation() { if (this.batchStream.ChangeSetBoundary == null) { - ThrowODataException(Strings.ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull); + ThrowODataException(SRResources.ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull); } this.dependsOnIdsTracker.ChangeSetStarted(); @@ -208,7 +209,7 @@ protected override void ValidateDependsOnIds(string contentId, IEnumerable @@ -328,7 +329,7 @@ internal override int ReadWithDelimiter(byte[] userBuffer, int userBufferOffset, } } - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStream_ReadWithDelimiter)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStream_ReadWithDelimiter)); } /// @@ -374,7 +375,7 @@ internal override int ReadWithLength(byte[] userBuffer, int userBufferOffset, in // We cannot fully satisfy the read request since there are not enough bytes in the stream. // This means that the content length of the stream was incorrect; this should never happen // since the caller should already have checked this. - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStreamBuffer_ReadWithLength)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStreamBuffer_ReadWithLength)); } else { @@ -451,7 +452,7 @@ internal ODataBatchOperationHeaders ReadHeaders() if (headers.ContainsKeyOrdinal(headerName)) { - throw new ODataException(Strings.ODataBatchReaderStream_DuplicateHeaderFound(headerName)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_DuplicateHeaderFound, headerName)); } headers.Add(headerName, headerValue); @@ -476,7 +477,7 @@ internal string ReadFirstNonEmptyLine() // null indicates end of input, which is unexpected at this point. if (line == null) { - throw new ODataException(Strings.ODataBatchReaderStream_UnexpectedEndOfInput); + throw new ODataException(SRResources.ODataBatchReaderStream_UnexpectedEndOfInput); } } while (line.Length == 0); @@ -497,7 +498,7 @@ private static void ValidateHeaderLine(string headerLine, out string headerName, int colon = headerLine.IndexOf(':', StringComparison.Ordinal); if (colon <= 0) { - throw new ODataException(Strings.ODataBatchReaderStream_InvalidHeaderSpecified(headerLine)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_InvalidHeaderSpecified, headerLine)); } headerName = headerLine.Substring(0, colon).Trim(); @@ -601,7 +602,7 @@ private string ReadLine() this.BatchBuffer.SkipTo(lineEndEndPosition + 1); break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataBatchReaderStream_ReadLine)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataBatchReaderStream_ReadLine)); } } @@ -639,7 +640,7 @@ private ODataBatchOperationHeaders ValidatePartHeaders(ODataBatchOperationHeader string contentType; if (!headers.TryGetValue(ODataConstants.ContentTypeHeader, out contentType)) { - throw new ODataException(Strings.ODataBatchReaderStream_MissingContentTypeHeader); + throw new ODataException(SRResources.ODataBatchReaderStream_MissingContentTypeHeader); } if (MediaTypeUtils.MediaTypeAndSubtypeAreEqual(contentType, MimeConstants.MimeApplicationHttp)) @@ -652,7 +653,7 @@ private ODataBatchOperationHeaders ValidatePartHeaders(ODataBatchOperationHeader if (!headers.TryGetValue(ODataConstants.ContentTransferEncoding, out transferEncoding) || string.Compare(transferEncoding, ODataConstants.BatchContentTransferEncoding, StringComparison.OrdinalIgnoreCase) != 0) { - throw new ODataException(Strings.ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader( + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader, ODataConstants.ContentTransferEncoding, ODataConstants.BatchContentTransferEncoding)); } @@ -664,12 +665,12 @@ private ODataBatchOperationHeaders ValidatePartHeaders(ODataBatchOperationHeader if (this.changesetBoundary != null) { // Nested changesets are not supported - throw new ODataException(Strings.ODataBatchReaderStream_NestedChangesetsAreNotSupported); + throw new ODataException(SRResources.ODataBatchReaderStream_NestedChangesetsAreNotSupported); } } else { - throw new ODataException(Strings.ODataBatchReaderStream_InvalidContentTypeSpecified( + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_InvalidContentTypeSpecified, ODataConstants.ContentTypeHeader, contentType, MimeConstants.MimeMultipartMixed, diff --git a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchWriter.cs b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchWriter.cs index 2e569274d6..fb2a02fb3b 100644 --- a/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchWriter.cs +++ b/src/Microsoft.OData.Core/MultipartMixed/ODataMultipartMixedBatchWriter.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.MultipartMixed { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -165,7 +166,7 @@ public override void OnInStreamError() // The OData protocol spec does not define the behavior when an exception is encountered outside of a batch operation. The batch writer // should not allow WriteError in this case. Note that WCF DS Server does serialize the error in XML format when it encounters one outside of a // batch operation. - throw new ODataException(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch); + throw new ODataException(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch); } public override async Task OnInStreamErrorAsync() @@ -178,7 +179,7 @@ await this.RawOutputContext.TextWriter.FlushAsync() // The OData protocol spec does not define the behavior when an exception is encountered outside of a batch operation. The batch writer // should not allow WriteError in this case. Note that WCF DS Server does serialize the error in XML format when it encounters one outside of a // batch operation. - throw new ODataException(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch); + throw new ODataException(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch); } /// @@ -249,7 +250,7 @@ protected override void ValidateDependsOnIds(string contentId, IEnumerable ReadHeaders() if (headers.ContainsKey(headerName)) { - throw new ODataException(Strings.ODataAsyncReader_DuplicateHeaderFound(headerName)); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_DuplicateHeaderFound, headerName)); } headers.Add(headerName, headerValue); @@ -253,7 +254,7 @@ private static void ValidateHeaderLine(string headerLine, out string headerName, int colon = headerLine.IndexOf(':', StringComparison.Ordinal); if (colon <= 0) { - throw new ODataException(Strings.ODataAsyncReader_InvalidHeaderSpecified(headerLine)); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_InvalidHeaderSpecified, headerLine)); } headerName = headerLine.Substring(0, colon).Trim(); @@ -274,7 +275,7 @@ private string ReadLine() { if (ch == '\n') { - throw new ODataException(Strings.ODataAsyncReader_InvalidNewLineEncountered('\n')); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, '\n')); } if (ch == '\r') @@ -283,7 +284,7 @@ private string ReadLine() if (ch != '\n') { - throw new ODataException(Strings.ODataAsyncReader_InvalidNewLineEncountered('\r')); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, '\r')); } return lineBuilder.ToString(); @@ -293,7 +294,7 @@ private string ReadLine() ch = this.ReadByte(); } - throw new ODataException(Strings.ODataAsyncReader_UnexpectedEndOfInput); + throw new ODataException(SRResources.ODataAsyncReader_UnexpectedEndOfInput); } /// @@ -389,7 +390,7 @@ private async Task> ReadHeadersAsync() if (headers.ContainsKey(headerName)) { - throw new ODataException(Strings.ODataAsyncReader_DuplicateHeaderFound(headerName)); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_DuplicateHeaderFound, headerName)); } headers.Add(headerName, headerValue); @@ -418,7 +419,7 @@ private async Task ReadLineAsync() { if (ch == '\n') { - throw new ODataException(Strings.ODataAsyncReader_InvalidNewLineEncountered('\n')); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, '\n')); } if (ch == '\r') @@ -428,7 +429,7 @@ private async Task ReadLineAsync() if (ch != '\n') { - throw new ODataException(Strings.ODataAsyncReader_InvalidNewLineEncountered('\r')); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, '\r')); } return lineBuilder.ToString(); @@ -439,7 +440,7 @@ private async Task ReadLineAsync() .ConfigureAwait(false); } - throw new ODataException(Strings.ODataAsyncReader_UnexpectedEndOfInput); + throw new ODataException(SRResources.ODataAsyncReader_UnexpectedEndOfInput); } /// diff --git a/src/Microsoft.OData.Core/ODataAsynchronousResponseMessage.cs b/src/Microsoft.OData.Core/ODataAsynchronousResponseMessage.cs index 8756cd93e6..30ee9694ed 100644 --- a/src/Microsoft.OData.Core/ODataAsynchronousResponseMessage.cs +++ b/src/Microsoft.OData.Core/ODataAsynchronousResponseMessage.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -276,7 +277,7 @@ private void VerifyCanSetHeaderAndStatusCode() { if (!this.writing) { - throw new ODataException(Strings.ODataAsyncResponseMessage_MustNotModifyMessage); + throw new ODataException(SRResources.ODataAsyncResponseMessage_MustNotModifyMessage); } } } diff --git a/src/Microsoft.OData.Core/ODataAsynchronousWriter.cs b/src/Microsoft.OData.Core/ODataAsynchronousWriter.cs index f28c7051a0..aab7cd2586 100644 --- a/src/Microsoft.OData.Core/ODataAsynchronousWriter.cs +++ b/src/Microsoft.OData.Core/ODataAsynchronousWriter.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -98,7 +99,7 @@ void IODataOutputInStreamErrorListener.OnInStreamError() this.rawOutputContext.VerifyNotDisposed(); this.rawOutputContext.TextWriter.Flush(); - throw new ODataException(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync); + throw new ODataException(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync); } /// @@ -108,7 +109,7 @@ async Task IODataOutputInStreamErrorListener.OnInStreamErrorAsync() await this.rawOutputContext.TextWriter.FlushAsync() .ConfigureAwait(false); - throw new ODataException(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync); + throw new ODataException(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync); } /// @@ -129,14 +130,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.rawOutputContext.Synchronous) { - throw new ODataException(Strings.ODataAsyncWriter_SyncCallOnAsyncWriter); + throw new ODataException(SRResources.ODataAsyncWriter_SyncCallOnAsyncWriter); } } else { if (this.rawOutputContext.Synchronous) { - throw new ODataException(Strings.ODataAsyncWriter_AsyncCallOnSyncWriter); + throw new ODataException(SRResources.ODataAsyncWriter_AsyncCallOnSyncWriter); } } } @@ -162,12 +163,12 @@ private void VerifyCanCreateResponseMessage(bool synchronousCall) if (!this.rawOutputContext.WritingResponse) { - throw new ODataException(Strings.ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse); + throw new ODataException(SRResources.ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse); } if (responseMessageCreated) { - throw new ODataException(Strings.ODataAsyncWriter_CannotCreateResponseMoreThanOnce); + throw new ODataException(SRResources.ODataAsyncWriter_CannotCreateResponseMoreThanOnce); } } diff --git a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs index b1cabd52dc..9494e34beb 100644 --- a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs +++ b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs @@ -12,6 +12,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -185,7 +186,7 @@ protected bool ReadImplementation() default: Debug.Assert(false, "Unsupported collection reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCore_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataCollectionReaderCore_ReadImplementation)); } return result; @@ -368,7 +369,7 @@ private void VerifyCanRead(bool synchronousCall) if (this.State == ODataCollectionReaderState.Exception || this.State == ODataCollectionReaderState.Completed) { - throw new ODataException(Strings.ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState(this.State)); + throw new ODataException(Error.Format(SRResources.ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState, this.State)); } } @@ -395,7 +396,7 @@ private void VerifySynchronousCallAllowed() { if (!this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataCollectionReaderCore_SyncCallOnAsyncReader); + throw new ODataException(SRResources.ODataCollectionReaderCore_SyncCallOnAsyncReader); } } @@ -406,7 +407,7 @@ private void VerifyAsynchronousCallAllowed() { if (this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataCollectionReaderCore_AsyncCallOnSyncReader); + throw new ODataException(SRResources.ODataCollectionReaderCore_AsyncCallOnSyncReader); } } diff --git a/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs b/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs index 7bdaacbdd0..0fe85cd0e0 100644 --- a/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs +++ b/src/Microsoft.OData.Core/ODataCollectionReaderCoreAsync.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -80,7 +81,7 @@ protected override Task ReadAsynchronously() default: Debug.Assert(false, "Unsupported collection reader state " + this.State + " detected."); - return TaskUtils.GetFaultedTask(new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionReaderCoreAsync_ReadAsynchronously))); + return TaskUtils.GetFaultedTask(new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataCollectionReaderCoreAsync_ReadAsynchronously))); } } } diff --git a/src/Microsoft.OData.Core/ODataCollectionWriterCore.cs b/src/Microsoft.OData.Core/ODataCollectionWriterCore.cs index 7878b5080e..3f116f2660 100644 --- a/src/Microsoft.OData.Core/ODataCollectionWriterCore.cs +++ b/src/Microsoft.OData.Core/ODataCollectionWriterCore.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -253,7 +254,7 @@ void IODataOutputInStreamErrorListener.OnInStreamError() // introduce another top-level element in XML) if (this.State == CollectionWriterState.Completed) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), CollectionWriterState.Error.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), CollectionWriterState.Error.ToString())); } this.StartPayloadInStartState(); @@ -269,7 +270,7 @@ async Task IODataOutputInStreamErrorListener.OnInStreamErrorAsync() // We can't write error after the payload was finished as it might introduce another top-level element in XML if (this.State == CollectionWriterState.Completed) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), CollectionWriterState.Error.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), CollectionWriterState.Error.ToString())); } await this.StartPayloadInStartStateAsync() @@ -461,9 +462,9 @@ private void WriteEndImplementation() case CollectionWriterState.Start: // fall through case CollectionWriterState.Completed: // fall through case CollectionWriterState.Error: // fall through - throw new ODataException(Strings.ODataCollectionWriterCore_WriteEndCalledInInvalidState(currentScope.State.ToString())); + throw new ODataException(Error.Format(SRResources.ODataCollectionWriterCore_WriteEndCalledInInvalidState, currentScope.State.ToString())); default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionWriterCore_WriteEnd_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataCollectionWriterCore_WriteEnd_UnreachableCodePath)); } thisParam.LeaveScope(); @@ -490,14 +491,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataCollectionWriterCore_SyncCallOnAsyncWriter); + throw new ODataException(SRResources.ODataCollectionWriterCore_SyncCallOnAsyncWriter); } } else { if (this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataCollectionWriterCore_AsyncCallOnSyncWriter); + throw new ODataException(SRResources.ODataCollectionWriterCore_AsyncCallOnSyncWriter); } } } @@ -651,37 +652,37 @@ private void ValidateTransition(CollectionWriterState newState) case CollectionWriterState.Start: if (newState != CollectionWriterState.Collection && newState != CollectionWriterState.Completed) { - throw new ODataException(Strings.ODataCollectionWriterCore_InvalidTransitionFromStart(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromStart, this.State.ToString(), newState.ToString())); } break; case CollectionWriterState.Collection: if (newState != CollectionWriterState.Item && newState != CollectionWriterState.Completed) { - throw new ODataException(Strings.ODataCollectionWriterCore_InvalidTransitionFromCollection(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromCollection, this.State.ToString(), newState.ToString())); } break; case CollectionWriterState.Item: if (newState != CollectionWriterState.Completed) { - throw new ODataException(Strings.ODataCollectionWriterCore_InvalidTransitionFromItem(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromItem, this.State.ToString(), newState.ToString())); } break; case CollectionWriterState.Completed: // we should never see a state transition when in state 'Completed' - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), newState.ToString())); case CollectionWriterState.Error: if (newState != CollectionWriterState.Error) { // No more state transitions once we are in error state - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromError(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromError, this.State.ToString(), newState.ToString())); } break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionWriterCore_ValidateTransition_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataCollectionWriterCore_ValidateTransition_UnreachableCodePath)); } } @@ -804,9 +805,9 @@ private Task WriteEndImplementationAsync() case CollectionWriterState.Start: // fall through case CollectionWriterState.Completed: // fall through case CollectionWriterState.Error: // fall through - throw new ODataException(Strings.ODataCollectionWriterCore_WriteEndCalledInInvalidState(currentScope.State.ToString())); + throw new ODataException(Error.Format(SRResources.ODataCollectionWriterCore_WriteEndCalledInInvalidState, currentScope.State.ToString())); default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataCollectionWriterCore_WriteEnd_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataCollectionWriterCore_WriteEnd_UnreachableCodePath)); } await thisParam.LeaveScopeAsync().ConfigureAwait(false); diff --git a/src/Microsoft.OData.Core/ODataContentTypeException.cs b/src/Microsoft.OData.Core/ODataContentTypeException.cs index 5767c86f9a..31144826fd 100644 --- a/src/Microsoft.OData.Core/ODataContentTypeException.cs +++ b/src/Microsoft.OData.Core/ODataContentTypeException.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Diagnostics; @@ -20,7 +21,7 @@ public class ODataContentTypeException : ODataException /// current system culture. /// public ODataContentTypeException() - : this(Strings.ODataException_GeneralError) + : this(SRResources.ODataException_GeneralError) { } diff --git a/src/Microsoft.OData.Core/ODataContextUriBuilder.cs b/src/Microsoft.OData.Core/ODataContextUriBuilder.cs index e1d20c9c24..e3e64e2a4e 100644 --- a/src/Microsoft.OData.Core/ODataContextUriBuilder.cs +++ b/src/Microsoft.OData.Core/ODataContextUriBuilder.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -65,7 +66,7 @@ internal static ODataContextUriBuilder Create(Uri baseContextUrl, bool throwIfMi { if (baseContextUrl == null && throwIfMissingInfo) { - throw new ODataException(Strings.ODataOutputContext_MetadataDocumentUriMissing); + throw new ODataException(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } return new ODataContextUriBuilder(baseContextUrl, throwIfMissingInfo); @@ -97,7 +98,7 @@ internal Uri BuildContextUri(ODataPayloadKind payloadKind, ODataContextUrlInfo c } else { - throw new ODataException(Strings.ODataContextUriBuilder_UnsupportedPayloadKind(payloadKind.ToString())); + throw new ODataException(Error.Format(SRResources.ODataContextUriBuilder_UnsupportedPayloadKind, payloadKind.ToString())); } switch (payloadKind) @@ -242,7 +243,7 @@ private static void ValidateType(ODataContextUrlInfo contextUrlInfo) { if (string.IsNullOrEmpty(contextUrlInfo.TypeName)) { - throw new ODataException(Strings.ODataContextUriBuilder_TypeNameMissingForProperty); + throw new ODataException(SRResources.ODataContextUriBuilder_TypeNameMissingForProperty); } } @@ -254,7 +255,7 @@ private static void ValidateCollectionType(ODataContextUrlInfo contextUrlInfo) { if (string.IsNullOrEmpty(contextUrlInfo.TypeName)) { - throw new ODataException(Strings.ODataContextUriBuilder_TypeNameMissingForTopLevelCollection); + throw new ODataException(SRResources.ODataContextUriBuilder_TypeNameMissingForTopLevelCollection); } } @@ -270,7 +271,7 @@ private static void ValidateNavigationSource(ODataContextUrlInfo contextUrlInfo) { if (string.IsNullOrEmpty(contextUrlInfo.TypeName)) { - throw new ODataException(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + throw new ODataException(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); } return; @@ -284,7 +285,7 @@ private static void ValidateNavigationSource(ODataContextUrlInfo contextUrlInfo) contextUrlInfo.IsUnknownEntitySet && string.IsNullOrEmpty(contextUrlInfo.NavigationSource) && string.IsNullOrEmpty(contextUrlInfo.TypeName)) { - throw new ODataException(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + throw new ODataException(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); } } @@ -296,7 +297,7 @@ private static void ValidateResourcePath(ODataContextUrlInfo contextUrlInfo) { if (string.IsNullOrEmpty(contextUrlInfo.ResourcePath)) { - throw new ODataException(Strings.ODataContextUriBuilder_ODataUriMissingForIndividualProperty); + throw new ODataException(SRResources.ODataContextUriBuilder_ODataUriMissingForIndividualProperty); } } diff --git a/src/Microsoft.OData.Core/ODataContextUrlInfo.cs b/src/Microsoft.OData.Core/ODataContextUrlInfo.cs index 29469d9dd1..da4c2ff6ce 100644 --- a/src/Microsoft.OData.Core/ODataContextUrlInfo.cs +++ b/src/Microsoft.OData.Core/ODataContextUrlInfo.cs @@ -16,6 +16,7 @@ namespace Microsoft.OData using Microsoft.OData.UriParser.Aggregation; using Microsoft.OData.UriParser; using Microsoft.OData.Edm; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -302,7 +303,7 @@ private static string ComputeNavigationPath(EdmNavigationSourceKind kind, ODataU ODataPath odataPath = odataUri.Path.TrimEndingTypeAndKeySegments(); if (!(odataPath.LastSegment is NavigationPropertySegment) && !(odataPath.LastSegment is OperationSegment)) { - throw new ODataException(Strings.ODataContextUriBuilder_ODataPathInvalidForContainedElement(odataPath.ToContextUrlPathString())); + throw new ODataException(Error.Format(SRResources.ODataContextUriBuilder_ODataPathInvalidForContainedElement, odataPath.ToContextUrlPathString())); } navigationPath = odataPath.ToContextUrlPathString(); @@ -327,7 +328,7 @@ private static string ComputeNavigationPath(EdmNavigationSourceKind kind, in ODa ODataPath odataPath = odataUri.Path.TrimEndingTypeAndKeySegments(); if (!(odataPath.LastSegment is NavigationPropertySegment) && !(odataPath.LastSegment is OperationSegment)) { - throw new ODataException(Strings.ODataContextUriBuilder_ODataPathInvalidForContainedElement(odataPath.ToContextUrlPathString())); + throw new ODataException(Error.Format(SRResources.ODataContextUriBuilder_ODataPathInvalidForContainedElement, odataPath.ToContextUrlPathString())); } navigationPath = odataPath.ToContextUrlPathString(); } @@ -457,7 +458,7 @@ private static string GetTypeNameForValue(ODataValue value, IEdmModel model) if (primitive == null) { Debug.Assert(value is ODataStreamReferenceValue, "value is ODataStreamReferenceValue"); - throw new ODataException(Strings.ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource); + throw new ODataException(SRResources.ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource); } // Try convert to underlying type if the primitive value is unsigned int. diff --git a/src/Microsoft.OData.Core/ODataErrorException.cs b/src/Microsoft.OData.Core/ODataErrorException.cs index 2d84f214f8..fa18df1abe 100644 --- a/src/Microsoft.OData.Core/ODataErrorException.cs +++ b/src/Microsoft.OData.Core/ODataErrorException.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -29,7 +30,7 @@ public sealed class ODataErrorException : ODataException /// current system culture. The Error property will be initialized with an empty instance. /// public ODataErrorException() - : this(Strings.ODataErrorException_GeneralError) + : this(SRResources.ODataErrorException_GeneralError) { } @@ -62,7 +63,7 @@ public ODataErrorException(string message, Exception innerException) /// current system culture. /// public ODataErrorException(ODataError error) - : this(Strings.ODataErrorException_GeneralError, null, error) + : this(SRResources.ODataErrorException_GeneralError, null, error) { } diff --git a/src/Microsoft.OData.Core/ODataException.cs b/src/Microsoft.OData.Core/ODataException.cs index 1abc2550fd..5512e5c4e6 100644 --- a/src/Microsoft.OData.Core/ODataException.cs +++ b/src/Microsoft.OData.Core/ODataException.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Diagnostics; @@ -22,7 +23,7 @@ public class ODataException : InvalidOperationException /// current system culture. /// public ODataException() - : this(Strings.ODataException_GeneralError) + : this(SRResources.ODataException_GeneralError) { } diff --git a/src/Microsoft.OData.Core/ODataInputContext.cs b/src/Microsoft.OData.Core/ODataInputContext.cs index 8ed1fc6b6a..02bab23a24 100644 --- a/src/Microsoft.OData.Core/ODataInputContext.cs +++ b/src/Microsoft.OData.Core/ODataInputContext.cs @@ -12,6 +12,7 @@ namespace Microsoft.OData using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using System.Xml; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; @@ -634,7 +635,7 @@ protected virtual void Dispose(bool disposing) /// An exception to throw. private ODataException CreatePayloadKindNotSupportedException(ODataPayloadKind payloadKind) { - return new ODataException(Strings.ODataInputContext_UnsupportedPayloadKindForFormat(this.format.ToString(), payloadKind.ToString())); + return new ODataException(Error.Format(SRResources.ODataInputContext_UnsupportedPayloadKindForFormat, this.format.ToString(), payloadKind.ToString())); } } } diff --git a/src/Microsoft.OData.Core/ODataInstanceAnnotation.cs b/src/Microsoft.OData.Core/ODataInstanceAnnotation.cs index cd5531673c..8ea680a9a2 100644 --- a/src/Microsoft.OData.Core/ODataInstanceAnnotation.cs +++ b/src/Microsoft.OData.Core/ODataInstanceAnnotation.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { using System; using System.Xml; + using Microsoft.OData.Core; using Microsoft.OData.Json; /// @@ -37,7 +38,7 @@ internal ODataInstanceAnnotation(string annotationName, ODataValue annotationVal if (!isCustomAnnotation && ODataAnnotationNames.IsODataAnnotationName(annotationName)) { // isCustomAnnotation==true includes '@odata.', which won't cause the below exception. - throw new ArgumentException(Strings.ODataInstanceAnnotation_ReservedNamesNotAllowed(annotationName, ODataJsonConstants.ODataAnnotationNamespacePrefix)); + throw new ArgumentException(Error.Format(SRResources.ODataInstanceAnnotation_ReservedNamesNotAllowed, annotationName, ODataJsonConstants.ODataAnnotationNamespacePrefix)); } ValidateName(annotationName); @@ -64,7 +65,7 @@ internal static void ValidateName(string name) { if (name.IndexOf('.', StringComparison.Ordinal) < 0 || name[0] == '.' || name[name.Length - 1] == '.') { - throw new ArgumentException(Strings.ODataInstanceAnnotation_NeedPeriodInName(name)); + throw new ArgumentException(Error.Format(SRResources.ODataInstanceAnnotation_NeedPeriodInName, name)); } try @@ -73,7 +74,7 @@ internal static void ValidateName(string name) } catch (XmlException e) { - throw new ArgumentException(Strings.ODataInstanceAnnotation_BadTermName(name), e); + throw new ArgumentException(Error.Format(SRResources.ODataInstanceAnnotation_BadTermName, name), e); } } @@ -87,7 +88,7 @@ internal static void ValidateValue(ODataValue value) if (value is ODataStreamReferenceValue) { - throw new ArgumentException(Strings.ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue, nameof(value)); + throw new ArgumentException(SRResources.ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue, nameof(value)); } } } diff --git a/src/Microsoft.OData.Core/ODataMediaType.cs b/src/Microsoft.OData.Core/ODataMediaType.cs index df659dea1e..19fe4a8ea2 100644 --- a/src/Microsoft.OData.Core/ODataMediaType.cs +++ b/src/Microsoft.OData.Core/ODataMediaType.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System.Collections.Generic; @@ -224,7 +225,7 @@ private static Encoding EncodingFromName(string name) Encoding result = HttpUtils.GetEncodingFromCharsetName(name); if (result == null) { - throw new ODataException(Strings.MediaType_EncodingNotSupported(name)); + throw new ODataException(Error.Format(SRResources.MediaType_EncodingNotSupported, name)); } return result; diff --git a/src/Microsoft.OData.Core/ODataMessage.cs b/src/Microsoft.OData.Core/ODataMessage.cs index 9b0eccb924..0ec600ce56 100644 --- a/src/Microsoft.OData.Core/ODataMessage.cs +++ b/src/Microsoft.OData.Core/ODataMessage.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -252,7 +253,7 @@ protected void VerifyCanSetHeader() { if (!this.writing) { - throw new ODataException(Strings.ODataMessage_MustNotModifyMessage); + throw new ODataException(SRResources.ODataMessage_MustNotModifyMessage); } Debug.Assert(this.bufferingReadStream == null, "The buffering stream should only be used when reading."); @@ -268,8 +269,8 @@ private static void ValidateMessageStream(Stream stream, bool isRequest) if (stream == null) { string error = isRequest - ? Strings.ODataRequestMessage_MessageStreamIsNull - : Strings.ODataResponseMessage_MessageStreamIsNull; + ? SRResources.ODataRequestMessage_MessageStreamIsNull + : SRResources.ODataResponseMessage_MessageStreamIsNull; throw new ODataException(error); } } @@ -284,8 +285,8 @@ private static void ValidateMessageStreamTask(Task streamTask, bool isRe if (streamTask == null) { string error = isRequest - ? Strings.ODataRequestMessage_StreamTaskIsNull - : Strings.ODataResponseMessage_StreamTaskIsNull; + ? SRResources.ODataRequestMessage_StreamTaskIsNull + : SRResources.ODataResponseMessage_StreamTaskIsNull; throw new ODataException(error); } } diff --git a/src/Microsoft.OData.Core/ODataMessageReader.cs b/src/Microsoft.OData.Core/ODataMessageReader.cs index 00338fa61c..d8007162b7 100644 --- a/src/Microsoft.OData.Core/ODataMessageReader.cs +++ b/src/Microsoft.OData.Core/ODataMessageReader.cs @@ -17,6 +17,7 @@ namespace Microsoft.OData using System.Threading.Tasks; using System.Xml; using Microsoft.Extensions.DependencyInjection; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -117,7 +118,7 @@ public ODataMessageReader(IODataRequestMessage requestMessage, ODataMessageReade ODataVersion requestedVersion = ODataUtilsInternal.GetODataVersion(this.message, this.settings.MaxProtocolVersion); if (requestedVersion > this.settings.MaxProtocolVersion) { - throw new ODataException(Strings.ODataUtils_MaxProtocolVersionExceeded(ODataUtils.ODataVersionToString(requestedVersion), ODataUtils.ODataVersionToString(this.settings.MaxProtocolVersion))); + throw new ODataException(Error.Format(SRResources.ODataUtils_MaxProtocolVersionExceeded, ODataUtils.ODataVersionToString(requestedVersion), ODataUtils.ODataVersionToString(this.settings.MaxProtocolVersion))); } this.model = model ?? GetModel(this.serviceProvider); @@ -162,7 +163,7 @@ public ODataMessageReader(IODataResponseMessage responseMessage, ODataMessageRea ODataVersion requestedVersion = ODataUtilsInternal.GetODataVersion(this.message, this.settings.MaxProtocolVersion); if (requestedVersion > this.settings.MaxProtocolVersion) { - throw new ODataException(Strings.ODataUtils_MaxProtocolVersionExceeded(ODataUtils.ODataVersionToString(requestedVersion), ODataUtils.ODataVersionToString(this.settings.MaxProtocolVersion))); + throw new ODataException(Error.Format(SRResources.ODataUtils_MaxProtocolVersionExceeded, ODataUtils.ODataVersionToString(requestedVersion), ODataUtils.ODataVersionToString(this.settings.MaxProtocolVersion))); } this.model = model ?? GetModel(this.serviceProvider); @@ -882,7 +883,7 @@ internal ODataFormat GetFormat() { if (this.format == null) { - throw new ODataException(Strings.ODataMessageReader_GetFormatCalledBeforeReadingStarted); + throw new ODataException(SRResources.ODataMessageReader_GetFormatCalledBeforeReadingStarted); } return this.format; @@ -949,7 +950,7 @@ private string GetContentTypeHeader(params ODataPayloadKind[] payloadKinds) { if (this.GetContentLengthHeader() != 0) { - throw new ODataContentTypeException(Strings.ODataMessageReader_NoneOrEmptyContentTypeHeader); + throw new ODataContentTypeException(SRResources.ODataMessageReader_NoneOrEmptyContentTypeHeader); } // Set a default format if content type is null and content length is 0. @@ -995,12 +996,12 @@ private void VerifyCanCreateODataResourceSetReader(IEdmEntitySetBase entitySet, { if (entitySet != null) { - throw new ArgumentException(Strings.ODataMessageReader_EntitySetSpecifiedWithoutMetadata("entitySet"), nameof(entitySet)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_EntitySetSpecifiedWithoutMetadata, "entitySet"), nameof(entitySet)); } if (expectedBaseResourceType != null) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata("expectedBaseEntityType"), "expectedBaseEntityType"); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, "expectedBaseEntityType"), "expectedBaseEntityType"); } } } @@ -1016,19 +1017,19 @@ private void VerifyCanCreateODataDeltaReader(IEdmEntitySetBase entitySet, IEdmEn if (!this.readingResponse) { - throw new ODataException(Strings.ODataMessageReader_DeltaInRequest); + throw new ODataException(SRResources.ODataMessageReader_DeltaInRequest); } if (!this.model.IsUserModel()) { if (entitySet != null) { - throw new ArgumentException(Strings.ODataMessageReader_EntitySetSpecifiedWithoutMetadata("entitySet"), nameof(entitySet)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_EntitySetSpecifiedWithoutMetadata, "entitySet"), nameof(entitySet)); } if (expectedBaseEntityType != null) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata("expectedBaseEntityType"), nameof(expectedBaseEntityType)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, "expectedBaseEntityType"), nameof(expectedBaseEntityType)); } } } @@ -1046,12 +1047,12 @@ private void VerifyCanCreateODataResourceReader(IEdmNavigationSource navigationS { if (navigationSource != null) { - throw new ArgumentException(Strings.ODataMessageReader_EntitySetSpecifiedWithoutMetadata("navigationSource"), nameof(navigationSource)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_EntitySetSpecifiedWithoutMetadata, "navigationSource"), nameof(navigationSource)); } if (resourceType != null) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata("resourceType"), nameof(resourceType)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, "resourceType"), nameof(resourceType)); } } } @@ -1069,7 +1070,7 @@ private void VerifyCanCreateODataCollectionReader(IEdmTypeReference expectedItem { if (!this.model.IsUserModel()) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata("expectedItemTypeReference"), nameof(expectedItemTypeReference)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, "expectedItemTypeReference"), nameof(expectedItemTypeReference)); } if (!expectedItemTypeReference.IsODataPrimitiveTypeKind() @@ -1077,7 +1078,7 @@ private void VerifyCanCreateODataCollectionReader(IEdmTypeReference expectedItem && expectedItemTypeReference.TypeKind() != EdmTypeKind.Enum) { throw new ArgumentException( - Strings.ODataMessageReader_ExpectedCollectionTypeWrongKind(expectedItemTypeReference.TypeKind().ToString()), + Error.Format(SRResources.ODataMessageReader_ExpectedCollectionTypeWrongKind, expectedItemTypeReference.TypeKind().ToString()), nameof(expectedItemTypeReference)); } } @@ -1109,12 +1110,12 @@ private void VerifyCanCreateODataParameterReader(IEdmOperation operation) if (this.readingResponse) { - throw new ODataException(Strings.ODataMessageReader_ParameterPayloadInResponse); + throw new ODataException(SRResources.ODataMessageReader_ParameterPayloadInResponse); } if (operation != null && !this.model.IsUserModel()) { - throw new ArgumentException(Strings.ODataMessageReader_OperationSpecifiedWithoutMetadata("operation"), nameof(operation)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_OperationSpecifiedWithoutMetadata, "operation"), nameof(operation)); } } @@ -1127,7 +1128,7 @@ private void VerifyCanReadServiceDocument() if (!this.readingResponse) { - throw new ODataException(Strings.ODataMessageReader_ServiceDocumentInRequest); + throw new ODataException(SRResources.ODataMessageReader_ServiceDocumentInRequest); } } @@ -1140,7 +1141,7 @@ private void VerifyCanReadMetadataDocument() if (!this.readingResponse) { - throw new ODataException(Strings.ODataMessageReader_MetadataDocumentInRequest); + throw new ODataException(SRResources.ODataMessageReader_MetadataDocumentInRequest); } } @@ -1170,22 +1171,22 @@ private void VerifyCanReadProperty(IEdmTypeReference expectedPropertyTypeReferen { if (!this.model.IsUserModel()) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata("expectedPropertyTypeReference"), nameof(expectedPropertyTypeReference)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, "expectedPropertyTypeReference"), nameof(expectedPropertyTypeReference)); } IEdmCollectionType collectionType = expectedPropertyTypeReference.Definition as IEdmCollectionType; if (collectionType != null && collectionType.ElementType.IsODataEntityTypeKind()) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind, nameof(expectedPropertyTypeReference)); + throw new ArgumentException(SRResources.ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind, nameof(expectedPropertyTypeReference)); } if (expectedPropertyTypeReference.IsODataEntityTypeKind()) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedPropertyTypeEntityKind, nameof(expectedPropertyTypeReference)); + throw new ArgumentException(SRResources.ODataMessageReader_ExpectedPropertyTypeEntityKind, nameof(expectedPropertyTypeReference)); } else if (expectedPropertyTypeReference.IsStream()) { - throw new ArgumentException(Strings.ODataMessageReader_ExpectedPropertyTypeStream, nameof(expectedPropertyTypeReference)); + throw new ArgumentException(SRResources.ODataMessageReader_ExpectedPropertyTypeStream, nameof(expectedPropertyTypeReference)); } } } @@ -1200,7 +1201,7 @@ private void VerifyCanReadError() if (!this.readingResponse) { // top-level errors can only be read for response messages - throw new ODataException(Strings.ODataMessageReader_ErrorPayloadInRequest); + throw new ODataException(SRResources.ODataMessageReader_ErrorPayloadInRequest); } } @@ -1235,7 +1236,7 @@ private ODataPayloadKind[] VerifyCanReadValue(IEdmTypeReference expectedTypeRefe if (!expectedTypeReference.IsODataPrimitiveTypeKind() && !expectedTypeReference.IsODataTypeDefinitionTypeKind()) { throw new ArgumentException( - Strings.ODataMessageReader_ExpectedValueTypeWrongKind(expectedTypeReference.TypeKind().ToString()), + Error.Format(SRResources.ODataMessageReader_ExpectedValueTypeWrongKind, expectedTypeReference.TypeKind().ToString()), nameof(expectedTypeReference)); } @@ -1261,12 +1262,12 @@ private void VerifyReaderNotDisposedAndNotUsed() this.VerifyNotDisposed(); if (this.readMethodCalled) { - throw new ODataException(Strings.ODataMessageReader_ReaderAlreadyUsed); + throw new ODataException(SRResources.ODataMessageReader_ReaderAlreadyUsed); } if (this.message.BufferingReadStream != null && this.message.BufferingReadStream.IsBuffering) { - throw new ODataException(Strings.ODataMessageReader_PayloadKindDetectionRunning); + throw new ODataException(SRResources.ODataMessageReader_PayloadKindDetectionRunning); } this.readMethodCalled = true; @@ -1342,7 +1343,7 @@ private bool TryGetSinglePayloadKindResultFromContentType(out IEnumerable @@ -123,7 +124,7 @@ public override Task CreateInputContextAsync( ExceptionUtils.CheckArgumentNotNull(messageInfo, "messageInfo"); ExceptionUtils.CheckArgumentNotNull(messageReaderSettings, "messageReaderSettings"); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataMetadataFormat_CreateInputContextAsync)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataMetadataFormat_CreateInputContextAsync)); } /// diff --git a/src/Microsoft.OData.Core/ODataMetadataInputContext.cs b/src/Microsoft.OData.Core/ODataMetadataInputContext.cs index b5949bf5b1..2d5bf4d155 100644 --- a/src/Microsoft.OData.Core/ODataMetadataInputContext.cs +++ b/src/Microsoft.OData.Core/ODataMetadataInputContext.cs @@ -14,6 +14,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; +using Microsoft.OData.Core; namespace Microsoft.OData { @@ -93,7 +94,7 @@ internal override IEdmModel ReadMetadataDocument(CsdlReaderSettingsBase csdlRead builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataInputContext_ErrorReadingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataInputContext_ErrorReadingMetadata, builder.ToString())); } Debug.Assert(model != null, "model != null"); @@ -169,7 +170,7 @@ private IEdmModel ReadMetadataDocumentImplementation(Func getRef builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataInputContext_ErrorReadingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataInputContext_ErrorReadingMetadata, builder.ToString())); } Debug.Assert(model != null, "model != null"); diff --git a/src/Microsoft.OData.Core/ODataMetadataJsonInputContext.cs b/src/Microsoft.OData.Core/ODataMetadataJsonInputContext.cs index 9ab488aaf7..f65c0e8974 100644 --- a/src/Microsoft.OData.Core/ODataMetadataJsonInputContext.cs +++ b/src/Microsoft.OData.Core/ODataMetadataJsonInputContext.cs @@ -10,6 +10,7 @@ using System.IO; using System.Text; using System.Text.Json; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; @@ -79,7 +80,7 @@ internal override IEdmModel ReadMetadataDocument(CsdlReaderSettingsBase csdlRead builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataInputContext_ErrorReadingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataInputContext_ErrorReadingMetadata, builder.ToString())); } Debug.Assert(model != null, "model != null"); diff --git a/src/Microsoft.OData.Core/ODataMetadataJsonOutputContext.cs b/src/Microsoft.OData.Core/ODataMetadataJsonOutputContext.cs index 2559c0ad01..f9eb077d11 100644 --- a/src/Microsoft.OData.Core/ODataMetadataJsonOutputContext.cs +++ b/src/Microsoft.OData.Core/ODataMetadataJsonOutputContext.cs @@ -12,6 +12,7 @@ using System.Text.Encodings.Web; using System.Text.Json; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; @@ -248,7 +249,7 @@ private void WriteMetadataDocumentImplementation() builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataOutputContext_ErrorWritingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataOutputContext_ErrorWritingMetadata, builder.ToString())); } } @@ -270,7 +271,7 @@ private async Task WriteMetadataDocumentImplementationAsync() builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataOutputContext_ErrorWritingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataOutputContext_ErrorWritingMetadata, builder.ToString())); } } diff --git a/src/Microsoft.OData.Core/ODataMetadataOutputContext.cs b/src/Microsoft.OData.Core/ODataMetadataOutputContext.cs index 2be0413502..cbc211d4b8 100644 --- a/src/Microsoft.OData.Core/ODataMetadataOutputContext.cs +++ b/src/Microsoft.OData.Core/ODataMetadataOutputContext.cs @@ -15,6 +15,7 @@ using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; using Microsoft.OData.Edm; +using Microsoft.OData.Core; namespace Microsoft.OData { @@ -272,7 +273,7 @@ private void WriteMetadataDocumentImplementation() builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataOutputContext_ErrorWritingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataOutputContext_ErrorWritingMetadata, builder.ToString())); } } @@ -296,7 +297,7 @@ private async Task WriteMetadataDocumentImplementationAsync() builder.AppendLine(error.ToString()); } - throw new ODataException(Strings.ODataMetadataOutputContext_ErrorWritingMetadata(builder.ToString())); + throw new ODataException(Error.Format(SRResources.ODataMetadataOutputContext_ErrorWritingMetadata, builder.ToString())); } } } diff --git a/src/Microsoft.OData.Core/ODataOutputContext.cs b/src/Microsoft.OData.Core/ODataOutputContext.cs index 52094334d7..839242d1a1 100644 --- a/src/Microsoft.OData.Core/ODataOutputContext.cs +++ b/src/Microsoft.OData.Core/ODataOutputContext.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -701,7 +702,7 @@ protected virtual ValueTask DisposeAsyncCore() /// An exception to throw. private ODataException CreatePayloadKindNotSupportedException(ODataPayloadKind payloadKind) { - return new ODataException(Strings.ODataOutputContext_UnsupportedPayloadKindForFormat(this.format.ToString(), payloadKind.ToString())); + return new ODataException(Error.Format(SRResources.ODataOutputContext_UnsupportedPayloadKindForFormat, this.format.ToString(), payloadKind.ToString())); } } } diff --git a/src/Microsoft.OData.Core/ODataParameterReaderCore.cs b/src/Microsoft.OData.Core/ODataParameterReaderCore.cs index 569f1c3752..7b4bcdce2f 100644 --- a/src/Microsoft.OData.Core/ODataParameterReaderCore.cs +++ b/src/Microsoft.OData.Core/ODataParameterReaderCore.cs @@ -14,6 +14,7 @@ namespace Microsoft.OData using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; @@ -235,7 +236,7 @@ protected internal IEdmTypeReference GetParameterTypeReference(string parameterN IEdmOperationParameter parameter = this.Operation.FindParameter(parameterName); if (parameter == null) { - throw new ODataException(Strings.ODataParameterReaderCore_ParameterNameNotInMetadata(parameterName, this.Operation.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_ParameterNameNotInMetadata, parameterName, this.Operation.Name)); } return this.inputContext.EdmTypeResolver.GetParameterType(parameter); @@ -254,7 +255,7 @@ protected internal void EnterScope(ODataParameterReaderState state, string name, { if (value != null && !EdmLibraryExtensions.IsPrimitiveType(value.GetType()) && !(value is ODataEnumValue)) { - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterReaderCore_ValueMustBePrimitiveOrNull)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterReaderCore_ValueMustBePrimitiveOrNull)); } } @@ -291,7 +292,7 @@ protected internal void EnterScope(ODataParameterReaderState state, string name, if (missingParameters.Count > 0) { this.scopes.Push(new Scope(ODataParameterReaderState.Exception, null, null)); - throw new ODataException(Strings.ODataParameterReaderCore_ParametersMissingInPayload(this.Operation.Name, string.Join(",", missingParameters.ToArray()))); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_ParametersMissingInPayload, this.Operation.Name, string.Join(",", missingParameters.ToArray()))); } } else if (name != null) @@ -299,7 +300,7 @@ protected internal void EnterScope(ODataParameterReaderState state, string name, // Record the parameter names we read and check for duplicates. if (this.parametersRead.Contains(name)) { - throw new ODataException(Strings.ODataParameterReaderCore_DuplicateParametersInPayload(name)); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_DuplicateParametersInPayload, name)); } this.parametersRead.Add(name); @@ -370,11 +371,11 @@ protected bool ReadImplementation() case ODataParameterReaderState.Exception: // fall through case ODataParameterReaderState.Completed: Debug.Assert(false, "This case should have been caught earlier."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterReaderCore_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterReaderCore_ReadImplementation)); default: Debug.Assert(false, "Unsupported parameter reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterReaderCore_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterReaderCore_ReadImplementation)); } return result; @@ -445,13 +446,13 @@ protected void VerifyCanCreateSubReader(ODataParameterReaderState expectedState) if (this.State != expectedState) { - throw new ODataException(Strings.ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState(ODataParameterReaderCore.GetCreateReaderMethodName(expectedState), this.State)); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState, ODataParameterReaderCore.GetCreateReaderMethodName(expectedState), this.State)); } if (this.subReaderState != SubReaderState.None) { Debug.Assert(this.Name != null, "this.Name != null"); - throw new ODataException(Strings.ODataParameterReaderCore_CreateReaderAlreadyCalled(ODataParameterReaderCore.GetCreateReaderMethodName(expectedState), this.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_CreateReaderAlreadyCalled, ODataParameterReaderCore.GetCreateReaderMethodName(expectedState), this.Name)); } } @@ -528,18 +529,18 @@ private void VerifyCanRead(bool synchronousCall) if (this.State == ODataParameterReaderState.Exception || this.State == ODataParameterReaderState.Completed) { - throw new ODataException(Strings.ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState(this.State)); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState, this.State)); } if (this.State == ODataParameterReaderState.Resource || this.State == ODataParameterReaderState.ResourceSet || this.State == ODataParameterReaderState.Collection) { if (this.subReaderState == SubReaderState.None) { - throw new ODataException(Strings.ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall(this.State, ODataParameterReaderCore.GetCreateReaderMethodName(this.State))); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall, this.State, ODataParameterReaderCore.GetCreateReaderMethodName(this.State))); } else if (this.subReaderState == SubReaderState.Active) { - throw new ODataException(Strings.ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall(this.State, ODataParameterReaderCore.GetCreateReaderMethodName(this.State))); + throw new ODataException(Error.Format(SRResources.ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall, this.State, ODataParameterReaderCore.GetCreateReaderMethodName(this.State))); } } } @@ -567,7 +568,7 @@ private void VerifySynchronousCallAllowed() { if (!this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataParameterReaderCore_SyncCallOnAsyncReader); + throw new ODataException(SRResources.ODataParameterReaderCore_SyncCallOnAsyncReader); } } @@ -578,7 +579,7 @@ private void VerifyAsynchronousCallAllowed() { if (this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataParameterReaderCore_AsyncCallOnSyncReader); + throw new ODataException(SRResources.ODataParameterReaderCore_AsyncCallOnSyncReader); } } diff --git a/src/Microsoft.OData.Core/ODataParameterReaderCoreAsync.cs b/src/Microsoft.OData.Core/ODataParameterReaderCoreAsync.cs index 52fdce4ff3..5ebaa33ae5 100644 --- a/src/Microsoft.OData.Core/ODataParameterReaderCoreAsync.cs +++ b/src/Microsoft.OData.Core/ODataParameterReaderCoreAsync.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -175,11 +176,11 @@ protected override async Task ReadAsynchronously() case ODataParameterReaderState.Exception: // fall through case ODataParameterReaderState.Completed: Debug.Assert(false, "This case should have been caught earlier."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterReaderCoreAsync_ReadAsynchronously)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterReaderCoreAsync_ReadAsynchronously)); default: Debug.Assert(false, "Unsupported parameter reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterReaderCoreAsync_ReadAsynchronously)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterReaderCoreAsync_ReadAsynchronously)); } } } diff --git a/src/Microsoft.OData.Core/ODataParameterWriterCore.cs b/src/Microsoft.OData.Core/ODataParameterWriterCore.cs index 9908090156..13a8a17258 100644 --- a/src/Microsoft.OData.Core/ODataParameterWriterCore.cs +++ b/src/Microsoft.OData.Core/ODataParameterWriterCore.cs @@ -14,6 +14,7 @@ namespace Microsoft.OData using System.IO; using System.Linq; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -326,7 +327,7 @@ void IODataOutputInStreamErrorListener.OnInStreamError() { // The parameter payload is written by the client and read by the server, we do not support // writing an in-stream error payload in this scenario. - throw new ODataException(Strings.ODataParameterWriter_InStreamErrorNotSupported); + throw new ODataException(SRResources.ODataParameterWriter_InStreamErrorNotSupported); } /// @@ -334,7 +335,7 @@ Task IODataOutputInStreamErrorListener.OnInStreamErrorAsync() { // The parameter payload is written by the client and read by the server, we do not support // writing an in-stream error payload in this scenario. - throw new ODataException(Strings.ODataParameterWriter_InStreamErrorNotSupported); + throw new ODataException(SRResources.ODataParameterWriter_InStreamErrorNotSupported); } /// @@ -451,7 +452,7 @@ private void VerifyCanWriteStart(bool synchronousCall) this.VerifyCallAllowed(synchronousCall); if (this.State != ParameterWriterState.Start) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteStart); + throw new ODataException(SRResources.ODataParameterWriterCore_CannotWriteStart); } } @@ -480,12 +481,12 @@ private IEdmTypeReference VerifyCanWriteParameterAndGetTypeReference(bool synchr this.VerifyNotInErrorOrCompletedState(); if (this.State != ParameterWriterState.CanWriteParameter) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteParameter); + throw new ODataException(SRResources.ODataParameterWriterCore_CannotWriteParameter); } if (this.parameterNamesWritten.Contains(parameterName)) { - throw new ODataException(Strings.ODataParameterWriterCore_DuplicatedParameterNameNotAllowed(parameterName)); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_DuplicatedParameterNameNotAllowed, parameterName)); } this.parameterNamesWritten.Add(parameterName); @@ -505,12 +506,12 @@ private IEdmTypeReference VerifyCanWriteValueParameter(bool synchronousCall, str IEdmTypeReference parameterTypeReference = this.VerifyCanWriteParameterAndGetTypeReference(synchronousCall, parameterName); if (parameterTypeReference != null && !parameterTypeReference.IsODataPrimitiveTypeKind() && !parameterTypeReference.IsODataEnumTypeKind() && !parameterTypeReference.IsODataTypeDefinitionTypeKind()) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind, parameterName, parameterTypeReference.TypeKind())); } if (parameterValue != null && (!EdmLibraryExtensions.IsPrimitiveType(parameterValue.GetType()) || parameterValue is Stream) && !(parameterValue is ODataEnumValue)) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType(parameterName, parameterValue.GetType())); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType, parameterName, parameterValue.GetType())); } return parameterTypeReference; @@ -530,7 +531,7 @@ private IEdmTypeReference VerifyCanCreateCollectionWriter(bool synchronousCall, // TODO : Change to structureds Collection check if (parameterTypeReference != null && !parameterTypeReference.IsNonEntityCollectionType()) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind, parameterName, parameterTypeReference.TypeKind())); } return parameterTypeReference == null ? null : parameterTypeReference.GetCollectionItemType(); @@ -548,7 +549,7 @@ private IEdmTypeReference VerifyCanCreateResourceWriter(bool synchronousCall, st IEdmTypeReference parameterTypeReference = this.VerifyCanWriteParameterAndGetTypeReference(synchronousCall, parameterName); if (parameterTypeReference != null && !parameterTypeReference.IsStructured()) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind, parameterName, parameterTypeReference.TypeKind())); } return parameterTypeReference; @@ -566,7 +567,7 @@ private IEdmTypeReference VerifyCanCreateResourceSetWriter(bool synchronousCall, IEdmTypeReference parameterTypeReference = this.VerifyCanWriteParameterAndGetTypeReference(synchronousCall, parameterName); if (parameterTypeReference != null && !parameterTypeReference.IsStructuredCollectionType()) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind(parameterName, parameterTypeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind, parameterName, parameterTypeReference.TypeKind())); } return parameterTypeReference; @@ -584,7 +585,7 @@ private IEdmTypeReference GetParameterTypeReference(string parameterName) IEdmOperationParameter parameter = this.operation.FindParameter(parameterName); if (parameter == null) { - throw new ODataException(Strings.ODataParameterWriterCore_ParameterNameNotFoundInOperation(parameterName, this.operation.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_ParameterNameNotFoundInOperation, parameterName, this.operation.Name)); } return this.outputContext.EdmTypeResolver.GetParameterType(parameter); @@ -661,7 +662,7 @@ private void VerifyCanWriteEnd(bool synchronousCall) this.VerifyNotInErrorOrCompletedState(); if (this.State != ParameterWriterState.CanWriteParameter) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteEnd); + throw new ODataException(SRResources.ODataParameterWriterCore_CannotWriteEnd); } this.VerifyAllParametersWritten(); @@ -695,7 +696,7 @@ private void VerifyAllParametersWritten() missingParameters = missingParameters.Select(name => String.Format(CultureInfo.InvariantCulture, "'{0}'", name)); // We're calling the ToArray here since not all platforms support the string.Join which takes IEnumerable. - throw new ODataException(Strings.ODataParameterWriterCore_MissingParameterInParameterPayload(string.Join(", ", missingParameters.ToArray()), this.operation.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_MissingParameterInParameterPayload, string.Join(", ", missingParameters.ToArray()), this.operation.Name)); } } } @@ -716,7 +717,7 @@ private void VerifyNotInErrorOrCompletedState() { if (this.State == ParameterWriterState.Error || this.State == ParameterWriterState.Completed) { - throw new ODataException(Strings.ODataParameterWriterCore_CannotWriteInErrorOrCompletedState); + throw new ODataException(SRResources.ODataParameterWriterCore_CannotWriteInErrorOrCompletedState); } } @@ -740,14 +741,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataParameterWriterCore_SyncCallOnAsyncWriter); + throw new ODataException(SRResources.ODataParameterWriterCore_SyncCallOnAsyncWriter); } } else { if (this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataParameterWriterCore_AsyncCallOnSyncWriter); + throw new ODataException(SRResources.ODataParameterWriterCore_AsyncCallOnSyncWriter); } } } @@ -902,37 +903,37 @@ private void ValidateTransition(ParameterWriterState newState) case ParameterWriterState.Start: if (newState != ParameterWriterState.CanWriteParameter && newState != ParameterWriterState.Completed) { - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromStart)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromStart)); } break; case ParameterWriterState.CanWriteParameter: if (newState != ParameterWriterState.CanWriteParameter && newState != ParameterWriterState.ActiveSubWriter && newState != ParameterWriterState.Completed) { - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromCanWriteParameter)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromCanWriteParameter)); } break; case ParameterWriterState.ActiveSubWriter: if (newState != ParameterWriterState.CanWriteParameter) { - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromActiveSubWriter)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromActiveSubWriter)); } break; case ParameterWriterState.Completed: // we should never see a state transition when in state 'Completed' - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromCompleted)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromCompleted)); case ParameterWriterState.Error: if (newState != ParameterWriterState.Error) { // No more state transitions once we are in error state - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromError)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_InvalidTransitionFromError)); } break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataParameterWriterCore_ValidateTransition_UnreachableCodePath)); } } diff --git a/src/Microsoft.OData.Core/ODataPayloadValueConverter.cs b/src/Microsoft.OData.Core/ODataPayloadValueConverter.cs index c0aeea9694..d375147100 100644 --- a/src/Microsoft.OData.Core/ODataPayloadValueConverter.cs +++ b/src/Microsoft.OData.Core/ODataPayloadValueConverter.cs @@ -13,7 +13,7 @@ namespace Microsoft.OData using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class for defining a payload value conversion for given model. Currently supports primitive only. @@ -84,7 +84,7 @@ public virtual object ConvertFromPayloadValue(object value, IEdmTypeReference ed if (targetType != typeof(Decimal)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertDecimal(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertDecimal, primitiveTypeReference.FullName())); } } else if (value is Double) @@ -95,21 +95,21 @@ public virtual object ConvertFromPayloadValue(object value, IEdmTypeReference ed { if (targetType != typeof(bool)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertBoolean(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertBoolean, primitiveTypeReference.FullName())); } } else if (value is DateTime) { if (targetType != typeof(DateTime)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertDateTime(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertDateTime, primitiveTypeReference.FullName())); } } else if (value is DateTimeOffset) { if (targetType != typeof(DateTimeOffset)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertDateTimeOffset(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertDateTimeOffset, primitiveTypeReference.FullName())); } } } @@ -253,7 +253,7 @@ private static object ConvertInt32Value(int intValue, Type targetType, IEdmPrimi if (targetType != typeof(Int32)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertInt32(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertInt32, primitiveTypeReference.FullName())); } return intValue; @@ -282,7 +282,7 @@ private static object ConvertDoubleValue(double doubleValue, Type targetType, IE if (targetType != typeof(Double)) { - throw new ODataException(ODataErrorStrings.ODataJsonReaderUtils_CannotConvertDouble(primitiveTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataJsonReaderUtils_CannotConvertDouble, primitiveTypeReference.FullName())); } return doubleValue; diff --git a/src/Microsoft.OData.Core/ODataRawOutputContext.cs b/src/Microsoft.OData.Core/ODataRawOutputContext.cs index 35ac1dd1ca..2c140c1827 100644 --- a/src/Microsoft.OData.Core/ODataRawOutputContext.cs +++ b/src/Microsoft.OData.Core/ODataRawOutputContext.cs @@ -13,6 +13,7 @@ namespace Microsoft.OData using System.IO; using System.Text; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Metadata; #endregion Namespaces @@ -160,7 +161,7 @@ internal override void WriteInStreamError(ODataError error, bool includeDebugInf this.outputInStreamErrorListener.OnInStreamError(); } - throw new ODataException(Strings.ODataMessageWriter_CannotWriteInStreamErrorForRawValues); + throw new ODataException(SRResources.ODataMessageWriter_CannotWriteInStreamErrorForRawValues); } /// @@ -189,7 +190,7 @@ await this.outputInStreamErrorListener.OnInStreamErrorAsync() .ConfigureAwait(false); } - throw new ODataException(Strings.ODataMessageWriter_CannotWriteInStreamErrorForRawValues); + throw new ODataException(SRResources.ODataMessageWriter_CannotWriteInStreamErrorForRawValues); } /// diff --git a/src/Microsoft.OData.Core/ODataRawValueUtils.cs b/src/Microsoft.OData.Core/ODataRawValueUtils.cs index af56776d38..0c5e04a8e8 100644 --- a/src/Microsoft.OData.Core/ODataRawValueUtils.cs +++ b/src/Microsoft.OData.Core/ODataRawValueUtils.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Xml; using Microsoft.OData.Edm; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -218,7 +219,7 @@ internal static object ConvertStringToPrimitive(string text, IEdmPrimitiveTypeRe default: // Note that Astoria supports XElement and Binary as well, but they are serialized as string or byte[] // and the metadata will actually talk about string and byte[] as well. Astoria will perform the conversion if necessary. - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataRawValueUtils_ConvertStringToPrimitive)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataRawValueUtils_ConvertStringToPrimitive)); } } catch (Exception e) diff --git a/src/Microsoft.OData.Core/ODataReaderCore.cs b/src/Microsoft.OData.Core/ODataReaderCore.cs index be56ef3582..d1f6da04b4 100644 --- a/src/Microsoft.OData.Core/ODataReaderCore.cs +++ b/src/Microsoft.OData.Core/ODataReaderCore.cs @@ -15,6 +15,7 @@ namespace Microsoft.OData using System.IO; using System.Linq; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; @@ -408,14 +409,14 @@ public override sealed Stream CreateReadStream() { if (this.State != ODataReaderState.Stream) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } StreamScope scope = this.CurrentScope as StreamScope; Debug.Assert(scope != null, "ODataReaderState.Stream when Scope is not a StreamScope"); if (scope.StreamingState != StreamingState.None) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } scope.StreamingState = StreamingState.Streaming; @@ -434,7 +435,7 @@ public override sealed TextReader CreateTextReader() Debug.Assert(scope != null, "ODataReaderState.Stream when Scope is not a StreamScope"); if (scope.StreamingState != StreamingState.None) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } scope.StreamingState = StreamingState.Streaming; @@ -442,7 +443,7 @@ public override sealed TextReader CreateTextReader() } else { - throw new ODataException(Strings.ODataReaderCore_CreateTextReaderCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateTextReaderCalledInInvalidState); } } @@ -822,7 +823,7 @@ protected void IncreaseResourceDepth() if (this.currentResourceDepth > this.inputContext.MessageReaderSettings.MessageQuotas.MaxNestingDepth) { - throw new ODataException(Strings.ValidationUtils_MaxDepthOfNestedEntriesExceeded(this.inputContext.MessageReaderSettings.MessageQuotas.MaxNestingDepth)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_MaxDepthOfNestedEntriesExceeded, this.inputContext.MessageReaderSettings.MessageQuotas.MaxNestingDepth)); } } @@ -917,11 +918,11 @@ private bool ReadImplementation() case ODataReaderState.Exception: // fall through case ODataReaderState.Completed: - throw new ODataException(Strings.ODataReaderCore_NoReadCallsAllowed(this.State)); + throw new ODataException(Error.Format(SRResources.ODataReaderCore_NoReadCallsAllowed, this.State)); default: Debug.Assert(false, "Unsupported reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataReaderCore_ReadImplementation)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataReaderCore_ReadImplementation)); } return result; @@ -989,7 +990,7 @@ private void VerifyCanRead(bool synchronousCall) if (this.State == ODataReaderState.Exception || this.State == ODataReaderState.Completed) { - throw new ODataException(Strings.ODataReaderCore_ReadOrReadAsyncCalledInInvalidState(this.State)); + throw new ODataException(Error.Format(SRResources.ODataReaderCore_ReadOrReadAsyncCalledInInvalidState, this.State)); } if (this.State == ODataReaderState.Stream) @@ -998,7 +999,7 @@ private void VerifyCanRead(bool synchronousCall) Debug.Assert(scope != null, "In stream state without a stream scope"); if (scope.StreamingState != StreamingState.Completed) { - throw new ODataException(Strings.ODataReaderCore_ReadCalledWithOpenStream); + throw new ODataException(SRResources.ODataReaderCore_ReadCalledWithOpenStream); } } } @@ -1013,14 +1014,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataReaderCore_SyncCallOnAsyncReader); + throw new ODataException(SRResources.ODataReaderCore_SyncCallOnAsyncReader); } } else { if (this.inputContext.Synchronous) { - throw new ODataException(Strings.ODataReaderCore_AsyncCallOnSyncReader); + throw new ODataException(SRResources.ODataReaderCore_AsyncCallOnSyncReader); } } } diff --git a/src/Microsoft.OData.Core/ODataReaderCoreAsync.cs b/src/Microsoft.OData.Core/ODataReaderCoreAsync.cs index 9c3d56d898..ee761ff81b 100644 --- a/src/Microsoft.OData.Core/ODataReaderCoreAsync.cs +++ b/src/Microsoft.OData.Core/ODataReaderCoreAsync.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; @@ -274,11 +275,11 @@ protected override async Task ReadAsynchronously() case ODataReaderState.Exception: // fall through case ODataReaderState.Completed: - throw new ODataException(Strings.ODataReaderCore_NoReadCallsAllowed(this.State)); + throw new ODataException(Error.Format(SRResources.ODataReaderCore_NoReadCallsAllowed, this.State)); default: Debug.Assert(false, "Unsupported reader state " + this.State + " detected."); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataReaderCoreAsync_ReadAsynchronously)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataReaderCoreAsync_ReadAsynchronously)); } return result; @@ -319,14 +320,14 @@ public override async Task CreateReadStreamAsync() { if (this.State != ODataReaderState.Stream) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } StreamScope scope = this.CurrentScope as StreamScope; Debug.Assert(scope != null, "ODataReaderState.Stream when Scope is not a StreamScope"); if (scope.StreamingState != StreamingState.None) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } scope.StreamingState = StreamingState.Streaming; @@ -345,14 +346,14 @@ public override async Task CreateTextReaderAsync() { if (this.State != ODataReaderState.Stream) { - throw new ODataException(Strings.ODataReaderCore_CreateTextReaderCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateTextReaderCalledInInvalidState); } StreamScope scope = this.CurrentScope as StreamScope; Debug.Assert(scope != null, "ODataReaderState.Stream when Scope is not a StreamScope"); if (scope.StreamingState != StreamingState.None) { - throw new ODataException(Strings.ODataReaderCore_CreateReadStreamCalledInInvalidState); + throw new ODataException(SRResources.ODataReaderCore_CreateReadStreamCalledInInvalidState); } scope.StreamingState = StreamingState.Streaming; diff --git a/src/Microsoft.OData.Core/ODataRequestMessage.cs b/src/Microsoft.OData.Core/ODataRequestMessage.cs index 6d0e188e2a..dcd21b0b58 100644 --- a/src/Microsoft.OData.Core/ODataRequestMessage.cs +++ b/src/Microsoft.OData.Core/ODataRequestMessage.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -53,7 +54,7 @@ public Uri Url set { - throw new ODataException(Strings.ODataMessage_MustNotModifyMessage); + throw new ODataException(SRResources.ODataMessage_MustNotModifyMessage); } } @@ -69,7 +70,7 @@ public string Method set { - throw new ODataException(Strings.ODataMessage_MustNotModifyMessage); + throw new ODataException(SRResources.ODataMessage_MustNotModifyMessage); } } @@ -123,7 +124,7 @@ public override Task GetStreamAsync() IODataRequestMessageAsync asyncRequestMessage = this.requestMessage as IODataRequestMessageAsync; if (asyncRequestMessage == null) { - throw new ODataException(Strings.ODataRequestMessage_AsyncNotAvailable); + throw new ODataException(SRResources.ODataRequestMessage_AsyncNotAvailable); } return this.GetStreamAsync(asyncRequestMessage.GetStreamAsync, /*isRequest*/ true); diff --git a/src/Microsoft.OData.Core/ODataResource.cs b/src/Microsoft.OData.Core/ODataResource.cs index 65535a7bb0..d3b60b41ca 100644 --- a/src/Microsoft.OData.Core/ODataResource.cs +++ b/src/Microsoft.OData.Core/ODataResource.cs @@ -12,6 +12,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Evaluation; #endregion Namespaces @@ -427,13 +428,13 @@ private static void VerifyProperties(IEnumerable properties) if (property.Value is ODataResourceValue) { - throw new ODataException(Strings.ODataResource_PropertyValueCannotBeODataResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataResource_PropertyValueCannotBeODataResourceValue, property.Name)); } else if ((collection = property.Value as ODataCollectionValue) != null) { if (collection != null && collection.Items != null && collection.Items.Any(t => t is ODataResourceValue)) { - throw new ODataException(Strings.ODataResource_PropertyValueCannotBeODataResourceValue(property.Name)); + throw new ODataException(Error.Format(SRResources.ODataResource_PropertyValueCannotBeODataResourceValue, property.Name)); } } } diff --git a/src/Microsoft.OData.Core/ODataResourceSetBase.cs b/src/Microsoft.OData.Core/ODataResourceSetBase.cs index 673f24934d..7c80e8a834 100644 --- a/src/Microsoft.OData.Core/ODataResourceSetBase.cs +++ b/src/Microsoft.OData.Core/ODataResourceSetBase.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -88,7 +88,7 @@ public Uri NextPageLink { if (this.DeltaLink != null && value != null) { - throw new ODataException(ODataErrorStrings.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); + throw new ODataException(SRResources.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); } this.nextPageLink = value; @@ -109,7 +109,7 @@ public Uri DeltaLink { if (this.NextPageLink != null && value != null) { - throw new ODataException(ODataErrorStrings.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); + throw new ODataException(SRResources.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); } this.deltaLink = value; diff --git a/src/Microsoft.OData.Core/ODataResponseMessage.cs b/src/Microsoft.OData.Core/ODataResponseMessage.cs index f1bd730223..685265cf48 100644 --- a/src/Microsoft.OData.Core/ODataResponseMessage.cs +++ b/src/Microsoft.OData.Core/ODataResponseMessage.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System.Collections.Generic; @@ -57,7 +58,7 @@ public int StatusCode set { - throw new ODataException(Strings.ODataMessage_MustNotModifyMessage); + throw new ODataException(SRResources.ODataMessage_MustNotModifyMessage); } } @@ -111,7 +112,7 @@ public override Task GetStreamAsync() IODataResponseMessageAsync asyncResponseMessage = this.responseMessage as IODataResponseMessageAsync; if (asyncResponseMessage == null) { - throw new ODataException(Strings.ODataResponseMessage_AsyncNotAvailable); + throw new ODataException(SRResources.ODataResponseMessage_AsyncNotAvailable); } return this.GetStreamAsync(asyncResponseMessage.GetStreamAsync, /*isRequest*/ false); diff --git a/src/Microsoft.OData.Core/ODataStream.cs b/src/Microsoft.OData.Core/ODataStream.cs index db82c7c66e..46ed6d4f37 100644 --- a/src/Microsoft.OData.Core/ODataStream.cs +++ b/src/Microsoft.OData.Core/ODataStream.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -110,7 +111,7 @@ protected void ValidateNotDisposed() { if (this.listener == null) { - throw new ObjectDisposedException(null, Strings.ODataBatchOperationStream_Disposed); + throw new ObjectDisposedException(null, SRResources.ODataBatchOperationStream_Disposed); } } } diff --git a/src/Microsoft.OData.Core/ODataStreamItem.cs b/src/Microsoft.OData.Core/ODataStreamItem.cs index 23d02b7b39..5f30907bd7 100644 --- a/src/Microsoft.OData.Core/ODataStreamItem.cs +++ b/src/Microsoft.OData.Core/ODataStreamItem.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { #region Namespaces using Edm; + using Microsoft.OData.Core; #endregion /// @@ -59,7 +60,7 @@ private set typeKind != EdmPrimitiveTypeKind.Binary && typeKind != EdmPrimitiveTypeKind.None) { - throw new ODataException(Strings.StreamItemInvalidPrimitiveKind(value)); + throw new ODataException(Error.Format(SRResources.StreamItemInvalidPrimitiveKind, value)); } this.typeKind = value; diff --git a/src/Microsoft.OData.Core/ODataStreamPropertyInfo.cs b/src/Microsoft.OData.Core/ODataStreamPropertyInfo.cs index 72c180137b..cd59ed46de 100644 --- a/src/Microsoft.OData.Core/ODataStreamPropertyInfo.cs +++ b/src/Microsoft.OData.Core/ODataStreamPropertyInfo.cs @@ -7,6 +7,7 @@ namespace Microsoft.OData { using System; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; @@ -106,7 +107,7 @@ public override EdmPrimitiveTypeKind PrimitiveTypeKind value != EdmPrimitiveTypeKind.String && value != EdmPrimitiveTypeKind.None) { - throw new ODataException(Strings.StreamItemInvalidPrimitiveKind(value)); + throw new ODataException(Error.Format(SRResources.StreamItemInvalidPrimitiveKind, value)); } this.primitiveTypeKind = value; diff --git a/src/Microsoft.OData.Core/ODataUtils.cs b/src/Microsoft.OData.Core/ODataUtils.cs index 9a33e15de5..5d2fc39283 100644 --- a/src/Microsoft.OData.Core/ODataUtils.cs +++ b/src/Microsoft.OData.Core/ODataUtils.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData using System; using System.Collections.Generic; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -40,7 +41,7 @@ public static ODataFormat SetHeadersForPayload(ODataMessageWriter messageWriter, if (payloadKind == ODataPayloadKind.Unsupported) { - throw new ArgumentException(Strings.ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind(payloadKind), nameof(payloadKind)); + throw new ArgumentException(Error.Format(SRResources.ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind, payloadKind), nameof(payloadKind)); } return messageWriter.SetHeaders(payloadKind); @@ -118,7 +119,7 @@ public static string ODataVersionToString(ODataVersion version) default: // invalid enum value - unreachable. - throw new ODataException(Strings.ODataUtils_UnsupportedVersionNumber); + throw new ODataException(SRResources.ODataUtils_UnsupportedVersionNumber); } } @@ -150,7 +151,7 @@ public static ODataVersion StringToODataVersion(string version) default: // invalid version string - throw new ODataException(Strings.ODataUtils_UnsupportedVersionHeader(version)); + throw new ODataException(Error.Format(SRResources.ODataUtils_UnsupportedVersionHeader, version)); } } @@ -206,7 +207,7 @@ public static ODataServiceDocument GenerateServiceDocument(this IEdmModel model) if (model.EntityContainer == null) { - throw new ODataException(Strings.ODataUtils_ModelDoesNotHaveContainer); + throw new ODataException(SRResources.ODataUtils_ModelDoesNotHaveContainer); } IList lstEntitySets = new List(); diff --git a/src/Microsoft.OData.Core/ODataUtilsInternal.cs b/src/Microsoft.OData.Core/ODataUtilsInternal.cs index 8e459844b3..6df1ebb58c 100644 --- a/src/Microsoft.OData.Core/ODataUtilsInternal.cs +++ b/src/Microsoft.OData.Core/ODataUtilsInternal.cs @@ -13,6 +13,7 @@ namespace Microsoft.OData using System.Linq; using Microsoft.OData.Edm; + using Microsoft.OData.Core; #endregion Namespaces @@ -95,7 +96,7 @@ internal static bool IsPayloadKindSupported(ODataPayloadKind payloadKind, bool i // Anything else should never show up default: Debug.Assert(false, "Unsupported payload kind found: " + payloadKind.ToString()); - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataUtilsInternal_IsPayloadKindSupported_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataUtilsInternal_IsPayloadKindSupported_UnreachableCodePath)); } } diff --git a/src/Microsoft.OData.Core/ODataVersionCache.cs b/src/Microsoft.OData.Core/ODataVersionCache.cs index a0a9f39c83..5754e92791 100644 --- a/src/Microsoft.OData.Core/ODataVersionCache.cs +++ b/src/Microsoft.OData.Core/ODataVersionCache.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; using System; using System.Diagnostics; @@ -55,7 +56,7 @@ internal T this[ODataVersion version] return this.v401.Value; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataVersionCache_UnknownVersion)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataVersionCache_UnknownVersion)); } } } diff --git a/src/Microsoft.OData.Core/ODataWriterCore.cs b/src/Microsoft.OData.Core/ODataWriterCore.cs index bb19412e98..855725d46e 100644 --- a/src/Microsoft.OData.Core/ODataWriterCore.cs +++ b/src/Microsoft.OData.Core/ODataWriterCore.cs @@ -11,6 +11,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Microsoft.OData.Metadata; @@ -330,7 +331,7 @@ protected IDuplicatePropertyNameChecker DuplicatePropertyNameChecker resourceScope = (ResourceBaseScope)this.scopeStack.Parent; break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_PropertyAndAnnotationCollector)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_PropertyAndAnnotationCollector)); } return resourceScope.DuplicatePropertyNameChecker; @@ -390,7 +391,7 @@ protected NestedResourceInfoScope ParentNestedResourceInfoScope } // The parent scope of a resource can only be a resourceSet or an expanded nav link - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_ParentNestedResourceInfoScope)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_ParentNestedResourceInfoScope)); } } @@ -750,7 +751,7 @@ void IODataOutputInStreamErrorListener.OnInStreamError() // introduce another top-level element in XML) if (this.State == WriterState.Completed) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), WriterState.Error.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), WriterState.Error.ToString())); } this.StartPayloadInStartState(); @@ -766,7 +767,7 @@ async Task IODataOutputInStreamErrorListener.OnInStreamErrorAsync() // introduce another top-level element in XML) if (this.State == WriterState.Completed) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), WriterState.Error.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), WriterState.Error.ToString())); } await this.StartPayloadInStartStateAsync() @@ -1325,7 +1326,7 @@ protected void ValidateNoDeltaLinkForExpandedResourceSet(ODataResourceSet resour if (resourceSet.DeltaLink != null) { - throw new ODataException(Strings.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); + throw new ODataException(SRResources.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); } } @@ -1590,7 +1591,7 @@ private void WriteStartResourceSetImplementation(ODataResourceSet resourceSet) // Check that Count is not set for requests if (!thisParam.outputContext.WritingResponse) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryCountInRequest, resourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryCountInRequest, resourceSetParam); } // Verify version requirements @@ -1631,12 +1632,12 @@ private void WriteStartDeltaResourceSetImplementation(ODataDeltaResourceSet delt { if (deltaResourceSetParam.NextPageLink != null) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryNextLinkInRequest, deltaResourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryNextLinkInRequest, deltaResourceSetParam); } if (deltaResourceSetParam.DeltaLink != null) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryDeltaLinkInRequest, deltaResourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryDeltaLinkInRequest, deltaResourceSetParam); } } @@ -1984,7 +1985,7 @@ private void WriteEndImplementation() case WriterState.NestedResourceInfo: if (!thisParam.outputContext.WritingResponse) { - throw new ODataException(Strings.ODataWriterCore_DeferredLinkInRequest); + throw new ODataException(SRResources.ODataWriterCore_DeferredLinkInRequest); } if (!thisParam.SkipWriting) @@ -2019,13 +2020,13 @@ private void WriteEndImplementation() break; case WriterState.Stream: case WriterState.String: - throw new ODataException(Strings.ODataWriterCore_StreamNotDisposed); + throw new ODataException(SRResources.ODataWriterCore_StreamNotDisposed); case WriterState.Start: // fall through case WriterState.Completed: // fall through case WriterState.Error: // fall through - throw new ODataException(Strings.ODataWriterCore_WriteEndCalledInInvalidState(currentScope.State.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_WriteEndCalledInInvalidState, currentScope.State.ToString())); default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_WriteEnd_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_WriteEnd_UnreachableCodePath)); } thisParam.LeaveScope(); @@ -2129,14 +2130,14 @@ private void VerifyCallAllowed(bool synchronousCall) { if (!this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataWriterCore_SyncCallOnAsyncWriter); + throw new ODataException(SRResources.ODataWriterCore_SyncCallOnAsyncWriter); } } else { if (this.outputContext.Synchronous) { - throw new ODataException(Strings.ODataWriterCore_AsyncCallOnSyncWriter); + throw new ODataException(SRResources.ODataWriterCore_AsyncCallOnSyncWriter); } } } @@ -2148,7 +2149,7 @@ private void VerifyWritingDelta() { if (!this.CurrentScope.EnableDelta) { - throw new ODataException(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + throw new ODataException(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } } @@ -2232,7 +2233,7 @@ private void CheckForNestedResourceInfoWithContent(ODataPayloadKind contentPaylo // into the nested resource info content. This is only allowed for collection navigation property in request/response. if (currentNestedResourceInfo.IsCollection != true) { - this.ThrowODataException(Strings.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, currentNestedResourceInfo); + this.ThrowODataException(SRResources.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, currentNestedResourceInfo); } // Note that we don't invoke duplicate property checker in this case as it's not necessary. @@ -2268,7 +2269,7 @@ private void CheckForNestedResourceInfoWithContent(ODataPayloadKind contentPaylo Debug.Assert(parenScope != null); if (parenScope.State != WriterState.NestedResourceInfo && parenScope.State != WriterState.NestedResourceInfoWithContent) { - this.ThrowODataException(Strings.ODataWriterCore_EntityReferenceLinkWithoutNavigationLink, null); + this.ThrowODataException(SRResources.ODataWriterCore_EntityReferenceLinkWithoutNavigationLink, null); } } } @@ -2306,7 +2307,7 @@ private void ValidateResourceForResourceSet(ODataResourceBase resource, Resource // the current scope if (!resourceScope.NavigationSource.EntityType.IsAssignableFrom(resourceType)) { - throw new ODataException(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes(resourceType.FullTypeName(), resourceScope.NavigationSource.EntityType)); + throw new ODataException(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, resourceType.FullTypeName(), resourceScope.NavigationSource.EntityType)); } resourceScope.ResourceTypeFromMetadata = resourceScope.NavigationSource.EntityType; @@ -2336,7 +2337,7 @@ private void ValidateResourceForResourceSet(ODataResourceBase resource, Resource (!this.outputContext.WritingResponse && resource is ODataDeletedResource || this.outputContext.WritingResponse && (!(resource is ODataDeletedResource))) && !HasKeyProperties(entityType, resource.Properties)) { - throw new ODataException(Strings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); + throw new ODataException(SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); } } } @@ -2508,7 +2509,7 @@ private void IncreaseResourceDepth() if (this.currentResourceDepth > this.outputContext.MessageWriterSettings.MessageQuotas.MaxNestingDepth) { - this.ThrowODataException(Strings.ValidationUtils_MaxDepthOfNestedEntriesExceeded(this.outputContext.MessageWriterSettings.MessageQuotas.MaxNestingDepth), null); + this.ThrowODataException(Error.Format(SRResources.ValidationUtils_MaxDepthOfNestedEntriesExceeded, this.outputContext.MessageWriterSettings.MessageQuotas.MaxNestingDepth), null); } } @@ -2755,7 +2756,7 @@ private void EnterScope(WriterState newState, ODataItem item) // Containment cannot be written alone without odata uri. if (!odataPath.Any()) { - throw new ODataException(Strings.ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement); + throw new ODataException(SRResources.ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement); } ODataPath newPath = null; @@ -2975,17 +2976,17 @@ private void ValidateTransition(WriterState newState) case WriterState.Start: if (newState != WriterState.ResourceSet && newState != WriterState.Resource && newState != WriterState.DeltaResourceSet && newState != WriterState.DeletedResource) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromStart(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, this.State.ToString(), newState.ToString())); } if ((newState == WriterState.ResourceSet || newState == WriterState.DeltaResourceSet) && !this.writingResourceSet) { - throw new ODataException(Strings.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter); + throw new ODataException(SRResources.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter); } if (newState == WriterState.Resource && this.writingResourceSet) { - throw new ODataException(Strings.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter); + throw new ODataException(SRResources.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter); } break; @@ -2994,23 +2995,23 @@ private void ValidateTransition(WriterState newState) { if (this.CurrentScope.Item == null) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromNullResource(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromNullResource, this.State.ToString(), newState.ToString())); } if (newState != WriterState.NestedResourceInfo && newState != WriterState.Property) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromResource(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, this.State.ToString(), newState.ToString())); } // TODO: The conditional expressions in the 2 `if` blocks below are adequately covered by the `if` block above? if (newState == WriterState.DeletedResource && this.ParentScope.State != WriterState.DeltaResourceSet) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromResourceSet(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, this.State.ToString(), newState.ToString())); } if (this.State == WriterState.DeletedResource && this.Version < ODataVersion.V401 && newState == WriterState.NestedResourceInfo) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFrom40DeletedResource(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFrom40DeletedResource, this.State.ToString(), newState.ToString())); } } @@ -3023,7 +3024,7 @@ private void ValidateTransition(WriterState newState) (this.CurrentScope.ResourceType.TypeKind != EdmTypeKind.Untyped || (newState != WriterState.Primitive && newState != WriterState.Stream && newState != WriterState.String && newState != WriterState.ResourceSet)))) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromResourceSet(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, this.State.ToString(), newState.ToString())); } break; @@ -3032,21 +3033,21 @@ private void ValidateTransition(WriterState newState) newState != WriterState.DeletedResource && !(this.ScopeLevel < 3 && (newState == WriterState.DeltaDeletedLink || newState == WriterState.DeltaLink))) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromResourceSet(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, this.State.ToString(), newState.ToString())); } break; case WriterState.NestedResourceInfo: if (newState != WriterState.NestedResourceInfoWithContent) { - throw new ODataException(Strings.ODataWriterCore_InvalidStateTransition(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidStateTransition, this.State.ToString(), newState.ToString())); } break; case WriterState.NestedResourceInfoWithContent: if (newState != WriterState.ResourceSet && newState != WriterState.Resource && newState != WriterState.Primitive && (this.Version < ODataVersion.V401 || (newState != WriterState.DeltaResourceSet && newState != WriterState.DeletedResource))) { - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromExpandedLink(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, this.State.ToString(), newState.ToString())); } break; @@ -3058,7 +3059,7 @@ private void ValidateTransition(WriterState newState) // we've already written the value for this property ODataPropertyInfo propertyInfo = propertyScope.Item as ODataPropertyInfo; Debug.Assert(propertyInfo != null, "Item in PropertyInfoScope is not ODataPropertyInfo"); - throw new ODataException(Strings.ODataWriterCore_PropertyValueAlreadyWritten(propertyInfo.Name)); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, propertyInfo.Name)); } if (newState == WriterState.Stream || newState == WriterState.String || newState == WriterState.Primitive) @@ -3067,26 +3068,26 @@ private void ValidateTransition(WriterState newState) } else { - throw new ODataException(Strings.ODataWriterCore_InvalidStateTransition(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidStateTransition, this.State.ToString(), newState.ToString())); } break; case WriterState.Stream: case WriterState.String: - throw new ODataException(Strings.ODataWriterCore_StreamNotDisposed); + throw new ODataException(SRResources.ODataWriterCore_StreamNotDisposed); case WriterState.Completed: // we should never see a state transition when in state 'Completed' - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromCompleted(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, this.State.ToString(), newState.ToString())); case WriterState.Error: if (newState != WriterState.Error) { // No more state transitions once we are in error state except for the fatal error - throw new ODataException(Strings.ODataWriterCore_InvalidTransitionFromError(this.State.ToString(), newState.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromError, this.State.ToString(), newState.ToString())); } break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_ValidateTransition_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_ValidateTransition_UnreachableCodePath)); } } @@ -3181,7 +3182,7 @@ private void PushScope(WriterState state, ODataItem item, IEdmNavigationSource n scope = new Scope(state, item, navigationSource, itemType, skipWriting, selectedProperties, odataUri, /*enableDelta*/ false); break; default: - string errorMessage = Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_Scope_Create_UnreachableCodePath); + string errorMessage = Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_Scope_Create_UnreachableCodePath); Debug.Assert(false, errorMessage); throw new ODataException(errorMessage); } @@ -3247,7 +3248,7 @@ await this.InterceptExceptionAsync( // Check that Count is not set for requests if (!thisParam.outputContext.WritingResponse) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryCountInRequest, resourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryCountInRequest, resourceSetParam); } } @@ -3291,12 +3292,12 @@ await this.InterceptExceptionAsync( // Check that links are not set for requests if (deltaResourceSetParam.NextPageLink != null) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryNextLinkInRequest, deltaResourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryNextLinkInRequest, deltaResourceSetParam); } if (deltaResourceSetParam.DeltaLink != null) { - thisParam.ThrowODataException(Strings.ODataWriterCore_QueryDeltaLinkInRequest, deltaResourceSetParam); + thisParam.ThrowODataException(SRResources.ODataWriterCore_QueryDeltaLinkInRequest, deltaResourceSetParam); } } @@ -3491,7 +3492,7 @@ await thisParam.EndDeltaResourceSetAsync(deltaResourceSet) case WriterState.NestedResourceInfo: if (!thisParam.outputContext.WritingResponse) { - throw new ODataException(Strings.ODataWriterCore_DeferredLinkInRequest); + throw new ODataException(SRResources.ODataWriterCore_DeferredLinkInRequest); } if (!thisParam.SkipWriting) @@ -3529,13 +3530,13 @@ await thisParam.EndPropertyAsync(property) break; case WriterState.Stream: case WriterState.String: - throw new ODataException(Strings.ODataWriterCore_StreamNotDisposed); + throw new ODataException(SRResources.ODataWriterCore_StreamNotDisposed); case WriterState.Start: // fall through case WriterState.Completed: // fall through case WriterState.Error: // fall through - throw new ODataException(Strings.ODataWriterCore_WriteEndCalledInInvalidState(currentScope.State.ToString())); + throw new ODataException(Error.Format(SRResources.ODataWriterCore_WriteEndCalledInInvalidState, currentScope.State.ToString())); default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ODataWriterCore_WriteEnd_UnreachableCodePath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ODataWriterCore_WriteEnd_UnreachableCodePath)); } await thisParam.LeaveScopeAsync() @@ -3659,7 +3660,7 @@ private async Task CheckForNestedResourceInfoWithContentAsync(ODataPayloadKind c // into the nested resource info content. This is only allowed for collection navigation property in request/response. if (currentNestedResourceInfo.IsCollection != true) { - this.ThrowODataException(Strings.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, currentNestedResourceInfo); + this.ThrowODataException(SRResources.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, currentNestedResourceInfo); } // Note that we don't invoke duplicate property checker in this case as it's not necessary. @@ -3696,7 +3697,7 @@ await thisParam.StartNestedResourceInfoWithContentAsync(currentNestedResourceInf Debug.Assert(parentScope != null); if (parentScope.State != WriterState.NestedResourceInfo && parentScope.State != WriterState.NestedResourceInfoWithContent) { - this.ThrowODataException(Strings.ODataWriterCore_EntityReferenceLinkWithoutNavigationLink, null); + this.ThrowODataException(SRResources.ODataWriterCore_EntityReferenceLinkWithoutNavigationLink, null); } } } diff --git a/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.cs b/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.cs deleted file mode 100644 index a53e54f958..0000000000 --- a/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.cs +++ /dev/null @@ -1,7519 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -namespace Microsoft.OData { - using System; - using System.Resources; - - /// - /// Strongly-typed and parameterized string resources. - /// - internal static class Strings { - /// - /// A string like "Value cannot be empty." - /// - internal static string ExceptionUtils_ArgumentStringEmpty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExceptionUtils_ArgumentStringEmpty); - } - } - - /// - /// A string like "An asynchronous operation was requested on an IODataRequestMessage instance. For asynchronous operations to succeed, the request message instance must implement IODataRequestMessageAsync." - /// - internal static string ODataRequestMessage_AsyncNotAvailable - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataRequestMessage_AsyncNotAvailable); - } - } - - /// - /// A string like "The IODataRequestMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null." - /// - internal static string ODataRequestMessage_StreamTaskIsNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataRequestMessage_StreamTaskIsNull); - } - } - - /// - /// A string like "The IODataRequestMessage.GetStream or IODataRequestMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream." - /// - internal static string ODataRequestMessage_MessageStreamIsNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataRequestMessage_MessageStreamIsNull); - } - } - - /// - /// A string like "An asynchronous operation was requested on an IODataResponseMessage instance. For asynchronous operations to succeed, the response message instance must implement IODataResponseMessageAsync." - /// - internal static string ODataResponseMessage_AsyncNotAvailable - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResponseMessage_AsyncNotAvailable); - } - } - - /// - /// A string like "The IODataResponseMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null." - /// - internal static string ODataResponseMessage_StreamTaskIsNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResponseMessage_StreamTaskIsNull); - } - } - - /// - /// A string like "The IODataResponseMessage.GetStream or IODataResponseMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream." - /// - internal static string ODataResponseMessage_MessageStreamIsNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResponseMessage_MessageStreamIsNull); - } - } - - /// - /// A string like "A writer or stream has been disposed with data still in the buffer. You must call Flush or FlushAsync before calling Dispose when some data has already been written." - /// - internal static string AsyncBufferedStream_WriterDisposedWithoutFlush - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AsyncBufferedStream_WriterDisposedWithoutFlush); - } - } - - /// - /// A string like "The format '{0}' does not support writing a payload of kind '{1}'." - /// - internal static string ODataOutputContext_UnsupportedPayloadKindForFormat(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataOutputContext_UnsupportedPayloadKindForFormat, p0, p1); - } - - /// - /// A string like "The format '{0}' does not support reading a payload of kind '{1}'." - /// - internal static string ODataInputContext_UnsupportedPayloadKindForFormat(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataInputContext_UnsupportedPayloadKindForFormat, p0, p1); - } - - /// - /// A string like "The ServiceRoot property in ODataMessageWriterSettings.ODataUri must be set when writing a payload." - /// - internal static string ODataOutputContext_MetadataDocumentUriMissing - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataOutputContext_MetadataDocumentUriMissing); - } - } - - /// - /// A string like "A relative URI value '{0}' was specified in the data to write, but the metadata document URI or the metadata for the item to be written was not specified for the writer. The metadata document URI and the metadata for the item to be written must be provided to the writer when using relative URI values." - /// - internal static string ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata, p0); - } - - /// - /// A string like "A relative URI value '{0}' was specified in the data to write, but a base URI was not specified for the writer. A base URI must be set when using relative URI values." - /// - internal static string ODataWriter_RelativeUriUsedWithoutBaseUriSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriter_RelativeUriUsedWithoutBaseUriSpecified, p0); - } - - /// - /// A string like "The property '{0}' is a stream property, but it is not a property of an ODataResource instance. In OData, stream properties must be properties of ODataResource instances." - /// - internal static string ODataWriter_StreamPropertiesMustBePropertiesOfODataResource(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriter_StreamPropertiesMustBePropertiesOfODataResource, p0); - } - - /// - /// A string like "An invalid state transition has been detected in an OData writer. Cannot transition from state '{0}' to state '{1}'." - /// - internal static string ODataWriterCore_InvalidStateTransition(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidStateTransition, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set." - /// - internal static string ODataWriterCore_InvalidTransitionFromStart(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromStart, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a property or a nested resource." - /// - internal static string ODataWriterCore_InvalidTransitionFromResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromResource, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}' when writing an OData 4.0 payload. To write content to a deleted resource, please specify ODataVersion 4.01 or greater in MessageWriterSettings." - /// - internal static string ODataWriterCore_InvalidTransitionFrom40DeletedResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFrom40DeletedResource, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. You must first call ODataWriter.WriteEnd to finish writing a null ODataResource." - /// - internal static string ODataWriterCore_InvalidTransitionFromNullResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromNullResource, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a resource." - /// - internal static string ODataWriterCore_InvalidTransitionFromResourceSet(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromResourceSet, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set." - /// - internal static string ODataWriterCore_InvalidTransitionFromExpandedLink(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromExpandedLink, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. Nothing further can be written once the writer has completed." - /// - internal static string ODataWriterCore_InvalidTransitionFromCompleted(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromCompleted, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. Nothing can be written once the writer entered the error state." - /// - internal static string ODataWriterCore_InvalidTransitionFromError(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_InvalidTransitionFromError, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. State transition is not allowed while writing an expanded navigation property, complex property or complex collection property." - /// - internal static string ODataJsonDeltaWriter_InvalidTransitionFromNestedResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeltaWriter_InvalidTransitionFromNestedResource, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. Nested resource can only be written within a delta resource." - /// - internal static string ODataJsonDeltaWriter_InvalidTransitionToNestedResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeltaWriter_InvalidTransitionToNestedResource, p0, p1); - } - - /// - /// A string like "WriteStart(expandedResourceSet) was called in an invalid state ('{0}'); WriteStart(expandedResourceSet) is only supported in state 'ExpandedNavigationProperty'." - /// - internal static string ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState, p0); - } - - /// - /// A string like "ODataWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Resource', 'ResourceSet', 'NavigationLink', and 'NavigationLinkWithContent'." - /// - internal static string ODataWriterCore_WriteEndCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_WriteEndCalledInInvalidState, p0); - } - - /// - /// A string like "ODataWriter.Write or ODataWriter.WriteEnd was called while streaming a value. Stream or TextWriter must be disposed before calling additional methods on ODataWriter." - /// - internal static string ODataWriterCore_StreamNotDisposed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_StreamNotDisposed); - } - } - - /// - /// A string like "No Id or key properties were found. A resource in a delta payload requires an ID or key properties be specified." - /// - internal static string ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); - } - } - - /// - /// A string like "The ODataResourceSet.Count must be null for request payloads. Query counts are only supported in responses." - /// - internal static string ODataWriterCore_QueryCountInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_QueryCountInRequest); - } - } - - /// - /// A string like "The NextPageLink must be null for request payloads. Next page links are only supported in responses." - /// - internal static string ODataWriterCore_QueryNextLinkInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_QueryNextLinkInRequest); - } - } - - /// - /// A string like "The DeltaLink must be null for request payloads. Delta links are only supported in responses." - /// - internal static string ODataWriterCore_QueryDeltaLinkInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_QueryDeltaLinkInRequest); - } - } - - /// - /// A string like "Cannot write a deleted resource, link, deleted link, or nested delta resource set within a resource set; they must be written within a delta resource set." - /// - internal static string ODataWriterCore_CannotWriteDeltaWithResourceSetWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); - } - } - - /// - /// A string like "Nested content is not allowed in an OData 4.0 deleted entry. For content in deleted entries, please specify OData 4.01 or greater." - /// - internal static string ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry); - } - } - - /// - /// A string like "Cannot write a top-level resource set with a writer that was created to write a top-level resource." - /// - internal static string ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter); - } - } - - /// - /// A string like "Cannot write a top-level resource with a writer that was created to write a top-level resource set." - /// - internal static string ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataWriterCore_SyncCallOnAsyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_SyncCallOnAsyncWriter); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataWriterCore_AsyncCallOnSyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_AsyncCallOnSyncWriter); - } - } - - /// - /// A string like "An entity reference link was written without a surrounding navigation link. The WriteEntityReferenceLink or WriteEntityReferenceLinkAsync methods can only be used when writing the content of a navigation link." - /// - internal static string ODataWriterCore_EntityReferenceLinkWithoutNavigationLink - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_EntityReferenceLinkWithoutNavigationLink); - } - } - - /// - /// A string like "A deferred link was written into a request. In requests, each nested resource info must have a resource set, resource, or entity reference link written into it." - /// - internal static string ODataWriterCore_DeferredLinkInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_DeferredLinkInRequest); - } - } - - /// - /// A string like "More than one item was written into the content of a nested resource. In OData, a nested resource can only contain more than one item in its content when ODataNestedResourceInfo.IsCollection set to true, and the writer is writing a request." - /// - internal static string ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent); - } - } - - /// - /// A string like "The ODataResourceSet.DeltaLink property must be null for expanded resource sets. Delta link is not supported on expanded resource sets." - /// - internal static string ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); - } - } - - /// - /// A string like "The Path property in ODataMessageWriterSettings.ODataUri must be set when writing contained elements." - /// - internal static string ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement); - } - } - - /// - /// A string like "Multiple properties with the name '{0}' were detected in a resource or a complex value. In OData, duplicate property names are not allowed." - /// - internal static string DuplicatePropertyNamesNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.DuplicatePropertyNamesNotAllowed, p0); - } - - /// - /// A string like "Multiple annotations with the name '{0}' were detected. In OData, duplicate annotations are not allowed." - /// - internal static string DuplicateAnnotationNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.DuplicateAnnotationNotAllowed, p0); - } - - /// - /// A string like "Multiple annotations with the name '{0}' were detected for the property with name '{1}'. In OData, duplicate annotations are not allowed." - /// - internal static string DuplicateAnnotationForPropertyNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.DuplicateAnnotationForPropertyNotAllowed, p0, p1); - } - - /// - /// A string like "Multiple annotations with the name '{0}' were detected for the instance annotation with name '{1}'. In OData, duplicate annotations are not allowed." - /// - internal static string DuplicateAnnotationForInstanceAnnotationNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.DuplicateAnnotationForInstanceAnnotationNotAllowed, p0, p1); - } - - /// - /// A string like "An annotation with name '{0}' for property '{1}' was detected after the property, or after an annotation for another property. In OData, annotations for a property must be in a single group and must appear before the property they annotate." - /// - internal static string PropertyAnnotationAfterTheProperty(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PropertyAnnotationAfterTheProperty, p0, p1); - } - - /// - /// A string like "Cannot convert a value of type '{0}' to the string representation of a primitive value." - /// - internal static string ValueUtils_CannotConvertValueToPrimitive(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValueUtils_CannotConvertValueToPrimitive, p0); - } - - /// - /// A string like "The value of type '{0}' is not supported and cannot be converted to a JSON representation." - /// - internal static string ODataJsonWriter_UnsupportedValueType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonWriter_UnsupportedValueType, p0); - } - - /// - /// A string like "Unable to serialize an object in a collection as it is not a supported ODataValue." - /// - internal static string ODataJsonWriter_UnsupportedValueInCollection - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonWriter_UnsupportedValueInCollection); - } - } - - /// - /// A string like "The specified ODataJsonDateTimeFormat is not supported." - /// - internal static string ODataJsonWriter_UnsupportedDateTimeFormat - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonWriter_UnsupportedDateTimeFormat); - } - } - - /// - /// A string like "An error occurred while processing the OData message." - /// - internal static string ODataException_GeneralError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataException_GeneralError); - } - } - - /// - /// A string like "An error was read from the payload. See the 'Error' property for more details." - /// - internal static string ODataErrorException_GeneralError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataErrorException_GeneralError); - } - } - - /// - /// A string like "An error occurred while parsing part of the URI." - /// - internal static string ODataUriParserException_GeneralError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriParserException_GeneralError); - } - } - - /// - /// A string like "'{0}' is missing a $select clause. All property paths, expands, and selects of complex types should include a $select statement." - /// - internal static string ODataUrlValidationError_SelectRequired(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUrlValidationError_SelectRequired, p0); - } - - /// - /// A string like "Exception thrown by invalid rule {0}. {1}" - /// - internal static string ODataUrlValidationError_InvalidRule(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUrlValidationError_InvalidRule, p0, p1); - } - - /// - /// A string like "The ODataMessageWriter has already been used to write a message payload. An ODataMessageWriter can only be used once to write a payload for a given message." - /// - internal static string ODataMessageWriter_WriterAlreadyUsed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_WriterAlreadyUsed); - } - } - - /// - /// A string like "Top-level entity reference link collection payloads are not allowed in requests." - /// - internal static string ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed); - } - } - - /// - /// A string like "An error cannot be written to a request payload. Errors are only supported in responses." - /// - internal static string ODataMessageWriter_ErrorPayloadInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_ErrorPayloadInRequest); - } - } - - /// - /// A string like "A service document cannot be written to request payloads. Service documents are only supported in responses." - /// - internal static string ODataMessageWriter_ServiceDocumentInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_ServiceDocumentInRequest); - } - } - - /// - /// A string like "A metadata document cannot be written to request payloads. Metadata documents are only supported in responses." - /// - internal static string ODataMessageWriter_MetadataDocumentInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_MetadataDocumentInRequest); - } - } - - /// - /// A string like "Cannot write delta in request payload." - /// - internal static string ODataMessageWriter_DeltaInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_DeltaInRequest); - } - } - - /// - /// A string like "Cannot write async in request payload." - /// - internal static string ODataMessageWriter_AsyncInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_AsyncInRequest); - } - } - - /// - /// A string like "Cannot write the value 'null' in top level property; return 204 instead." - /// - internal static string ODataMessageWriter_CannotWriteTopLevelNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotWriteTopLevelNull); - } - } - - /// - /// A string like "Cannot write the value 'null' in raw format." - /// - internal static string ODataMessageWriter_CannotWriteNullInRawFormat - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotWriteNullInRawFormat); - } - } - - /// - /// A string like "Cannot set message headers for the invalid payload kind '{0}'." - /// - internal static string ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind, p0); - } - - /// - /// A string like "The payload kind '{0}' used in the last call to ODataUtils.SetHeadersForPayload is incompatible with the payload being written, which is of kind '{1}'." - /// - internal static string ODataMessageWriter_IncompatiblePayloadKinds(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_IncompatiblePayloadKinds, p0, p1); - } - - /// - /// A string like "The stream property '{0}' cannot be written to the payload as a top level property." - /// - internal static string ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty, p0); - } - - /// - /// A string like "The WriteError method or the WriteErrorAsync method on the ODataMessageWriter has already been called to write an error payload. Only a single error payload can be written with each ODataMessageWriter instance." - /// - internal static string ODataMessageWriter_WriteErrorAlreadyCalled - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_WriteErrorAlreadyCalled); - } - } - - /// - /// A string like "The WriteError method or the WriteErrorAsync method on ODataMessageWriter cannot be called after the WriteValue method or the WriteValueAsync method is called. In OData, writing an in-stream error for raw values is not supported." - /// - internal static string ODataMessageWriter_CannotWriteInStreamErrorForRawValues - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotWriteInStreamErrorForRawValues); - } - } - - /// - /// A string like "No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings in order to write a metadata document." - /// - internal static string ODataMessageWriter_CannotWriteMetadataWithoutModel - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotWriteMetadataWithoutModel); - } - } - - /// - /// A string like "No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings when CreateODataParameterWriter is called with a non-null operation." - /// - internal static string ODataMessageWriter_CannotSpecifyOperationWithoutModel - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_CannotSpecifyOperationWithoutModel); - } - } - - /// - /// A string like "A JsonPaddingFunctionName was specified, but the content-type '{0}' is not supported with Json Padding." - /// - internal static string ODataMessageWriter_JsonPaddingOnInvalidContentType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_JsonPaddingOnInvalidContentType, p0); - } - - /// - /// A string like "The type '{0}' specified as the collection's item type is not primitive, enum or complex. An ODataCollectionWriter can only write collections of primitive, enum or complex values." - /// - internal static string ODataMessageWriter_NonCollectionType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_NonCollectionType, p0); - } - - /// - /// A string like "Not allowed to write top level property '{0}' with 'ODataResourceValue' or collection of resource value." - /// - internal static string ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue, p0); - } - - /// - /// A string like "The provided implementation of IJsonWriterFactory returned null for arguments: isIeee754Compatible '{0}', encoding '{1}'. The factory should return a concrete IJsonWriter implementation." - /// - internal static string ODataMessageWriter_JsonWriterFactory_ReturnedNull(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_JsonWriterFactory_ReturnedNull, p0, p1); - } - - /// - /// A string like "The requested buffer capacity {0} exceeds the max buffer size." - /// - internal static string ODataMessageWriter_Buffer_Maximum_Size_Exceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriter_Buffer_Maximum_Size_Exceeded, p0); - } - - /// - /// A string like "Both startResourceXmlCustomizationCallback and endResourceXmlCustomizationCallback must be either null or non-null." - /// - internal static string ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth); - } - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write the collection or to write nothing at all." - /// - internal static string ODataCollectionWriterCore_InvalidTransitionFromStart(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_InvalidTransitionFromStart, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or to write the end of the collection." - /// - internal static string ODataCollectionWriterCore_InvalidTransitionFromCollection(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_InvalidTransitionFromCollection, p0, p1); - } - - /// - /// A string like "Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or the end of the collection." - /// - internal static string ODataCollectionWriterCore_InvalidTransitionFromItem(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_InvalidTransitionFromItem, p0, p1); - } - - /// - /// A string like "ODataCollectionWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Start', 'Collection', and 'Item'." - /// - internal static string ODataCollectionWriterCore_WriteEndCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_WriteEndCalledInInvalidState, p0); - } - - /// - /// A string like "A synchronous operation was called on an asynchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous." - /// - internal static string ODataCollectionWriterCore_SyncCallOnAsyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_SyncCallOnAsyncWriter); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous." - /// - internal static string ODataCollectionWriterCore_AsyncCallOnSyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionWriterCore_AsyncCallOnSyncWriter); - } - } - - /// - /// A string like "An invalid HTTP method '{0}' was detected for a request in a change set. Requests in change sets only support the HTTP methods 'POST', 'PUT', 'DELETE', and 'PATCH'." - /// - internal static string ODataBatch_InvalidHttpMethodForChangeSetRequest(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatch_InvalidHttpMethodForChangeSetRequest, p0); - } - - /// - /// A string like "The header with name '{0}' was not present in the header collection of the batch operation." - /// - internal static string ODataBatchOperationHeaderDictionary_KeyNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchOperationHeaderDictionary_KeyNotFound, p0); - } - - /// - /// A string like "Multiple headers with names that match '{0}', when using a case insensitive comparison, have been added. When case-insensitive header names are used, at most one header can be added for each name." - /// - internal static string ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys, p0); - } - - /// - /// A string like "Writing an in-stream error is not supported when writing a parameter payload." - /// - internal static string ODataParameterWriter_InStreamErrorNotSupported - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriter_InStreamErrorNotSupported); - } - } - - /// - /// A string like "CreateParameterWriter was called on a response message. A parameter payload is only allowed in a request message." - /// - internal static string ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous." - /// - internal static string ODataParameterWriterCore_SyncCallOnAsyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_SyncCallOnAsyncWriter); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous." - /// - internal static string ODataParameterWriterCore_AsyncCallOnSyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_AsyncCallOnSyncWriter); - } - } - - /// - /// A string like "WriteStart can only be called once, and it must be called before writing anything else." - /// - internal static string ODataParameterWriterCore_CannotWriteStart - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteStart); - } - } - - /// - /// A string like "WriteValue and CreateCollectionWriter can only be called after WriteStart and before WriteEnd; they cannot be called until the previously created sub-writer is completed." - /// - internal static string ODataParameterWriterCore_CannotWriteParameter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteParameter); - } - } - - /// - /// A string like "WriteEnd can only be called after WriteStart and after the previously created sub-writer has completed." - /// - internal static string ODataParameterWriterCore_CannotWriteEnd - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteEnd); - } - } - - /// - /// A string like "The writer is in either the 'Error' or 'Completed' state. No further writes can be performed on this writer." - /// - internal static string ODataParameterWriterCore_CannotWriteInErrorOrCompletedState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteInErrorOrCompletedState); - } - } - - /// - /// A string like "The parameter '{0}' has already been written. Duplicate parameter names are not allowed in the parameter payload." - /// - internal static string ODataParameterWriterCore_DuplicatedParameterNameNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_DuplicatedParameterNameNotAllowed, p0); - } - - /// - /// A string like "The parameter '{0}' is of Edm type kind '{1}'. You cannot call WriteValue on a parameter that is not of Edm type kinds 'Primitive' or 'Enum'." - /// - internal static string ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind, p0, p1); - } - - /// - /// A string like "The value for parameter '{0}' is of type '{1}'. WriteValue can only write null, ODataEnumValue and primitive types that are not Stream type." - /// - internal static string ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType, p0, p1); - } - - /// - /// A string like "The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateCollectionWriter on a parameter that is not of Edm type kind 'Collection'." - /// - internal static string ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind, p0, p1); - } - - /// - /// A string like "The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceWriter on a parameter that is not of Edm type kind 'Entity' or 'Complex'." - /// - internal static string ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind, p0, p1); - } - - /// - /// A string like "The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceSetWriter on a parameter that is not of Edm type kind 'Collection(Entity)' or 'Collection(Complex)'." - /// - internal static string ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind, p0, p1); - } - - /// - /// A string like "The name '{0}' is not a recognized parameter name for operation '{1}'." - /// - internal static string ODataParameterWriterCore_ParameterNameNotFoundInOperation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_ParameterNameNotFoundInOperation, p0, p1); - } - - /// - /// A string like "The parameters {0} of the operation '{1}' could not be found when writing the parameter payload. All parameters present in the operation must be written to the parameter payload." - /// - internal static string ODataParameterWriterCore_MissingParameterInParameterPayload(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterWriterCore_MissingParameterInParameterPayload, p0, p1); - } - - /// - /// A string like "ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync was called while a stream being used to write operation content, obtained from the operation message by using GetStream or GetStreamAsync, was still active. This is not allowed. ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync can only be called when an active stream for the operation content does not exist." - /// - internal static string ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndBatch with an active change set; you must first call ODataBatchWriter.WriteEndChangeset." - /// - internal static string ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteStartChangeset with an active change set; you must first call ODataBatchWriter.WriteEndChangeset." - /// - internal static string ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndChangeset without an active change set; you must first call ODataBatchWriter.WriteStartChangeset." - /// - internal static string ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After creating the writer, the only valid methods are ODataBatchWriter.WriteStartBatch and ODataBatchWriter.FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromStart - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromStart); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After calling WriteStartBatch, the only valid methods on ODataBatchWriter are WriteStartChangeset, CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndBatch, and FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromBatchStarted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromBatchStarted); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After calling WriteStartChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndChangeset, and FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromChangeSetStarted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromChangeSetStarted); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After calling CreateOperationRequestMessage or CreateOperationResponseMessage, the only valid methods on ODataBatchWriter are WriteStartChangeset, WriteEndChangeset, WriteEndBatch, and FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromOperationCreated - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromOperationCreated); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. You cannot use the batch writer while another writer is writing the content of an operation. Dispose the stream for the operation before continuing to use the ODataBatchWriter." - /// - internal static string ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After writing the content of an operation, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndChangeset, WriteEndBatch and FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. After calling WriteEndChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndBatch, and FlushAsync." - /// - internal static string ODataBatchWriter_InvalidTransitionFromChangeSetCompleted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted); - } - } - - /// - /// A string like "An invalid method call on ODataBatchWriter was detected. You can only call ODataBatchWriter.FlushAsync after ODataBatchWriter.WriteEndBatch has been called." - /// - internal static string ODataBatchWriter_InvalidTransitionFromBatchCompleted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_InvalidTransitionFromBatchCompleted); - } - } - - /// - /// A string like "When writing a batch response, you cannot create a batch operation request message." - /// - internal static string ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse); - } - } - - /// - /// A string like "When writing a batch request, you cannot create a batch operation response message." - /// - internal static string ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest); - } - } - - /// - /// A string like "The current batch message contains too many parts. Only batch messages with a maximum number of '{0}' query operations and change sets are allowed." - /// - internal static string ODataBatchWriter_MaxBatchSizeExceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_MaxBatchSizeExceeded, p0); - } - - /// - /// A string like "The current change set contains too many operations. Only change sets with a maximum number of '{0}' operations are allowed." - /// - internal static string ODataBatchWriter_MaxChangeSetSizeExceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_MaxChangeSetSizeExceeded, p0); - } - - /// - /// A string like "A synchronous operation was called on an asynchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataBatchWriter_SyncCallOnAsyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_SyncCallOnAsyncWriter); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataBatchWriter_AsyncCallOnSyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_AsyncCallOnSyncWriter); - } - } - - /// - /// A string like "The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01." - /// - internal static string ODataBatchWriter_DuplicateContentIDsNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_DuplicateContentIDsNotAllowed, p0); - } - - /// - /// A string like "The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when a batch is being written by using ODataBatchWriter. In OData, writing an in-stream error for a batch payload is not supported." - /// - internal static string ODataBatchWriter_CannotWriteInStreamErrorForBatch - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchWriter_CannotWriteInStreamErrorForBatch); - } - } - - /// - /// A string like "The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader." - /// - internal static string ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified, p0); - } - - /// - /// A string like "The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. When the relative URI is a reference to a content ID, the content ID does not exist in the current change set." - /// - internal static string ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified, p0); - } - - /// - /// A string like "An attempt to change the properties of the message or to retrieve the payload stream for the message has failed. Either the payload stream has already been requested or the processing of the message has been completed. In both cases, no more changes can be made to the message." - /// - internal static string ODataBatchOperationMessage_VerifyNotCompleted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchOperationMessage_VerifyNotCompleted); - } - } - - /// - /// A string like "Cannot access a closed stream." - /// - internal static string ODataBatchOperationStream_Disposed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchOperationStream_Disposed); - } - } - - /// - /// A string like "When reading a batch response, you cannot create a batch operation request message." - /// - internal static string ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse); - } - } - - /// - /// A string like "When reading a batch request, you cannot create a batch operation response message." - /// - internal static string ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest); - } - } - - /// - /// A string like "The method CreateOperationRequestMessage was called in state '{0}', which is not allowed. CreateOperationRequestMessage can only be called in state 'Operation'." - /// - internal static string ODataBatchReader_InvalidStateForCreateOperationRequestMessage(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_InvalidStateForCreateOperationRequestMessage, p0); - } - - /// - /// A string like "A request message for the operation has already been created. You cannot create a request message for the same operation multiple times." - /// - internal static string ODataBatchReader_OperationRequestMessageAlreadyCreated - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_OperationRequestMessageAlreadyCreated); - } - } - - /// - /// A string like "A response message for the operation has already been created. You cannot create a response message for the same operation multiple times." - /// - internal static string ODataBatchReader_OperationResponseMessageAlreadyCreated - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_OperationResponseMessageAlreadyCreated); - } - } - - /// - /// A string like "The method CreateOperationResponseMessage was called in state '{0}', which is not allowed. CreateOperationResponseMessage can only be called in state 'Operation'." - /// - internal static string ODataBatchReader_InvalidStateForCreateOperationResponseMessage(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_InvalidStateForCreateOperationResponseMessage, p0); - } - - /// - /// A string like "You cannot use a batch reader while the stream for the content of an operation is still active. You must first dispose the operation stream before further calls to the batch reader are made." - /// - internal static string ODataBatchReader_CannotUseReaderWhileOperationStreamActive - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_CannotUseReaderWhileOperationStreamActive); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataBatchReader_SyncCallOnAsyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_SyncCallOnAsyncReader); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataBatchReader_AsyncCallOnSyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_AsyncCallOnSyncReader); - } - } - - /// - /// A string like "ODataBatchReader.ReadAsync or ODataBatchReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'." - /// - internal static string ODataBatchReader_ReadOrReadAsyncCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_ReadOrReadAsyncCalledInInvalidState, p0); - } - - /// - /// A string like "The current batch message contains too many parts. A maximum number of '{0}' query operations and change sets are allowed in a batch message." - /// - internal static string ODataBatchReader_MaxBatchSizeExceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_MaxBatchSizeExceeded, p0); - } - - /// - /// A string like "The current change set contains too many operations. A maximum number of '{0}' operations are allowed in a change set." - /// - internal static string ODataBatchReader_MaxChangeSetSizeExceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_MaxChangeSetSizeExceeded, p0); - } - - /// - /// A string like "An operation was detected, but no message was created for it. You must create a message for every operation found in a batch or change set." - /// - internal static string ODataBatchReader_NoMessageWasCreatedForOperation - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_NoMessageWasCreatedForOperation); - } - } - - /// - /// A string like "Reader mode is not setup correctly." - /// - internal static string ODataBatchReader_ReaderModeNotInitilized - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_ReaderModeNotInitilized); - } - } - - /// - /// A string like "Json batch format requires top level property name 'requests' or 'response' but it is missing." - /// - internal static string ODataBatchReader_JsonBatchTopLevelPropertyMissing - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_JsonBatchTopLevelPropertyMissing); - } - } - - /// - /// A string like "The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01." - /// - internal static string ODataBatchReader_DuplicateContentIDsNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_DuplicateContentIDsNotAllowed, p0); - } - - /// - /// A string like "The atomicityGroup ID [{0}] was found duplicated in the batch request. AtomicityGroup IDs have to be adjacent, otherwise would be detected as duplicated." - /// - internal static string ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed, p0); - } - - /// - /// A string like "Request property [{0}] is required but is missing." - /// - internal static string ODataBatchReader_RequestPropertyMissing(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_RequestPropertyMissing, p0); - } - - /// - /// A string like "The dependsOn request Id [{0}] is same as atomicityGroup property value [{1}], and is not allowed." - /// - internal static string ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed, p0, p1); - } - - /// - /// A string like "The dependsOn request Id [{0}] is same as id property value [{1}], and it is not allowed." - /// - internal static string ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed, p0, p1); - } - - /// - /// A string like "The dependsOn request Id [{0}] is part of atomic group [{1}]. Therefore dependsOn property should refer to atomic group Id [{1}] instead." - /// - internal static string ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed, p0, p1); - } - - /// - /// A string like "The dependsOn Id: [{0}] in request [{1}] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed." - /// - internal static string ODataBatchReader_DependsOnIdNotFound(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_DependsOnIdNotFound, p0, p1); - } - - /// - /// A string like "Absolute URI {0} is not start with the base URI [{1}] specified by the operation message." - /// - internal static string ODataBatchReader_AbsoluteURINotMatchingBaseUri(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_AbsoluteURINotMatchingBaseUri, p0, p1); - } - - /// - /// A string like "Request Id reference [{0}] in Uri [{1}] is not found in effective depends-on-Ids [{2}] of the request." - /// - internal static string ODataBatchReader_ReferenceIdNotIncludedInDependsOn(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_ReferenceIdNotIncludedInDependsOn, p0, p1, p2); - } - - /// - /// A string like "Group id or changeset GUID cannot be null." - /// - internal static string ODataBatch_GroupIdOrChangeSetIdCannotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatch_GroupIdOrChangeSetIdCannotBeNull); - } - } - - /// - /// A string like "Message with id [{0}] is positioned incorrectly: all messages of same groupId [{1}] must be adjacent." - /// - internal static string ODataBatchReader_MessageIdPositionedIncorrectly(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_MessageIdPositionedIncorrectly, p0, p1); - } - - /// - /// A string like "Changeset boundary must have been set by now." - /// - internal static string ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull); - } - } - - /// - /// A string like "The message header '{0}' is invalid. The header value must be of the format '<header name>: <header value>'." - /// - internal static string ODataBatchReaderStream_InvalidHeaderSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidHeaderSpecified, p0); - } - - /// - /// A string like "The request line '{0}' is invalid. The request line at the start of each operation must be of the format 'HttpMethod RequestUrl HttpVersion'." - /// - internal static string ODataBatchReaderStream_InvalidRequestLine(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidRequestLine, p0); - } - - /// - /// A string like "The response line '{0}' is invalid. The response line at the start of each operation must be of the format 'HttpVersion StatusCode StatusCodeString'." - /// - internal static string ODataBatchReaderStream_InvalidResponseLine(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidResponseLine, p0); - } - - /// - /// A string like "The HTTP version '{0}' used in a batch operation request or response is not valid. The value must be '{1}'." - /// - internal static string ODataBatchReaderStream_InvalidHttpVersionSpecified(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidHttpVersionSpecified, p0, p1); - } - - /// - /// A string like " The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value." - /// - internal static string ODataBatchReaderStream_NonIntegerHttpStatusCode(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_NonIntegerHttpStatusCode, p0); - } - - /// - /// A string like "The 'Content-Type' header is missing. The 'Content-Type' header must be specified for each MIME part of a batch message." - /// - internal static string ODataBatchReaderStream_MissingContentTypeHeader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_MissingContentTypeHeader); - } - } - - /// - /// A string like "A missing or invalid '{0}' header was found. The '{0}' header must be specified for each batch operation, and its value must be '{1}'." - /// - internal static string ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader, p0, p1); - } - - /// - /// A string like "The '{0}' header value '{1}' is invalid. When this is the start of the change set, the value must be '{2}'; otherwise it must be '{3}'." - /// - internal static string ODataBatchReaderStream_InvalidContentTypeSpecified(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidContentTypeSpecified, p0, p1, p2, p3); - } - - /// - /// A string like "The content length header '{0}' is not valid. The content length header must be a valid Int32 literal and must be greater than or equal to 0." - /// - internal static string ODataBatchReaderStream_InvalidContentLengthSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_InvalidContentLengthSpecified, p0); - } - - /// - /// A string like "The header '{0}' was specified multiple times. Each header must appear only once in a batch part." - /// - internal static string ODataBatchReaderStream_DuplicateHeaderFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_DuplicateHeaderFound, p0); - } - - /// - /// A string like "Nested change sets in a batch payload are not supported." - /// - internal static string ODataBatchReaderStream_NestedChangesetsAreNotSupported - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_NestedChangesetsAreNotSupported); - } - } - - /// - /// A string like "Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for operation payloads. They are not supported in batch or change set parts." - /// - internal static string ODataBatchReaderStream_MultiByteEncodingsNotSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_MultiByteEncodingsNotSupported, p0); - } - - /// - /// A string like "Encountered an unexpected end of input while reading the batch payload." - /// - internal static string ODataBatchReaderStream_UnexpectedEndOfInput - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStream_UnexpectedEndOfInput); - } - } - - /// - /// A string like "Too many white spaces after a boundary delimiter and before the terminating line resource set. For security reasons, the total number of characters for a boundary including white spaces must not exceed {0}." - /// - internal static string ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached, p0); - } - - /// - /// A string like "Unknown property name '{0}' for message in batch." - /// - internal static string ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch, p0); - } - - /// - /// A string like "Duplicate property name '{0}' for request in batch." - /// - internal static string ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch, p0); - } - - /// - /// A string like "Duplicate header name '{0}' for request in batch." - /// - internal static string ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch, p0); - } - - /// - /// A string like "Unexpected reader.NodeType: {0}." - /// - internal static string ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType, p0); - } - - /// - /// A string like "Unknown/undefined type, new type that needs to be supported: {0}?" - /// - internal static string ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader, p0); - } - - /// - /// A string like "When not writing an async response, you cannot create an async response message." - /// - internal static string ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse); - } - } - - /// - /// A string like "You cannot create an async response message more than once." - /// - internal static string ODataAsyncWriter_CannotCreateResponseMoreThanOnce - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncWriter_CannotCreateResponseMoreThanOnce); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataAsyncWriter_SyncCallOnAsyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncWriter_SyncCallOnAsyncWriter); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous." - /// - internal static string ODataAsyncWriter_AsyncCallOnSyncWriter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncWriter_AsyncCallOnSyncWriter); - } - } - - /// - /// A string like "The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when an async message is being written by using ODataAsyncWriter. In OData, writing an in-stream error for an async payload is not supported." - /// - internal static string ODataAsyncWriter_CannotWriteInStreamErrorForAsync - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncWriter_CannotWriteInStreamErrorForAsync); - } - } - - /// - /// A string like "The message header '{0}' is invalid. The header value must be of the format '<header name>: <header value>'." - /// - internal static string ODataAsyncReader_InvalidHeaderSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_InvalidHeaderSpecified, p0); - } - - /// - /// A string like "When not reading an async response, you cannot create an async response message." - /// - internal static string ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse); - } - } - - /// - /// A string like "The response line '{0}' is invalid. The response line at the start of the async response must be of the format 'HttpVersion StatusCode StatusCodeString'." - /// - internal static string ODataAsyncReader_InvalidResponseLine(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_InvalidResponseLine, p0); - } - - /// - /// A string like "The HTTP version '{0}' used in an async response is not valid. The value must be '{1}'." - /// - internal static string ODataAsyncReader_InvalidHttpVersionSpecified(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_InvalidHttpVersionSpecified, p0, p1); - } - - /// - /// A string like "The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value." - /// - internal static string ODataAsyncReader_NonIntegerHttpStatusCode(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_NonIntegerHttpStatusCode, p0); - } - - /// - /// A string like "The header '{0}' was specified multiple times. Each header must appear only once." - /// - internal static string ODataAsyncReader_DuplicateHeaderFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_DuplicateHeaderFound, p0); - } - - /// - /// A string like "Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for async payloads. They are not supported in batch or change set parts." - /// - internal static string ODataAsyncReader_MultiByteEncodingsNotSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_MultiByteEncodingsNotSupported, p0); - } - - /// - /// A string like "Invalid new line '{0}' encountered. Should be '\r\n'." - /// - internal static string ODataAsyncReader_InvalidNewLineEncountered(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_InvalidNewLineEncountered, p0); - } - - /// - /// A string like "Encountered an unexpected end of input while reading the async payload. Could be due to calling CreateResponseMessage() more than once." - /// - internal static string ODataAsyncReader_UnexpectedEndOfInput - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_UnexpectedEndOfInput); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataAsyncReader_SyncCallOnAsyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_SyncCallOnAsyncReader); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataAsyncReader_AsyncCallOnSyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncReader_AsyncCallOnSyncReader); - } - } - - /// - /// A string like "The MIME type '{0}' is invalid or unspecified." - /// - internal static string HttpUtils_MediaTypeUnspecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeUnspecified, p0); - } - - /// - /// A string like "The MIME type '{0}' requires a '/' character between type and subtype, such as 'text/plain'." - /// - internal static string HttpUtils_MediaTypeRequiresSlash(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeRequiresSlash, p0); - } - - /// - /// A string like "The MIME type '{0}' requires a subtype definition." - /// - internal static string HttpUtils_MediaTypeRequiresSubType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeRequiresSubType, p0); - } - - /// - /// A string like "The MIME type is missing a parameter value for a parameter with the name '{0}'." - /// - internal static string HttpUtils_MediaTypeMissingParameterValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeMissingParameterValue, p0); - } - - /// - /// A string like "The MIME type is missing a parameter name for a parameter definition." - /// - internal static string HttpUtils_MediaTypeMissingParameterName - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeMissingParameterName); - } - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the escape character '{3}' is not inside a quoted-string." - /// - internal static string HttpUtils_EscapeCharWithoutQuotes(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_EscapeCharWithoutQuotes, p0, p1, p2, p3); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because it terminates with the escape character '{3}'. In a quoted-string, the escape characters must always be followed by a character." - /// - internal static string HttpUtils_EscapeCharAtEnd(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_EscapeCharAtEnd, p0, p1, p2, p3); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the closing quote character was not found for the quoted-string." - /// - internal static string HttpUtils_ClosingQuoteNotFound(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_ClosingQuoteNotFound, p0, p1, p2); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the character '{3}' is not allowed in a quoted-string. For more information, see RFC 2616, Sections 3.6 and 2.2." - /// - internal static string HttpUtils_InvalidCharacterInQuotedParameterValue(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidCharacterInQuotedParameterValue, p0, p1, p2, p3); - } - - /// - /// A string like "The value for the Content-Type header is missing." - /// - internal static string HttpUtils_ContentTypeMissing - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_ContentTypeMissing); - } - } - - /// - /// A string like "The MIME type '{0}' requires a semi-colon character (';') before a parameter definition." - /// - internal static string HttpUtils_MediaTypeRequiresSemicolonBeforeParameter(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MediaTypeRequiresSemicolonBeforeParameter, p0); - } - - /// - /// A string like "An invalid quality value was detected in the header string '{0}'; quality values must start with '0' or '1' but not with '{1}'." - /// - internal static string HttpUtils_InvalidQualityValueStartChar(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidQualityValueStartChar, p0, p1); - } - - /// - /// A string like "An invalid quality value '{0}' was detected in the header string '{1}'; quality values must be in the range [0, 1]." - /// - internal static string HttpUtils_InvalidQualityValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidQualityValue, p0, p1); - } - - /// - /// A string like "An error occurred when converting the character '{0}' to an integer." - /// - internal static string HttpUtils_CannotConvertCharToInt(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_CannotConvertCharToInt, p0); - } - - /// - /// A string like "The separator ',' was missing between charset values in the header '{0}'." - /// - internal static string HttpUtils_MissingSeparatorBetweenCharsets(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_MissingSeparatorBetweenCharsets, p0); - } - - /// - /// A string like "A separator character was missing between charset values in the header '{0}'." - /// - internal static string HttpUtils_InvalidSeparatorBetweenCharsets(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidSeparatorBetweenCharsets, p0); - } - - /// - /// A string like "An invalid (empty) charset name found in the header '{0}'." - /// - internal static string HttpUtils_InvalidCharsetName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidCharsetName, p0); - } - - /// - /// A string like "An unexpected end of the q-Value was detected in the header '{0}'." - /// - internal static string HttpUtils_UnexpectedEndOfQValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_UnexpectedEndOfQValue, p0); - } - - /// - /// A string like "The expected literal '{0}' was not found at position '{1}' in the string '{2}'." - /// - internal static string HttpUtils_ExpectedLiteralNotFoundInString(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_ExpectedLiteralNotFoundInString, p0, p1, p2); - } - - /// - /// A string like "The string '{0}' cannot be converted into a supported HTTP method. The only supported HTTP methods are GET, DELETE, PUT, POST and PATCH." - /// - internal static string HttpUtils_InvalidHttpMethodString(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_InvalidHttpMethodString, p0); - } - - /// - /// A string like "The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type." - /// - internal static string HttpUtils_NoOrMoreThanOneContentTypeSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpUtils_NoOrMoreThanOneContentTypeSpecified, p0); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a recognized separator. The supported separators are ',', ';', and '='." - /// - internal static string HttpHeaderValueLexer_UnrecognizedSeparator(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpHeaderValueLexer_UnrecognizedSeparator, p0, p1, p2, p3); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token is expected but a quoted-string is found instead." - /// - internal static string HttpHeaderValueLexer_TokenExpectedButFoundQuotedString(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString, p0, p1, p2); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token or a quoted-string is expected at this position but were not found." - /// - internal static string HttpHeaderValueLexer_FailedToReadTokenOrQuotedString(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, p0, p1, p2); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a valid separator after a quoted-string." - /// - internal static string HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString, p0, p1, p2, p3); - } - - /// - /// A string like "An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the header value should not end with the separator '{3}'." - /// - internal static string HttpHeaderValueLexer_EndOfFileAfterSeparator(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.HttpHeaderValueLexer_EndOfFileAfterSeparator, p0, p1, p2, p3); - } - - /// - /// A string like "The character set '{0}' is not supported." - /// - internal static string MediaType_EncodingNotSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MediaType_EncodingNotSupported, p0); - } - - /// - /// A string like "A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) '{0}' do not match any of the acceptable MIME types '{1}'." - /// - internal static string MediaTypeUtils_DidNotFindMatchingMediaType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MediaTypeUtils_DidNotFindMatchingMediaType, p0, p1); - } - - /// - /// A string like "A supported MIME type could not be found that matches the content type of the response. None of the supported type(s) '{0}' matches the content type '{1}'." - /// - internal static string MediaTypeUtils_CannotDetermineFormatFromContentType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MediaTypeUtils_CannotDetermineFormatFromContentType, p0, p1); - } - - /// - /// A string like "The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type." - /// - internal static string MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified, p0); - } - - /// - /// A string like "The content type '{0}' specifies a batch payload; however, the payload either does not include a batch boundary or includes more than one boundary. In OData, batch payload content types must specify exactly one batch boundary in the '{1}' parameter of the content type." - /// - internal static string MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads, p0, p1); - } - - /// - /// A string like "Expected literal type token but found token '{0}'." - /// - internal static string ExpressionLexer_ExpectedLiteralToken(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_ExpectedLiteralToken, p0); - } - - /// - /// A string like "The type '{0}' is not supported when converting to a URI literal." - /// - internal static string ODataUriUtils_ConvertToUriLiteralUnsupportedType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertToUriLiteralUnsupportedType, p0); - } - - /// - /// A string like "An IEdmTypeReference must be provided with a matching IEdmModel. No model was provided." - /// - internal static string ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel); - } - } - - /// - /// A string like "The overflow exception caught for expected type '{0}'. '{1}'." - /// - internal static string ODataUriUtils_ConvertFromUriLiteralOverflowNumber(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertFromUriLiteralOverflowNumber, p0, p1); - } - - /// - /// A string like "Type verification failed. Expected type '{0}' but received the value '{1}'." - /// - internal static string ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure, p0, p1); - } - - /// - /// A string like "Type verification failed. Expected type '{0}' but received non-matching null value with associated type '{1}'." - /// - internal static string ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure, p0, p1); - } - - /// - /// A string like "Type verification failed. Expected non-nullable type '{0}' but received a null value." - /// - internal static string ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType, p0); - } - - /// - /// A string like "The value of type '{0}' could not be converted to a raw string." - /// - internal static string ODataUtils_CannotConvertValueToRawString(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_CannotConvertValueToRawString, p0); - } - - /// - /// A string like "A default MIME type could not be found for the requested payload in format '{0}'." - /// - internal static string ODataUtils_DidNotFindDefaultMediaType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_DidNotFindDefaultMediaType, p0); - } - - /// - /// A string like "The value '{0}' of the OData-Version HTTP header is invalid. Only '4.0' and '4.01' are supported as values for the OData-Version header." - /// - internal static string ODataUtils_UnsupportedVersionHeader(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_UnsupportedVersionHeader, p0); - } - - /// - /// A string like "An OData version of {0} was specified and the maximum supported OData version is {1}." - /// - internal static string ODataUtils_MaxProtocolVersionExceeded(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_MaxProtocolVersionExceeded, p0, p1); - } - - /// - /// A string like "An invalid enum value was specified for the version number." - /// - internal static string ODataUtils_UnsupportedVersionNumber - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_UnsupportedVersionNumber); - } - } - - /// - /// A string like "The provided model does not contain an entity container." - /// - internal static string ODataUtils_ModelDoesNotHaveContainer - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUtils_ModelDoesNotHaveContainer); - } - } - - /// - /// A string like "The value returned by the '{0}' property cannot be modified until the end of the owning resource is reported by the reader." - /// - internal static string ReaderUtils_EnumerableModified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderUtils_EnumerableModified, p0); - } - - /// - /// A string like "A null value was found with the expected type '{0}[Nullable=False]'. The expected type '{0}[Nullable=False]' does not allow null values." - /// - internal static string ReaderValidationUtils_NullValueForNonNullableType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_NullValueForNonNullableType, p0); - } - - /// - /// A string like "A null value was found for a collection of type '{0}[Nullable=True]. Collection-valued properties with Nullable=True can contain null values, but collection-valued properties cannot themselves be null." - /// - internal static string ReaderValidationUtils_NullValueForNullableType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_NullValueForNullableType, p0); - } - - /// - /// A string like "A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values." - /// - internal static string ReaderValidationUtils_NullNamedValueForNonNullableType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_NullNamedValueForNonNullableType, p0, p1); - } - - /// - /// A string like "A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=True]'. The expected type '{1}[Nullable=True]' cannot be null but it can have null values." - /// - internal static string ReaderValidationUtils_NullNamedValueForNullableType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_NullNamedValueForNullableType, p0, p1); - } - - /// - /// A string like "No URI value was found for an entity reference link. A single URI value was expected." - /// - internal static string ReaderValidationUtils_EntityReferenceLinkMissingUri - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_EntityReferenceLinkMissingUri); - } - } - - /// - /// A string like "A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value." - /// - internal static string ReaderValidationUtils_ValueWithoutType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ValueWithoutType); - } - } - - /// - /// A string like "A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified." - /// - internal static string ReaderValidationUtils_ResourceWithoutType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ResourceWithoutType); - } - } - - /// - /// A string like "Cannot convert the literal '{0}' to the expected type '{1}'." - /// - internal static string ReaderValidationUtils_CannotConvertPrimitiveValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_CannotConvertPrimitiveValue, p0, p1); - } - - /// - /// A string like "The base URI '{0}' specified in ODataMessageReaderSettings.BaseUri is invalid; it must be either null or an absolute URI." - /// - internal static string ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute, p0); - } - - /// - /// A string like "The ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds is not set to ODataUndeclaredPropertyBehaviorKinds.None. When reading request payloads, the ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds property must be set to ODataUndeclaredPropertyBehaviorKinds.None; other values are not supported." - /// - internal static string ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest); - } - } - - /// - /// A string like "The context URI '{0}' references the entity set with name '{1}'; however, the name of the expected entity set is '{2}' and does not match the entity set referenced in the context URI." - /// - internal static string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet, p0, p1, p2); - } - - /// - /// A string like "The context URI '{0}' references the entity type with name '{1}'; however, the name of the expected entity type is '{2}' which is not compatible with the entity type with name '{1}'." - /// - internal static string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType, p0, p1, p2); - } - - /// - /// A string like "The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the name of the expected property is '{3}'." - /// - internal static string ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames, p0, p1, p2, p3); - } - - /// - /// A string like "The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the declaring type of the expected property is '{3}'." - /// - internal static string ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes, p0, p1, p2, p3); - } - - /// - /// A string like "The property or operation import name '{0}' was read from the payload; however, the name of the expected property or operation import is '{1}'." - /// - internal static string ReaderValidationUtils_NonMatchingPropertyNames(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_NonMatchingPropertyNames, p0, p1); - } - - /// - /// A string like "The context URI '{0}' references the type '{1}'; however the expected type is '{2}'." - /// - internal static string ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType, p0, p1, p2); - } - - /// - /// A string like "The context URI '{0}' refers to the item type '{1}' which is not assignable to the expected item type '{2}'." - /// - internal static string ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType, p0, p1, p2); - } - - /// - /// A string like "The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'." - /// - internal static string ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, p0, p1, p2); - } - - /// - /// A string like "The ODataMessageReader has already been used to read a message payload. An ODataMessageReader can only be used once to read a payload for a given message." - /// - internal static string ODataMessageReader_ReaderAlreadyUsed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ReaderAlreadyUsed); - } - } - - /// - /// A string like "A top-level error cannot be read from request payloads. Top-level errors are only supported in responses." - /// - internal static string ODataMessageReader_ErrorPayloadInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ErrorPayloadInRequest); - } - } - - /// - /// A string like "A service document cannot be read from request payloads. Service documents are only supported in responses." - /// - internal static string ODataMessageReader_ServiceDocumentInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ServiceDocumentInRequest); - } - } - - /// - /// A string like "A metadata document cannot be read from request payloads. Metadata documents are only supported in responses." - /// - internal static string ODataMessageReader_MetadataDocumentInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_MetadataDocumentInRequest); - } - } - - /// - /// A string like "Delta are only supported in responses." - /// - internal static string ODataMessageReader_DeltaInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_DeltaInRequest); - } - } - - /// - /// A string like "The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The expected type can only be specified if metadata is made available to the reader." - /// - internal static string ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata, p0); - } - - /// - /// A string like "The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The entity set can only be specified if metadata is made available to the reader." - /// - internal static string ODataMessageReader_EntitySetSpecifiedWithoutMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_EntitySetSpecifiedWithoutMetadata, p0); - } - - /// - /// A string like "The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation import can only be specified if metadata is made available to the reader." - /// - internal static string ODataMessageReader_OperationImportSpecifiedWithoutMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_OperationImportSpecifiedWithoutMetadata, p0); - } - - /// - /// A string like "The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation can only be specified if metadata is made available to the reader." - /// - internal static string ODataMessageReader_OperationSpecifiedWithoutMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_OperationSpecifiedWithoutMetadata, p0); - } - - /// - /// A string like "The expected type for a collection reader is of kind '{0}'. Only types of Primitive or ComplexType kind can be specified as the expected type for a collection reader." - /// - internal static string ODataMessageReader_ExpectedCollectionTypeWrongKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedCollectionTypeWrongKind, p0); - } - - /// - /// A string like "The expected type for property reading is of entity collection kind. Top-level properties can only be of primitive, complex, primitive collection or complex collection kind." - /// - internal static string ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind); - } - } - - /// - /// A string like "The expected type for property reading is of entity kind. Top-level properties cannot be of entity type." - /// - internal static string ODataMessageReader_ExpectedPropertyTypeEntityKind - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedPropertyTypeEntityKind); - } - } - - /// - /// A string like "The expected type for property reading is Edm.Stream. Top-level properties cannot be of stream type." - /// - internal static string ODataMessageReader_ExpectedPropertyTypeStream - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedPropertyTypeStream); - } - } - - /// - /// A string like "The expected type for a value is of kind '{0}'. Only types of Primitive kind can be specified as the expected type for reading a value." - /// - internal static string ODataMessageReader_ExpectedValueTypeWrongKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ExpectedValueTypeWrongKind, p0); - } - - /// - /// A string like "A missing or empty content type header was found when trying to read a message. The content type header is required." - /// - internal static string ODataMessageReader_NoneOrEmptyContentTypeHeader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_NoneOrEmptyContentTypeHeader); - } - } - - /// - /// A string like "The wildcard '*' was detected in the value '{0}' of the content type header. The value of the content type header cannot contain wildcards." - /// - internal static string ODataMessageReader_WildcardInContentType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_WildcardInContentType, p0); - } - - /// - /// A string like "GetFormat was called before reading was started. GetFormat can only be called after a read method was called or a reader was created." - /// - internal static string ODataMessageReader_GetFormatCalledBeforeReadingStarted - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_GetFormatCalledBeforeReadingStarted); - } - } - - /// - /// A string like "DetectPayloadKind or DetectPayloadKindAsync was called more than once; DetectPayloadKind or DetectPayloadKindAsync can only be called once." - /// - internal static string ODataMessageReader_DetectPayloadKindMultipleTimes - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_DetectPayloadKindMultipleTimes); - } - } - - /// - /// A string like "Payload kind detection has not completed. Read or create methods cannot be called on the ODataMessageReader before payload kind detection is complete." - /// - internal static string ODataMessageReader_PayloadKindDetectionRunning - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_PayloadKindDetectionRunning); - } - } - - /// - /// A string like "The ODataMessageReader is using the server behavior for WCF Data Services, as specified in its settings. Payload kind detection is not supported when using the WCF Data services server behavior." - /// - internal static string ODataMessageReader_PayloadKindDetectionInServerMode - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_PayloadKindDetectionInServerMode); - } - } - - /// - /// A string like "A parameter payload cannot be read from a response payload. Parameter payloads are only supported in requests." - /// - internal static string ODataMessageReader_ParameterPayloadInResponse - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_ParameterPayloadInResponse); - } - } - - /// - /// A string like "The navigation property '{0}' with singleton cardinality on type '{1}' was specified for reading a collection of entity reference links. A navigation property with collection cardinality has to be provided." - /// - internal static string ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks, p0, p1); - } - - /// - /// A string like "An attempt was made to modify the message. The message cannot be modified." - /// - internal static string ODataAsyncResponseMessage_MustNotModifyMessage - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataAsyncResponseMessage_MustNotModifyMessage); - } - } - - /// - /// A string like "An attempt was made to modify the message. The message cannot be modified." - /// - internal static string ODataMessage_MustNotModifyMessage - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMessage_MustNotModifyMessage); - } - } - - /// - /// A string like "A synchronous operation was called on an asynchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataReaderCore_SyncCallOnAsyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_SyncCallOnAsyncReader); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous." - /// - internal static string ODataReaderCore_AsyncCallOnSyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_AsyncCallOnSyncReader); - } - } - - /// - /// A string like "ODataReader.ReadAsync or ODataReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'." - /// - internal static string ODataReaderCore_ReadOrReadAsyncCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_ReadOrReadAsyncCalledInInvalidState, p0); - } - - /// - /// A string like "CreateReadStream was called in an invalid state. CreateReadStream can only be called once in ReaderState.Stream." - /// - internal static string ODataReaderCore_CreateReadStreamCalledInInvalidState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_CreateReadStreamCalledInInvalidState); - } - } - - /// - /// A string like "CreateTextReader was called in an invalid state. CreateTextReader can only be called once in ReaderState.Stream." - /// - internal static string ODataReaderCore_CreateTextReaderCalledInInvalidState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_CreateTextReaderCalledInInvalidState); - } - } - - /// - /// A string like "Read called with an open stream or textreader. Please close any open streams or text readers before calling Read." - /// - internal static string ODataReaderCore_ReadCalledWithOpenStream - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_ReadCalledWithOpenStream); - } - } - - /// - /// A string like "Calling Read or ReadAsync on an ODataReader instance is not allowed in state '{0}'." - /// - internal static string ODataReaderCore_NoReadCallsAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataReaderCore_NoReadCallsAllowed, p0); - } - - /// - /// A string like "Attempted to write a value for a property {0} whose value has already been written." - /// - internal static string ODataWriterCore_PropertyValueAlreadyWritten(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataWriterCore_PropertyValueAlreadyWritten, p0); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the resources of a resource set. A 'StartObject' or 'EndArray' node was expected." - /// - internal static string ODataJsonReader_CannotReadResourcesOfResourceSet(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReader_CannotReadResourcesOfResourceSet, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.Int32' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertInt32(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertInt32, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.Double' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertDouble(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertDouble, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.Boolean' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertBoolean(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertBoolean, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.Decimal' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertDecimal(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertDecimal, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.DateTime' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertDateTime(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertDateTime, p0); - } - - /// - /// A string like "Cannot convert a value of type 'Edm.DateTimeOffset' to the expected target type '{0}'." - /// - internal static string ODataJsonReaderUtils_CannotConvertDateTimeOffset(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_CannotConvertDateTimeOffset, p0); - } - - /// - /// A string like "Cannot convert a value to target type '{0}' because of conflict between input format string/number and parameter 'IEEE754Compatible' false/true." - /// - internal static string ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, p0); - } - - /// - /// A string like "Multiple '{0}' properties were found in an error or inner error object. In OData, an error or inner error must have at most one '{0}' property." - /// - internal static string ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName, p0); - } - - /// - /// A string like "Multiple operations have the same 'Metadata' property value of '{0}'. The 'Target' property value of these operations must be set to a non-null value." - /// - internal static string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget, p0); - } - - /// - /// A string like "Multiple operations have the same 'Metadata' property value of '{0}' and the same 'Target' property value of '{1}'. When multiple operations have the same 'Metadata' property value, their 'Target' property values must be unique." - /// - internal static string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget, p0, p1); - } - - /// - /// A string like "A property with name '{0}' was found in the error object when reading a top-level error. In OData, a top-level error object must have exactly one property with name 'error'." - /// - internal static string ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty, p0); - } - - /// - /// A string like "A property with name '{0}' was found in the message value of a top-level error. In OData, the message value of a top-level error value can only have properties with name 'lang' or 'value'." - /// - internal static string ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty, p0); - } - - /// - /// A string like "ODataCollectionReader.ReadAsync or ODataCollectionReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'." - /// - internal static string ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState, p0); - } - - /// - /// A string like "A synchronous operation was called on an asynchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous." - /// - internal static string ODataCollectionReaderCore_SyncCallOnAsyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionReaderCore_SyncCallOnAsyncReader); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous." - /// - internal static string ODataCollectionReaderCore_AsyncCallOnSyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionReaderCore_AsyncCallOnSyncReader); - } - } - - /// - /// A string like "The current state of the collection reader is '{0}'; however, the expected item type of a collection reader can only be set in state '{1}'." - /// - internal static string ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState, p0, p1); - } - - /// - /// A string like "ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'." - /// - internal static string ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState, p0); - } - - /// - /// A string like "A synchronous operation was called on an asynchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous." - /// - internal static string ODataParameterReaderCore_SyncCallOnAsyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_SyncCallOnAsyncReader); - } - } - - /// - /// A string like "An asynchronous operation was called on a synchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous." - /// - internal static string ODataParameterReaderCore_AsyncCallOnSyncReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_AsyncCallOnSyncReader); - } - } - - /// - /// A string like "ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state. '{1}' must be called in this state, and the created reader must be in the 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called." - /// - internal static string ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall, p0, p1); - } - - /// - /// A string like "ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state and '{1}' was called but the created reader is not in the 'Completed' state. The created reader must be in 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called." - /// - internal static string ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall, p0, p1); - } - - /// - /// A string like "You cannot call the method '{0}' in state '{1}'." - /// - internal static string ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState, p0, p1); - } - - /// - /// A string like "The '{0}' method has already been called for the parameter '{1}'. Only one create reader method call is allowed for each resource, resource set, or collection parameter." - /// - internal static string ODataParameterReaderCore_CreateReaderAlreadyCalled(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_CreateReaderAlreadyCalled, p0, p1); - } - - /// - /// A string like "The parameter '{0}' in the request payload is not a valid parameter for the operation '{1}'." - /// - internal static string ODataParameterReaderCore_ParameterNameNotInMetadata(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_ParameterNameNotInMetadata, p0, p1); - } - - /// - /// A string like "Multiple parameters with the name '{0}' were found in the request payload." - /// - internal static string ODataParameterReaderCore_DuplicateParametersInPayload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_DuplicateParametersInPayload, p0); - } - - /// - /// A string like "One or more parameters of the operation '{0}' are missing from the request payload. The missing parameters are: {1}." - /// - internal static string ODataParameterReaderCore_ParametersMissingInPayload(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataParameterReaderCore_ParametersMissingInPayload, p0, p1); - } - - /// - /// A string like "The 'Metadata' property on an {0} must be set to a non-null value." - /// - internal static string ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, p0); - } - - /// - /// A string like "The 'Target' property on an {0} must be set to a non-null value." - /// - internal static string ValidationUtils_ActionsAndFunctionsMustSpecifyTarget(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ActionsAndFunctionsMustSpecifyTarget, p0); - } - - /// - /// A string like "The '{0}' enumerable contains a null item. This enumerable cannot contain null items." - /// - internal static string ValidationUtils_EnumerableContainsANullItem(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_EnumerableContainsANullItem, p0); - } - - /// - /// A string like "The 'Name' property on an ODataAssociationLink must be set to a non-empty string." - /// - internal static string ValidationUtils_AssociationLinkMustSpecifyName - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_AssociationLinkMustSpecifyName); - } - } - - /// - /// A string like "The 'Url' property on an ODataAssociationLink must be set to a non-null value that represents the association or associations the link references." - /// - internal static string ValidationUtils_AssociationLinkMustSpecifyUrl - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_AssociationLinkMustSpecifyUrl); - } - } - - /// - /// A string like "An empty type name was found; the name of a type cannot be an empty string." - /// - internal static string ValidationUtils_TypeNameMustNotBeEmpty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_TypeNameMustNotBeEmpty); - } - } - - /// - /// A string like "The property '{0}' does not exist on type '{1}'. Make sure to only use property names that are defined by the type or mark the type as open type." - /// - internal static string ValidationUtils_PropertyDoesNotExistOnType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_PropertyDoesNotExistOnType, p0, p1); - } - - /// - /// A string like "The 'Url' property on a resource collection must be set to a non-null value." - /// - internal static string ValidationUtils_ResourceMustSpecifyUrl - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ResourceMustSpecifyUrl); - } - } - - /// - /// A string like "The 'Name' property on a resource collection with the 'Url' '{0}' must be set to a non-null value." - /// - internal static string ValidationUtils_ResourceMustSpecifyName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ResourceMustSpecifyName, p0); - } - - /// - /// A string like "A service document element without a Url was detected; a service document element must have a non-null Url value." - /// - internal static string ValidationUtils_ServiceDocumentElementUrlMustNotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ServiceDocumentElementUrlMustNotBeNull); - } - } - - /// - /// A string like "A primitive value was specified; however, a value of the non-primitive type '{0}' was expected." - /// - internal static string ValidationUtils_NonPrimitiveTypeForPrimitiveValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_NonPrimitiveTypeForPrimitiveValue, p0); - } - - /// - /// A string like "Unsupported primitive type. A primitive type could not be determined for an instance of type '{0}'." - /// - internal static string ValidationUtils_UnsupportedPrimitiveType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_UnsupportedPrimitiveType, p0); - } - - /// - /// A string like "An incompatible primitive type '{0}[Nullable={1}]' was found for an item that was expected to be of type '{2}[Nullable={3}]'." - /// - internal static string ValidationUtils_IncompatiblePrimitiveItemType(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_IncompatiblePrimitiveItemType, p0, p1, p2, p3); - } - - /// - /// A string like "A null value was detected in the items of a collection property value; non-nullable instances of collection types do not support null values as items." - /// - internal static string ValidationUtils_NonNullableCollectionElementsMustNotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_NonNullableCollectionElementsMustNotBeNull); - } - } - - /// - /// A string like "Type name '{0}' is an invalid collection type name; a collection type name must be in the format 'Collection(<itemTypeName>)'." - /// - internal static string ValidationUtils_InvalidCollectionTypeName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_InvalidCollectionTypeName, p0); - } - - /// - /// A string like "A type named '{0}' could not be resolved by the model. When a model is available, each type name must resolve to a valid type." - /// - internal static string ValidationUtils_UnrecognizedTypeName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_UnrecognizedTypeName, p0); - } - - /// - /// A string like "Incompatible type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'." - /// - internal static string ValidationUtils_IncorrectTypeKind(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_IncorrectTypeKind, p0, p1, p2); - } - - /// - /// A string like "Incompatible type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'." - /// - internal static string ValidationUtils_IncorrectTypeKindNoTypeName(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_IncorrectTypeKindNoTypeName, p0, p1); - } - - /// - /// A string like "A value with type '{0}' was found, which is of kind '{1}'. Value can only be of kind 'Primitive', 'Complex' or 'Collection'." - /// - internal static string ValidationUtils_IncorrectValueTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_IncorrectValueTypeKind, p0, p1); - } - - /// - /// A string like "The 'Name' property on an ODataNestedResourceInfo must be set to a non-empty string." - /// - internal static string ValidationUtils_LinkMustSpecifyName - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_LinkMustSpecifyName); - } - } - - /// - /// A string like "The property '{0}' cannot be a stream property because it is not of kind EdmPrimitiveTypeKind.Stream." - /// - internal static string ValidationUtils_MismatchPropertyKindForStreamProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_MismatchPropertyKindForStreamProperty, p0); - } - - /// - /// A string like "Nested collection instances are not allowed." - /// - internal static string ValidationUtils_NestedCollectionsAreNotSupported - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_NestedCollectionsAreNotSupported); - } - } - - /// - /// A string like "An ODataStreamReferenceValue item was found in a collection property value, which is not allowed. Collection properties can only have primitive and complex values as items." - /// - internal static string ValidationUtils_StreamReferenceValuesNotSupportedInCollections - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_StreamReferenceValuesNotSupportedInCollections); - } - } - - /// - /// A string like "A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as '{0}', but the type specified in the metadata is '{1}'." - /// - internal static string ValidationUtils_IncompatibleType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_IncompatibleType, p0, p1); - } - - /// - /// A string like "An open collection property '{0}' was found. In OData, open collection properties are not supported." - /// - internal static string ValidationUtils_OpenCollectionProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_OpenCollectionProperty, p0); - } - - /// - /// A string like "An open stream property '{0}' was found. In OData, open stream properties are not supported." - /// - internal static string ValidationUtils_OpenStreamProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_OpenStreamProperty, p0); - } - - /// - /// A string like "An invalid collection type kind '{0}' was found. In OData, collection types must be of kind 'Collection'." - /// - internal static string ValidationUtils_InvalidCollectionTypeReference(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_InvalidCollectionTypeReference, p0); - } - - /// - /// A string like "A resource with type '{0}' was found with a media resource, but this entity type is not a media link resource (MLE). When the type is not an MLE entity, the resource cannot have a media resource." - /// - internal static string ValidationUtils_ResourceWithMediaResourceAndNonMLEType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ResourceWithMediaResourceAndNonMLEType, p0); - } - - /// - /// A string like "A resource with type '{0}' was found without a media resource, but this entity type is a media link resource (MLE). When the type is an MLE entity, the resource must have a media resource." - /// - internal static string ValidationUtils_ResourceWithoutMediaResourceAndMLEType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ResourceWithoutMediaResourceAndMLEType, p0); - } - - /// - /// A string like "A resource with type '{0}' was found, but it is not assignable to the expected type '{1}'. The type specified in the resource must be equal to either the expected type or a derived type." - /// - internal static string ValidationUtils_ResourceTypeNotAssignableToExpectedType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_ResourceTypeNotAssignableToExpectedType, p0, p1); - } - - /// - /// A string like "A property with name '{0}' on type '{1}' has kind '{2}', but it is expected to be of kind 'Navigation'." - /// - internal static string ValidationUtils_NavigationPropertyExpected(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_NavigationPropertyExpected, p0, p1, p2); - } - - /// - /// A string like "The boundary delimiter '{0}' is invalid. A boundary delimiter must be non-null, be non-empty, and have a maximum of {1} characters." - /// - internal static string ValidationUtils_InvalidBatchBoundaryDelimiterLength(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_InvalidBatchBoundaryDelimiterLength, p0, p1); - } - - /// - /// A string like "The maximum recursion depth limit was reached. The depth of nested values in a single property cannot exceed {0}." - /// - internal static string ValidationUtils_RecursionDepthLimitReached(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_RecursionDepthLimitReached, p0); - } - - /// - /// A string like "The depth limit for entries in nested expanded navigation links was reached. The number of nested expanded entries cannot exceed {0}." - /// - internal static string ValidationUtils_MaxDepthOfNestedEntriesExceeded(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_MaxDepthOfNestedEntriesExceeded, p0); - } - - /// - /// A string like "A null value was found in a collection, but the expected collection item type '{0}' does not allow null values." - /// - internal static string ValidationUtils_NullCollectionItemForNonNullableType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_NullCollectionItemForNonNullableType, p0); - } - - /// - /// A string like "The property name '{0}' is invalid; property names must not contain any of the reserved characters {1}." - /// - internal static string ValidationUtils_PropertiesMustNotContainReservedChars(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_PropertiesMustNotContainReservedChars, p0, p1); - } - - /// - /// A string like "A null value was detected when enumerating the collections in a workspace. Workspace collections cannot be null." - /// - internal static string ValidationUtils_WorkspaceResourceMustNotContainNullItem - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_WorkspaceResourceMustNotContainNullItem); - } - } - - /// - /// A string like "Encountered a property '{0}' that was expected to be a reference to a location in the $metadata document but does not contain a '#' character or is otherwise not a valid metadata reference property. A metadata reference property must contain a '#' and be a valid absolute URI or begin with a '#' and be a valid URI fragment." - /// - internal static string ValidationUtils_InvalidMetadataReferenceProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValidationUtils_InvalidMetadataReferenceProperty, p0); - } - - /// - /// A string like "The 'ODataResource.Properties' enumerable contains a null item. This enumerable cannot contain null items." - /// - internal static string WriterValidationUtils_PropertyMustNotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_PropertyMustNotBeNull); - } - } - - /// - /// A string like "An ODataProperty instance without a name was detected; an ODataProperty must have a non-null, non-empty name." - /// - internal static string WriterValidationUtils_PropertiesMustHaveNonEmptyName - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_PropertiesMustHaveNonEmptyName); - } - } - - /// - /// A string like "No TypeName was found for an ODataResource of an open property, ODataResource or custom instance annotation, even though metadata was specified. If a model is passed to the writer, each complex value on an open property, resource or custom instance annotation must have a type name." - /// - internal static string WriterValidationUtils_MissingTypeNameWithMetadata - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_MissingTypeNameWithMetadata); - } - } - - /// - /// A string like "The ODataResourceSet.NextPageLink must be null for request payloads. A next link is only supported in responses." - /// - internal static string WriterValidationUtils_NextPageLinkInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_NextPageLinkInRequest); - } - } - - /// - /// A string like "A default stream ODataStreamReferenceValue was detected with a 'ContentType' property but without a ReadLink value. In OData, a default stream must either have both a content type and a read link, or neither of them." - /// - internal static string WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink); - } - } - - /// - /// A string like "A default stream ODataStreamReferenceValue was detected with a 'ReadLink' property but without a ContentType value. In OData, a default stream must either have both a content type and a read link, or neither of them." - /// - internal static string WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType); - } - } - - /// - /// A string like "An ODataStreamReferenceValue was detected with null values for both EditLink and ReadLink. In OData, a stream resource must have at least an edit link or a read link." - /// - internal static string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink); - } - } - - /// - /// A string like "An ODataStreamReferenceValue was detected with an ETag but without an edit link. In OData, a stream resource must have an edit link to have an ETag." - /// - internal static string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag); - } - } - - /// - /// A string like "An ODataStreamReferenceValue was detected with an empty string 'ContentType' property. In OData, a stream resource must either have a non-empty content type or it must be null." - /// - internal static string WriterValidationUtils_StreamReferenceValueEmptyContentType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_StreamReferenceValueEmptyContentType); - } - } - - /// - /// A string like "A resource with an empty ID value was detected. In OData, a resource must either a non-empty ID value or no ID value." - /// - internal static string WriterValidationUtils_EntriesMustHaveNonEmptyId - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_EntriesMustHaveNonEmptyId); - } - } - - /// - /// A string like "The base URI '{0}' specified in ODataMessageWriterSettings.BaseUri is invalid; it must either be null or an absolute URI." - /// - internal static string WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute, p0); - } - - /// - /// A string like "An ODataEntityReferenceLink with a null Url was detected; an ODataEntityReferenceLink must have a non-null Url." - /// - internal static string WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull); - } - } - - /// - /// A string like "The 'ODataEntityReferenceLinks.Links' enumerable contains a null item. This enumerable cannot contain null items." - /// - internal static string WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull); - } - } - - /// - /// A string like "The type '{0}' of a resource in an expanded link is not compatible with the element type '{1}' of the expanded link. Entries in an expanded link must have entity types that are assignable to the element type of the expanded link." - /// - internal static string WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, p0, p1); - } - - /// - /// A string like "The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the actual payload is a resource." - /// - internal static string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent, p0); - } - - /// - /// A string like "The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the actual payload is a resource set." - /// - internal static string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent, p0); - } - - /// - /// A string like "The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the metadata declares it as a resource." - /// - internal static string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata, p0); - } - - /// - /// A string like "The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the metadata declares it as resource set." - /// - internal static string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata, p0); - } - - /// - /// A string like "The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource set, but the metadata declares it as a resource." - /// - internal static string WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata, p0); - } - - /// - /// A string like "The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource, but the metadata declares it as resource set." - /// - internal static string WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata, p0); - } - - /// - /// A string like "The collection property '{0}' has a null value, which is not allowed. In OData, collection properties cannot have null values." - /// - internal static string WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue, p0); - } - - /// - /// A string like "The property '{0}[Nullable=False]' of type '{1}' has a null value, which is not allowed." - /// - internal static string WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, p0, p1); - } - - /// - /// A string like "The stream property '{0}' has a null value, which is not allowed. In OData, stream properties cannot have null values." - /// - internal static string WriterValidationUtils_StreamPropertiesMustNotHaveNullValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue, p0); - } - - /// - /// A string like "An action or a function with metadata '{0}' was detected when writing a request; actions and functions are only supported in responses." - /// - internal static string WriterValidationUtils_OperationInRequest(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_OperationInRequest, p0); - } - - /// - /// A string like "An association link with name '{0}' could not be written to the request payload. Association links are only supported in responses." - /// - internal static string WriterValidationUtils_AssociationLinkInRequest(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_AssociationLinkInRequest, p0); - } - - /// - /// A string like "The stream property {0} in a request payload cannot contain etag, editLink, or readLink values." - /// - internal static string WriterValidationUtils_StreamPropertyInRequest(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_StreamPropertyInRequest, p0); - } - - /// - /// A string like "The service document URI '{0}' specified is invalid; it must be either null or an absolute URI." - /// - internal static string WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute, p0); - } - - /// - /// A string like "The ODataNestedResourceInfo.Url property on an navigation link '{0}' is null. The ODataNestedResourceInfo.Url property must be set to a non-null value that represents the entity or entities the navigation link references." - /// - internal static string WriterValidationUtils_NavigationLinkMustSpecifyUrl(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_NavigationLinkMustSpecifyUrl, p0); - } - - /// - /// A string like "The ODataNestedResourceInfo.IsCollection property on a nested resource info '{0}' is null. The ODataNestedResourceInfo.IsCollection property must be specified when writing a nested resource into a request." - /// - internal static string WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection, p0); - } - - /// - /// A string like "A JSON Padding function was specified on ODataMessageWriterSettings when trying to write a request message. JSON Padding is only for writing responses." - /// - internal static string WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage); - } - } - - /// - /// A string like "The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'." - /// - internal static string WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, p0, p1, p2); - } - - /// - /// A string like "An XML node of type '{0}' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes." - /// - internal static string XmlReaderExtension_InvalidNodeInStringValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.XmlReaderExtension_InvalidNodeInStringValue, p0); - } - - /// - /// A string like "An XML node of type '{0}' was found at the root level. The root level of an OData payload must contain a single XML element and no text nodes." - /// - internal static string XmlReaderExtension_InvalidRootNode(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.XmlReaderExtension_InvalidRootNode, p0); - } - - /// - /// A string like "The metadata document could not be read from the message content.\r\n{0}" - /// - internal static string ODataMetadataInputContext_ErrorReadingMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataInputContext_ErrorReadingMetadata, p0); - } - - /// - /// A string like "The metadata document could not be written as specified.\r\n{0}" - /// - internal static string ODataMetadataOutputContext_ErrorWritingMetadata(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataOutputContext_ErrorWritingMetadata, p0); - } - - /// - /// A string like "The JSON metadata is not supported at this platform. It's only supported at platform implementing .NETStardard 2.0." - /// - internal static string ODataMetadataOutputContext_NotSupportJsonMetadata - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataOutputContext_NotSupportJsonMetadata); - } - } - - /// - /// A string like "A relative URI value '{0}' was specified in the payload, but no base URI for it was found. When the payload contains a relative URI, there must be an xml:base in the payload or else a base URI must specified in the reader settings." - /// - internal static string ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified, p0); - } - - /// - /// A string like "The element with name '{0}' is not a valid collection item. The name of the collection item element must be 'element' and it must belong to the '{1}' namespace." - /// - internal static string ODataPropertyAndValueDeserializer_InvalidCollectionElement(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataPropertyAndValueDeserializer_InvalidCollectionElement, p0, p1); - } - - /// - /// A string like "The property '{0}' on type '{1}' was found in the {{http://docs.oasis-open.org/odata/ns/metadata}}:properties element, and it is declared as a navigation property." - /// - internal static string ODataPropertyAndValueDeserializer_NavigationPropertyInProperties(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataPropertyAndValueDeserializer_NavigationPropertyInProperties, p0, p1); - } - - /// - /// A string like "Writing null value for the instance annotation '{0}' is not allowed. The instance annotation '{0}' has the expected type '{1}[Nullable=False]'." - /// - internal static string JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation, p0, p1); - } - - /// - /// A string like "When resolving operations '{0}' the group returned has both actions and functions with an invalid IEdmModel." - /// - internal static string EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid, p0); - } - - /// - /// A string like "Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return non-bound operations." - /// - internal static string EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid, p0); - } - - /// - /// A string like "Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return bound operations without any parameters." - /// - internal static string EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid, p0); - } - - /// - /// A string like "Value '{0}' was either too large or too small for a '{1}'." - /// - internal static string EdmLibraryExtensions_ValueOverflowForUnderlyingType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmLibraryExtensions_ValueOverflowForUnderlyingType, p0, p1); - } - - /// - /// A string like "The 'type' attribute on element {{http://www.w3.org/2005/Atom}}:content is either missing or has an invalid value '{0}'. Only 'application/xml' and 'application/atom+xml' are supported as the value of the 'type' attribute on the {{http://www.w3.org/2005/Atom}}:content element." - /// - internal static string ODataXmlResourceDeserializer_ContentWithWrongType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataXmlResourceDeserializer_ContentWithWrongType, p0); - } - - /// - /// A string like "Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in a top-level error value. In OData, the value of a top-level error value can have no more than one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element" - /// - internal static string ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName, p0); - } - - /// - /// A string like "Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in an inner error value. In OData, the value of an inner error value can have at most one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element." - /// - internal static string ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName, p0); - } - - /// - /// A string like "An invalid item type kind '{0}' was found. Items in a collection can only be of type kind 'Primitive' or 'Complex', but not of type kind '{0}'." - /// - internal static string CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind, p0); - } - - /// - /// A string like "An item of type kind '{0}' was found in a collection that otherwise has items of type kind '{1}'. In OData, all items in a collection must have the same type kind." - /// - internal static string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind, p0, p1); - } - - /// - /// A string like "An item with type name '{0}' was found in a collection of items with type name '{1}'. In OData, all items in a collection must have the same type name." - /// - internal static string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName, p0, p1); - } - - /// - /// A string like "A resource of type '{0}' was found in a resource set that otherwise has entries of type '{1}'. In OData, all entries in a resource set must have a common base type." - /// - internal static string ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, p0, p1); - } - - /// - /// A string like "The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of {0} bytes has been read from the stream; however a maximum of {1} bytes is allowed." - /// - internal static string MessageStreamWrappingStream_ByteLimitExceeded(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MessageStreamWrappingStream_ByteLimitExceeded, p0, p1); - } - - /// - /// A string like "The custom type resolver set in ODataMessageWriterSettings.EnableWcfDataServicesClientBehavior returned 'null' when resolving the type '{0}'. When a custom type resolver is specified, it cannot return null." - /// - internal static string MetadataUtils_ResolveTypeName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataUtils_ResolveTypeName, p0); - } - - /// - /// A string like "The method 'FindDeclaredBoundOperations' on the IEdmModel has thrown an exception when looking for operations with a binding type {0}. See inner exception for more details." - /// - internal static string MetadataUtils_CalculateBindableOperationsForType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataUtils_CalculateBindableOperationsForType, p0); - } - - /// - /// A string like "The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type." - /// - internal static string EdmValueUtils_UnsupportedPrimitiveType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_UnsupportedPrimitiveType, p0); - } - - /// - /// A string like "Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'." - /// - internal static string EdmValueUtils_IncorrectPrimitiveTypeKind(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_IncorrectPrimitiveTypeKind, p0, p1, p2); - } - - /// - /// A string like "Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'." - /// - internal static string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName, p0, p1); - } - - /// - /// A string like "A value with primitive kind '{0}' cannot be converted into a primitive object value." - /// - internal static string EdmValueUtils_CannotConvertTypeToClrValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_CannotConvertTypeToClrValue, p0); - } - - /// - /// A string like "The property '{0}' is not declared on the non-open type '{1}'." - /// - internal static string ODataEdmStructuredValue_UndeclaredProperty(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataEdmStructuredValue_UndeclaredProperty, p0, p1); - } - - /// - /// A string like "The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required." - /// - internal static string ODataMetadataBuilder_MissingEntitySetUri(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataBuilder_MissingEntitySetUri, p0); - } - - /// - /// A string like "The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments." - /// - internal static string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix, p0, p1); - } - - /// - /// A string like "Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required." - /// - internal static string ODataMetadataBuilder_MissingEntityInstanceUri(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataBuilder_MissingEntityInstanceUri, p0); - } - - /// - /// A string like "Parent id or contained context url is missing which is required to compute id for contained instance. Specify ODataUri in the ODataMessageWriterSettings or return parent id or context url in the payload." - /// - internal static string ODataMetadataBuilder_MissingParentIdOrContextUrl - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataBuilder_MissingParentIdOrContextUrl); - } - } - - /// - /// A string like "The Id cannot be computed, since the navigation source '{0}' cannot be resolved to a known entity set from model." - /// - internal static string ODataMetadataBuilder_UnknownEntitySet(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataMetadataBuilder_UnknownEntitySet, p0); - } - - /// - /// A string like "The entity type '{0}' is not compatible with the base type '{1}' of the provided entity set '{2}'. When an entity type is specified for an OData resource set or resource reader, it has to be the same or a subtype of the base type of the specified entity set." - /// - internal static string ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType, p0, p1, p2); - } - - /// - /// A string like "ODataMessageReader.DetectPayloadKind was called for a request payload. Payload kind detection is only supported for responses in Json." - /// - internal static string ODataJsonInputContext_PayloadKindDetectionForRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_PayloadKindDetectionForRequest); - } - } - - /// - /// A string like "The parameter '{0}' is specified with a null value. For Json, the '{0}' argument to the 'CreateParameterReader' method cannot be null." - /// - internal static string ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader, p0); - } - - /// - /// A string like "Parsing Json resource sets or entries in requests without entity set is not supported. Pass in the entity set as a parameter to ODataMessageReader.CreateODataResourceReader or ODataMessageReader.CreateODataResourceSetReader method." - /// - internal static string ODataJsonInputContext_NoEntitySetForRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_NoEntitySetForRequest); - } - } - - /// - /// A string like "Parsing Json payloads without a model is only supported for error payloads." - /// - internal static string ODataJsonInputContext_ModelRequiredForReading - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_ModelRequiredForReading); - } - } - - /// - /// A string like "An attempt to read a collection request payload without specifying a collection item type was detected. When reading collection payloads in requests, an expected item type has to be provided." - /// - internal static string ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests); - } - } - - /// - /// A string like "The required instance annotation 'odata.context' was not found at the beginning of a response payload." - /// - internal static string ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); - } - } - - /// - /// A string like "The annotation '{0}' was targeting the instance annotation '{1}'. Only the '{2}' annotation is allowed to target an instance annotation." - /// - internal static string ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, p0, p1, p2); - } - - /// - /// A string like "The annotation '{0}' is found targeting the instance annotation '{1}'. However the value for the instance annotation '{1}' is not found immediately after. In Json, an annotation targeting an instance annotation must be immediately followed by the value of the targeted instance annotation." - /// - internal static string ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, p0, p1); - } - - /// - /// A string like "An attempt to write an entity reference link inside a navigation link after a resource set has been written inside the same navigation link in a request was detected. In Json requests, all entity reference links inside a navigation link have to be written before all resource sets inside the same navigation link." - /// - internal static string ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest); - } - } - - /// - /// A string like "The ODataResourceSet.InstanceAnnotations collection must be empty for expanded resource sets. Custom instance annotations are not supported on expanded resource sets." - /// - internal static string ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); - } - } - - /// - /// A string like "Neither an expected type nor a type name in the OData object model was provided for a resource value. When writing a request payload, either an expected type or a type name has to be specified." - /// - internal static string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); - } - } - - /// - /// A string like "Neither an expected type nor a type name in the OData object model was provided for a collection property. When writing a request payload, either an expected type or a type name has to be specified." - /// - internal static string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); - } - } - - /// - /// A string like "When writing a JSON response, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResourceSerializationInfo must be set on the ODataResource or ODataResourceSet that is being written." - /// - internal static string ODataResourceTypeContext_MetadataOrSerializationInfoMissing - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceTypeContext_MetadataOrSerializationInfoMissing); - } - } - - /// - /// A string like "When writing a JSON response in full metadata mode, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResource.TypeName must be set." - /// - internal static string ODataResourceTypeContext_ODataResourceTypeNameMissing - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceTypeContext_ODataResourceTypeNameMissing); - } - } - - /// - /// A string like "The base type '{0}' of the entity set specified for writing a payload is not assignable from the specified entity type '{1}'. When an entity type is specified it has to be the same or derived from the base type of the entity set." - /// - internal static string ODataContextUriBuilder_ValidateDerivedType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_ValidateDerivedType, p0, p1); - } - - /// - /// A string like "The collection type name for the top level collection is unknown. When writing a response, the item type must be passed to the ODataMessageWriter.CreateODataCollectionWriter method or the ODataCollectionStartSerializationInfo must be set on the ODataCollectionStart." - /// - internal static string ODataContextUriBuilder_TypeNameMissingForTopLevelCollection - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_TypeNameMissingForTopLevelCollection); - } - } - - /// - /// A string like "Context URL for payload kind '{0}' is not supported." - /// - internal static string ODataContextUriBuilder_UnsupportedPayloadKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_UnsupportedPayloadKind, p0); - } - - /// - /// A string like "The stream value must be a property of an ODataResource instance." - /// - internal static string ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource); - } - } - - /// - /// A string like "The navigationSource for resource or resource set is unknown or the Type is null. When writing a response, the navigation source or the type must be passed to the ODataMessageWriter.CreateODataResourceWriter/ODataMessageWriter.CreateODataResourceSetWriter method or the ODataResourceSerializationInfo must be set on the resource/resource set." - /// - internal static string ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); - } - } - - /// - /// A string like "The ODataMessageWriterSetting.ODataUri must be set when writing individual property." - /// - internal static string ODataContextUriBuilder_ODataUriMissingForIndividualProperty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_ODataUriMissingForIndividualProperty); - } - } - - /// - /// A string like "The type name for the top level property is unknown. When writing a response, the ODataValue must have a type name on itself or have a SerializationTypeNameAnnotation." - /// - internal static string ODataContextUriBuilder_TypeNameMissingForProperty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_TypeNameMissingForProperty); - } - } - - /// - /// A string like "The Path property '{0}' of ODataMessageWriterSetting.ODataUri must end with the navigation property which the contained elements being written belong to." - /// - internal static string ODataContextUriBuilder_ODataPathInvalidForContainedElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataContextUriBuilder_ODataPathInvalidForContainedElement, p0); - } - - /// - /// A string like "The annotation '{0}' was found. This annotation is either not recognized or not expected at the current position." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, p0); - } - - /// - /// A string like "The property '{0}' has a property annotation '{1}'. This annotation is either not recognized or not expected at the current position." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, p0, p1); - } - - /// - /// A string like "An OData property annotation '{0}' was found. This property annotation is either not recognized or not expected at the current position." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, p0); - } - - /// - /// A string like "A property with name '{0}' was found. This property is either not recognized or not expected at the current position." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedProperty, p0); - } - - /// - /// A string like "No top-level properties were found. A top-level property or collection in Json must be represented as a JSON object with exactly one property which is not an annotation." - /// - internal static string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload); - } - } - - /// - /// A string like "A top-level property with name '{0}' was found in the payload; however, property and collection payloads must always have a top-level property with name '{1}'." - /// - internal static string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, p0, p1); - } - - /// - /// A string like "The 'odata.type' instance annotation value '{0}' is not a valid type name. The value of the 'odata.type' instance annotation must be a non-empty string." - /// - internal static string ODataJsonPropertyAndValueDeserializer_InvalidTypeName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, p0); - } - - /// - /// A string like "One or more property annotations for property '{0}' were found in the top-level property or collection payload without the property to annotate. Top-level property and collection payloads must contain a single property, with optional annotations for this property." - /// - internal static string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, p0); - } - - /// - /// A string like "One or more property annotations for property '{0}' were found in the resource value without the property to annotate. Resource values must only contain property annotations for existing properties." - /// - internal static string ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty, p0); - } - - /// - /// A string like "A complex property with an '{0}' property annotation was found. Complex properties must not have the '{0}' property annotation, instead the '{0}' should be specified as an instance annotation in the complex value." - /// - internal static string ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation, p0); - } - - /// - /// A string like "The 'odata.type' instance annotation in a resource object is not the first property of the object. In OData, the 'odata.type' instance annotation must be the first property of the resource object." - /// - internal static string ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst); - } - } - - /// - /// A string like "The property '{0}' has a property annotation '{1}'. Primitive, complex, collection or open properties can only have an 'odata.type' property annotation." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation, p0, p1); - } - - /// - /// A string like "The property with name '{0}' was found after the data property with name '{1}'. If a type is specified for a data property, it must appear before the data property." - /// - internal static string ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty, p0, p1); - } - - /// - /// A string like "An '{0}' annotation was read inside a JSON object representing a primitive value; type annotations for primitive values have to be property annotations of the owning property." - /// - internal static string ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue, p0); - } - - /// - /// A string like "A top-level property with an invalid primitive null value was found. In OData, top-level properties with null value have to be serialized as JSON object with an '{0}' annotation that has the value '{1}'." - /// - internal static string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue, p0, p1); - } - - /// - /// A string like "Encountered a metadata reference property '{0}' in a scope other than a resource. In OData, a property name with a '#' character indicates a reference into the metadata and is only supported for describing operations bound to a resource." - /// - internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, p0); - } - - /// - /// A string like "The property with name '{0}' was found in a null payload. In OData, no properties or OData annotations can appear in a null payload." - /// - internal static string ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload, p0); - } - - /// - /// A string like "A collection type of '{0}' was specified for a non-collection value." - /// - internal static string ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected, p0); - } - - /// - /// A string like "A non-collection type of '{0}' was specified for a collection value." - /// - internal static string ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected, p0); - } - - /// - /// A string like "The property with name '{0}' was found with a value node of type '{1}'; however, a resource value of type '{2}' was expected." - /// - internal static string ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty, p0, p1, p2); - } - - /// - /// A string like "The value specified for the spatial property was not valid. You must specify a valid spatial value." - /// - internal static string ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue); - } - } - - /// - /// A string like "If a primitive value is representing a resource, the resource must be null." - /// - internal static string ODataJsonReader_UnexpectedPrimitiveValueForODataResource - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReader_UnexpectedPrimitiveValueForODataResource); - } - } - - /// - /// A string like "The '{0}' instance or property annotation has a null value. In OData, the '{0}' instance or property annotation must have a non-null string value." - /// - internal static string ODataJsonReaderUtils_AnnotationWithNullValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_AnnotationWithNullValue, p0); - } - - /// - /// A string like "An '{0}' annotation was found with an invalid value. In OData, the only valid value for the '{0}' annotation is '{1}'." - /// - internal static string ODataJsonReaderUtils_InvalidValueForODataNullAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation, p0, p1); - } - - /// - /// A string like "The InstanceAnnotations collection has more than one instance annotations with the name '{0}'. All instance annotation names must be unique within the collection." - /// - internal static string JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, p0); - } - - /// - /// A string like "A null metadata document URI was found in the payload. Metadata document URIs must not be null." - /// - internal static string ODataJsonContextUriParser_NullMetadataDocumentUri - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_NullMetadataDocumentUri); - } - } - - /// - /// A string like "The context URI '{0}' is not valid for the expected payload kind '{1}'." - /// - internal static string ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind, p0, p1); - } - - /// - /// A string like "The context URI '{0}' references the entity set or type '{1}'. However, no entity set or type with name '{1}' is declared in the metadata." - /// - internal static string ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName, p0, p1); - } - - /// - /// A string like "A '$select' query option was found for the payload kind '{0}'. In OData, a '$select' query option is only supported for payload kinds 'Resource' and 'ResourceSet'." - /// - internal static string ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption, p0); - } - - /// - /// A string like "No model was specified for the ODataMessageReader. A message reader requires a model for Json payload to be specified in the ODataMessageReader constructor." - /// - internal static string ODataJsonContextUriParser_NoModel - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_NoModel); - } - } - - /// - /// A string like "The context URL '{0}' is invalid." - /// - internal static string ODataJsonContextUriParser_InvalidContextUrl(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_InvalidContextUrl, p0); - } - - /// - /// A string like "Last segment in context URL '{0}' should not be KeySegment." - /// - internal static string ODataJsonContextUriParser_LastSegmentIsKeySegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_LastSegmentIsKeySegment, p0); - } - - /// - /// A string like "The top level context URL '{0}' should be an absolute Uri." - /// - internal static string ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute, p0); - } - - /// - /// A string like "Invalid primitive value '{0}' for @removed annotation. @removed annotation must be a JSON object, optionally containing a 'reason' property." - /// - internal static string ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject, p0); - } - - /// - /// A string like "The 'odata.type' instance annotation in a resource object is preceded by an invalid property. In OData, the 'odata.type' instance annotation must be either the first property in the JSON object or the second if the 'odata.context' instance annotation is present." - /// - internal static string ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst); - } - } - - /// - /// A string like "The '{0}' instance annotation in a resource object is preceded by a property or property annotation. In OData, the '{0}' instance annotation must be before any property or property annotation in a resource object." - /// - internal static string ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, p0); - } - - /// - /// A string like "Encountered a deleted entity when reading a non-delta response payload. Deleted entities are only supported in request payloads and delta responses." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); - } - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the start of the content of a resource set; however, a node of type 'StartArray' was expected." - /// - internal static string ODataJsonResourceDeserializer_CannotReadResourceSetContentStart(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart, p0); - } - - /// - /// A string like "Did not find the required '{0}' property for the expected resource set." - /// - internal static string ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound, p0); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the entries of a typed resource set; however, a node of type 'StartObject' or 'EndArray', or a null value, was expected." - /// - internal static string ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, p0); - } - - /// - /// A string like "A property annotation for a property with name '{0}' was found when reading a top-level resource set. No property annotations, only instance annotations are allowed when reading top-level resource sets." - /// - internal static string ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet, p0); - } - - /// - /// A string like "A property with name '{0}' was found when reading a top-level resource set. No properties other than the resource set property with name '{1}' are allowed." - /// - internal static string ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet, p0, p1); - } - - /// - /// A string like "A property '{0}' which only has property annotations in the payload but no property value is declared to be of type '{1}'. In OData, only navigation properties and named streams can be represented as properties without values." - /// - internal static string ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType, p0, p1); - } - - /// - /// A string like "A stream property {0} was found in a Json request payload. Stream properties are only supported in responses." - /// - internal static string ODataJsonResourceDeserializer_StreamPropertyInRequest(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_StreamPropertyInRequest, p0); - } - - /// - /// A string like "The stream property '{0}' has a property annotation '{1}'. Stream property can only have the 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaEtag' and 'odata.mediaContentType' property annotations." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation, p0, p1); - } - - /// - /// A string like "A stream property '{0}' has a value in the payload. In OData, stream property must not have a value, it must only use property annotations." - /// - internal static string ODataJsonResourceDeserializer_StreamPropertyWithValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_StreamPropertyWithValue, p0); - } - - /// - /// A string like "The navigation property '{0}' has a property annotation '{1}'. Deferred navigation links can only have the 'odata.navigationLink' and 'odata.associationLink' property annotations." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation, p0, p1); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartObject' node or 'PrimitiveValue' node with null value was expected." - /// - internal static string ODataJsonResourceDeserializer_CannotReadSingletonNestedResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource, p0, p1); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartArray' node was expected." - /// - internal static string ODataJsonResourceDeserializer_CannotReadCollectionNestedResource(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource, p0, p1); - } - - /// - /// A string like "A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property '{0}'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected." - /// - internal static string ODataJsonResourceDeserializer_CannotReadNestedResource(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_CannotReadNestedResource, p0); - } - - /// - /// A string like "The navigation property '{0}' has a property annotation '{1}'. Expanded resource navigation links can only have the 'odata.context', 'odata.navigationLink' and 'odata.associationLink' property annotations." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation, p0, p1); - } - - /// - /// A string like "The navigation property '{0}' has a property annotation '{1}'. Expanded resource set navigation links can only have the 'odata.context', 'odata.navigationLink', 'odata.associationLink' and 'odata.nextLink' property annotations" - /// - internal static string ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation, p0, p1); - } - - /// - /// A string like "The property '{0}' has a property annotation '{1}'. The complex collection property can only have the 'odata.count', 'odata.type' and 'odata.nextLink' property annotations." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation, p0, p1); - } - - /// - /// A string like "Multiple property annotations '{0}' were found when reading the nested resource '{1}'. Only a single property annotation '{0}' can be specified for a nested resource." - /// - internal static string ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, p0, p1); - } - - /// - /// A string like "A property annotation '{0}' was found after the property '{1}' it is annotating. Only the 'odata.nextLink' property annotation can be used after the property it is annotating." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet, p0, p1); - } - - /// - /// A string like "The navigation property '{0}' has a property annotation '{1}'. Navigation links in request payloads can only have the '{2}' property annotation." - /// - internal static string ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation, p0, p1, p2); - } - - /// - /// A string like "The resource reference navigation property '{0}' has a property annotation '{1}' with an array value. Resource reference navigation properties can only have a property annotation '{1}' with a string value." - /// - internal static string ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation, p0, p1); - } - - /// - /// A string like "The resource set reference navigation property '{0}' has a property annotation '{1}' with a string value. Resource set reference navigation properties can only have a property annotation '{1}' with an array value." - /// - internal static string ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation, p0, p1); - } - - /// - /// A string like "The value of '{0}' property annotation is an empty array. The '{0}' property annotation must have a non-empty array as its value." - /// - internal static string ODataJsonResourceDeserializer_EmptyBindArray(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_EmptyBindArray, p0); - } - - /// - /// A string like "The navigation property '{0}' has no expanded value and no '{1}' property annotation. Navigation property in request without expanded value must have the '{1}' property annotation." - /// - internal static string ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink, p0, p1); - } - - /// - /// A string like "The resource reference navigation property '{0}' has both the '{1}' property annotation as well as a value. Resource reference navigation properties can have either '{1}' property annotations or values, but not both." - /// - internal static string ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue, p0, p1); - } - - /// - /// A string like "An undeclared property '{0}' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values." - /// - internal static string ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType, p0); - } - - /// - /// A string like "Encountered the operation '{0}' which can not be resolved to an ODataAction or ODataFunction." - /// - internal static string ODataJsonResourceDeserializer_OperationIsNotActionOrFunction(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_OperationIsNotActionOrFunction, p0); - } - - /// - /// A string like "Multiple '{0}' properties were found for an operation '{1}'. In OData, an operation can have at most one '{0}' property." - /// - internal static string ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, p0, p1); - } - - /// - /// A string like "Multiple target bindings encountered for the operation '{0}' but the 'target' property was not found in an operation value. To differentiate between multiple target bindings, each operation value must have exactly one 'target' property." - /// - internal static string ODataJsonResourceDeserializer_OperationMissingTargetProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_OperationMissingTargetProperty, p0); - } - - /// - /// A string like "A metadata reference property was found in a Json request payload. Metadata reference properties are only supported in responses." - /// - internal static string ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest); - } - } - - /// - /// A string like "The '{0}' property of the operation '{1}' cannot have a null value." - /// - internal static string ODataJsonValidationUtils_OperationPropertyCannotBeNull(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonValidationUtils_OperationPropertyCannotBeNull, p0, p1); - } - - /// - /// A string like "Encountered a reference into metadata '{0}' which does not refer to the known metadata url '{1}'. Open metadata reference properties are not supported." - /// - internal static string ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, p0, p1); - } - - /// - /// A string like "A relative URI value '{0}' was specified in the payload, but the {1} annotation is missing from the payload. The payload must only contain absolute URIs or the {1} annotation must be on the payload." - /// - internal static string ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation, p0, p1); - } - - /// - /// A string like "The {0} annotation is missing from the payload." - /// - internal static string ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload, p0); - } - - /// - /// A string like "When trying to read the start of a collection, the expected collection property with name '{0}' was not found." - /// - internal static string ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound, p0); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the items of a collection; however, a 'StartArray' node was expected." - /// - internal static string ODataJsonCollectionDeserializer_CannotReadCollectionContentStart(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart, p0); - } - - /// - /// A string like "A property or annotation for a property with name '{0}' or an instance annotation with name '{0}' was found after reading the items of a top-level collection. No additional properties or annotations are allowed after the collection property." - /// - internal static string ODataJsonCollectionDeserializer_CannotReadCollectionEnd(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, p0); - } - - /// - /// A string like "An 'odata.type' annotation with value '{0}' was found for a top-level collection payload; however, top-level collections must specify a collection type." - /// - internal static string ODataJsonCollectionDeserializer_InvalidCollectionTypeName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonCollectionDeserializer_InvalidCollectionTypeName, p0); - } - - /// - /// A string like "A node of type '{0}' was read from the JSON reader when trying to read the start of an entity reference link. In Json, entity reference links must be objects." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue, p0); - } - - /// - /// A string like "A property annotation with name '{0}' was detected when reading an entity reference link; entity reference links do not support property annotations." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink, p0); - } - - /// - /// A string like "An instance annotation with name '{0}' or a property annotation for the property with name '{0}' was found when reading an entity reference link. No OData property or instance annotations are allowed when reading entity reference links." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink, p0); - } - - /// - /// A string like "A property with name '{0}' was found when reading an entity reference link. No properties other than the entity reference link property with name '{1}' are allowed." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink, p0, p1); - } - - /// - /// A string like "The required property '{0}' for an entity reference link was not found." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, p0); - } - - /// - /// A string like "Multiple '{0}' properties were found in an entity reference link object; however, a single '{0}' property was expected." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink, p0); - } - - /// - /// A string like "The '{0}' property of an entity reference link object cannot have a null value." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull, p0); - } - - /// - /// A string like "A property annotation was found for entity reference links; however, entity reference links only support instance annotations." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks); - } - } - - /// - /// A string like "A property with name '{0}' or a property annotation for a property with name '{0}' was found when trying to read a collection of entity reference links; however, a property with name '{1}' was expected." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound, p0, p1); - } - - /// - /// A string like "A property annotation for a property with name '{0}' was found when reading an entity reference links payload. No property annotations, only instance annotations are allowed when reading entity reference links." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks, p0); - } - - /// - /// A string like "Did not find the required '{0}' property for an entity reference links payload." - /// - internal static string ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound, p0); - } - - /// - /// A string like "The '{0}' property of an operation '{1}' in '{2}' cannot have a null value." - /// - internal static string ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull, p0, p1, p2); - } - - /// - /// A string like "Found a node of type '{1}' when starting to read the '{0}' operations value, however a node of type 'StartObject' was expected. The '{0}' operations value must have an object value." - /// - internal static string ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, p0, p1); - } - - /// - /// A string like "Multiple '{0}' properties were found in a service document. In OData, a service document must have exactly one '{0}' property." - /// - internal static string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument, p0); - } - - /// - /// A string like "Multiple '{0}' properties were found in a service document element. In OData, a service document element must have exactly one '{0}' property." - /// - internal static string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement, p0); - } - - /// - /// A string like "No '{0}' property was found for a service document. In OData, a service document must have exactly one '{0}' property." - /// - internal static string ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument, p0); - } - - /// - /// A string like "Encountered a service document element without a '{0}' property. In service documents, service document elements must contain a '{0}' property." - /// - internal static string ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement, p0); - } - - /// - /// A string like "An unrecognized property annotation '{0}' was found in a '{1}' object in a service document. OData property annotations are not allowed in workspaces." - /// - internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument, p0, p1); - } - - /// - /// A string like "An unrecognized instance annotation '{0}' was found in a '{1}' object in a service document. OData instance annotations are not allowed in workspaces." - /// - internal static string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument, p0, p1); - } - - /// - /// A string like "An unrecognized property annotation '{0}' was found in a service document element. OData property annotations are not allowed in service document elements." - /// - internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement, p0); - } - - /// - /// A string like "An unrecognized instance annotation '{0}' was found in a service document element. OData instance annotations are not allowed in service document elements." - /// - internal static string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement, p0); - } - - /// - /// A string like "Encountered unexpected property '{0}' in a service document element. In service documents, service document element may only have '{1}' and '{2}' properties." - /// - internal static string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement, p0, p1, p2); - } - - /// - /// A string like "Encountered unexpected property '{0}' in a service document. The top level object of a service document may only have a '{1}' property." - /// - internal static string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument, p0, p1); - } - - /// - /// A string like "Encountered a property annotation for the property '{0}' which wasn't immediately followed by the property. Property annotations must occur directly before the property being annotated." - /// - internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, p0); - } - - /// - /// A string like "An OData property annotation was found for a parameter payload; however, parameter payloads do not support OData property annotations." - /// - internal static string ODataJsonParameterDeserializer_PropertyAnnotationForParameters - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonParameterDeserializer_PropertyAnnotationForParameters); - } - } - - /// - /// A string like "One or more property annotations for property '{0}' were found in a parameter payload without the property to annotate. Parameter payloads must not contain property annotations for properties that are not in the payload." - /// - internal static string ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters, p0); - } - - /// - /// A string like "The parameter '{0}' is of the '{1}' primitive type, which is not supported in Json." - /// - internal static string ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType, p0, p1); - } - - /// - /// A string like "When trying to read a null collection parameter value in Json, a node of type '{0}' with the value '{1}' was read from the JSON reader; however, a primitive 'null' value was expected." - /// - internal static string ODataJsonParameterDeserializer_NullCollectionExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonParameterDeserializer_NullCollectionExpected, p0, p1); - } - - /// - /// A string like "The parameter '{0}' is of an unsupported type kind '{1}'. Only primitive, enum, complex, primitive collection, enum collection and complex collection types are supported." - /// - internal static string ODataJsonParameterDeserializer_UnsupportedParameterTypeKind(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonParameterDeserializer_UnsupportedParameterTypeKind, p0, p1); - } - - /// - /// A string like "When parsing a select clause a '*' segment was found before last segment of a property path. In OData, a '*' segment can only appear as last segment of a property path." - /// - internal static string SelectedPropertiesNode_StarSegmentNotLastSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectedPropertiesNode_StarSegmentNotLastSegment); - } - } - - /// - /// A string like "When parsing a select clause a '*' segment was found immediately after a type segment in a property path. In OData, a '*' segment cannot appear following a type segment." - /// - internal static string SelectedPropertiesNode_StarSegmentAfterTypeSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectedPropertiesNode_StarSegmentAfterTypeSegment); - } - } - - /// - /// A string like "An OData property annotation '{0}' was found in an error payload; however, error payloads do not support OData property annotations." - /// - internal static string ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload, p0); - } - - /// - /// A string like "An OData instance annotation '{0}' was found in an error payload; however, error payloads do not support OData instance annotations." - /// - internal static string ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload, p0); - } - - /// - /// A string like "One or more property annotations for property '{0}' were found in an error payload without the property to annotate. Error payloads must not contain property annotations for properties that are not in the payload." - /// - internal static string ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError, p0); - } - - /// - /// A string like "A property with name '{0}' was found in the error value of a top-level error. In OData, a top-level error value can only have properties with name 'code', 'message', or 'innererror', or custom instance annotations." - /// - internal static string ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty, p0); - } - - /// - /// A string like "The entity type '{0}' has no key properties. Entity types must define at least one key property." - /// - internal static string ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties, p0); - } - - /// - /// A string like "The key property '{0}' on type '{1}' has a null value. Key properties must not have null values." - /// - internal static string ODataConventionalUriBuilder_NullKeyValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataConventionalUriBuilder_NullKeyValue, p0, p1); - } - - /// - /// A string like "An ODataResource of type '{0}' is found without key properties. When writing without a user model, each resource must contain at least one property whose 'ODataProperty.SerializationInfo.PropertyKind' set to 'ODataPropertyKind.Key'. When writing with a user model, the entity type '{0}' defined in the model must define at least one key property." - /// - internal static string ODataResourceMetadataContext_EntityTypeWithNoKeyProperties(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceMetadataContext_EntityTypeWithNoKeyProperties, p0); - } - - /// - /// A string like "The key property '{0}' on type '{1}' has a null value. Key properties must not have null values." - /// - internal static string ODataResourceMetadataContext_NullKeyValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceMetadataContext_NullKeyValue, p0, p1); - } - - /// - /// A string like "The property '{0}' on type '{1}' is a non-primitive value. All key and etag properties must be of primitive types." - /// - internal static string ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues, p0, p1); - } - - /// - /// A string like "The value of a property '{0}' in ODataResource cannot be of type ODataResourceValue or collection of ODataResourceValue." - /// - internal static string ODataResource_PropertyValueCannotBeODataResourceValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResource_PropertyValueCannotBeODataResourceValue, p0); - } - - /// - /// A string like "The primitive property '{0}' on type '{1}' has a value which is not a primitive value." - /// - internal static string EdmValueUtils_NonPrimitiveValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_NonPrimitiveValue, p0, p1); - } - - /// - /// A string like "The entity instance value of type '{0}' doesn't have a value for property '{1}'. To compute an entity's metadata, its key and concurrency-token property values must be provided." - /// - internal static string EdmValueUtils_PropertyDoesntExist(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.EdmValueUtils_PropertyDoesntExist, p0, p1); - } - - /// - /// A string like "Cannot create an ODataPrimitiveValue from null; use ODataNullValue instead." - /// - internal static string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull); - } - } - - /// - /// A string like "An ODataPrimitiveValue was instantiated with a value of type '{0}'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types." - /// - internal static string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType, p0); - } - - /// - /// A string like "'{0}' is an invalid instance annotation name. An instance annotation name must contain a period that is not at the start or end of the name." - /// - internal static string ODataInstanceAnnotation_NeedPeriodInName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataInstanceAnnotation_NeedPeriodInName, p0); - } - - /// - /// A string like "'{0}' is a reserved instance annotation name because it starts with '{1}'. Reserved names are not allowed for custom instance annotations." - /// - internal static string ODataInstanceAnnotation_ReservedNamesNotAllowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataInstanceAnnotation_ReservedNamesNotAllowed, p0, p1); - } - - /// - /// A string like "'{0}' is an invalid instance annotation name." - /// - internal static string ODataInstanceAnnotation_BadTermName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataInstanceAnnotation_BadTermName, p0); - } - - /// - /// A string like "The value of an instance annotation cannot be of type ODataStreamReferenceValue." - /// - internal static string ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue); - } - } - - /// - /// A string like "A type name was not provided for an instance of ODataCollectionValue." - /// - internal static string ODataJsonValueSerializer_MissingTypeNameOnCollection - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonValueSerializer_MissingTypeNameOnCollection); - } - } - - /// - /// A string like "A raw value was not provided for an instance of ODataUntypedValue." - /// - internal static string ODataJsonValueSerializer_MissingRawValueOnUntyped - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataJsonValueSerializer_MissingRawValueOnUntyped); - } - } - - /// - /// A string like "Encountered an 'annotation' element without a 'term' attribute. All 'annotation' elements must have a 'term' attribute." - /// - internal static string InstanceAnnotation_MissingTermAttributeOnAnnotationElement - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.InstanceAnnotation_MissingTermAttributeOnAnnotationElement); - } - } - - /// - /// A string like "The value of the 'type' attribute on an 'annotation' element was '{0}', which is incompatible with the '{1}' attribute." - /// - internal static string InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType, p0, p1); - } - - /// - /// A string like "Encountered the attribute '{0}' on a non-empty 'annotation' element. If attribute value notation is used to specify the annotation's value, then there can be no body to the element." - /// - internal static string InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement, p0); - } - - /// - /// A string like "Encountered an 'annotation' element with more than one attribute from following set: 'int', 'string', 'decimal', 'float', and 'bool'. Only one such attribute may appear on an 'annotation' element." - /// - internal static string InstanceAnnotation_MultipleAttributeValueNotationAttributes - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.InstanceAnnotation_MultipleAttributeValueNotationAttributes); - } - } - - /// - /// A string like "The pattern '{0}' is not a valid pattern to match an annotation. It must contain at least one '.' separating the namespace and the name segments of an annotation." - /// - internal static string AnnotationFilterPattern_InvalidPatternMissingDot(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AnnotationFilterPattern_InvalidPatternMissingDot, p0); - } - - /// - /// A string like "The pattern '{0}' is not a valid pattern to match an annotation. It must not contain a namespace or name segment that is empty." - /// - internal static string AnnotationFilterPattern_InvalidPatternEmptySegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AnnotationFilterPattern_InvalidPatternEmptySegment, p0); - } - - /// - /// A string like "The pattern '{0}' is not a supported pattern to match an annotation. It must not contain '*' as part of a segment." - /// - internal static string AnnotationFilterPattern_InvalidPatternWildCardInSegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AnnotationFilterPattern_InvalidPatternWildCardInSegment, p0); - } - - /// - /// A string like "The pattern '{0}' is not a supported pattern to match an annotation. '*' must be the last segment of the pattern." - /// - internal static string AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment, p0); - } - - /// - /// A string like "The specified URI '{0}' must be absolute." - /// - internal static string SyntacticTree_UriMustBeAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_UriMustBeAbsolute, p0); - } - - /// - /// A string like "The maximum depth setting must be a number greater than zero." - /// - internal static string SyntacticTree_MaxDepthInvalid - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_MaxDepthInvalid); - } - } - - /// - /// A string like "Invalid value '{0}' for $skip query option found. The $skip query option requires a non-negative integer value." - /// - internal static string SyntacticTree_InvalidSkipQueryOptionValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_InvalidSkipQueryOptionValue, p0); - } - - /// - /// A string like "Invalid value '{0}' for $top query option found. The $top query option requires a non-negative integer value." - /// - internal static string SyntacticTree_InvalidTopQueryOptionValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_InvalidTopQueryOptionValue, p0); - } - - /// - /// A string like "Invalid value '{0}' for $count query option found. Valid values are '{1}'." - /// - internal static string SyntacticTree_InvalidCountQueryOptionValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_InvalidCountQueryOptionValue, p0, p1); - } - - /// - /// A string like "Invalid value '{0}' for $index query option found. The $index query option requires an integer value." - /// - internal static string SyntacticTree_InvalidIndexQueryOptionValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SyntacticTree_InvalidIndexQueryOptionValue, p0); - } - - /// - /// A string like "Query option '{0}' was specified more than once, but it must be specified at most once." - /// - internal static string QueryOptionUtils_QueryParameterMustBeSpecifiedOnce(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, p0); - } - - /// - /// A string like "The CLR literal of type '{0}' is not supported to be written as a Uri part." - /// - internal static string UriBuilder_NotSupportedClrLiteral(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriBuilder_NotSupportedClrLiteral, p0); - } - - /// - /// A string like "QueryToken '{0}' is not supported to be written as a Uri part." - /// - internal static string UriBuilder_NotSupportedQueryToken(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriBuilder_NotSupportedQueryToken, p0); - } - - /// - /// A string like "Recursion depth exceeded allowed limit." - /// - internal static string UriQueryExpressionParser_TooDeep - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_TooDeep); - } - } - - /// - /// A string like "Expression expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_ExpressionExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_ExpressionExpected, p0, p1); - } - - /// - /// A string like "'(' expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_OpenParenExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_OpenParenExpected, p0, p1); - } - - /// - /// A string like "')' or ',' expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_CloseParenOrCommaExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_CloseParenOrCommaExpected, p0, p1); - } - - /// - /// A string like "')' or operator expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_CloseParenOrOperatorExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_CloseParenOrOperatorExpected, p0, p1); - } - - /// - /// A string like "Only $filter and $search query options are allowed within $count." - /// - internal static string UriQueryExpressionParser_IllegalQueryOptioninDollarCount - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_IllegalQueryOptioninDollarCount); - } - } - - /// - /// A string like "Expecting a Star token but got: '{0}'." - /// - internal static string UriQueryExpressionParser_CannotCreateStarTokenFromNonStar(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_CannotCreateStarTokenFromNonStar, p0); - } - - /// - /// A string like "The range variable '{0}' has already been declared." - /// - internal static string UriQueryExpressionParser_RangeVariableAlreadyDeclared(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_RangeVariableAlreadyDeclared, p0); - } - - /// - /// A string like "'as' expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_AsExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_AsExpected, p0, p1); - } - - /// - /// A string like "'with' expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_WithExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_WithExpected, p0, p1); - } - - /// - /// A string like "Unrecognized with '{0}' at '{1}' in '{2}'." - /// - internal static string UriQueryExpressionParser_UnrecognizedWithMethod(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_UnrecognizedWithMethod, p0, p1, p2); - } - - /// - /// A string like "Expression expected at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_PropertyPathExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_PropertyPathExpected, p0, p1); - } - - /// - /// A string like "'{0}' expected at position {1} in '{2}'." - /// - internal static string UriQueryExpressionParser_KeywordOrIdentifierExpected(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_KeywordOrIdentifierExpected, p0, p1, p2); - } - - /// - /// A string like "The inner most expand transformation requires a filter transformation at position {0} in '{1}'." - /// - internal static string UriQueryExpressionParser_InnerMostExpandRequireFilter(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_InnerMostExpandRequireFilter, p0, p1); - } - - /// - /// A string like "The URI '{0}' is not valid because it is not based on '{1}'." - /// - internal static string UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri, p0, p1); - } - - /// - /// A string like "Bad Request: there was an error in the query syntax." - /// - internal static string UriQueryPathParser_SyntaxError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryPathParser_SyntaxError); - } - } - - /// - /// A string like "Too many segments in URI." - /// - internal static string UriQueryPathParser_TooManySegments - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryPathParser_TooManySegments); - } - } - - /// - /// A string like "The URI part '{0}' is not valid because there's no leading escape character." - /// - internal static string UriQueryPathParser_InvalidEscapeUri(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryPathParser_InvalidEscapeUri, p0); - } - - /// - /// A string like "The DateTimeOffset text '{0}' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range." - /// - internal static string UriUtils_DateTimeOffsetInvalidFormat(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriUtils_DateTimeOffsetInvalidFormat, p0); - } - - /// - /// A string like "Inner or start path segments must be navigation properties in $select." - /// - internal static string SelectionItemBinder_NonNavigationPathToken - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectionItemBinder_NonNavigationPathToken); - } - } - - /// - /// A string like "The parameter alias value expression is not string value." - /// - internal static string MetadataBinder_ParameterAliasValueExpressionNotSingleValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_ParameterAliasValueExpressionNotSingleValue); - } - } - - /// - /// A string like "An unsupported query token kind '{0}' was found." - /// - internal static string MetadataBinder_UnsupportedQueryTokenKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_UnsupportedQueryTokenKind, p0); - } - - /// - /// A string like "Could not find a property named '{1}' on type '{0}'." - /// - internal static string MetadataBinder_PropertyNotDeclared(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_PropertyNotDeclared, p0, p1); - } - - /// - /// A string like "Can not resolve the segment identifier '{0}' in query option." - /// - internal static string MetadataBinder_InvalidIdentifierInQueryOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_InvalidIdentifierInQueryOption, p0); - } - - /// - /// A string like "Property '{0}' is not declared on type '{1}' or is not a key property. Only key properties can be used in key lookups." - /// - internal static string MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue, p0, p1); - } - - /// - /// A string like "Could not find a function named '{0}' with parameters '{1}'." - /// - internal static string MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared, p0, p1); - } - - /// - /// A string like "An unnamed key value was used in a key lookup on a type '{0}' which has more than one key property. Unnamed key value can only be used on a type with one key property." - /// - internal static string MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties, p0); - } - - /// - /// A string like "A key property '{0}' was found twice in a key lookup. Each key property can be specified just once in a key lookup." - /// - internal static string MetadataBinder_DuplicitKeyPropertyInKeyValues(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_DuplicitKeyPropertyInKeyValues, p0); - } - - /// - /// A string like "A key lookup on type '{0}' didn't specify values for all key properties. All key properties must be specified in a key lookup." - /// - internal static string MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues, p0); - } - - /// - /// A string like "Expression of type '{0}' cannot be converted to type '{1}'." - /// - internal static string MetadataBinder_CannotConvertToType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CannotConvertToType, p0, p1); - } - - /// - /// A string like "The $filter expression must evaluate to a single boolean value." - /// - internal static string MetadataBinder_FilterExpressionNotSingleValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_FilterExpressionNotSingleValue); - } - } - - /// - /// A string like "The $orderby expression must evaluate to a single value of primitive type." - /// - internal static string MetadataBinder_OrderByExpressionNotSingleValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_OrderByExpressionNotSingleValue); - } - } - - /// - /// A string like "A PropertyAccessQueryToken without a parent was encountered outside of $filter or $orderby expression. The PropertyAccessQueryToken without a parent token is only allowed inside $filter or $orderby expressions." - /// - internal static string MetadataBinder_PropertyAccessWithoutParentParameter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_PropertyAccessWithoutParentParameter); - } - } - - /// - /// A string like "The operand for a binary operator '{0}' is not a single value. Binary operators require both operands to be single values." - /// - internal static string MetadataBinder_BinaryOperatorOperandNotSingleValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_BinaryOperatorOperandNotSingleValue, p0); - } - - /// - /// A string like "The operand for a unary operator '{0}' is not a single value. Unary operators require the operand to be a single value." - /// - internal static string MetadataBinder_UnaryOperatorOperandNotSingleValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_UnaryOperatorOperandNotSingleValue, p0); - } - - /// - /// A string like "The left operand for the IN operation is not a single value. IN operations require the left operand to be a single value and the right operand to be a collection value." - /// - internal static string MetadataBinder_LeftOperandNotSingleValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_LeftOperandNotSingleValue); - } - } - - /// - /// A string like "The right operand for the IN operation is not a collection value. IN operations require the left operand to be a single value and the right operand to be a collection value." - /// - internal static string MetadataBinder_RightOperandNotCollectionValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_RightOperandNotCollectionValue); - } - } - - /// - /// A string like "The parent value for a property access of a property '{0}' is not a single value. Property access can only be applied to a single value." - /// - internal static string MetadataBinder_PropertyAccessSourceNotSingleValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_PropertyAccessSourceNotSingleValue, p0); - } - - /// - /// A string like "The next token in a CountSegmentNode must be a collection." - /// - internal static string MetadataBinder_CountSegmentNextTokenNotCollectionValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CountSegmentNextTokenNotCollectionValue); - } - } - - /// - /// A string like "A binary operator with incompatible types was detected. Found operand types '{0}' and '{1}' for operator kind '{2}'." - /// - internal static string MetadataBinder_IncompatibleOperandsError(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_IncompatibleOperandsError, p0, p1, p2); - } - - /// - /// A string like "A unary operator with an incompatible type was detected. Found operand type '{0}' for operator kind '{1}'." - /// - internal static string MetadataBinder_IncompatibleOperandError(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_IncompatibleOperandError, p0, p1); - } - - /// - /// A string like "An unknown function with name '{0}' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed." - /// - internal static string MetadataBinder_UnknownFunction(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_UnknownFunction, p0); - } - - /// - /// A string like "The argument for an invocation of a function with name '{0}' is not a single value. All arguments for this function must be single values." - /// - internal static string MetadataBinder_FunctionArgumentNotSingleValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_FunctionArgumentNotSingleValue, p0); - } - - /// - /// A string like "No function signature for the function with name '{0}' matches the specified arguments. The function signatures considered are: {1}." - /// - internal static string MetadataBinder_NoApplicableFunctionFound(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_NoApplicableFunctionFound, p0, p1); - } - - /// - /// A string like "A token of kind '{0}' was bound to the value null; this is invalid. A query token must always be bound to a non-null query node." - /// - internal static string MetadataBinder_BoundNodeCannotBeNull(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_BoundNodeCannotBeNull, p0); - } - - /// - /// A string like "The value '{0}' is not a non-negative integer value. In OData, the $top query option must specify a non-negative integer value." - /// - internal static string MetadataBinder_TopRequiresNonNegativeInteger(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_TopRequiresNonNegativeInteger, p0); - } - - /// - /// A string like "The value '{0}' is not a non-negative integer value. In OData, the $skip query option must specify a non-negative integer value." - /// - internal static string MetadataBinder_SkipRequiresNonNegativeInteger(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_SkipRequiresNonNegativeInteger, p0); - } - - /// - /// A string like "The bind state cannot be null. In OData, the bind state for query options should not be null and there should be query options in the object." - /// - internal static string MetadataBinder_QueryOptionsBindStateCannotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_QueryOptionsBindStateCannotBeNull); - } - } - - /// - /// A string like "The bind method cannot be null. In OData, the processing of query options should have a corresponding bind method." - /// - internal static string MetadataBinder_QueryOptionsBindMethodCannotBeNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_QueryOptionsBindMethodCannotBeNull); - } - } - - /// - /// A string like "Encountered invalid type cast. '{0}' is not assignable from '{1}'." - /// - internal static string MetadataBinder_HierarchyNotFollowed(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_HierarchyNotFollowed, p0, p1); - } - - /// - /// A string like "Any/All may only be used following a collection." - /// - internal static string MetadataBinder_LambdaParentMustBeCollection - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_LambdaParentMustBeCollection); - } - } - - /// - /// A string like "The parameter '{0}' is not in scope." - /// - internal static string MetadataBinder_ParameterNotInScope(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_ParameterNotInScope, p0); - } - - /// - /// A string like "A navigation property can only follow single entity nodes." - /// - internal static string MetadataBinder_NavigationPropertyNotFollowingSingleEntityType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_NavigationPropertyNotFollowingSingleEntityType); - } - } - - /// - /// A string like "The Any/All query expression must evaluate to a single boolean value." - /// - internal static string MetadataBinder_AnyAllExpressionNotSingleValue - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_AnyAllExpressionNotSingleValue); - } - } - - /// - /// A string like "The Cast or IsOf expression has an invalid number of operands: number of operands is '{0}' and it should be 1 or 2." - /// - internal static string MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands, p0); - } - - /// - /// A string like "Cast or IsOf Function must have a type in its arguments." - /// - internal static string MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); - } - } - - /// - /// A string like "The Cast and IsOf functions do not support collection arguments or types." - /// - internal static string MetadataBinder_CastOrIsOfCollectionsNotSupported - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CastOrIsOfCollectionsNotSupported); - } - } - - /// - /// A string like "Collection open properties are not supported in this release." - /// - internal static string MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease); - } - } - - /// - /// A string like "Can only bind segments that are Navigation, Structural, Complex, or Collections. We found a segment '{0}' that isn't any of those. Please revise the query." - /// - internal static string MetadataBinder_IllegalSegmentType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_IllegalSegmentType, p0); - } - - /// - /// A string like "The '{0}' option cannot be applied to the query path. '{0}' can only be applied to a collection of entities." - /// - internal static string MetadataBinder_QueryOptionNotApplicable(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.MetadataBinder_QueryOptionNotApplicable, p0); - } - - /// - /// A string like "String item should be single/double quoted: '{0}'." - /// - internal static string StringItemShouldBeQuoted(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.StringItemShouldBeQuoted, p0); - } - - /// - /// A string like "Invalid PrimitiveTypeKind {0}. A Stream item must be of type binary or string, or none if unknown."" - /// - internal static string StreamItemInvalidPrimitiveKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.StreamItemInvalidPrimitiveKind, p0); - } - - /// - /// A string like "$apply/aggregate expression '{0}' operation does not support value type '{1}'." - /// - internal static string ApplyBinder_AggregateExpressionIncompatibleTypeForMethod(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_AggregateExpressionIncompatibleTypeForMethod, p0, p1); - } - - /// - /// A string like "$apply/aggregate does not support method '{0}'." - /// - internal static string ApplyBinder_UnsupportedAggregateMethod(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_UnsupportedAggregateMethod, p0); - } - - /// - /// A string like "$apply/aggregate expression token kind '{0}' not supported." - /// - internal static string ApplyBinder_UnsupportedAggregateKind(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_UnsupportedAggregateKind, p0); - } - - /// - /// A string like "$apply/aggregate expression '{0}' must evaluate to a single value." - /// - internal static string ApplyBinder_AggregateExpressionNotSingleValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_AggregateExpressionNotSingleValue, p0); - } - - /// - /// A string like "$apply/groupby grouping expression '{0}' must evaluate to a property access value." - /// - internal static string ApplyBinder_GroupByPropertyNotPropertyAccessValue(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_GroupByPropertyNotPropertyAccessValue, p0); - } - - /// - /// A string like "$apply clause does not support type '{0}'." - /// - internal static string ApplyBinder_UnsupportedType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_UnsupportedType, p0); - } - - /// - /// A string like "$apply/groupby not support '{0}' as child transformation" - /// - internal static string ApplyBinder_UnsupportedGroupByChild(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ApplyBinder_UnsupportedGroupByChild, p0); - } - - /// - /// A string like "There are unsupported aggregation expressions in the transformation node." - /// - internal static string AggregateTransformationNode_UnsupportedAggregateExpressions - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.AggregateTransformationNode_UnsupportedAggregateExpressions); - } - } - - /// - /// A string like "Cannot find a suitable overload for function '{0}' that takes '{1}' arguments." - /// - internal static string FunctionCallBinder_CannotFindASuitableOverload(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionCallBinder_CannotFindASuitableOverload, p0, p1); - } - - /// - /// A string like "Found a Uri function '{0}' with a parent token. Uri functions cannot have parent tokens." - /// - internal static string FunctionCallBinder_UriFunctionMustHaveHaveNullParent(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, p0); - } - - /// - /// A string like "Found a function '{0}' on an open property. Functions on open properties are not supported." - /// - internal static string FunctionCallBinder_CallingFunctionOnOpenProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionCallBinder_CallingFunctionOnOpenProperty, p0); - } - - /// - /// A string like "Parameter or entity key names must be unique. There is most likely an error in the model." - /// - internal static string FunctionCallParser_DuplicateParameterOrEntityKeyName - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionCallParser_DuplicateParameterOrEntityKeyName); - } - } - - /// - /// A string like "'{0}' is not a valid count option." - /// - internal static string ODataUriParser_InvalidCount(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataUriParser_InvalidCount, p0); - } - - /// - /// A string like "The child type '{0}' in a cast was not an entity type. Casts can only be performed on entity types." - /// - internal static string CastBinder_ChildTypeIsNotEntity(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CastBinder_ChildTypeIsNotEntity, p0); - } - - /// - /// A string like "Enumeration type value can only be casted to or from string." - /// - internal static string CastBinder_EnumOnlyCastToOrFromString - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CastBinder_EnumOnlyCastToOrFromString); - } - } - - /// - /// A string like "The string '{0}' is not a valid enumeration type constant." - /// - internal static string Binder_IsNotValidEnumConstant(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Binder_IsNotValidEnumConstant, p0); - } - - /// - /// A string like "Invalid content-id '{0}' for batch reference segment." - /// - internal static string BatchReferenceSegment_InvalidContentID(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BatchReferenceSegment_InvalidContentID, p0); - } - - /// - /// A string like "Property '{0}' is of an unrecognized EdmPropertyKind." - /// - internal static string SelectExpandBinder_UnknownPropertyType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectExpandBinder_UnknownPropertyType, p0); - } - - /// - /// A string like "It's not allowed to append '{0}' after wildcard." - /// - internal static string SelectExpandBinder_InvalidIdentifierAfterWildcard(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectExpandBinder_InvalidIdentifierAfterWildcard, p0); - } - - /// - /// A string like "It's not allowed to nest query options within '{0}' selection." - /// - internal static string SelectExpandBinder_InvalidQueryOptionNestedSelection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectExpandBinder_InvalidQueryOptionNestedSelection, p0); - } - - /// - /// A string like "Found a system token, '{0}', while parsing a select clause." - /// - internal static string SelectExpandBinder_SystemTokenInSelect(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectExpandBinder_SystemTokenInSelect, p0); - } - - /// - /// A string like "Only properties specified in $expand can be traversed in $select query options. Selected item was '{0}'." - /// - internal static string SelectionItemBinder_NoExpandForSelectedProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectionItemBinder_NoExpandForSelectedProperty, p0); - } - - /// - /// A string like "Trying to follow type segments on a segment that isn't a type. Segment was '{0}'." - /// - internal static string SelectExpandPathBinder_FollowNonTypeSegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectExpandPathBinder_FollowNonTypeSegment, p0); - } - - /// - /// A string like "Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties." - /// - internal static string SelectBinder_MultiLevelPathInSelect - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectBinder_MultiLevelPathInSelect); - } - } - - /// - /// A string like "Trying to traverse a non-normalized expand tree." - /// - internal static string ExpandItemBinder_TraversingANonNormalizedTree - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_TraversingANonNormalizedTree); - } - } - - /// - /// A string like "The type '{0}' is not defined in the model." - /// - internal static string ExpandItemBinder_CannotFindType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_CannotFindType, p0); - } - - /// - /// A string like "Property '{0}' on type '{1}' is not a navigation property or complex property. Only navigation properties can be expanded." - /// - internal static string ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty, p0, p1); - } - - /// - /// A string like "Found a path within a select or expand query option that isn't ended by a non-type segment." - /// - internal static string ExpandItemBinder_TypeSegmentNotFollowedByPath - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_TypeSegmentNotFollowedByPath); - } - } - - /// - /// A string like "Trying to parse a type segment path that is too long." - /// - internal static string ExpandItemBinder_PathTooDeep - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_PathTooDeep); - } - } - - /// - /// A string like "Found a path traversing multiple navigation properties. Please rephrase the query such that each expand path contains only type segments and navigation properties." - /// - internal static string ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); - } - } - - /// - /// A string like "The $level option on navigation property '{0}' is not allowed, because the related entity type '{1}' could not be cast to source entity type '{2}'." - /// - internal static string ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType, p0, p1, p2); - } - - /// - /// A string like "Segment '{0}' is not valid in expand path. Before navigation property, only type segment or entity or complex property can exist." - /// - internal static string ExpandItemBinder_InvaidSegmentInExpand(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandItemBinder_InvaidSegmentInExpand, p0); - } - - /// - /// A string like "The navigation property must have a target multiplicity of 'One' or 'ZeroOrOne' to create a SingleNavigationNode." - /// - internal static string Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity); - } - } - - /// - /// A string like "An entity type '{0}' was given to NonEntityParameterQueryNode. Use EntityParameterQueryNode instead." - /// - internal static string Nodes_NonentityParameterQueryNodeWithEntityType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_NonentityParameterQueryNodeWithEntityType, p0); - } - - /// - /// A string like "The navigation property must have a target multiplicity of 'Many' to create a CollectionNavigationNode." - /// - internal static string Nodes_CollectionNavigationNode_MustHaveManyMultiplicity - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity); - } - } - - /// - /// A string like "A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is not structural." - /// - internal static string Nodes_PropertyAccessShouldBeNonEntityProperty(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_PropertyAccessShouldBeNonEntityProperty, p0); - } - - /// - /// A string like "A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is a collection." - /// - internal static string Nodes_PropertyAccessTypeShouldNotBeCollection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_PropertyAccessTypeShouldNotBeCollection, p0); - } - - /// - /// A string like "A node of this kind requires the associated property to be a structural, collection type, but property '{0}' is not a collection." - /// - internal static string Nodes_PropertyAccessTypeMustBeCollection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_PropertyAccessTypeMustBeCollection, p0); - } - - /// - /// A string like "Only static Entity Set reference expressions are supported currently." - /// - internal static string Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease); - } - } - - /// - /// A string like "An instance of CollectionFunctionCallNode can only be created with a primitive, complex or enum collection type. For functions returning a collection of entities, use EntityCollectionFunctionCallNode instead." - /// - internal static string Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); - } - } - - /// - /// A string like "An instance of EntityCollectionFunctionCallNode can only be created with an entity collection type. For functions returning a collection of primitive or complex values, use CollectionFunctionCallNode instead." - /// - internal static string Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity); - } - } - - /// - /// A string like "An instance of SingleValueFunctionCallNode can only be created with a primitive, complex or enum type. For functions returning a single entity, use SingleEntityFunctionCallNode instead." - /// - internal static string Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); - } - } - - /// - /// A string like "An instance of InNode can only be created where the item types of the right operand '{0}' and the left operand '{1}' can be compared." - /// - internal static string Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType, p0, p1); - } - - /// - /// A string like "Found a segment that isn't a path while parsing the path within a select or expand query option." - /// - internal static string ExpandTreeNormalizer_NonPathInPropertyChain - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpandTreeNormalizer_NonPathInPropertyChain); - } - } - - /// - /// A string like "Found multiple select terms with same select path '{0}' at one $select, please combine them together." - /// - internal static string SelectTreeNormalizer_MultipleSelecTermWithSamePathFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.SelectTreeNormalizer_MultipleSelecTermWithSamePathFound, p0); - } - - /// - /// A string like "Term '{0}' is not valid in a $expand expression, as only $level option is allowed when the expanded navigation property is star." - /// - internal static string UriExpandParser_TermIsNotValidForStar(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriExpandParser_TermIsNotValidForStar, p0); - } - - /// - /// A string like "Term '{0}' is not valid in a $expand expression, no option is allowed when the expanded navigation property is */$ref." - /// - internal static string UriExpandParser_TermIsNotValidForStarRef(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriExpandParser_TermIsNotValidForStarRef, p0); - } - - /// - /// A string like "Cannot get parent structured type for term '{0}' to auto populate all navigation properties." - /// - internal static string UriExpandParser_ParentStructuredTypeIsNull(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriExpandParser_ParentStructuredTypeIsNull, p0); - } - - /// - /// A string like "Term '{0}' is not valid in a $expand expression as multiple stars are not allowed." - /// - internal static string UriExpandParser_TermWithMultipleStarNotAllowed(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriExpandParser_TermWithMultipleStarNotAllowed, p0); - } - - /// - /// A string like "Term '{0}' is not valid in a $select or $expand expression." - /// - internal static string UriSelectParser_TermIsNotValid(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_TermIsNotValid, p0); - } - - /// - /// A string like "Top option must be a non-negative integer, it is set to '{0}' instead." - /// - internal static string UriSelectParser_InvalidTopOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_InvalidTopOption, p0); - } - - /// - /// A string like "Skip option must be a non-negative integer, it is set to '{0}' instead." - /// - internal static string UriSelectParser_InvalidSkipOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_InvalidSkipOption, p0); - } - - /// - /// A string like "Count option must be a boolean value, it is set to '{0}' instead." - /// - internal static string UriSelectParser_InvalidCountOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_InvalidCountOption, p0); - } - - /// - /// A string like "Levels option must be a non-negative integer or 'max', it is set to '{0}' instead." - /// - internal static string UriSelectParser_InvalidLevelsOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_InvalidLevelsOption, p0); - } - - /// - /// A string like "Found system token '{0}' in select or expand clause '{1}'." - /// - internal static string UriSelectParser_SystemTokenInSelectExpand(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriSelectParser_SystemTokenInSelectExpand, p0, p1); - } - - /// - /// A string like "Missing expand option on navigation property '{0}'. If a parenthesis expression follows an expanded navigation property, then at least one expand option must be provided." - /// - internal static string UriParser_MissingExpandOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_MissingExpandOption, p0); - } - - /// - /// A string like "Empty parenthesis not allowed." - /// - internal static string UriParser_EmptyParenthesis - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_EmptyParenthesis); - } - } - - /// - /// A string like "Missing select option on property '{0}'. If a parenthesis expression follows a selected property, then at least one query option must be provided." - /// - internal static string UriParser_MissingSelectOption(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_MissingSelectOption, p0); - } - - /// - /// A string like "Parameter 'relativeUri' must be a relative Uri if serviceRoot is not specified." - /// - internal static string UriParser_RelativeUriMustBeRelative - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_RelativeUriMustBeRelative); - } - } - - /// - /// A string like "A service root URI must be provided to the ODataUriParser in order to use this method." - /// - internal static string UriParser_NeedServiceRootForThisOverload - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_NeedServiceRootForThisOverload); - } - } - - /// - /// A string like "The URI '{0}' must be an absolute URI." - /// - internal static string UriParser_UriMustBeAbsolute(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_UriMustBeAbsolute, p0); - } - - /// - /// A string like "The limit must be greater than or equal to zero" - /// - internal static string UriParser_NegativeLimit - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_NegativeLimit); - } - } - - /// - /// A string like "The result of parsing $expand contained at least {0} items, but the maximum allowed is {1}." - /// - internal static string UriParser_ExpandCountExceeded(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_ExpandCountExceeded, p0, p1); - } - - /// - /// A string like "The result of parsing $expand was at least {0} items deep, but the maximum allowed is {1}." - /// - internal static string UriParser_ExpandDepthExceeded(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_ExpandDepthExceeded, p0, p1); - } - - /// - /// A string like "The type '{0}' is not valid for $select or $expand, only structured types are allowed." - /// - internal static string UriParser_TypeInvalidForSelectExpand(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_TypeInvalidForSelectExpand, p0); - } - - /// - /// A string like "The handler property for context '{0}' should not return null." - /// - internal static string UriParser_ContextHandlerCanNotBeNull(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParser_ContextHandlerCanNotBeNull, p0); - } - - /// - /// A string like "More than one properties match the name '{0}' were found in type '{1}'." - /// - internal static string UriParserMetadata_MultipleMatchingPropertiesFound(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserMetadata_MultipleMatchingPropertiesFound, p0, p1); - } - - /// - /// A string like "More than one navigation sources match the name '{0}' were found in model." - /// - internal static string UriParserMetadata_MultipleMatchingNavigationSourcesFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserMetadata_MultipleMatchingNavigationSourcesFound, p0); - } - - /// - /// A string like "More than one types match the name '{0}' were found in model." - /// - internal static string UriParserMetadata_MultipleMatchingTypesFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserMetadata_MultipleMatchingTypesFound, p0); - } - - /// - /// A string like "More than one keys match the name '{0}' were found." - /// - internal static string UriParserMetadata_MultipleMatchingKeysFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserMetadata_MultipleMatchingKeysFound, p0); - } - - /// - /// A string like "More than one parameters match the name '{0}' were found." - /// - internal static string UriParserMetadata_MultipleMatchingParametersFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserMetadata_MultipleMatchingParametersFound, p0); - } - - /// - /// A string like "The UrlValidator used to validate an ODataUri must use the same Model as the ODataUriParser." - /// - internal static string UriValidator_ValidatorMustUseSameModelAsParser - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriValidator_ValidatorMustUseSameModelAsParser); - } - } - - /// - /// A string like "The request URI is not valid. $ref cannot be applied to the segment '{0}' since $ref can only follow an entity segment or entity collection segment." - /// - internal static string PathParser_EntityReferenceNotSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PathParser_EntityReferenceNotSupported, p0); - } - - /// - /// A string like "$value cannot be applied to a collection." - /// - internal static string PathParser_CannotUseValueOnCollection - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PathParser_CannotUseValueOnCollection); - } - } - - /// - /// A string like "The type '{0}' does not inherit from and is not a base type of '{1}'. The type of '{2}' must be related to the Type of the EntitySet." - /// - internal static string PathParser_TypeMustBeRelatedToSet(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PathParser_TypeMustBeRelatedToSet, p0, p1, p2); - } - - /// - /// A string like "Type cast segment '{0}' after a collection which is not of entity or complex type is not allowed." - /// - internal static string PathParser_TypeCastOnlyAllowedAfterStructuralCollection(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PathParser_TypeCastOnlyAllowedAfterStructuralCollection, p0); - } - - /// - /// A string like "Type cast segment '{0}' on {1} '{2}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation." - /// - internal static string PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, p0, p1, p2); - } - - /// - /// A string like "A resource set may contain a next page link, a delta link or neither, but must not contain both." - /// - internal static string ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); - } - } - - /// - /// A string like "The last segment, and only the last segment, can be a navigation property in $expand." - /// - internal static string ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty); - } - } - - /// - /// A string like "The last segment must be a navigation property or type segment in $expand." - /// - internal static string ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment); - } - } - - /// - /// A string like "Found a segment of type '{0} in an expand path, but only NavigationProperty, Property and Type segments are allowed." - /// - internal static string ODataExpandPath_InvalidExpandPathSegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataExpandPath_InvalidExpandPathSegment, p0); - } - - /// - /// A string like "TypeSegment cannot be the only segment in a $select." - /// - internal static string ODataSelectPath_CannotOnlyHaveTypeSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataSelectPath_CannotOnlyHaveTypeSegment); - } - } - - /// - /// A string like "Found a segment of type '{0} in a select path, but only TypeSegment, NavigationPropertySegment, PropertySegment, OperationSegment or OpenPropertySegments are allowed." - /// - internal static string ODataSelectPath_InvalidSelectPathSegmentType(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataSelectPath_InvalidSelectPathSegmentType, p0); - } - - /// - /// A string like "An operation can only be the last segment in $select." - /// - internal static string ODataSelectPath_OperationSegmentCanOnlyBeLastSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataSelectPath_OperationSegmentCanOnlyBeLastSegment); - } - } - - /// - /// A string like "A navigation property can only be the last segment in $select." - /// - internal static string ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment); - } - } - - /// - /// A string like "The target Entity Set of Navigation Property '{0}' could not be found. This is most likely an error in the IEdmModel." - /// - internal static string RequestUriProcessor_TargetEntitySetNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_TargetEntitySetNotFound, p0); - } - - /// - /// A string like "The function overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel." - /// - internal static string RequestUriProcessor_FoundInvalidFunctionImport(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_FoundInvalidFunctionImport, p0); - } - - /// - /// A string like "No type could be computed for this Segment since there were multiple possible operations with varying return types." - /// - internal static string OperationSegment_ReturnTypeForMultipleOverloads - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.OperationSegment_ReturnTypeForMultipleOverloads); - } - } - - /// - /// A string like "The return type from the operation is not possible with the given entity set." - /// - internal static string OperationSegment_CannotReturnNull - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.OperationSegment_CannotReturnNull); - } - } - - /// - /// A string like "Unable to resolve function overloads to a single function. There was more than one function in the model with name '{0}' and parameter names '{1}'." - /// - internal static string FunctionOverloadResolver_NoSingleMatchFound(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_NoSingleMatchFound, p0, p1); - } - - /// - /// A string like "Multiple action overloads were found with the same binding parameter for '{0}'." - /// - internal static string FunctionOverloadResolver_MultipleActionOverloads(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_MultipleActionOverloads, p0); - } - - /// - /// A string like "Multiple action import overloads were found with the same binding parameter for '{0}'." - /// - internal static string FunctionOverloadResolver_MultipleActionImportOverloads(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_MultipleActionImportOverloads, p0); - } - - /// - /// A string like "Multiple action import and function import overloads for '{0}' were found." - /// - internal static string FunctionOverloadResolver_MultipleOperationImportOverloads(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_MultipleOperationImportOverloads, p0); - } - - /// - /// A string like "Multiple action and function overloads for '{0}' were found." - /// - internal static string FunctionOverloadResolver_MultipleOperationOverloads(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_MultipleOperationOverloads, p0); - } - - /// - /// A string like "The operation overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel." - /// - internal static string FunctionOverloadResolver_FoundInvalidOperation(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_FoundInvalidOperation, p0); - } - - /// - /// A string like "The operation import overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel." - /// - internal static string FunctionOverloadResolver_FoundInvalidOperationImport(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.FunctionOverloadResolver_FoundInvalidOperationImport, p0); - } - - /// - /// A string like "The given custom function '{0}' already exists as a Built-In function. Consider use 'addAsOverloadToBuiltInFunction = true' parameter." - /// - internal static string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload, p0); - } - - /// - /// A string like "The given custom function '{0}' already exists as a Built-In function in one of it's overloads. Thus cannot override the Built-In function." - /// - internal static string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature, p0); - } - - /// - /// A string like "The given function name '{0}' already exists as a custom function with the same overload." - /// - internal static string CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists, p0); - } - - /// - /// A string like "The ODataPathSegment provided (Id = {0}) is not an EntitySetSegment." - /// - internal static string RequestUriProcessor_InvalidValueForEntitySegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_InvalidValueForEntitySegment, p0); - } - - /// - /// A string like "The KeySegment provided (Id = {0}) is either null, having no keys, or does not target a single resource." - /// - internal static string RequestUriProcessor_InvalidValueForKeySegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_InvalidValueForKeySegment, p0); - } - - /// - /// A string like "$filter path segment cannot be applied on single entities or singletons. Entity type: '{0}'." - /// - internal static string RequestUriProcessor_CannotApplyFilterOnSingleEntities(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_CannotApplyFilterOnSingleEntities, p0); - } - - /// - /// A string like "$each set-based operation cannot be applied on single entities or singletons. Entity type: '{0}'." - /// - internal static string RequestUriProcessor_CannotApplyEachOnSingleEntities(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_CannotApplyEachOnSingleEntities, p0); - } - - /// - /// A string like "The $filter path segment must be in the form $filter(expression), where the expression resolves to a boolean." - /// - internal static string RequestUriProcessor_FilterPathSegmentSyntaxError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_FilterPathSegmentSyntaxError); - } - } - - /// - /// A string like "There are no navigation sources found to apply '{0}'." - /// - internal static string RequestUriProcessor_NoNavigationSourceFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_NoNavigationSourceFound, p0); - } - - /// - /// A string like "Only a single operation can follow $each." - /// - internal static string RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); - } - } - - /// - /// A string like "Empty segment encountered in request URL. Please make sure that a valid request URL is specified." - /// - internal static string RequestUriProcessor_EmptySegmentInRequestUrl - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_EmptySegmentInRequestUrl); - } - } - - /// - /// A string like "Bad Request - Error in query syntax." - /// - internal static string RequestUriProcessor_SyntaxError - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_SyntaxError); - } - } - - /// - /// A string like "The request URI is not valid, the segment $count cannot be applied to the root of the service." - /// - internal static string RequestUriProcessor_CountOnRoot - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_CountOnRoot); - } - } - - /// - /// A string like "The request URI is not valid, the segment $filter cannot be applied to the root of the service." - /// - internal static string RequestUriProcessor_FilterOnRoot - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_FilterOnRoot); - } - } - - /// - /// A string like "The request URI is not valid, the segment $each cannot be applied to the root of the service." - /// - internal static string RequestUriProcessor_EachOnRoot - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_EachOnRoot); - } - } - - /// - /// A string like "The request URI is not valid, the segment $ref cannot be applied to the root of the service." - /// - internal static string RequestUriProcessor_RefOnRoot - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_RefOnRoot); - } - } - - /// - /// A string like "The request URI is not valid. The segment '{0}' must be the last segment in the URI because it is one of the following: $ref, $batch, $count, $value, $metadata, a named media resource, an action, a noncomposable function, an action import, a noncomposable function import, an operation with void return type, or an operation import with void return type." - /// - internal static string RequestUriProcessor_MustBeLeafSegment(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_MustBeLeafSegment, p0); - } - - /// - /// A string like "The request URI is not valid. The segment '{0}' must refer to a navigation property since the previous segment identifier is '{1}'." - /// - internal static string RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment, p0, p1); - } - - /// - /// A string like "The request URI is not valid. There must a segment specified after the '{0}' segment and the segment must refer to a entity resource." - /// - internal static string RequestUriProcessor_MissingSegmentAfterLink(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_MissingSegmentAfterLink, p0); - } - - /// - /// A string like "The request URI is not valid. $count cannot be applied to the segment '{0}' since $count can only follow an entity set, a collection navigation property, a structural property of collection type, an operation returning collection type or an operation import returning collection type." - /// - internal static string RequestUriProcessor_CountNotSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_CountNotSupported, p0); - } - - /// - /// A string like "The request URI is not valid. Since the segment '{0}' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource." - /// - internal static string RequestUriProcessor_CannotQueryCollections(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_CannotQueryCollections, p0); - } - - /// - /// A string like "The request URI is not valid. The segment '{0}' cannot include key predicates, however it may end with empty parenthesis." - /// - internal static string RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, p0); - } - - /// - /// A string like "The segment '{1}' in the request URI is not valid. The segment '{0}' refers to a primitive property, function, or service operation, so the only supported value from the next segment is '$value'." - /// - internal static string RequestUriProcessor_ValueSegmentAfterScalarPropertySegment(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, p0, p1); - } - - /// - /// A string like "The type '{0}' specified in the URI is neither a base type nor a sub-type of the previously-specified type '{1}'." - /// - internal static string RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, p0, p1); - } - - /// - /// A string like "Open navigation properties are not supported on OpenTypes. Property name: '{0}'." - /// - internal static string OpenNavigationPropertiesNotSupportedOnOpenTypes(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.OpenNavigationPropertiesNotSupportedOnOpenTypes, p0); - } - - /// - /// A string like "Error processing request stream. In batch mode, a resource can be cross-referenced only for bind/unbind operations." - /// - internal static string BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation); - } - } - - /// - /// A string like "The response requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service is set to {1}." - /// - internal static string DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion, p0, p1); - } - - /// - /// A string like "The number of keys specified in the URI does not match number of key properties for the resource '{0}'." - /// - internal static string BadRequest_KeyCountMismatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BadRequest_KeyCountMismatch, p0); - } - - /// - /// A string like "The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared key of the resource '{0}'." - /// - internal static string BadRequest_KeyMismatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BadRequest_KeyMismatch, p0); - } - - /// - /// A string like "The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared or alternate key properties for the resource '{0}'." - /// - internal static string BadRequest_KeyOrAlternateKeyMismatch(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BadRequest_KeyOrAlternateKeyMismatch, p0); - } - - /// - /// A string like "Segments with multiple key values must specify them in 'name=value' form." - /// - internal static string RequestUriProcessor_KeysMustBeNamed - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_KeysMustBeNamed); - } - } - - /// - /// A string like "Resource not found for the segment '{0}'." - /// - internal static string RequestUriProcessor_ResourceNotFound(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_ResourceNotFound, p0); - } - - /// - /// A string like "Batched service action '{0}' cannot be invoked because it was bound to an entity created in the same changeset." - /// - internal static string RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset, p0); - } - - /// - /// A string like "Forbidden" - /// - internal static string RequestUriProcessor_Forbidden - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_Forbidden); - } - } - - /// - /// A string like "Found an operation bound to a non-entity type." - /// - internal static string RequestUriProcessor_OperationSegmentBoundToANonEntityType - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_OperationSegmentBoundToANonEntityType); - } - } - - /// - /// A string like "The request URI is not valid. The bound function binding to '{0}' does not match the composability of the escape function in the URI." - /// - internal static string RequestUriProcessor_NoBoundEscapeFunctionSupported(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_NoBoundEscapeFunctionSupported, p0); - } - - /// - /// A string like "The UrlEscape function '{0}' must have exactly one non-binding parameter of type 'Edm.String'." - /// - internal static string RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter, p0); - } - - /// - /// A string like "A composable escape function must have a valid operation passed as a parameter." - /// - internal static string RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter); - } - } - - /// - /// A string like "An internal error '{0}' occurred." - /// - internal static string General_InternalError(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.General_InternalError, p0); - } - - /// - /// A string like "A non-negative integer value was expected, but the value '{0}' is not a valid non-negative integer." - /// - internal static string ExceptionUtils_CheckIntegerNotNegative(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExceptionUtils_CheckIntegerNotNegative, p0); - } - - /// - /// A string like "A positive integer value was expected, but the value '{0}' is not a valid positive integer." - /// - internal static string ExceptionUtils_CheckIntegerPositive(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExceptionUtils_CheckIntegerPositive, p0); - } - - /// - /// A string like "A positive long value was expected; however, the value '{0}' is not a valid positive long value." - /// - internal static string ExceptionUtils_CheckLongPositive(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExceptionUtils_CheckLongPositive, p0); - } - - /// - /// A string like "Value cannot be null or empty." - /// - internal static string ExceptionUtils_ArgumentStringNullOrEmpty - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExceptionUtils_ArgumentStringNullOrEmpty); - } - } - - /// - /// A string like "Only $ref is allowed with star in $expand option." - /// - internal static string ExpressionToken_OnlyRefAllowWithStarInExpand - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_OnlyRefAllowWithStarInExpand); - } - } - - /// - /// A string like "$count is not allowed in $select option." - /// - internal static string ExpressionToken_DollarCountNotAllowedInSelect - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_DollarCountNotAllowedInSelect); - } - } - - /// - /// A string like "No property is allowed after $count segment." - /// - internal static string ExpressionToken_NoPropAllowedAfterDollarCount - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_NoPropAllowedAfterDollarCount); - } - } - - /// - /// A string like "No property is allowed after $ref segment." - /// - internal static string ExpressionToken_NoPropAllowedAfterRef - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_NoPropAllowedAfterRef); - } - } - - /// - /// A string like "No segment is allowed before star in $expand." - /// - internal static string ExpressionToken_NoSegmentAllowedBeforeStarInExpand - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); - } - } - - /// - /// A string like "An identifier was expected at position {0}." - /// - internal static string ExpressionToken_IdentifierExpected(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionToken_IdentifierExpected, p0); - } - - /// - /// A string like "There is an unterminated string literal at position {0} in '{1}'." - /// - internal static string ExpressionLexer_UnterminatedStringLiteral(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_UnterminatedStringLiteral, p0, p1); - } - - /// - /// A string like "Syntax error: character '{0}' is not valid at position {1} in '{2}'." - /// - internal static string ExpressionLexer_InvalidCharacter(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_InvalidCharacter, p0, p1, p2); - } - - /// - /// A string like "Syntax error at position {0} in '{1}'." - /// - internal static string ExpressionLexer_SyntaxError(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_SyntaxError, p0, p1); - } - - /// - /// A string like "There is an unterminated literal at position {0} in '{1}'." - /// - internal static string ExpressionLexer_UnterminatedLiteral(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_UnterminatedLiteral, p0, p1); - } - - /// - /// A string like "A digit was expected at position {0} in '{1}'." - /// - internal static string ExpressionLexer_DigitExpected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_DigitExpected, p0, p1); - } - - /// - /// A string like "Found an unbalanced bracket expression." - /// - internal static string ExpressionLexer_UnbalancedBracketExpression - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_UnbalancedBracketExpression); - } - } - - /// - /// A string like "Numeric string '{0}' is not a valid Int32/Int64/Double/Decimal." - /// - internal static string ExpressionLexer_InvalidNumericString(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_InvalidNumericString, p0); - } - - /// - /// A string like "An unrecognized escape sequence '\\{0}' was found at position {1} in '{2}'." - /// - internal static string ExpressionLexer_InvalidEscapeSequence(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ExpressionLexer_InvalidEscapeSequence, p0, p1, p2); - } - - /// - /// A string like "Unrecognized '{0}' literal '{1}' at '{2}' in '{3}'." - /// - internal static string UriQueryExpressionParser_UnrecognizedLiteral(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_UnrecognizedLiteral, p0, p1, p2, p3); - } - - /// - /// A string like "Unrecognized '{0}' literal '{1}' at '{2}' in '{3}' with reason '{4}'." - /// - internal static string UriQueryExpressionParser_UnrecognizedLiteralWithReason(object p0, object p1, object p2, object p3, object p4) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriQueryExpressionParser_UnrecognizedLiteralWithReason, p0, p1, p2, p3, p4); - } - - /// - /// A string like "Failed to parse '{0}' of Edm type '{1}' to primitive type." - /// - internal static string UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue, p0, p1); - } - - /// - /// A string like "Failed to parse string to Geography." - /// - internal static string UriPrimitiveTypeParsers_FailedToParseStringToGeography - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriPrimitiveTypeParsers_FailedToParseStringToGeography); - } - } - - /// - /// A string like "The given uri custom type parser already exists." - /// - internal static string UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists); - } - } - - /// - /// A string like "An existing custom UriTypeParser is already registered to the given EdmTypeReference '{0}'." - /// - internal static string UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists, p0); - } - - /// - /// A string like "The given type prefix literal name '{0}' must contain letters or '.' only." - /// - internal static string UriParserHelper_InvalidPrefixLiteral(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.UriParserHelper_InvalidPrefixLiteral, p0); - } - - /// - /// A string like "The given type literal prefix '{0}' already exists as a custom uri type literal prefix." - /// - internal static string CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists, p0); - } - - /// - /// A string like "The value '{0}' is not a valid duration value." - /// - internal static string ValueParser_InvalidDuration(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ValueParser_InvalidDuration, p0); - } - - /// - /// A string like "The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information." - /// - internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.PlatformHelper_DateTimeOffsetMustContainTimeZone, p0); - } - - /// - /// A string like "Invalid JSON. An unexpected comma was found in scope '{0}'. A comma is only valid between properties of an object or between elements of an array." - /// - internal static string JsonReader_UnexpectedComma(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_UnexpectedComma, p0); - } - - /// - /// A string like "Invalid JSON. A array closure mismatch occurred. A '{0}' was expected to match '{1}', but instead '{2}' was found." - /// - internal static string JsonReader_ArrayClosureMismatch(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_ArrayClosureMismatch, p0, p1, p2); - } - - /// - /// A string like "Invalid JSON. More than one value was found at the root of the JSON content. JSON content can only have one value at the root level, which is an array, an object or a primitive value." - /// - internal static string JsonReader_MultipleTopLevelValues - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_MultipleTopLevelValues); - } - } - - /// - /// A string like "Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed." - /// - internal static string JsonReader_EndOfInputWithOpenScope - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_EndOfInputWithOpenScope); - } - } - - /// - /// A string like "Invalid JSON. Unexpected token '{0}'." - /// - internal static string JsonReader_UnexpectedToken(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_UnexpectedToken, p0); - } - - /// - /// A string like "Invalid JSON. A token was not recognized in the JSON content." - /// - internal static string JsonReader_UnrecognizedToken - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_UnrecognizedToken); - } - } - - /// - /// A string like "Invalid JSON. A colon character ':' is expected after the property name '{0}', but none was found." - /// - internal static string JsonReader_MissingColon(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_MissingColon, p0); - } - - /// - /// A string like "Invalid JSON. An unrecognized escape sequence '{0}' was found in a JSON string value." - /// - internal static string JsonReader_UnrecognizedEscapeSequence(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_UnrecognizedEscapeSequence, p0); - } - - /// - /// A string like "Invalid JSON. Unexpected end of input reached while processing a JSON string value." - /// - internal static string JsonReader_UnexpectedEndOfString - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_UnexpectedEndOfString); - } - } - - /// - /// A string like "Invalid JSON. The value '{0}' is not a valid number." - /// - internal static string JsonReader_InvalidNumberFormat(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_InvalidNumberFormat, p0); - } - - /// - /// A string like "Invalid Binary value. The value '{0}' is not a valid Base64 encoded value." - /// - internal static string JsonReader_InvalidBinaryFormat(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_InvalidBinaryFormat, p0); - } - - /// - /// A string like "Invalid JSON. A comma character ',' was expected in scope '{0}'. Every two elements in an array and properties of an object must be separated by commas." - /// - internal static string JsonReader_MissingComma(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_MissingComma, p0); - } - - /// - /// A string like "Invalid JSON. The property name '{0}' is not valid. The name of a property cannot be empty." - /// - internal static string JsonReader_InvalidPropertyNameOrUnexpectedComma(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_InvalidPropertyNameOrUnexpectedComma, p0); - } - - /// - /// A string like "Cannot increase the JSON reader buffer to hold the input JSON which has very long token." - /// - internal static string JsonReader_MaxBufferReached - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_MaxBufferReached); - } - } - - /// - /// A string like "Cannot access the Value property while streaming a value. Please dispose the StreamReader or TextReader before continuing." - /// - internal static string JsonReader_CannotAccessValueInStreamState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_CannotAccessValueInStreamState); - } - } - - /// - /// A string like "Cannot call Read while streaming a value. Please dispose the StreamReader or TextReader before continuing." - /// - internal static string JsonReader_CannotCallReadInStreamState - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_CannotCallReadInStreamState); - } - } - - /// - /// A string like "Cannot create a Stream in the current state. A Stream can only be created for reading a JSON string value when positioned on, and before accessing, the value." - /// - internal static string JsonReader_CannotCreateReadStream - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_CannotCreateReadStream); - } - } - - /// - /// A string like "Cannot create a TextReader in the current state. A TextReader can only be created for reading a JSON string value when positioned on, and before accessing, the value." - /// - internal static string JsonReader_CannotCreateTextReader - { - get - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReader_CannotCreateTextReader); - } - } - - /// - /// A string like "An unexpected '{1}' node was found when reading from the JSON reader. A '{0}' node was expected." - /// - internal static string JsonReaderExtensions_UnexpectedNodeDetected(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_UnexpectedNodeDetected, p0, p1); - } - - /// - /// A string like "An unexpected '{1}' node was found for property named '{2}' when reading from the JSON reader. A '{0}' node was expected." - /// - internal static string JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName(object p0, object p1, object p2) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, p0, p1, p2); - } - - /// - /// A string like "Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value." - /// - internal static string JsonReaderExtensions_CannotReadPropertyValueAsString(object p0, object p1) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_CannotReadPropertyValueAsString, p0, p1); - } - - /// - /// A string like "Cannot read the value '{0}' as a quoted JSON string value." - /// - internal static string JsonReaderExtensions_CannotReadValueAsString(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_CannotReadValueAsString, p0); - } - - /// - /// A string like "Cannot read the value '{0}' as a double numeric value." - /// - internal static string JsonReaderExtensions_CannotReadValueAsDouble(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_CannotReadValueAsDouble, p0); - } - - /// - /// A string like "An unexpected instance annotation name '{0}' was found when reading from the JSON reader, In OData, Instance annotation name must start with @." - /// - internal static string JsonReaderExtensions_UnexpectedInstanceAnnotationName(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.JsonReaderExtensions_UnexpectedInstanceAnnotationName, p0); - } - - /// - /// A string like "The buffer from pool cannot be null or less than the required minimal size '{0}'." - /// - internal static string BufferUtils_InvalidBufferOrSize(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.BufferUtils_InvalidBufferOrSize, p0); - } - - /// - /// A string like "No service for type '{0}' has been registered." - /// - internal static string ServiceProviderExtensions_NoServiceRegistered(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.ServiceProviderExtensions_NoServiceRegistered, p0); - } - - /// - /// A string like "The value '{0}' is not a qualified type name. A qualified type name is expected." - /// - internal static string TypeUtils_TypeNameIsNotQualified(object p0) - { - return Microsoft.OData.TextRes.GetString(Microsoft.OData.TextRes.TypeUtils_TypeNameIsNotQualified, p0); - } - - } - - /// - /// Strongly-typed and parameterized exception factory. - /// - internal static partial class Error { - - /// - /// The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. - /// - internal static Exception ArgumentNull(string paramName) { - return new ArgumentNullException(paramName); - } - - /// - /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. - /// - internal static Exception ArgumentOutOfRange(string paramName) { - return new ArgumentOutOfRangeException(paramName); - } - - /// - /// The exception that is thrown when the author has not yet implemented the logic at this point in the program. This can act as an exception based TODO tag. - /// - internal static Exception NotImplemented() { - return new NotImplementedException(); - } - - /// - /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. - /// - internal static Exception NotSupported() { - return new NotSupportedException(); - } - } -} diff --git a/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.tt b/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.tt deleted file mode 100644 index 7f90c1580f..0000000000 --- a/src/Microsoft.OData.Core/Parameterized.Microsoft.OData.Core.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\StringsClassGenerator.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Core"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Core.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Core/PropertyAndAnnotationCollector.cs b/src/Microsoft.OData.Core/PropertyAndAnnotationCollector.cs index 2cc06f0745..e141e6e5cd 100644 --- a/src/Microsoft.OData.Core/PropertyAndAnnotationCollector.cs +++ b/src/Microsoft.OData.Core/PropertyAndAnnotationCollector.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Json; #endregion Namespaces @@ -115,8 +116,7 @@ internal void CheckForDuplicatePropertyNames(ODataPropertyInfo property) else { throw new ODataException( - Strings.DuplicatePropertyNamesNotAllowed( - propertyName)); + Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, propertyName)); } } @@ -205,8 +205,7 @@ internal ODataNestedResourceInfo ValidatePropertyOpenForAssociationLinkAndGetNes else { throw new ODataException( - Strings.DuplicateAnnotationNotAllowed( - "odata.associationLink")); + Error.Format(SRResources.DuplicateAnnotationNotAllowed, "odata.associationLink")); } return data.NestedResourceInfo; @@ -246,8 +245,7 @@ internal void AddODataScopeAnnotation(string annotationName, object annotationVa catch (ArgumentException) { throw new ODataException( - Strings.DuplicateAnnotationNotAllowed( - annotationName)); + Error.Format(SRResources.DuplicateAnnotationNotAllowed, annotationName)); } } @@ -323,8 +321,7 @@ internal void AddODataPropertyAnnotation(string propertyName, string annotationN if (data.Processed) { throw new ODataException( - Strings.PropertyAnnotationAfterTheProperty( - annotationName, propertyName)); + Error.Format(SRResources.PropertyAnnotationAfterTheProperty, annotationName, propertyName)); } } @@ -336,8 +333,8 @@ internal void AddODataPropertyAnnotation(string propertyName, string annotationN { throw new ODataException( ODataJsonReaderUtils.IsAnnotationProperty(propertyName) - ? Strings.DuplicateAnnotationForInstanceAnnotationNotAllowed(annotationName, propertyName) - : Strings.DuplicateAnnotationForPropertyNotAllowed(annotationName, propertyName)); + ? Error.Format(SRResources.DuplicateAnnotationForInstanceAnnotationNotAllowed, annotationName, propertyName) + : Error.Format(SRResources.DuplicateAnnotationForPropertyNotAllowed, annotationName, propertyName)); } } @@ -368,8 +365,7 @@ internal void AddCustomPropertyAnnotation(string propertyName, string annotation if (data.Processed) { throw new ODataException( - Strings.PropertyAnnotationAfterTheProperty( - annotationName, propertyName)); + Error.Format(SRResources.PropertyAnnotationAfterTheProperty, annotationName, propertyName)); } } @@ -466,8 +462,8 @@ internal void MarkPropertyAsProcessed(string propertyName) throw new ODataException( ODataJsonReaderUtils.IsAnnotationProperty(propertyName) && !ODataJsonUtils.IsMetadataReferenceProperty(propertyName) - ? Strings.DuplicateAnnotationNotAllowed(propertyName) - : Strings.DuplicatePropertyNamesNotAllowed(propertyName)); + ? Error.Format(SRResources.DuplicateAnnotationNotAllowed, propertyName) + : Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, propertyName)); } data.Processed = true; @@ -488,8 +484,7 @@ internal void CheckIfPropertyOpenForAnnotations(string propertyName, string anno && data.Processed) { throw new ODataException( - Strings.PropertyAnnotationAfterTheProperty( - annotationName, propertyName)); + Error.Format(SRResources.PropertyAnnotationAfterTheProperty, annotationName, propertyName)); } } @@ -509,8 +504,7 @@ private static void CheckNestedResourceInfoDuplicateNameForExistingDuplicationRe else if (propertyData.State != PropertyState.AnnotationSeen) { throw new ODataException( - Strings.DuplicatePropertyNamesNotAllowed( - propertyName)); + Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, propertyName)); } } diff --git a/src/Microsoft.OData.Core/RawValueWriter.cs b/src/Microsoft.OData.Core/RawValueWriter.cs index f169a3b603..63385289e0 100644 --- a/src/Microsoft.OData.Core/RawValueWriter.cs +++ b/src/Microsoft.OData.Core/RawValueWriter.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.IO; using System.Text; using System.Threading.Tasks; + using Microsoft.OData.Core; using Microsoft.OData.Json; using Microsoft.Spatial; @@ -156,7 +157,7 @@ internal void WriteRawValue(object value) else { // throw an exception because the value is neither enum nor primitive - throw new ODataException(Strings.ODataUtils_CannotConvertValueToRawString(value.GetType().FullName)); + throw new ODataException(Error.Format(SRResources.ODataUtils_CannotConvertValueToRawString, value.GetType().FullName)); } } @@ -245,7 +246,7 @@ internal Task WriteRawValueAsync(object value) // Value is neither enum nor primitive return TaskUtils.GetFaultedTask( - new ODataException(Strings.ODataUtils_CannotConvertValueToRawString(value.GetType().FullName))); + new ODataException(Error.Format(SRResources.ODataUtils_CannotConvertValueToRawString, value.GetType().FullName))); } /// diff --git a/src/Microsoft.OData.Core/ReadOnlyEnumerableExtensions.cs b/src/Microsoft.OData.Core/ReadOnlyEnumerableExtensions.cs index ec2888ada7..8498d547ed 100644 --- a/src/Microsoft.OData.Core/ReadOnlyEnumerableExtensions.cs +++ b/src/Microsoft.OData.Core/ReadOnlyEnumerableExtensions.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -42,7 +43,7 @@ internal static ReadOnlyEnumerable ToReadOnlyEnumerable(this IEnumerable readonlyCollection = source as ReadOnlyEnumerable; if (readonlyCollection == null) { - throw new ODataException(Strings.ReaderUtils_EnumerableModified(collectionName)); + throw new ODataException(Error.Format(SRResources.ReaderUtils_EnumerableModified, collectionName)); } return readonlyCollection; diff --git a/src/Microsoft.OData.Core/ReaderValidationUtils.cs b/src/Microsoft.OData.Core/ReaderValidationUtils.cs index 1be2e15729..4d1ba59d4f 100644 --- a/src/Microsoft.OData.Core/ReaderValidationUtils.cs +++ b/src/Microsoft.OData.Core/ReaderValidationUtils.cs @@ -11,6 +11,7 @@ namespace Microsoft.OData using System.Diagnostics; using System.Linq; using System.Text; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.OData.Metadata; @@ -32,7 +33,7 @@ internal static void ValidateMessageReaderSettings(ODataMessageReaderSettings me if (messageReaderSettings.BaseUri != null && !messageReaderSettings.BaseUri.IsAbsoluteUri) { - throw new ODataException(Strings.ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute(UriUtils.UriToString(messageReaderSettings.BaseUri))); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute, UriUtils.UriToString(messageReaderSettings.BaseUri))); } } @@ -46,7 +47,7 @@ internal static void ValidateEntityReferenceLink(ODataEntityReferenceLink link) if (link.Url == null) { - throw new ODataException(Strings.ReaderValidationUtils_EntityReferenceLinkMissingUri); + throw new ODataException(SRResources.ReaderValidationUtils_EntityReferenceLinkMissingUri); } } @@ -70,7 +71,7 @@ internal static void ValidateStreamReferenceProperty( { if (streamEdmProperty == null && throwOnUndeclaredLinkProperty) { - throw new ODataException(Strings.ValidationUtils_OpenStreamProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_OpenStreamProperty, propertyName)); } } } @@ -140,7 +141,7 @@ internal static IEdmProperty ValidatePropertyDefined(string propertyName, { if (throwOnUndeclaredPropertyForNonOpenType) { - throw new ODataException(Strings.ValidationUtils_PropertyDoesNotExistOnType(propertyName, owningStructuredType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, propertyName, owningStructuredType.FullTypeName())); } } @@ -158,7 +159,7 @@ internal static ODataException GetPrimitiveTypeConversionException(IEdmPrimitive { Debug.Assert(targetTypeReference != null, "targetTypeReference != null"); - return new ODataException(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue(stringValue, targetTypeReference.FullName()), innerException); + return new ODataException(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, stringValue, targetTypeReference.FullName()), innerException); } /// @@ -419,7 +420,7 @@ internal static IEdmTypeReference ResolveAndValidatePrimitiveTargetType( (IEdmPrimitiveType)payloadType.AsActualType(), (IEdmPrimitiveType)(expectedTypeReference.Definition))) { - throw new ODataException(Strings.ValidationUtils_IncompatibleType(payloadTypeName, expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, payloadTypeName, expectedTypeReference.FullName())); } if (expectedTypeReference.PrimitiveKind() == EdmPrimitiveTypeKind.PrimitiveType) @@ -544,7 +545,7 @@ internal static void ValidateEncodingSupportedInBatch(Encoding encoding) { // TODO: Batch reader does not support multi codepoint encodings // We decided to not support multi-byte encodings other than UTF8 for now. - throw new ODataException(Strings.ODataBatchReaderStream_MultiByteEncodingsNotSupported(encoding.WebName)); + throw new ODataException(Error.Format(SRResources.ODataBatchReaderStream_MultiByteEncodingsNotSupported, encoding.WebName)); } } @@ -559,7 +560,7 @@ internal static void ValidateEncodingSupportedInAsync(Encoding encoding) if (string.CompareOrdinal(Encoding.UTF8.WebName, encoding.WebName) != 0) { // We decided to not support multi-byte encodings other than UTF8 for now. - throw new ODataException(Strings.ODataAsyncReader_MultiByteEncodingsNotSupported(encoding.WebName)); + throw new ODataException(Error.Format(SRResources.ODataAsyncReader_MultiByteEncodingsNotSupported, encoding.WebName)); } } @@ -590,7 +591,7 @@ internal static void ValidateResourceSetOrResourceContextUri(ODataJsonContextUri } else if (contextUriParseResult.NavigationSource != null && string.CompareOrdinal(scope.NavigationSource.FullNavigationSourceName(), contextUriParseResult.NavigationSource.FullNavigationSourceName()) != 0) { - throw new ODataException(Strings.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet, UriUtils.UriToString(contextUriParseResult.ContextUri), contextUriParseResult.NavigationSource.FullNavigationSourceName(), scope.NavigationSource.FullNavigationSourceName())); @@ -621,7 +622,7 @@ internal static void ValidateResourceSetOrResourceContextUri(ODataJsonContextUri } else if (!payloadEntityType.IsAssignableFrom(scope.ResourceType)) { - throw new ODataException(Strings.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType, UriUtils.UriToString(contextUriParseResult.ContextUri), contextUriParseResult.EdmType.FullTypeName(), scope.ResourceType.FullTypeName())); @@ -653,7 +654,7 @@ internal static IEdmTypeReference ValidateCollectionContextUriAndGetPayloadItemT // We allow co-variance in collection types (e.g., expecting the item type of Geography from a payload of Collection(GeographyPoint). if (!expectedItemTypeReference.IsAssignableFrom(actualCollectionType.ElementType)) { - throw new ODataException(Strings.ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType, UriUtils.UriToString(contextUriParseResult.ContextUri), actualCollectionType.ElementType.FullName(), expectedItemTypeReference.FullName())); @@ -667,7 +668,7 @@ internal static IEdmTypeReference ValidateCollectionContextUriAndGetPayloadItemT "contextUriParseResult.EdmType is IEdmComplexType"); if (expectedItemTypeReference != null && !expectedItemTypeReference.Definition.IsAssignableFrom(contextUriParseResult.EdmType)) { - throw new ODataException(Strings.ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType( + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType, UriUtils.UriToString(contextUriParseResult.ContextUri), contextUriParseResult.EdmType.FullTypeName(), expectedItemTypeReference.Definition.FullTypeName())); @@ -690,7 +691,7 @@ internal static void ValidateOperationProperty(object propertyValue, string prop if (propertyValue == null) { - throw new ODataException(Strings.ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull( + throw new ODataException(Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull, propertyName, metadata, operationsHeader)); @@ -713,7 +714,7 @@ private static IEdmTypeReference ResolveAndValidateTargetTypeWithNoExpectedType( { if (expectedTypeKind == EdmTypeKind.Entity) { - throw new ODataException(Strings.ReaderValidationUtils_ResourceWithoutType); + throw new ODataException(SRResources.ReaderValidationUtils_ResourceWithoutType); } return null; // supports undeclared property @@ -786,7 +787,7 @@ private static IEdmTypeReference ResolveAndValidateTargetTypeStrictValidationDis break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ReaderValidationUtils_ResolveAndValidateTypeName_Strict_TypeKind)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ReaderValidationUtils_ResolveAndValidateTypeName_Strict_TypeKind)); } // Either there's no payload type, in which case use the expected one, or the payload one and the expected one are equal. @@ -840,7 +841,7 @@ private static IEdmTypeReference ResolveAndValidateTargetTypeStrictValidationEna case EdmTypeKind.Enum: if (!expectedTypeReference.IsUntyped() && payloadType != null && string.CompareOrdinal(payloadType.FullTypeName(), expectedTypeReference.FullName()) != 0) { - throw new ODataException(Strings.ValidationUtils_IncompatibleType(payloadType.FullTypeName(), expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, payloadType.FullTypeName(), expectedTypeReference.FullName())); } break; @@ -851,21 +852,21 @@ private static IEdmTypeReference ResolveAndValidateTargetTypeStrictValidationEna { VerifyCollectionComplexItemType(expectedTypeReference, payloadType); - throw new ODataException(Strings.ValidationUtils_IncompatibleType(payloadType.FullTypeName(), expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, payloadType.FullTypeName(), expectedTypeReference.FullName())); } break; case EdmTypeKind.TypeDefinition: if (payloadType != null && !expectedTypeReference.Definition.IsAssignableFrom(payloadType)) { - throw new ODataException(Strings.ValidationUtils_IncompatibleType(payloadType.FullTypeName(), expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, payloadType.FullTypeName(), expectedTypeReference.FullName())); } break; case EdmTypeKind.Untyped: break; default: - throw new ODataException(Strings.General_InternalError(InternalErrorCodes.ReaderValidationUtils_ResolveAndValidateTypeName_Strict_TypeKind)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.ReaderValidationUtils_ResolveAndValidateTypeName_Strict_TypeKind)); } // Either there's no payload type, in which case use the expected one, or the payload one and the expected one are equal. @@ -881,7 +882,7 @@ private static void VerifyPayloadTypeDefined(string payloadTypeName, IEdmType pa { if (payloadTypeName != null && payloadType == null) { - throw new ODataException(Strings.ValidationUtils_UnrecognizedTypeName(payloadTypeName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, payloadTypeName)); } } @@ -910,7 +911,7 @@ private static void VerifyComplexType(IEdmTypeReference expectedTypeReference, I if (failIfNotRelated) { // And now the generic one when the types are not related at all. - throw new ODataException(Strings.ValidationUtils_IncompatibleType(structuredPayloadType.FullTypeName(), structuredExpectedType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, structuredPayloadType.FullTypeName(), structuredExpectedType.FullTypeName())); } } } @@ -1156,10 +1157,10 @@ private static void ThrowNullValueForNonNullableTypeException(IEdmTypeReference { if (string.IsNullOrEmpty(propertyName)) { - throw new ODataException(Strings.ReaderValidationUtils_NullValueForNonNullableType(expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullValueForNonNullableType, expectedValueTypeReference.FullName())); } - throw new ODataException(Strings.ReaderValidationUtils_NullNamedValueForNonNullableType(propertyName, expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, propertyName, expectedValueTypeReference.FullName())); } /// @@ -1171,10 +1172,10 @@ private static void ThrowNullValueForNullableTypeException(IEdmTypeReference exp { if (string.IsNullOrEmpty(propertyName)) { - throw new ODataException(Strings.ReaderValidationUtils_NullValueForNullableType(expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullValueForNullableType, expectedValueTypeReference.FullName())); } - throw new ODataException(Strings.ReaderValidationUtils_NullNamedValueForNullableType(propertyName, expectedValueTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNullableType, propertyName, expectedValueTypeReference.FullName())); } diff --git a/src/Microsoft.OData.Core/ResourceSetWithoutExpectedTypeValidator.cs b/src/Microsoft.OData.Core/ResourceSetWithoutExpectedTypeValidator.cs index fc79eed9b9..d4758eefe0 100644 --- a/src/Microsoft.OData.Core/ResourceSetWithoutExpectedTypeValidator.cs +++ b/src/Microsoft.OData.Core/ResourceSetWithoutExpectedTypeValidator.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { #region Namespaces using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -55,13 +56,13 @@ internal void ValidateResource(IEdmType itemType) if (structuredType == null || thisStructuredType == null) { - throw new ODataException(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes(itemType.FullTypeName(), this.itemType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, itemType.FullTypeName(), this.itemType.FullTypeName())); } // Make sure the resource types is same or derived type of expected type if (!this.itemType.IsAssignableFrom(itemType)) { - throw new ODataException(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes(itemType.FullTypeName(), this.itemType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, itemType.FullTypeName(), this.itemType.FullTypeName())); } } } diff --git a/src/Microsoft.OData.Core/SRResources.Designer.cs b/src/Microsoft.OData.Core/SRResources.Designer.cs new file mode 100644 index 0000000000..b0dd1fc399 --- /dev/null +++ b/src/Microsoft.OData.Core/SRResources.Designer.cs @@ -0,0 +1,7573 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.OData.Core { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SRResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SRResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.OData.Core.SRResources", typeof(SRResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to There are unsupported aggregation expressions in the transformation node.. + /// + internal static string AggregateTransformationNode_UnsupportedAggregateExpressions { + get { + return ResourceManager.GetString("AggregateTransformationNode_UnsupportedAggregateExpressions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pattern '{0}' is not a valid pattern to match an annotation. It must not contain a namespace or name segment that is empty.. + /// + internal static string AnnotationFilterPattern_InvalidPatternEmptySegment { + get { + return ResourceManager.GetString("AnnotationFilterPattern_InvalidPatternEmptySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pattern '{0}' is not a valid pattern to match an annotation. It must contain at least one '.' separating the namespace and the name segments of an annotation.. + /// + internal static string AnnotationFilterPattern_InvalidPatternMissingDot { + get { + return ResourceManager.GetString("AnnotationFilterPattern_InvalidPatternMissingDot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pattern '{0}' is not a supported pattern to match an annotation. It must not contain '*' as part of a segment.. + /// + internal static string AnnotationFilterPattern_InvalidPatternWildCardInSegment { + get { + return ResourceManager.GetString("AnnotationFilterPattern_InvalidPatternWildCardInSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The pattern '{0}' is not a supported pattern to match an annotation. '*' must be the last segment of the pattern.. + /// + internal static string AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment { + get { + return ResourceManager.GetString("AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/aggregate expression '{0}' operation does not support value type '{1}'.. + /// + internal static string ApplyBinder_AggregateExpressionIncompatibleTypeForMethod { + get { + return ResourceManager.GetString("ApplyBinder_AggregateExpressionIncompatibleTypeForMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/aggregate expression '{0}' must evaluate to a single value.. + /// + internal static string ApplyBinder_AggregateExpressionNotSingleValue { + get { + return ResourceManager.GetString("ApplyBinder_AggregateExpressionNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/groupby grouping expression '{0}' must evaluate to a property access value.. + /// + internal static string ApplyBinder_GroupByPropertyNotPropertyAccessValue { + get { + return ResourceManager.GetString("ApplyBinder_GroupByPropertyNotPropertyAccessValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/aggregate expression token kind '{0}' not supported.. + /// + internal static string ApplyBinder_UnsupportedAggregateKind { + get { + return ResourceManager.GetString("ApplyBinder_UnsupportedAggregateKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/aggregate does not support method '{0}'.. + /// + internal static string ApplyBinder_UnsupportedAggregateMethod { + get { + return ResourceManager.GetString("ApplyBinder_UnsupportedAggregateMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply/groupby not support '{0}' as child transformation. + /// + internal static string ApplyBinder_UnsupportedGroupByChild { + get { + return ResourceManager.GetString("ApplyBinder_UnsupportedGroupByChild", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply clause does not support type '{0}'.. + /// + internal static string ApplyBinder_UnsupportedType { + get { + return ResourceManager.GetString("ApplyBinder_UnsupportedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A writer or stream has been disposed with data still in the buffer. You must call Flush or FlushAsync before calling Dispose when some data has already been written.. + /// + internal static string AsyncBufferedStream_WriterDisposedWithoutFlush { + get { + return ResourceManager.GetString("AsyncBufferedStream_WriterDisposedWithoutFlush", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The number of keys specified in the URI does not match number of key properties for the resource '{0}'.. + /// + internal static string BadRequest_KeyCountMismatch { + get { + return ResourceManager.GetString("BadRequest_KeyCountMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared key of the resource '{0}'.. + /// + internal static string BadRequest_KeyMismatch { + get { + return ResourceManager.GetString("BadRequest_KeyMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared or alternate key properties for the resource '{0}'.. + /// + internal static string BadRequest_KeyOrAlternateKeyMismatch { + get { + return ResourceManager.GetString("BadRequest_KeyOrAlternateKeyMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error processing request stream. In batch mode, a resource can be cross-referenced only for bind/unbind operations.. + /// + internal static string BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation { + get { + return ResourceManager.GetString("BadRequest_ResourceCanBeCrossReferencedOnlyForBindOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid content-id '{0}' for batch reference segment.. + /// + internal static string BatchReferenceSegment_InvalidContentID { + get { + return ResourceManager.GetString("BatchReferenceSegment_InvalidContentID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The string '{0}' is not a valid enumeration type constant.. + /// + internal static string Binder_IsNotValidEnumConstant { + get { + return ResourceManager.GetString("Binder_IsNotValidEnumConstant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The buffer from pool cannot be null or less than the required minimal size '{0}'.. + /// + internal static string BufferUtils_InvalidBufferOrSize { + get { + return ResourceManager.GetString("BufferUtils_InvalidBufferOrSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The child type '{0}' in a cast was not an entity type. Casts can only be performed on entity types.. + /// + internal static string CastBinder_ChildTypeIsNotEntity { + get { + return ResourceManager.GetString("CastBinder_ChildTypeIsNotEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enumeration type value can only be casted to or from string.. + /// + internal static string CastBinder_EnumOnlyCastToOrFromString { + get { + return ResourceManager.GetString("CastBinder_EnumOnlyCastToOrFromString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An item of type kind '{0}' was found in a collection that otherwise has items of type kind '{1}'. In OData, all items in a collection must have the same type kind.. + /// + internal static string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind { + get { + return ResourceManager.GetString("CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An item with type name '{0}' was found in a collection of items with type name '{1}'. In OData, all items in a collection must have the same type name.. + /// + internal static string CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName { + get { + return ResourceManager.GetString("CollectionWithoutExpectedTypeValidator_IncompatibleItemTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid item type kind '{0}' was found. Items in a collection can only be of type kind 'Primitive' or 'Complex', but not of type kind '{0}'.. + /// + internal static string CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind { + get { + return ResourceManager.GetString("CollectionWithoutExpectedTypeValidator_InvalidItemTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given custom function '{0}' already exists as a Built-In function in one of it's overloads. Thus cannot override the Built-In function.. + /// + internal static string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature { + get { + return ResourceManager.GetString("CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given custom function '{0}' already exists as a Built-In function. Consider use 'addAsOverloadToBuiltInFunction = true' parameter.. + /// + internal static string CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload { + get { + return ResourceManager.GetString("CustomUriFunctions_AddCustomUriFunction_BuiltInExistsNotAddingAsOverload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given function name '{0}' already exists as a custom function with the same overload.. + /// + internal static string CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists { + get { + return ResourceManager.GetString("CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given type literal prefix '{0}' already exists as a custom uri type literal prefix.. + /// + internal static string CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists { + get { + return ResourceManager.GetString("CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service is set to {1}.. + /// + internal static string DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion { + get { + return ResourceManager.GetString("DataServiceConfiguration_ResponseVersionIsBiggerThanProtocolVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple annotations with the name '{0}' were detected for the instance annotation with name '{1}'. In OData, duplicate annotations are not allowed.. + /// + internal static string DuplicateAnnotationForInstanceAnnotationNotAllowed { + get { + return ResourceManager.GetString("DuplicateAnnotationForInstanceAnnotationNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple annotations with the name '{0}' were detected for the property with name '{1}'. In OData, duplicate annotations are not allowed.. + /// + internal static string DuplicateAnnotationForPropertyNotAllowed { + get { + return ResourceManager.GetString("DuplicateAnnotationForPropertyNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple annotations with the name '{0}' were detected. In OData, duplicate annotations are not allowed.. + /// + internal static string DuplicateAnnotationNotAllowed { + get { + return ResourceManager.GetString("DuplicateAnnotationNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple properties with the name '{0}' were detected in a resource or a complex value. In OData, duplicate property names are not allowed.. + /// + internal static string DuplicatePropertyNamesNotAllowed { + get { + return ResourceManager.GetString("DuplicatePropertyNamesNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return bound operations without any parameters.. + /// + internal static string EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInvalid { + get { + return ResourceManager.GetString("EdmLibraryExtensions_NoParameterBoundOperationsFoundFromIEdmModelFindMethodIsInva" + + "lid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When resolving operations '{0}' the group returned has both actions and functions with an invalid IEdmModel.. + /// + internal static string EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid { + get { + return ResourceManager.GetString("EdmLibraryExtensions_OperationGroupReturningActionsAndFunctionsModelInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return non-bound operations.. + /// + internal static string EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid { + get { + return ResourceManager.GetString("EdmLibraryExtensions_UnBoundOperationsFoundFromIEdmModelFindMethodIsInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value '{0}' was either too large or too small for a '{1}'.. + /// + internal static string EdmLibraryExtensions_ValueOverflowForUnderlyingType { + get { + return ResourceManager.GetString("EdmLibraryExtensions_ValueOverflowForUnderlyingType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value with primitive kind '{0}' cannot be converted into a primitive object value.. + /// + internal static string EdmValueUtils_CannotConvertTypeToClrValue { + get { + return ResourceManager.GetString("EdmValueUtils_CannotConvertTypeToClrValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'.. + /// + internal static string EdmValueUtils_IncorrectPrimitiveTypeKind { + get { + return ResourceManager.GetString("EdmValueUtils_IncorrectPrimitiveTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'.. + /// + internal static string EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName { + get { + return ResourceManager.GetString("EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The primitive property '{0}' on type '{1}' has a value which is not a primitive value.. + /// + internal static string EdmValueUtils_NonPrimitiveValue { + get { + return ResourceManager.GetString("EdmValueUtils_NonPrimitiveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity instance value of type '{0}' doesn't have a value for property '{1}'. To compute an entity's metadata, its key and concurrency-token property values must be provided.. + /// + internal static string EdmValueUtils_PropertyDoesntExist { + get { + return ResourceManager.GetString("EdmValueUtils_PropertyDoesntExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type.. + /// + internal static string EdmValueUtils_UnsupportedPrimitiveType { + get { + return ResourceManager.GetString("EdmValueUtils_UnsupportedPrimitiveType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be empty.. + /// + internal static string ExceptionUtils_ArgumentStringEmpty { + get { + return ResourceManager.GetString("ExceptionUtils_ArgumentStringEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be empty1.. + /// + internal static string ExceptionUtils_ArgumentStringEmpty1 { + get { + return ResourceManager.GetString("ExceptionUtils_ArgumentStringEmpty1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null or empty.. + /// + internal static string ExceptionUtils_ArgumentStringNullOrEmpty { + get { + return ResourceManager.GetString("ExceptionUtils_ArgumentStringNullOrEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A non-negative integer value was expected, but the value '{0}' is not a valid non-negative integer.. + /// + internal static string ExceptionUtils_CheckIntegerNotNegative { + get { + return ResourceManager.GetString("ExceptionUtils_CheckIntegerNotNegative", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A positive integer value was expected, but the value '{0}' is not a valid positive integer.. + /// + internal static string ExceptionUtils_CheckIntegerPositive { + get { + return ResourceManager.GetString("ExceptionUtils_CheckIntegerPositive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A positive long value was expected; however, the value '{0}' is not a valid positive long value.. + /// + internal static string ExceptionUtils_CheckLongPositive { + get { + return ResourceManager.GetString("ExceptionUtils_CheckLongPositive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not defined in the model.. + /// + internal static string ExpandItemBinder_CannotFindType { + get { + return ResourceManager.GetString("ExpandItemBinder_CannotFindType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Segment '{0}' is not valid in expand path. Before navigation property, only type segment or entity or complex property can exist.. + /// + internal static string ExpandItemBinder_InvaidSegmentInExpand { + get { + return ResourceManager.GetString("ExpandItemBinder_InvaidSegmentInExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The $level option on navigation property '{0}' is not allowed, because the related entity type '{1}' could not be cast to source entity type '{2}'.. + /// + internal static string ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType { + get { + return ResourceManager.GetString("ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Trying to parse a type segment path that is too long.. + /// + internal static string ExpandItemBinder_PathTooDeep { + get { + return ResourceManager.GetString("ExpandItemBinder_PathTooDeep", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property '{0}' on type '{1}' is not a navigation property or complex property. Only navigation properties can be expanded.. + /// + internal static string ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty { + get { + return ResourceManager.GetString("ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Trying to traverse a non-normalized expand tree.. + /// + internal static string ExpandItemBinder_TraversingANonNormalizedTree { + get { + return ResourceManager.GetString("ExpandItemBinder_TraversingANonNormalizedTree", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a path traversing multiple navigation properties. Please rephrase the query such that each expand path contains only type segments and navigation properties.. + /// + internal static string ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath { + get { + return ResourceManager.GetString("ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a path within a select or expand query option that isn't ended by a non-type segment.. + /// + internal static string ExpandItemBinder_TypeSegmentNotFollowedByPath { + get { + return ResourceManager.GetString("ExpandItemBinder_TypeSegmentNotFollowedByPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a segment that isn't a path while parsing the path within a select or expand query option.. + /// + internal static string ExpandTreeNormalizer_NonPathInPropertyChain { + get { + return ResourceManager.GetString("ExpandTreeNormalizer_NonPathInPropertyChain", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A digit was expected at position {0} in '{1}'.. + /// + internal static string ExpressionLexer_DigitExpected { + get { + return ResourceManager.GetString("ExpressionLexer_DigitExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected literal type token but found token '{0}'.. + /// + internal static string ExpressionLexer_ExpectedLiteralToken { + get { + return ResourceManager.GetString("ExpressionLexer_ExpectedLiteralToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Syntax error: character '{0}' is not valid at position {1} in '{2}'.. + /// + internal static string ExpressionLexer_InvalidCharacter { + get { + return ResourceManager.GetString("ExpressionLexer_InvalidCharacter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unrecognized escape sequence '\\{0}' was found at position {1} in '{2}'.. + /// + internal static string ExpressionLexer_InvalidEscapeSequence { + get { + return ResourceManager.GetString("ExpressionLexer_InvalidEscapeSequence", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Numeric string '{0}' is not a valid Int32/Int64/Double/Decimal.. + /// + internal static string ExpressionLexer_InvalidNumericString { + get { + return ResourceManager.GetString("ExpressionLexer_InvalidNumericString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Syntax error at position {0} in '{1}'.. + /// + internal static string ExpressionLexer_SyntaxError { + get { + return ResourceManager.GetString("ExpressionLexer_SyntaxError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found an unbalanced bracket expression.. + /// + internal static string ExpressionLexer_UnbalancedBracketExpression { + get { + return ResourceManager.GetString("ExpressionLexer_UnbalancedBracketExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is an unterminated literal at position {0} in '{1}'.. + /// + internal static string ExpressionLexer_UnterminatedLiteral { + get { + return ResourceManager.GetString("ExpressionLexer_UnterminatedLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is an unterminated string literal at position {0} in '{1}'.. + /// + internal static string ExpressionLexer_UnterminatedStringLiteral { + get { + return ResourceManager.GetString("ExpressionLexer_UnterminatedStringLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $count is not allowed in $select option.. + /// + internal static string ExpressionToken_DollarCountNotAllowedInSelect { + get { + return ResourceManager.GetString("ExpressionToken_DollarCountNotAllowedInSelect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An identifier was expected at position {0}.. + /// + internal static string ExpressionToken_IdentifierExpected { + get { + return ResourceManager.GetString("ExpressionToken_IdentifierExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No property is allowed after $count segment.. + /// + internal static string ExpressionToken_NoPropAllowedAfterDollarCount { + get { + return ResourceManager.GetString("ExpressionToken_NoPropAllowedAfterDollarCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No property is allowed after $ref segment.. + /// + internal static string ExpressionToken_NoPropAllowedAfterRef { + get { + return ResourceManager.GetString("ExpressionToken_NoPropAllowedAfterRef", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No segment is allowed before star in $expand.. + /// + internal static string ExpressionToken_NoSegmentAllowedBeforeStarInExpand { + get { + return ResourceManager.GetString("ExpressionToken_NoSegmentAllowedBeforeStarInExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only $ref is allowed with star in $expand option.. + /// + internal static string ExpressionToken_OnlyRefAllowWithStarInExpand { + get { + return ResourceManager.GetString("ExpressionToken_OnlyRefAllowWithStarInExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a function '{0}' on an open property. Functions on open properties are not supported.. + /// + internal static string FunctionCallBinder_CallingFunctionOnOpenProperty { + get { + return ResourceManager.GetString("FunctionCallBinder_CallingFunctionOnOpenProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find a suitable overload for function '{0}' that takes '{1}' arguments.. + /// + internal static string FunctionCallBinder_CannotFindASuitableOverload { + get { + return ResourceManager.GetString("FunctionCallBinder_CannotFindASuitableOverload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a Uri function '{0}' with a parent token. Uri functions cannot have parent tokens.. + /// + internal static string FunctionCallBinder_UriFunctionMustHaveHaveNullParent { + get { + return ResourceManager.GetString("FunctionCallBinder_UriFunctionMustHaveHaveNullParent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter or entity key names must be unique. There is most likely an error in the model.. + /// + internal static string FunctionCallParser_DuplicateParameterOrEntityKeyName { + get { + return ResourceManager.GetString("FunctionCallParser_DuplicateParameterOrEntityKeyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel.. + /// + internal static string FunctionOverloadResolver_FoundInvalidOperation { + get { + return ResourceManager.GetString("FunctionOverloadResolver_FoundInvalidOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel.. + /// + internal static string FunctionOverloadResolver_FoundInvalidOperationImport { + get { + return ResourceManager.GetString("FunctionOverloadResolver_FoundInvalidOperationImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple action import overloads were found with the same binding parameter for '{0}'.. + /// + internal static string FunctionOverloadResolver_MultipleActionImportOverloads { + get { + return ResourceManager.GetString("FunctionOverloadResolver_MultipleActionImportOverloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple action overloads were found with the same binding parameter for '{0}'.. + /// + internal static string FunctionOverloadResolver_MultipleActionOverloads { + get { + return ResourceManager.GetString("FunctionOverloadResolver_MultipleActionOverloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple action import and function import overloads for '{0}' were found.. + /// + internal static string FunctionOverloadResolver_MultipleOperationImportOverloads { + get { + return ResourceManager.GetString("FunctionOverloadResolver_MultipleOperationImportOverloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple action and function overloads for '{0}' were found.. + /// + internal static string FunctionOverloadResolver_MultipleOperationOverloads { + get { + return ResourceManager.GetString("FunctionOverloadResolver_MultipleOperationOverloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to resolve function overloads to a single function. There was more than one function in the model with name '{0}' and parameter names '{1}'.. + /// + internal static string FunctionOverloadResolver_NoSingleMatchFound { + get { + return ResourceManager.GetString("FunctionOverloadResolver_NoSingleMatchFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An internal error '{0}' occurred.. + /// + internal static string General_InternalError { + get { + return ResourceManager.GetString("General_InternalError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the header value should not end with the separator '{3}'.. + /// + internal static string HttpHeaderValueLexer_EndOfFileAfterSeparator { + get { + return ResourceManager.GetString("HttpHeaderValueLexer_EndOfFileAfterSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token or a quoted-string is expected at this position but were not found.. + /// + internal static string HttpHeaderValueLexer_FailedToReadTokenOrQuotedString { + get { + return ResourceManager.GetString("HttpHeaderValueLexer_FailedToReadTokenOrQuotedString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a valid separator after a quoted-string.. + /// + internal static string HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString { + get { + return ResourceManager.GetString("HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token is expected but a quoted-string is found instead.. + /// + internal static string HttpHeaderValueLexer_TokenExpectedButFoundQuotedString { + get { + return ResourceManager.GetString("HttpHeaderValueLexer_TokenExpectedButFoundQuotedString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a recognized separator. The supported separators are ',', ';', and '='.. + /// + internal static string HttpHeaderValueLexer_UnrecognizedSeparator { + get { + return ResourceManager.GetString("HttpHeaderValueLexer_UnrecognizedSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when converting the character '{0}' to an integer.. + /// + internal static string HttpUtils_CannotConvertCharToInt { + get { + return ResourceManager.GetString("HttpUtils_CannotConvertCharToInt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the closing quote character was not found for the quoted-string.. + /// + internal static string HttpUtils_ClosingQuoteNotFound { + get { + return ResourceManager.GetString("HttpUtils_ClosingQuoteNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value for the Content-Type header is missing.. + /// + internal static string HttpUtils_ContentTypeMissing { + get { + return ResourceManager.GetString("HttpUtils_ContentTypeMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because it terminates with the escape character '{3}'. In a quoted-string, the escape characters must always be followed by a character.. + /// + internal static string HttpUtils_EscapeCharAtEnd { + get { + return ResourceManager.GetString("HttpUtils_EscapeCharAtEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the escape character '{3}' is not inside a quoted-string.. + /// + internal static string HttpUtils_EscapeCharWithoutQuotes { + get { + return ResourceManager.GetString("HttpUtils_EscapeCharWithoutQuotes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected literal '{0}' was not found at position '{1}' in the string '{2}'.. + /// + internal static string HttpUtils_ExpectedLiteralNotFoundInString { + get { + return ResourceManager.GetString("HttpUtils_ExpectedLiteralNotFoundInString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the character '{3}' is not allowed in a quoted-string. For more information, see RFC 2616, Sections 3.6 and 2.2.. + /// + internal static string HttpUtils_InvalidCharacterInQuotedParameterValue { + get { + return ResourceManager.GetString("HttpUtils_InvalidCharacterInQuotedParameterValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid (empty) charset name found in the header '{0}'.. + /// + internal static string HttpUtils_InvalidCharsetName { + get { + return ResourceManager.GetString("HttpUtils_InvalidCharsetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The string '{0}' cannot be converted into a supported HTTP method. The only supported HTTP methods are GET, DELETE, PUT, POST and PATCH.. + /// + internal static string HttpUtils_InvalidHttpMethodString { + get { + return ResourceManager.GetString("HttpUtils_InvalidHttpMethodString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid quality value '{0}' was detected in the header string '{1}'; quality values must be in the range [0, 1].. + /// + internal static string HttpUtils_InvalidQualityValue { + get { + return ResourceManager.GetString("HttpUtils_InvalidQualityValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid quality value was detected in the header string '{0}'; quality values must start with '0' or '1' but not with '{1}'.. + /// + internal static string HttpUtils_InvalidQualityValueStartChar { + get { + return ResourceManager.GetString("HttpUtils_InvalidQualityValueStartChar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A separator character was missing between charset values in the header '{0}'.. + /// + internal static string HttpUtils_InvalidSeparatorBetweenCharsets { + get { + return ResourceManager.GetString("HttpUtils_InvalidSeparatorBetweenCharsets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type is missing a parameter name for a parameter definition.. + /// + internal static string HttpUtils_MediaTypeMissingParameterName { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeMissingParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type is missing a parameter value for a parameter with the name '{0}'.. + /// + internal static string HttpUtils_MediaTypeMissingParameterValue { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeMissingParameterValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type '{0}' requires a semi-colon character (';') before a parameter definition.. + /// + internal static string HttpUtils_MediaTypeRequiresSemicolonBeforeParameter { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeRequiresSemicolonBeforeParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type '{0}' requires a '/' character between type and subtype, such as 'text/plain'.. + /// + internal static string HttpUtils_MediaTypeRequiresSlash { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeRequiresSlash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type '{0}' requires a subtype definition.. + /// + internal static string HttpUtils_MediaTypeRequiresSubType { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeRequiresSubType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type '{0}' is invalid or unspecified.. + /// + internal static string HttpUtils_MediaTypeUnspecified { + get { + return ResourceManager.GetString("HttpUtils_MediaTypeUnspecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The separator ',' was missing between charset values in the header '{0}'.. + /// + internal static string HttpUtils_MissingSeparatorBetweenCharsets { + get { + return ResourceManager.GetString("HttpUtils_MissingSeparatorBetweenCharsets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type.. + /// + internal static string HttpUtils_NoOrMoreThanOneContentTypeSpecified { + get { + return ResourceManager.GetString("HttpUtils_NoOrMoreThanOneContentTypeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected end of the q-Value was detected in the header '{0}'.. + /// + internal static string HttpUtils_UnexpectedEndOfQValue { + get { + return ResourceManager.GetString("HttpUtils_UnexpectedEndOfQValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered the attribute '{0}' on a non-empty 'annotation' element. If attribute value notation is used to specify the annotation's value, then there can be no body to the element.. + /// + internal static string InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement { + get { + return ResourceManager.GetString("InstanceAnnotation_AttributeValueNotationUsedOnNonEmptyElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the 'type' attribute on an 'annotation' element was '{0}', which is incompatible with the '{1}' attribute.. + /// + internal static string InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType { + get { + return ResourceManager.GetString("InstanceAnnotation_AttributeValueNotationUsedWithIncompatibleType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered an 'annotation' element without a 'term' attribute. All 'annotation' elements must have a 'term' attribute.. + /// + internal static string InstanceAnnotation_MissingTermAttributeOnAnnotationElement { + get { + return ResourceManager.GetString("InstanceAnnotation_MissingTermAttributeOnAnnotationElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered an 'annotation' element with more than one attribute from following set: 'int', 'string', 'decimal', 'float', and 'bool'. Only one such attribute may appear on an 'annotation' element.. + /// + internal static string InstanceAnnotation_MultipleAttributeValueNotationAttributes { + get { + return ResourceManager.GetString("InstanceAnnotation_MultipleAttributeValueNotationAttributes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The InstanceAnnotations collection has more than one instance annotations with the name '{0}'. All instance annotation names must be unique within the collection.. + /// + internal static string JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection { + get { + return ResourceManager.GetString("JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Writing null value for the instance annotation '{0}' is not allowed. The instance annotation '{0}' has the expected type '{1}[Nullable=False]'.. + /// + internal static string JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation { + get { + return ResourceManager.GetString("JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. A array closure mismatch occurred. A '{0}' was expected to match '{1}', but instead '{2}' was found.. + /// + internal static string JsonReader_ArrayClosureMismatch { + get { + return ResourceManager.GetString("JsonReader_ArrayClosureMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot access the Value property while streaming a value. Please dispose the StreamReader or TextReader before continuing.. + /// + internal static string JsonReader_CannotAccessValueInStreamState { + get { + return ResourceManager.GetString("JsonReader_CannotAccessValueInStreamState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot call Read while streaming a value. Please dispose the StreamReader or TextReader before continuing.. + /// + internal static string JsonReader_CannotCallReadInStreamState { + get { + return ResourceManager.GetString("JsonReader_CannotCallReadInStreamState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create a Stream in the current state. A Stream can only be created for reading a JSON string value when positioned on, and before accessing, the value.. + /// + internal static string JsonReader_CannotCreateReadStream { + get { + return ResourceManager.GetString("JsonReader_CannotCreateReadStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create a TextReader in the current state. A TextReader can only be created for reading a JSON string value when positioned on, and before accessing, the value.. + /// + internal static string JsonReader_CannotCreateTextReader { + get { + return ResourceManager.GetString("JsonReader_CannotCreateTextReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed.. + /// + internal static string JsonReader_EndOfInputWithOpenScope { + get { + return ResourceManager.GetString("JsonReader_EndOfInputWithOpenScope", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid Binary value. The value '{0}' is not a valid Base64 encoded value.. + /// + internal static string JsonReader_InvalidBinaryFormat { + get { + return ResourceManager.GetString("JsonReader_InvalidBinaryFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. The value '{0}' is not a valid number.. + /// + internal static string JsonReader_InvalidNumberFormat { + get { + return ResourceManager.GetString("JsonReader_InvalidNumberFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. The property name '{0}' is not valid. The name of a property cannot be empty.. + /// + internal static string JsonReader_InvalidPropertyNameOrUnexpectedComma { + get { + return ResourceManager.GetString("JsonReader_InvalidPropertyNameOrUnexpectedComma", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot increase the JSON reader buffer to hold the input JSON which has very long token.. + /// + internal static string JsonReader_MaxBufferReached { + get { + return ResourceManager.GetString("JsonReader_MaxBufferReached", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. A colon character ':' is expected after the property name '{0}', but none was found.. + /// + internal static string JsonReader_MissingColon { + get { + return ResourceManager.GetString("JsonReader_MissingColon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. A comma character ',' was expected in scope '{0}'. Every two elements in an array and properties of an object must be separated by commas.. + /// + internal static string JsonReader_MissingComma { + get { + return ResourceManager.GetString("JsonReader_MissingComma", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. More than one value was found at the root of the JSON content. JSON content can only have one value at the root level, which is an array, an object or a primitive value.. + /// + internal static string JsonReader_MultipleTopLevelValues { + get { + return ResourceManager.GetString("JsonReader_MultipleTopLevelValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. An unexpected comma was found in scope '{0}'. A comma is only valid between properties of an object or between elements of an array.. + /// + internal static string JsonReader_UnexpectedComma { + get { + return ResourceManager.GetString("JsonReader_UnexpectedComma", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. Unexpected end of input reached while processing a JSON string value.. + /// + internal static string JsonReader_UnexpectedEndOfString { + get { + return ResourceManager.GetString("JsonReader_UnexpectedEndOfString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. Unexpected token '{0}'.. + /// + internal static string JsonReader_UnexpectedToken { + get { + return ResourceManager.GetString("JsonReader_UnexpectedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. An unrecognized escape sequence '{0}' was found in a JSON string value.. + /// + internal static string JsonReader_UnrecognizedEscapeSequence { + get { + return ResourceManager.GetString("JsonReader_UnrecognizedEscapeSequence", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid JSON. A token was not recognized in the JSON content.. + /// + internal static string JsonReader_UnrecognizedToken { + get { + return ResourceManager.GetString("JsonReader_UnrecognizedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value.. + /// + internal static string JsonReaderExtensions_CannotReadPropertyValueAsString { + get { + return ResourceManager.GetString("JsonReaderExtensions_CannotReadPropertyValueAsString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' as a double numeric value.. + /// + internal static string JsonReaderExtensions_CannotReadValueAsDouble { + get { + return ResourceManager.GetString("JsonReaderExtensions_CannotReadValueAsDouble", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' as a quoted JSON string value.. + /// + internal static string JsonReaderExtensions_CannotReadValueAsString { + get { + return ResourceManager.GetString("JsonReaderExtensions_CannotReadValueAsString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected instance annotation name '{0}' was found when reading from the JSON reader, In OData, Instance annotation name must start with @.. + /// + internal static string JsonReaderExtensions_UnexpectedInstanceAnnotationName { + get { + return ResourceManager.GetString("JsonReaderExtensions_UnexpectedInstanceAnnotationName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected '{1}' node was found when reading from the JSON reader. A '{0}' node was expected.. + /// + internal static string JsonReaderExtensions_UnexpectedNodeDetected { + get { + return ResourceManager.GetString("JsonReaderExtensions_UnexpectedNodeDetected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected '{1}' node was found for property named '{2}' when reading from the JSON reader. A '{0}' node was expected.. + /// + internal static string JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName { + get { + return ResourceManager.GetString("JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The character set '{0}' is not supported.. + /// + internal static string MediaType_EncodingNotSupported { + get { + return ResourceManager.GetString("MediaType_EncodingNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content type '{0}' specifies a batch payload; however, the payload either does not include a batch boundary or includes more than one boundary. In OData, batch payload content types must specify exactly one batch boundary in the '{1}' parameter of the content type.. + /// + internal static string MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads { + get { + return ResourceManager.GetString("MediaTypeUtils_BoundaryMustBeSpecifiedForBatchPayloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A supported MIME type could not be found that matches the content type of the response. None of the supported type(s) '{0}' matches the content type '{1}'.. + /// + internal static string MediaTypeUtils_CannotDetermineFormatFromContentType { + get { + return ResourceManager.GetString("MediaTypeUtils_CannotDetermineFormatFromContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) '{0}' do not match any of the acceptable MIME types '{1}'.. + /// + internal static string MediaTypeUtils_DidNotFindMatchingMediaType { + get { + return ResourceManager.GetString("MediaTypeUtils_DidNotFindMatchingMediaType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type.. + /// + internal static string MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified { + get { + return ResourceManager.GetString("MediaTypeUtils_NoOrMoreThanOneContentTypeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of {0} bytes has been read from the stream; however a maximum of {1} bytes is allowed.. + /// + internal static string MessageStreamWrappingStream_ByteLimitExceeded { + get { + return ResourceManager.GetString("MessageStreamWrappingStream_ByteLimitExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Any/All query expression must evaluate to a single boolean value.. + /// + internal static string MetadataBinder_AnyAllExpressionNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_AnyAllExpressionNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operand for a binary operator '{0}' is not a single value. Binary operators require both operands to be single values.. + /// + internal static string MetadataBinder_BinaryOperatorOperandNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_BinaryOperatorOperandNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A token of kind '{0}' was bound to the value null; this is invalid. A query token must always be bound to a non-null query node.. + /// + internal static string MetadataBinder_BoundNodeCannotBeNull { + get { + return ResourceManager.GetString("MetadataBinder_BoundNodeCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expression of type '{0}' cannot be converted to type '{1}'.. + /// + internal static string MetadataBinder_CannotConvertToType { + get { + return ResourceManager.GetString("MetadataBinder_CannotConvertToType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Cast and IsOf functions do not support collection arguments or types.. + /// + internal static string MetadataBinder_CastOrIsOfCollectionsNotSupported { + get { + return ResourceManager.GetString("MetadataBinder_CastOrIsOfCollectionsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Cast or IsOf expression has an invalid number of operands: number of operands is '{0}' and it should be 1 or 2.. + /// + internal static string MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands { + get { + return ResourceManager.GetString("MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cast or IsOf Function must have a type in its arguments.. + /// + internal static string MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument { + get { + return ResourceManager.GetString("MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collection open properties are not supported in this release.. + /// + internal static string MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease { + get { + return ResourceManager.GetString("MetadataBinder_CollectionOpenPropertiesNotSupportedInThisRelease", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The next token in a CountSegmentNode must be a collection.. + /// + internal static string MetadataBinder_CountSegmentNextTokenNotCollectionValue { + get { + return ResourceManager.GetString("MetadataBinder_CountSegmentNextTokenNotCollectionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A key property '{0}' was found twice in a key lookup. Each key property can be specified just once in a key lookup.. + /// + internal static string MetadataBinder_DuplicitKeyPropertyInKeyValues { + get { + return ResourceManager.GetString("MetadataBinder_DuplicitKeyPropertyInKeyValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The $filter expression must evaluate to a single boolean value.. + /// + internal static string MetadataBinder_FilterExpressionNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_FilterExpressionNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The argument for an invocation of a function with name '{0}' is not a single value. All arguments for this function must be single values.. + /// + internal static string MetadataBinder_FunctionArgumentNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_FunctionArgumentNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered invalid type cast. '{0}' is not assignable from '{1}'.. + /// + internal static string MetadataBinder_HierarchyNotFollowed { + get { + return ResourceManager.GetString("MetadataBinder_HierarchyNotFollowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can only bind segments that are Navigation, Structural, Complex, or Collections. We found a segment '{0}' that isn't any of those. Please revise the query.. + /// + internal static string MetadataBinder_IllegalSegmentType { + get { + return ResourceManager.GetString("MetadataBinder_IllegalSegmentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A unary operator with an incompatible type was detected. Found operand type '{0}' for operator kind '{1}'.. + /// + internal static string MetadataBinder_IncompatibleOperandError { + get { + return ResourceManager.GetString("MetadataBinder_IncompatibleOperandError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A binary operator with incompatible types was detected. Found operand types '{0}' and '{1}' for operator kind '{2}'.. + /// + internal static string MetadataBinder_IncompatibleOperandsError { + get { + return ResourceManager.GetString("MetadataBinder_IncompatibleOperandsError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can not resolve the segment identifier '{0}' in query option.. + /// + internal static string MetadataBinder_InvalidIdentifierInQueryOption { + get { + return ResourceManager.GetString("MetadataBinder_InvalidIdentifierInQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Any/All may only be used following a collection.. + /// + internal static string MetadataBinder_LambdaParentMustBeCollection { + get { + return ResourceManager.GetString("MetadataBinder_LambdaParentMustBeCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The left operand for the IN operation is not a single value. IN operations require the left operand to be a single value and the right operand to be a collection value.. + /// + internal static string MetadataBinder_LeftOperandNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_LeftOperandNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A navigation property can only follow single entity nodes.. + /// + internal static string MetadataBinder_NavigationPropertyNotFollowingSingleEntityType { + get { + return ResourceManager.GetString("MetadataBinder_NavigationPropertyNotFollowingSingleEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No function signature for the function with name '{0}' matches the specified arguments. The function signatures considered are: {1}.. + /// + internal static string MetadataBinder_NoApplicableFunctionFound { + get { + return ResourceManager.GetString("MetadataBinder_NoApplicableFunctionFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A key lookup on type '{0}' didn't specify values for all key properties. All key properties must be specified in a key lookup.. + /// + internal static string MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues { + get { + return ResourceManager.GetString("MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The $orderby expression must evaluate to a single value of primitive type.. + /// + internal static string MetadataBinder_OrderByExpressionNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_OrderByExpressionNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter alias value expression is not string value.. + /// + internal static string MetadataBinder_ParameterAliasValueExpressionNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_ParameterAliasValueExpressionNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is not in scope.. + /// + internal static string MetadataBinder_ParameterNotInScope { + get { + return ResourceManager.GetString("MetadataBinder_ParameterNotInScope", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parent value for a property access of a property '{0}' is not a single value. Property access can only be applied to a single value.. + /// + internal static string MetadataBinder_PropertyAccessSourceNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_PropertyAccessSourceNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A PropertyAccessQueryToken without a parent was encountered outside of $filter or $orderby expression. The PropertyAccessQueryToken without a parent token is only allowed inside $filter or $orderby expressions.. + /// + internal static string MetadataBinder_PropertyAccessWithoutParentParameter { + get { + return ResourceManager.GetString("MetadataBinder_PropertyAccessWithoutParentParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find a property named '{1}' on type '{0}'.. + /// + internal static string MetadataBinder_PropertyNotDeclared { + get { + return ResourceManager.GetString("MetadataBinder_PropertyNotDeclared", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property '{0}' is not declared on type '{1}' or is not a key property. Only key properties can be used in key lookups.. + /// + internal static string MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue { + get { + return ResourceManager.GetString("MetadataBinder_PropertyNotDeclaredOrNotKeyInKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find a function named '{0}' with parameters '{1}'.. + /// + internal static string MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared { + get { + return ResourceManager.GetString("MetadataBinder_QualifiedFunctionNameWithParametersNotDeclared", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' option cannot be applied to the query path. '{0}' can only be applied to a collection of entities.. + /// + internal static string MetadataBinder_QueryOptionNotApplicable { + get { + return ResourceManager.GetString("MetadataBinder_QueryOptionNotApplicable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bind method cannot be null. In OData, the processing of query options should have a corresponding bind method.. + /// + internal static string MetadataBinder_QueryOptionsBindMethodCannotBeNull { + get { + return ResourceManager.GetString("MetadataBinder_QueryOptionsBindMethodCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bind state cannot be null. In OData, the bind state for query options should not be null and there should be query options in the object.. + /// + internal static string MetadataBinder_QueryOptionsBindStateCannotBeNull { + get { + return ResourceManager.GetString("MetadataBinder_QueryOptionsBindStateCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The right operand for the IN operation is not a collection value. IN operations require the left operand to be a single value and the right operand to be a collection value.. + /// + internal static string MetadataBinder_RightOperandNotCollectionValue { + get { + return ResourceManager.GetString("MetadataBinder_RightOperandNotCollectionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a non-negative integer value. In OData, the $skip query option must specify a non-negative integer value.. + /// + internal static string MetadataBinder_SkipRequiresNonNegativeInteger { + get { + return ResourceManager.GetString("MetadataBinder_SkipRequiresNonNegativeInteger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a non-negative integer value. In OData, the $top query option must specify a non-negative integer value.. + /// + internal static string MetadataBinder_TopRequiresNonNegativeInteger { + get { + return ResourceManager.GetString("MetadataBinder_TopRequiresNonNegativeInteger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operand for a unary operator '{0}' is not a single value. Unary operators require the operand to be a single value.. + /// + internal static string MetadataBinder_UnaryOperatorOperandNotSingleValue { + get { + return ResourceManager.GetString("MetadataBinder_UnaryOperatorOperandNotSingleValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unknown function with name '{0}' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.. + /// + internal static string MetadataBinder_UnknownFunction { + get { + return ResourceManager.GetString("MetadataBinder_UnknownFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unnamed key value was used in a key lookup on a type '{0}' which has more than one key property. Unnamed key value can only be used on a type with one key property.. + /// + internal static string MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties { + get { + return ResourceManager.GetString("MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unsupported query token kind '{0}' was found.. + /// + internal static string MetadataBinder_UnsupportedQueryTokenKind { + get { + return ResourceManager.GetString("MetadataBinder_UnsupportedQueryTokenKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The method 'FindDeclaredBoundOperations' on the IEdmModel has thrown an exception when looking for operations with a binding type {0}. See inner exception for more details.. + /// + internal static string MetadataUtils_CalculateBindableOperationsForType { + get { + return ResourceManager.GetString("MetadataUtils_CalculateBindableOperationsForType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The custom type resolver set in ODataMessageWriterSettings.EnableWcfDataServicesClientBehavior returned 'null' when resolving the type '{0}'. When a custom type resolver is specified, it cannot return null.. + /// + internal static string MetadataUtils_ResolveTypeName { + get { + return ResourceManager.GetString("MetadataUtils_ResolveTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance of CollectionFunctionCallNode can only be created with a primitive, complex or enum collection type. For functions returning a collection of entities, use EntityCollectionFunctionCallNode instead.. + /// + internal static string Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum { + get { + return ResourceManager.GetString("Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property must have a target multiplicity of 'Many' to create a CollectionNavigationNode.. + /// + internal static string Nodes_CollectionNavigationNode_MustHaveManyMultiplicity { + get { + return ResourceManager.GetString("Nodes_CollectionNavigationNode_MustHaveManyMultiplicity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property must have a target multiplicity of 'One' or 'ZeroOrOne' to create a SingleNavigationNode.. + /// + internal static string Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity { + get { + return ResourceManager.GetString("Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance of EntityCollectionFunctionCallNode can only be created with an entity collection type. For functions returning a collection of primitive or complex values, use CollectionFunctionCallNode instead.. + /// + internal static string Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity { + get { + return ResourceManager.GetString("Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance of InNode can only be created where the item types of the right operand '{0}' and the left operand '{1}' can be compared.. + /// + internal static string Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType { + get { + return ResourceManager.GetString("Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity type '{0}' was given to NonEntityParameterQueryNode. Use EntityParameterQueryNode instead.. + /// + internal static string Nodes_NonentityParameterQueryNodeWithEntityType { + get { + return ResourceManager.GetString("Nodes_NonentityParameterQueryNodeWithEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only static Entity Set reference expressions are supported currently.. + /// + internal static string Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease { + get { + return ResourceManager.GetString("Nodes_NonStaticEntitySetExpressionsAreNotSupportedInThisRelease", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is not structural.. + /// + internal static string Nodes_PropertyAccessShouldBeNonEntityProperty { + get { + return ResourceManager.GetString("Nodes_PropertyAccessShouldBeNonEntityProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of this kind requires the associated property to be a structural, collection type, but property '{0}' is not a collection.. + /// + internal static string Nodes_PropertyAccessTypeMustBeCollection { + get { + return ResourceManager.GetString("Nodes_PropertyAccessTypeMustBeCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is a collection.. + /// + internal static string Nodes_PropertyAccessTypeShouldNotBeCollection { + get { + return ResourceManager.GetString("Nodes_PropertyAccessTypeShouldNotBeCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance of SingleValueFunctionCallNode can only be created with a primitive, complex or enum type. For functions returning a single entity, use SingleEntityFunctionCallNode instead.. + /// + internal static string Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum { + get { + return ResourceManager.GetString("Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataAsyncReader_AsyncCallOnSyncReader { + get { + return ResourceManager.GetString("ODataAsyncReader_AsyncCallOnSyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When not reading an async response, you cannot create an async response message.. + /// + internal static string ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse { + get { + return ResourceManager.GetString("ODataAsyncReader_CannotCreateResponseWhenNotReadingResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The header '{0}' was specified multiple times. Each header must appear only once.. + /// + internal static string ODataAsyncReader_DuplicateHeaderFound { + get { + return ResourceManager.GetString("ODataAsyncReader_DuplicateHeaderFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The message header '{0}' is invalid. The header value must be of the format '<header name="">: <header value="">'.. + /// + internal static string ODataAsyncReader_InvalidHeaderSpecified { + get { + return ResourceManager.GetString("ODataAsyncReader_InvalidHeaderSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP version '{0}' used in an async response is not valid. The value must be '{1}'.. + /// + internal static string ODataAsyncReader_InvalidHttpVersionSpecified { + get { + return ResourceManager.GetString("ODataAsyncReader_InvalidHttpVersionSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid new line '{0}' encountered. Should be '\r\n'.. + /// + internal static string ODataAsyncReader_InvalidNewLineEncountered { + get { + return ResourceManager.GetString("ODataAsyncReader_InvalidNewLineEncountered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response line '{0}' is invalid. The response line at the start of the async response must be of the format 'HttpVersion StatusCode StatusCodeString'.. + /// + internal static string ODataAsyncReader_InvalidResponseLine { + get { + return ResourceManager.GetString("ODataAsyncReader_InvalidResponseLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for async payloads. They are not supported in batch or change set parts.. + /// + internal static string ODataAsyncReader_MultiByteEncodingsNotSupported { + get { + return ResourceManager.GetString("ODataAsyncReader_MultiByteEncodingsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value.. + /// + internal static string ODataAsyncReader_NonIntegerHttpStatusCode { + get { + return ResourceManager.GetString("ODataAsyncReader_NonIntegerHttpStatusCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataAsyncReader_SyncCallOnAsyncReader { + get { + return ResourceManager.GetString("ODataAsyncReader_SyncCallOnAsyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered an unexpected end of input while reading the async payload. Could be due to calling CreateResponseMessage() more than once.. + /// + internal static string ODataAsyncReader_UnexpectedEndOfInput { + get { + return ResourceManager.GetString("ODataAsyncReader_UnexpectedEndOfInput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt was made to modify the message. The message cannot be modified.. + /// + internal static string ODataAsyncResponseMessage_MustNotModifyMessage { + get { + return ResourceManager.GetString("ODataAsyncResponseMessage_MustNotModifyMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataAsyncWriter_AsyncCallOnSyncWriter { + get { + return ResourceManager.GetString("ODataAsyncWriter_AsyncCallOnSyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot create an async response message more than once.. + /// + internal static string ODataAsyncWriter_CannotCreateResponseMoreThanOnce { + get { + return ResourceManager.GetString("ODataAsyncWriter_CannotCreateResponseMoreThanOnce", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When not writing an async response, you cannot create an async response message.. + /// + internal static string ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse { + get { + return ResourceManager.GetString("ODataAsyncWriter_CannotCreateResponseWhenNotWritingResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when an async message is being written by using ODataAsyncWriter. In OData, writing an in-stream error for an async payload is not supported.. + /// + internal static string ODataAsyncWriter_CannotWriteInStreamErrorForAsync { + get { + return ResourceManager.GetString("ODataAsyncWriter_CannotWriteInStreamErrorForAsync", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataAsyncWriter_SyncCallOnAsyncWriter { + get { + return ResourceManager.GetString("ODataAsyncWriter_SyncCallOnAsyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Group id or changeset GUID cannot be null.. + /// + internal static string ODataBatch_GroupIdOrChangeSetIdCannotBeNull { + get { + return ResourceManager.GetString("ODataBatch_GroupIdOrChangeSetIdCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid HTTP method '{0}' was detected for a request in a change set. Requests in change sets only support the HTTP methods 'POST', 'PUT', 'DELETE', and 'PATCH'.. + /// + internal static string ODataBatch_InvalidHttpMethodForChangeSetRequest { + get { + return ResourceManager.GetString("ODataBatch_InvalidHttpMethodForChangeSetRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple headers with names that match '{0}', when using a case insensitive comparison, have been added. When case-insensitive header names are used, at most one header can be added for each name.. + /// + internal static string ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys { + get { + return ResourceManager.GetString("ODataBatchOperationHeaderDictionary_DuplicateCaseInsensitiveKeys", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The header with name '{0}' was not present in the header collection of the batch operation.. + /// + internal static string ODataBatchOperationHeaderDictionary_KeyNotFound { + get { + return ResourceManager.GetString("ODataBatchOperationHeaderDictionary_KeyNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to change the properties of the message or to retrieve the payload stream for the message has failed. Either the payload stream has already been requested or the processing of the message has been completed. In both cases, no more changes can be made to the message.. + /// + internal static string ODataBatchOperationMessage_VerifyNotCompleted { + get { + return ResourceManager.GetString("ODataBatchOperationMessage_VerifyNotCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot access a closed stream.. + /// + internal static string ODataBatchOperationStream_Disposed { + get { + return ResourceManager.GetString("ODataBatchOperationStream_Disposed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Absolute URI {0} is not start with the base URI [{1}] specified by the operation message.. + /// + internal static string ODataBatchReader_AbsoluteURINotMatchingBaseUri { + get { + return ResourceManager.GetString("ODataBatchReader_AbsoluteURINotMatchingBaseUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataBatchReader_AsyncCallOnSyncReader { + get { + return ResourceManager.GetString("ODataBatchReader_AsyncCallOnSyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When reading a batch response, you cannot create a batch operation request message.. + /// + internal static string ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse { + get { + return ResourceManager.GetString("ODataBatchReader_CannotCreateRequestOperationWhenReadingResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When reading a batch request, you cannot create a batch operation response message.. + /// + internal static string ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest { + get { + return ResourceManager.GetString("ODataBatchReader_CannotCreateResponseOperationWhenReadingRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot use a batch reader while the stream for the content of an operation is still active. You must first dispose the operation stream before further calls to the batch reader are made.. + /// + internal static string ODataBatchReader_CannotUseReaderWhileOperationStreamActive { + get { + return ResourceManager.GetString("ODataBatchReader_CannotUseReaderWhileOperationStreamActive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependsOn Id: [{0}] in request [{1}] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed.. + /// + internal static string ODataBatchReader_DependsOnIdNotFound { + get { + return ResourceManager.GetString("ODataBatchReader_DependsOnIdNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependsOn request Id [{0}] is part of atomic group [{1}]. Therefore dependsOn property should refer to atomic group Id [{1}] instead.. + /// + internal static string ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed { + get { + return ResourceManager.GetString("ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The atomicityGroup ID [{0}] was found duplicated in the batch request. AtomicityGroup IDs have to be adjacent, otherwise would be detected as duplicated.. + /// + internal static string ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed { + get { + return ResourceManager.GetString("ODataBatchReader_DuplicateAtomicityGroupIDsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01.. + /// + internal static string ODataBatchReader_DuplicateContentIDsNotAllowed { + get { + return ResourceManager.GetString("ODataBatchReader_DuplicateContentIDsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The method CreateOperationRequestMessage was called in state '{0}', which is not allowed. CreateOperationRequestMessage can only be called in state 'Operation'.. + /// + internal static string ODataBatchReader_InvalidStateForCreateOperationRequestMessage { + get { + return ResourceManager.GetString("ODataBatchReader_InvalidStateForCreateOperationRequestMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The method CreateOperationResponseMessage was called in state '{0}', which is not allowed. CreateOperationResponseMessage can only be called in state 'Operation'.. + /// + internal static string ODataBatchReader_InvalidStateForCreateOperationResponseMessage { + get { + return ResourceManager.GetString("ODataBatchReader_InvalidStateForCreateOperationResponseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Json batch format requires top level property name 'requests' or 'response' but it is missing.. + /// + internal static string ODataBatchReader_JsonBatchTopLevelPropertyMissing { + get { + return ResourceManager.GetString("ODataBatchReader_JsonBatchTopLevelPropertyMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current batch message contains too many parts. A maximum number of '{0}' query operations and change sets are allowed in a batch message.. + /// + internal static string ODataBatchReader_MaxBatchSizeExceeded { + get { + return ResourceManager.GetString("ODataBatchReader_MaxBatchSizeExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current change set contains too many operations. A maximum number of '{0}' operations are allowed in a change set.. + /// + internal static string ODataBatchReader_MaxChangeSetSizeExceeded { + get { + return ResourceManager.GetString("ODataBatchReader_MaxChangeSetSizeExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Message with id [{0}] is positioned incorrectly: all messages of same groupId [{1}] must be adjacent.. + /// + internal static string ODataBatchReader_MessageIdPositionedIncorrectly { + get { + return ResourceManager.GetString("ODataBatchReader_MessageIdPositionedIncorrectly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An operation was detected, but no message was created for it. You must create a message for every operation found in a batch or change set.. + /// + internal static string ODataBatchReader_NoMessageWasCreatedForOperation { + get { + return ResourceManager.GetString("ODataBatchReader_NoMessageWasCreatedForOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A request message for the operation has already been created. You cannot create a request message for the same operation multiple times.. + /// + internal static string ODataBatchReader_OperationRequestMessageAlreadyCreated { + get { + return ResourceManager.GetString("ODataBatchReader_OperationRequestMessageAlreadyCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A response message for the operation has already been created. You cannot create a response message for the same operation multiple times.. + /// + internal static string ODataBatchReader_OperationResponseMessageAlreadyCreated { + get { + return ResourceManager.GetString("ODataBatchReader_OperationResponseMessageAlreadyCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reader mode is not setup correctly.. + /// + internal static string ODataBatchReader_ReaderModeNotInitilized { + get { + return ResourceManager.GetString("ODataBatchReader_ReaderModeNotInitilized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changeset boundary must have been set by now.. + /// + internal static string ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull { + get { + return ResourceManager.GetString("ODataBatchReader_ReaderStreamChangesetBoundaryCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataBatchReader.ReadAsync or ODataBatchReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'.. + /// + internal static string ODataBatchReader_ReadOrReadAsyncCalledInInvalidState { + get { + return ResourceManager.GetString("ODataBatchReader_ReadOrReadAsyncCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request Id reference [{0}] in Uri [{1}] is not found in effective depends-on-Ids [{2}] of the request.. + /// + internal static string ODataBatchReader_ReferenceIdNotIncludedInDependsOn { + get { + return ResourceManager.GetString("ODataBatchReader_ReferenceIdNotIncludedInDependsOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request property [{0}] is required but is missing.. + /// + internal static string ODataBatchReader_RequestPropertyMissing { + get { + return ResourceManager.GetString("ODataBatchReader_RequestPropertyMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependsOn request Id [{0}] is same as atomicityGroup property value [{1}], and is not allowed.. + /// + internal static string ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed { + get { + return ResourceManager.GetString("ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependsOn request Id [{0}] is same as id property value [{1}], and it is not allowed.. + /// + internal static string ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed { + get { + return ResourceManager.GetString("ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataBatchReader_SyncCallOnAsyncReader { + get { + return ResourceManager.GetString("ODataBatchReader_SyncCallOnAsyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The header '{0}' was specified multiple times. Each header must appear only once in a batch part.. + /// + internal static string ODataBatchReaderStream_DuplicateHeaderFound { + get { + return ResourceManager.GetString("ODataBatchReaderStream_DuplicateHeaderFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content length header '{0}' is not valid. The content length header must be a valid Int32 literal and must be greater than or equal to 0.. + /// + internal static string ODataBatchReaderStream_InvalidContentLengthSpecified { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidContentLengthSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' header value '{1}' is invalid. When this is the start of the change set, the value must be '{2}'; otherwise it must be '{3}'.. + /// + internal static string ODataBatchReaderStream_InvalidContentTypeSpecified { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidContentTypeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The message header '{0}' is invalid. The header value must be of the format '<header name="">: <header value="">'.. + /// + internal static string ODataBatchReaderStream_InvalidHeaderSpecified { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidHeaderSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP version '{0}' used in a batch operation request or response is not valid. The value must be '{1}'.. + /// + internal static string ODataBatchReaderStream_InvalidHttpVersionSpecified { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidHttpVersionSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request line '{0}' is invalid. The request line at the start of each operation must be of the format 'HttpMethod RequestUrl HttpVersion'.. + /// + internal static string ODataBatchReaderStream_InvalidRequestLine { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidRequestLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The response line '{0}' is invalid. The response line at the start of each operation must be of the format 'HttpVersion StatusCode StatusCodeString'.. + /// + internal static string ODataBatchReaderStream_InvalidResponseLine { + get { + return ResourceManager.GetString("ODataBatchReaderStream_InvalidResponseLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Content-Type' header is missing. The 'Content-Type' header must be specified for each MIME part of a batch message.. + /// + internal static string ODataBatchReaderStream_MissingContentTypeHeader { + get { + return ResourceManager.GetString("ODataBatchReaderStream_MissingContentTypeHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A missing or invalid '{0}' header was found. The '{0}' header must be specified for each batch operation, and its value must be '{1}'.. + /// + internal static string ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader { + get { + return ResourceManager.GetString("ODataBatchReaderStream_MissingOrInvalidContentEncodingHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for operation payloads. They are not supported in batch or change set parts.. + /// + internal static string ODataBatchReaderStream_MultiByteEncodingsNotSupported { + get { + return ResourceManager.GetString("ODataBatchReaderStream_MultiByteEncodingsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nested change sets in a batch payload are not supported.. + /// + internal static string ODataBatchReaderStream_NestedChangesetsAreNotSupported { + get { + return ResourceManager.GetString("ODataBatchReaderStream_NestedChangesetsAreNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value.. + /// + internal static string ODataBatchReaderStream_NonIntegerHttpStatusCode { + get { + return ResourceManager.GetString("ODataBatchReaderStream_NonIntegerHttpStatusCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered an unexpected end of input while reading the batch payload.. + /// + internal static string ODataBatchReaderStream_UnexpectedEndOfInput { + get { + return ResourceManager.GetString("ODataBatchReaderStream_UnexpectedEndOfInput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Too many white spaces after a boundary delimiter and before the terminating line resource set. For security reasons, the total number of characters for a boundary including white spaces must not exceed {0}.. + /// + internal static string ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached { + get { + return ResourceManager.GetString("ODataBatchReaderStreamBuffer_BoundaryLineSecurityLimitReached", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. When the relative URI is a reference to a content ID, the content ID does not exist in the current change set.. + /// + internal static string ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified { + get { + return ResourceManager.GetString("ODataBatchUtils_RelativeUriStartingWithDollarUsedWithoutBaseUriSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader.. + /// + internal static string ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified { + get { + return ResourceManager.GetString("ODataBatchUtils_RelativeUriUsedWithoutBaseUriSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataBatchWriter_AsyncCallOnSyncWriter { + get { + return ResourceManager.GetString("ODataBatchWriter_AsyncCallOnSyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndBatch with an active change set; you must first call ODataBatchWriter.WriteEndChangeset.. + /// + internal static string ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndChangeset without an active change set; you must first call ODataBatchWriter.WriteStartChangeset.. + /// + internal static string ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When writing a batch response, you cannot create a batch operation request message.. + /// + internal static string ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When writing a batch request, you cannot create a batch operation response message.. + /// + internal static string ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteStartChangeset with an active change set; you must first call ODataBatchWriter.WriteEndChangeset.. + /// + internal static string ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when a batch is being written by using ODataBatchWriter. In OData, writing an in-stream error for a batch payload is not supported.. + /// + internal static string ODataBatchWriter_CannotWriteInStreamErrorForBatch { + get { + return ResourceManager.GetString("ODataBatchWriter_CannotWriteInStreamErrorForBatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01.. + /// + internal static string ODataBatchWriter_DuplicateContentIDsNotAllowed { + get { + return ResourceManager.GetString("ODataBatchWriter_DuplicateContentIDsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync was called while a stream being used to write operation content, obtained from the operation message by using GetStream or GetStreamAsync, was still active. This is not allowed. ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync can only be called when an active stream for the operation content does not exist.. + /// + internal static string ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState { + get { + return ResourceManager.GetString("ODataBatchWriter_FlushOrFlushAsyncCalledInStreamRequestedState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. You can only call ODataBatchWriter.FlushAsync after ODataBatchWriter.WriteEndBatch has been called.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromBatchCompleted { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromBatchCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After calling WriteStartBatch, the only valid methods on ODataBatchWriter are WriteStartChangeset, CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndBatch, and FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromBatchStarted { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromBatchStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After calling WriteEndChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndBatch, and FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromChangeSetCompleted { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromChangeSetCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After calling WriteStartChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndChangeset, and FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromChangeSetStarted { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromChangeSetStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After writing the content of an operation, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndChangeset, WriteEndBatch and FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. You cannot use the batch writer while another writer is writing the content of an operation. Dispose the stream for the operation before continuing to use the ODataBatchWriter.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After calling CreateOperationRequestMessage or CreateOperationResponseMessage, the only valid methods on ODataBatchWriter are WriteStartChangeset, WriteEndChangeset, WriteEndBatch, and FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromOperationCreated { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromOperationCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid method call on ODataBatchWriter was detected. After creating the writer, the only valid methods are ODataBatchWriter.WriteStartBatch and ODataBatchWriter.FlushAsync.. + /// + internal static string ODataBatchWriter_InvalidTransitionFromStart { + get { + return ResourceManager.GetString("ODataBatchWriter_InvalidTransitionFromStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current batch message contains too many parts. Only batch messages with a maximum number of '{0}' query operations and change sets are allowed.. + /// + internal static string ODataBatchWriter_MaxBatchSizeExceeded { + get { + return ResourceManager.GetString("ODataBatchWriter_MaxBatchSizeExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current change set contains too many operations. Only change sets with a maximum number of '{0}' operations are allowed.. + /// + internal static string ODataBatchWriter_MaxChangeSetSizeExceeded { + get { + return ResourceManager.GetString("ODataBatchWriter_MaxChangeSetSizeExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataBatchWriter_SyncCallOnAsyncWriter { + get { + return ResourceManager.GetString("ODataBatchWriter_SyncCallOnAsyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous.. + /// + internal static string ODataCollectionReaderCore_AsyncCallOnSyncReader { + get { + return ResourceManager.GetString("ODataCollectionReaderCore_AsyncCallOnSyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current state of the collection reader is '{0}'; however, the expected item type of a collection reader can only be set in state '{1}'.. + /// + internal static string ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState { + get { + return ResourceManager.GetString("ODataCollectionReaderCore_ExpectedItemTypeSetInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataCollectionReader.ReadAsync or ODataCollectionReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'.. + /// + internal static string ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState { + get { + return ResourceManager.GetString("ODataCollectionReaderCore_ReadOrReadAsyncCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous.. + /// + internal static string ODataCollectionReaderCore_SyncCallOnAsyncReader { + get { + return ResourceManager.GetString("ODataCollectionReaderCore_SyncCallOnAsyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous.. + /// + internal static string ODataCollectionWriterCore_AsyncCallOnSyncWriter { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_AsyncCallOnSyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or to write the end of the collection.. + /// + internal static string ODataCollectionWriterCore_InvalidTransitionFromCollection { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_InvalidTransitionFromCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or the end of the collection.. + /// + internal static string ODataCollectionWriterCore_InvalidTransitionFromItem { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_InvalidTransitionFromItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write the collection or to write nothing at all.. + /// + internal static string ODataCollectionWriterCore_InvalidTransitionFromStart { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_InvalidTransitionFromStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous.. + /// + internal static string ODataCollectionWriterCore_SyncCallOnAsyncWriter { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_SyncCallOnAsyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataCollectionWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Start', 'Collection', and 'Item'.. + /// + internal static string ODataCollectionWriterCore_WriteEndCalledInInvalidState { + get { + return ResourceManager.GetString("ODataCollectionWriterCore_WriteEndCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigationSource for resource or resource set is unknown or the Type is null. When writing a response, the navigation source or the type must be passed to the ODataMessageWriter.CreateODataResourceWriter/ODataMessageWriter.CreateODataResourceSetWriter method or the ODataResourceSerializationInfo must be set on the resource/resource set.. + /// + internal static string ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet { + get { + return ResourceManager.GetString("ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Path property '{0}' of ODataMessageWriterSetting.ODataUri must end with the navigation property which the contained elements being written belong to.. + /// + internal static string ODataContextUriBuilder_ODataPathInvalidForContainedElement { + get { + return ResourceManager.GetString("ODataContextUriBuilder_ODataPathInvalidForContainedElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMessageWriterSetting.ODataUri must be set when writing individual property.. + /// + internal static string ODataContextUriBuilder_ODataUriMissingForIndividualProperty { + get { + return ResourceManager.GetString("ODataContextUriBuilder_ODataUriMissingForIndividualProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream value must be a property of an ODataResource instance.. + /// + internal static string ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource { + get { + return ResourceManager.GetString("ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type name for the top level property is unknown. When writing a response, the ODataValue must have a type name on itself or have a SerializationTypeNameAnnotation.. + /// + internal static string ODataContextUriBuilder_TypeNameMissingForProperty { + get { + return ResourceManager.GetString("ODataContextUriBuilder_TypeNameMissingForProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The collection type name for the top level collection is unknown. When writing a response, the item type must be passed to the ODataMessageWriter.CreateODataCollectionWriter method or the ODataCollectionStartSerializationInfo must be set on the ODataCollectionStart.. + /// + internal static string ODataContextUriBuilder_TypeNameMissingForTopLevelCollection { + get { + return ResourceManager.GetString("ODataContextUriBuilder_TypeNameMissingForTopLevelCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Context URL for payload kind '{0}' is not supported.. + /// + internal static string ODataContextUriBuilder_UnsupportedPayloadKind { + get { + return ResourceManager.GetString("ODataContextUriBuilder_UnsupportedPayloadKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base type '{0}' of the entity set specified for writing a payload is not assignable from the specified entity type '{1}'. When an entity type is specified it has to be the same or derived from the base type of the entity set.. + /// + internal static string ODataContextUriBuilder_ValidateDerivedType { + get { + return ResourceManager.GetString("ODataContextUriBuilder_ValidateDerivedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' has no key properties. Entity types must define at least one key property.. + /// + internal static string ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties { + get { + return ResourceManager.GetString("ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key property '{0}' on type '{1}' has a null value. Key properties must not have null values.. + /// + internal static string ODataConventionalUriBuilder_NullKeyValue { + get { + return ResourceManager.GetString("ODataConventionalUriBuilder_NullKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' is not declared on the non-open type '{1}'.. + /// + internal static string ODataEdmStructuredValue_UndeclaredProperty { + get { + return ResourceManager.GetString("ODataEdmStructuredValue_UndeclaredProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error was read from the payload. See the 'Error' property for more details.. + /// + internal static string ODataErrorException_GeneralError { + get { + return ResourceManager.GetString("ODataErrorException_GeneralError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred while processing the OData message.. + /// + internal static string ODataException_GeneralError { + get { + return ResourceManager.GetString("ODataException_GeneralError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a segment of type '{0} in an expand path, but only NavigationProperty, Property and Type segments are allowed.. + /// + internal static string ODataExpandPath_InvalidExpandPathSegment { + get { + return ResourceManager.GetString("ODataExpandPath_InvalidExpandPathSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The last segment must be a navigation property or type segment in $expand.. + /// + internal static string ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment { + get { + return ResourceManager.GetString("ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The last segment, and only the last segment, can be a navigation property in $expand.. + /// + internal static string ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty { + get { + return ResourceManager.GetString("ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The format '{0}' does not support reading a payload of kind '{1}'.. + /// + internal static string ODataInputContext_UnsupportedPayloadKindForFormat { + get { + return ResourceManager.GetString("ODataInputContext_UnsupportedPayloadKindForFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid instance annotation name.. + /// + internal static string ODataInstanceAnnotation_BadTermName { + get { + return ResourceManager.GetString("ODataInstanceAnnotation_BadTermName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid instance annotation name. An instance annotation name must contain a period that is not at the start or end of the name.. + /// + internal static string ODataInstanceAnnotation_NeedPeriodInName { + get { + return ResourceManager.GetString("ODataInstanceAnnotation_NeedPeriodInName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is a reserved instance annotation name because it starts with '{1}'. Reserved names are not allowed for custom instance annotations.. + /// + internal static string ODataInstanceAnnotation_ReservedNamesNotAllowed { + get { + return ResourceManager.GetString("ODataInstanceAnnotation_ReservedNamesNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of an instance annotation cannot be of type ODataStreamReferenceValue.. + /// + internal static string ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue { + get { + return ResourceManager.GetString("ODataInstanceAnnotation_ValueCannotBeODataStreamReferenceValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected reader.NodeType: {0}.. + /// + internal static string ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType { + get { + return ResourceManager.GetString("ODataJsonBatchBodyContentReaderStream_UnexpectedNodeType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown/undefined type, new type that needs to be supported: {0}?. + /// + internal static string ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader { + get { + return ResourceManager.GetString("ODataJsonBatchBodyContentReaderStream_UnsupportedContentTypeInHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate header name '{0}' for request in batch.. + /// + internal static string ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch { + get { + return ResourceManager.GetString("ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate property name '{0}' for request in batch.. + /// + internal static string ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch { + get { + return ResourceManager.GetString("ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown property name '{0}' for message in batch.. + /// + internal static string ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch { + get { + return ResourceManager.GetString("ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the items of a collection; however, a 'StartArray' node was expected.. + /// + internal static string ODataJsonCollectionDeserializer_CannotReadCollectionContentStart { + get { + return ResourceManager.GetString("ODataJsonCollectionDeserializer_CannotReadCollectionContentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property or annotation for a property with name '{0}' or an instance annotation with name '{0}' was found after reading the items of a top-level collection. No additional properties or annotations are allowed after the collection property.. + /// + internal static string ODataJsonCollectionDeserializer_CannotReadCollectionEnd { + get { + return ResourceManager.GetString("ODataJsonCollectionDeserializer_CannotReadCollectionEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When trying to read the start of a collection, the expected collection property with name '{0}' was not found.. + /// + internal static string ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound { + get { + return ResourceManager.GetString("ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An 'odata.type' annotation with value '{0}' was found for a top-level collection payload; however, top-level collections must specify a collection type.. + /// + internal static string ODataJsonCollectionDeserializer_InvalidCollectionTypeName { + get { + return ResourceManager.GetString("ODataJsonCollectionDeserializer_InvalidCollectionTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' is not valid for the expected payload kind '{1}'.. + /// + internal static string ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URL '{0}' is invalid.. + /// + internal static string ODataJsonContextUriParser_InvalidContextUrl { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_InvalidContextUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the entity set or type '{1}'. However, no entity set or type with name '{1}' is declared in the metadata.. + /// + internal static string ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_InvalidEntitySetNameOrTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A '$select' query option was found for the payload kind '{0}'. In OData, a '$select' query option is only supported for payload kinds 'Resource' and 'ResourceSet'.. + /// + internal static string ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_InvalidPayloadKindWithSelectQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last segment in context URL '{0}' should not be KeySegment.. + /// + internal static string ODataJsonContextUriParser_LastSegmentIsKeySegment { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_LastSegmentIsKeySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No model was specified for the ODataMessageReader. A message reader requires a model for Json payload to be specified in the ODataMessageReader constructor.. + /// + internal static string ODataJsonContextUriParser_NoModel { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_NoModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null metadata document URI was found in the payload. Metadata document URIs must not be null.. + /// + internal static string ODataJsonContextUriParser_NullMetadataDocumentUri { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_NullMetadataDocumentUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The top level context URL '{0}' should be an absolute Uri.. + /// + internal static string ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute { + get { + return ResourceManager.GetString("ODataJsonContextUriParser_TopLevelContextUrlShouldBeAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. State transition is not allowed while writing an expanded navigation property, complex property or complex collection property.. + /// + internal static string ODataJsonDeltaWriter_InvalidTransitionFromNestedResource { + get { + return ResourceManager.GetString("ODataJsonDeltaWriter_InvalidTransitionFromNestedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. Nested resource can only be written within a delta resource.. + /// + internal static string ODataJsonDeltaWriter_InvalidTransitionToNestedResource { + get { + return ResourceManager.GetString("ODataJsonDeltaWriter_InvalidTransitionToNestedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WriteStart(expandedResourceSet) was called in an invalid state ('{0}'); WriteStart(expandedResourceSet) is only supported in state 'ExpandedNavigationProperty'.. + /// + internal static string ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState { + get { + return ResourceManager.GetString("ODataJsonDeltaWriter_WriteStartExpandedResourceSetCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation '{0}' is found targeting the instance annotation '{1}'. However the value for the instance annotation '{1}' is not found immediately after. In Json, an annotation targeting an instance annotation must be immediately followed by the value of the targeted instance annotation.. + /// + internal static string ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue { + get { + return ResourceManager.GetString("ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The required instance annotation 'odata.context' was not found at the beginning of a response payload.. + /// + internal static string ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty { + get { + return ResourceManager.GetString("ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation '{0}' was targeting the instance annotation '{1}'. Only the '{2}' annotation is allowed to target an instance annotation.. + /// + internal static string ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation { + get { + return ResourceManager.GetString("ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A relative URI value '{0}' was specified in the payload, but the {1} annotation is missing from the payload. The payload must only contain absolute URIs or the {1} annotation must be on the payload.. + /// + internal static string ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation { + get { + return ResourceManager.GetString("ODataJsonDeserializer_RelativeUriUsedWithouODataMetadataAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the start of an entity reference link. In Json, entity reference links must be objects.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' property of an entity reference link object cannot have a null value.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Did not find the required '{0}' property for an entity reference links payload.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotF" + + "ound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance annotation with name '{0}' or a property annotation for the property with name '{0}' was found when reading an entity reference link. No OData property or instance annotations are allowed when reading entity reference links.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' or a property annotation for a property with name '{0}' was found when trying to read a collection of entity reference links; however, a property with name '{1}' was expected.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property annotation for a property with name '{0}' was found when reading an entity reference links payload. No property annotations, only instance annotations are allowed when reading entity reference links.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferen" + + "ceLinks", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found when reading an entity reference link. No properties other than the entity reference link property with name '{1}' are allowed.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The required property '{0}' for an entity reference link was not found.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{0}' properties were found in an entity reference link object; however, a single '{0}' property was expected.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLi" + + "nk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property annotation with name '{0}' was detected when reading an entity reference link; entity reference links do not support property annotations.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property annotation was found for entity reference links; however, entity reference links only support instance annotations.. + /// + internal static string ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks { + get { + return ResourceManager.GetString("ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink" + + "s", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An OData instance annotation '{0}' was found in an error payload; however, error payloads do not support OData instance annotations.. + /// + internal static string ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An OData property annotation '{0}' was found in an error payload; however, error payloads do not support OData property annotations.. + /// + internal static string ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more property annotations for property '{0}' were found in an error payload without the property to annotate. Error payloads must not contain property annotations for properties that are not in the payload.. + /// + internal static string ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found in the message value of a top-level error. In OData, the message value of a top-level error value can only have properties with name 'lang' or 'value'.. + /// + internal static string ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_TopLevelErrorMessageValueWithInvalidProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found in the error value of a top-level error. In OData, a top-level error value can only have properties with name 'code', 'message', or 'innererror', or custom instance annotations.. + /// + internal static string ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found in the error object when reading a top-level error. In OData, a top-level error object must have exactly one property with name 'error'.. + /// + internal static string ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty { + get { + return ResourceManager.GetString("ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' is not compatible with the base type '{1}' of the provided entity set '{2}'. When an entity type is specified for an OData resource set or resource reader, it has to be the same or a subtype of the base type of the specified entity set.. + /// + internal static string ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType { + get { + return ResourceManager.GetString("ODataJsonInputContext_EntityTypeMustBeCompatibleWithEntitySetBaseType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to read a collection request payload without specifying a collection item type was detected. When reading collection payloads in requests, an expected item type has to be provided.. + /// + internal static string ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests { + get { + return ResourceManager.GetString("ODataJsonInputContext_ItemTypeRequiredForCollectionReaderInRequests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing Json payloads without a model is only supported for error payloads.. + /// + internal static string ODataJsonInputContext_ModelRequiredForReading { + get { + return ResourceManager.GetString("ODataJsonInputContext_ModelRequiredForReading", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing Json resource sets or entries in requests without entity set is not supported. Pass in the entity set as a parameter to ODataMessageReader.CreateODataResourceReader or ODataMessageReader.CreateODataResourceSetReader method.. + /// + internal static string ODataJsonInputContext_NoEntitySetForRequest { + get { + return ResourceManager.GetString("ODataJsonInputContext_NoEntitySetForRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is specified with a null value. For Json, the '{0}' argument to the 'CreateParameterReader' method cannot be null.. + /// + internal static string ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader { + get { + return ResourceManager.GetString("ODataJsonInputContext_OperationCannotBeNullForCreateParameterReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataMessageReader.DetectPayloadKind was called for a request payload. Payload kind detection is only supported for responses in Json.. + /// + internal static string ODataJsonInputContext_PayloadKindDetectionForRequest { + get { + return ResourceManager.GetString("ODataJsonInputContext_PayloadKindDetectionForRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' property of an operation '{1}' in '{2}' cannot have a null value.. + /// + internal static string ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull { + get { + return ResourceManager.GetString("ODataJsonOperationsDeserializerUtils_OperationPropertyCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a node of type '{1}' when starting to read the '{0}' operations value, however a node of type 'StartObject' was expected. The '{0}' operations value must have an object value.. + /// + internal static string ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue { + get { + return ResourceManager.GetString("ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When trying to read a null collection parameter value in Json, a node of type '{0}' with the value '{1}' was read from the JSON reader; however, a primitive 'null' value was expected.. + /// + internal static string ODataJsonParameterDeserializer_NullCollectionExpected { + get { + return ResourceManager.GetString("ODataJsonParameterDeserializer_NullCollectionExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An OData property annotation was found for a parameter payload; however, parameter payloads do not support OData property annotations.. + /// + internal static string ODataJsonParameterDeserializer_PropertyAnnotationForParameters { + get { + return ResourceManager.GetString("ODataJsonParameterDeserializer_PropertyAnnotationForParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more property annotations for property '{0}' were found in a parameter payload without the property to annotate. Parameter payloads must not contain property annotations for properties that are not in the payload.. + /// + internal static string ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters { + get { + return ResourceManager.GetString("ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of an unsupported type kind '{1}'. Only primitive, enum, complex, primitive collection, enum collection and complex collection types are supported.. + /// + internal static string ODataJsonParameterDeserializer_UnsupportedParameterTypeKind { + get { + return ResourceManager.GetString("ODataJsonParameterDeserializer_UnsupportedParameterTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of the '{1}' primitive type, which is not supported in Json.. + /// + internal static string ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType { + get { + return ResourceManager.GetString("ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A non-collection type of '{0}' was specified for a collection value.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A collection type of '{0}' was specified for a non-collection value.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A complex property with an '{0}' property annotation was found. Complex properties must not have the '{0}' property annotation, instead the '{0}' should be specified as an instance annotation in the complex value.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_ComplexValueWithPropertyTypeAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A top-level property with name '{0}' was found in the payload; however, property and collection payloads must always have a top-level property with name '{1}'.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No top-level properties were found. A top-level property or collection in Json must be represented as a JSON object with exactly one property which is not an annotation.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'odata.type' instance annotation value '{0}' is not a valid type name. The value of the 'odata.type' instance annotation must be a non-empty string.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_InvalidTypeName { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_InvalidTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property with name '{0}' was found in a null payload. In OData, no properties or OData annotations can appear in a null payload.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property with name '{0}' was found with a value node of type '{1}'; however, a resource value of type '{2}' was expected.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An '{0}' annotation was read inside a JSON object representing a primitive value; type annotations for primitive values have to be property annotations of the owning property.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'odata.type' instance annotation in a resource object is not the first property of the object. In OData, the 'odata.type' instance annotation must be the first property of the resource object.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more property annotations for property '{0}' were found in the resource value without the property to annotate. Resource values must only contain property annotations for existing properties.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutPrope" + + "rty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more property annotations for property '{0}' were found in the top-level property or collection payload without the property to annotate. Top-level property and collection payloads must contain a single property, with optional annotations for this property.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A top-level property with an invalid primitive null value was found. In OData, top-level properties with null value have to be serialized as JSON object with an '{0}' annotation that has the value '{1}'.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_TopLevelPropertyWithPrimitiveNullValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property with name '{0}' was found after the data property with name '{1}'. If a type is specified for a data property, it must appear before the data property.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation '{0}' was found. This annotation is either not recognized or not expected at the current position.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' has a property annotation '{1}'. Primitive, complex, collection or open properties can only have an 'odata.type' property annotation.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedDataPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a metadata reference property '{0}' in a scope other than a resource. In OData, a property name with a '#' character indicates a reference into the metadata and is only supported for describing operations bound to a resource.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An OData property annotation '{0}' was found. This property annotation is either not recognized or not expected at the current position.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found. This property is either not recognized or not expected at the current position.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedProperty { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' has a property annotation '{1}'. This annotation is either not recognized or not expected at the current position.. + /// + internal static string ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Neither an expected type nor a type name in the OData object model was provided for a collection property. When writing a request payload, either an expected type or a type name has to be specified.. + /// + internal static string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectio" + + "nValueInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Neither an expected type nor a type name in the OData object model was provided for a resource value. When writing a request payload, either an expected type or a type name has to be specified.. + /// + internal static string ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest { + get { + return ResourceManager.GetString("ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceV" + + "alueRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the resources of a resource set. A 'StartObject' or 'EndArray' node was expected.. + /// + internal static string ODataJsonReader_CannotReadResourcesOfResourceSet { + get { + return ResourceManager.GetString("ODataJsonReader_CannotReadResourcesOfResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If a primitive value is representing a resource, the resource must be null.. + /// + internal static string ODataJsonReader_UnexpectedPrimitiveValueForODataResource { + get { + return ResourceManager.GetString("ODataJsonReader_UnexpectedPrimitiveValueForODataResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value specified for the spatial property was not valid. You must specify a valid spatial value.. + /// + internal static string ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue { + get { + return ResourceManager.GetString("ODataJsonReaderCoreUtils_CannotReadSpatialPropertyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' instance or property annotation has a null value. In OData, the '{0}' instance or property annotation must have a non-null string value.. + /// + internal static string ODataJsonReaderUtils_AnnotationWithNullValue { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_AnnotationWithNullValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.Boolean' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertBoolean { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertBoolean", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.DateTime' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertDateTime { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertDateTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.DateTimeOffset' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertDateTimeOffset { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertDateTimeOffset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.Decimal' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertDecimal { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertDecimal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.Double' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertDouble { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertDouble", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type 'Edm.Int32' to the expected target type '{0}'.. + /// + internal static string ODataJsonReaderUtils_CannotConvertInt32 { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_CannotConvertInt32", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value to target type '{0}' because of conflict between input format string/number and parameter 'IEEE754Compatible' false/true.. + /// + internal static string ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An '{0}' annotation was found with an invalid value. In OData, the only valid value for the '{0}' annotation is '{1}'.. + /// + internal static string ODataJsonReaderUtils_InvalidValueForODataNullAnnotation { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_InvalidValueForODataNullAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{0}' properties were found in an error or inner error object. In OData, an error or inner error must have at most one '{0}' property.. + /// + internal static string ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName { + get { + return ResourceManager.GetString("ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The resource reference navigation property '{0}' has a property annotation '{1}' with an array value. Resource reference navigation properties can only have a property annotation '{1}' with a string value.. + /// + internal static string ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_ArrayValueForSingletonBindPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartArray' node was expected.. + /// + internal static string ODataJsonResourceDeserializer_CannotReadCollectionNestedResource { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_CannotReadCollectionNestedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property '{0}'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.. + /// + internal static string ODataJsonResourceDeserializer_CannotReadNestedResource { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_CannotReadNestedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the start of the content of a resource set; however, a node of type 'StartArray' was expected.. + /// + internal static string ODataJsonResourceDeserializer_CannotReadResourceSetContentStart { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_CannotReadResourceSetContentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartObject' node or 'PrimitiveValue' node with null value was expected.. + /// + internal static string ODataJsonResourceDeserializer_CannotReadSingletonNestedResource { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_CannotReadSingletonNestedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid primitive value '{0}' for @removed annotation. @removed annotation must be a JSON object, optionally containing a 'reason' property.. + /// + internal static string ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple property annotations '{0}' were found when reading the nested resource '{1}'. Only a single property annotation '{0}' can be specified for a nested resource.. + /// + internal static string ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of '{0}' property annotation is an empty array. The '{0}' property annotation must have a non-empty array as its value.. + /// + internal static string ODataJsonResourceDeserializer_EmptyBindArray { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_EmptyBindArray", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Did not find the required '{0}' property for the expected resource set.. + /// + internal static string ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A node of type '{0}' was read from the JSON reader when trying to read the entries of a typed resource set; however, a node of type 'StartObject' or 'EndArray', or a null value, was expected.. + /// + internal static string ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property annotation for a property with name '{0}' was found when reading a top-level resource set. No property annotations, only instance annotations are allowed when reading top-level resource sets.. + /// + internal static string ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' was found when reading a top-level resource set. No properties other than the resource set property with name '{1}' are allowed.. + /// + internal static string ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A metadata reference property was found in a Json request payload. Metadata reference properties are only supported in responses.. + /// + internal static string ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_MetadataReferencePropertyInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{0}' properties were found for an operation '{1}'. In OData, an operation can have at most one '{0}' property.. + /// + internal static string ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' has no expanded value and no '{1}' property annotation. Navigation property in request without expanded value must have the '{1}' property annotation.. + /// + internal static string ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLink { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_NavigationPropertyWithoutValueAndEntityReferenceLin" + + "k", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered the operation '{0}' which can not be resolved to an ODataAction or ODataFunction.. + /// + internal static string ODataJsonResourceDeserializer_OperationIsNotActionOrFunction { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_OperationIsNotActionOrFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple target bindings encountered for the operation '{0}' but the 'target' property was not found in an operation value. To differentiate between multiple target bindings, each operation value must have exactly one 'target' property.. + /// + internal static string ODataJsonResourceDeserializer_OperationMissingTargetProperty { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_OperationMissingTargetProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An undeclared property '{0}' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.. + /// + internal static string ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_PropertyWithoutValueWithUnknownType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property '{0}' which only has property annotations in the payload but no property value is declared to be of type '{1}'. In OData, only navigation properties and named streams can be represented as properties without values.. + /// + internal static string ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_PropertyWithoutValueWithWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' instance annotation in a resource object is preceded by a property or property annotation. In OData, the '{0}' instance annotation must be before any property or property annotation in a resource object.. + /// + internal static string ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'odata.type' instance annotation in a resource object is preceded by an invalid property. In OData, the 'odata.type' instance annotation must be either the first property in the JSON object or the second if the 'odata.context' instance annotation is present.. + /// + internal static string ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The resource reference navigation property '{0}' has both the '{1}' property annotation as well as a value. Resource reference navigation properties can have either '{1}' property annotations or values, but not both.. + /// + internal static string ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_SingletonNavigationPropertyWithBindingAndValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A stream property {0} was found in a Json request payload. Stream properties are only supported in responses.. + /// + internal static string ODataJsonResourceDeserializer_StreamPropertyInRequest { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_StreamPropertyInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A stream property '{0}' has a value in the payload. In OData, stream property must not have a value, it must only use property annotations.. + /// + internal static string ODataJsonResourceDeserializer_StreamPropertyWithValue { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_StreamPropertyWithValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The resource set reference navigation property '{0}' has a property annotation '{1}' with a string value. Resource set reference navigation properties can only have a property annotation '{1}' with an array value.. + /// + internal static string ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_StringValueForCollectionBindPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' has a property annotation '{1}'. The complex collection property can only have the 'odata.count', 'odata.type' and 'odata.nextLink' property annotations.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedComplexCollectionPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' has a property annotation '{1}'. Deferred navigation links can only have the 'odata.navigationLink' and 'odata.associationLink' property annotations.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedDeferredLinkPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a deleted entity when reading a non-delta response payload. Deleted entities are only supported in request payloads and delta responses.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' has a property annotation '{1}'. Expanded resource set navigation links can only have the 'odata.context', 'odata.navigationLink', 'odata.associationLink' and 'odata.nextLink' property annotations. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedExpandedCollectionNavigationLinkPropertyA" + + "nnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' has a property annotation '{1}'. Expanded resource navigation links can only have the 'odata.context', 'odata.navigationLink' and 'odata.associationLink' property annotations.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedExpandedSingletonNavigationLinkPropertyAn" + + "notation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' has a property annotation '{1}'. Navigation links in request payloads can only have the '{2}' property annotation.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property annotation '{0}' was found after the property '{1}' it is annotating. Only the 'odata.nextLink' property annotation can be used after the property it is annotating.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSe" + + "t", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream property '{0}' has a property annotation '{1}'. Stream property can only have the 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaEtag' and 'odata.mediaContentType' property annotations.. + /// + internal static string ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation { + get { + return ResourceManager.GetString("ODataJsonResourceDeserializer_UnexpectedStreamPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} annotation is missing from the payload.. + /// + internal static string ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload { + get { + return ResourceManager.GetString("ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple operations have the same 'Metadata' property value of '{0}' and the same 'Target' property value of '{1}'. When multiple operations have the same 'Metadata' property value, their 'Target' property values must be unique.. + /// + internal static string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget { + get { + return ResourceManager.GetString("ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple operations have the same 'Metadata' property value of '{0}'. The 'Target' property value of these operations must be set to a non-null value.. + /// + internal static string ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget { + get { + return ResourceManager.GetString("ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A relative URI value '{0}' was specified in the data to write, but the metadata document URI or the metadata for the item to be written was not specified for the writer. The metadata document URI and the metadata for the item to be written must be provided to the writer when using relative URI values.. + /// + internal static string ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata { + get { + return ResourceManager.GetString("ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{0}' properties were found in a service document. In OData, a service document must have exactly one '{0}' property.. + /// + internal static string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{0}' properties were found in a service document element. In OData, a service document element must have exactly one '{0}' property.. + /// + internal static string ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unrecognized instance annotation '{0}' was found in a '{1}' object in a service document. OData instance annotations are not allowed in workspaces.. + /// + internal static string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unrecognized instance annotation '{0}' was found in a service document element. OData instance annotations are not allowed in service document elements.. + /// + internal static string ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a service document element without a '{0}' property. In service documents, service document elements must contain a '{0}' property.. + /// + internal static string ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElem" + + "ent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No '{0}' property was found for a service document. In OData, a service document must have exactly one '{0}' property.. + /// + internal static string ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unrecognized property annotation '{0}' was found in a '{1}' object in a service document. OData property annotations are not allowed in workspaces.. + /// + internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unrecognized property annotation '{0}' was found in a service document element. OData property annotations are not allowed in service document elements.. + /// + internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a property annotation for the property '{0}' which wasn't immediately followed by the property. Property annotations must occur directly before the property being annotated.. + /// + internal static string ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered unexpected property '{0}' in a service document. The top level object of a service document may only have a '{1}' property.. + /// + internal static string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered unexpected property '{0}' in a service document element. In service documents, service document element may only have '{1}' and '{2}' properties.. + /// + internal static string ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement { + get { + return ResourceManager.GetString("ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a reference into metadata '{0}' which does not refer to the known metadata url '{1}'. Open metadata reference properties are not supported.. + /// + internal static string ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported { + get { + return ResourceManager.GetString("ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' property of the operation '{1}' cannot have a null value.. + /// + internal static string ODataJsonValidationUtils_OperationPropertyCannotBeNull { + get { + return ResourceManager.GetString("ODataJsonValidationUtils_OperationPropertyCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A raw value was not provided for an instance of ODataUntypedValue.. + /// + internal static string ODataJsonValueSerializer_MissingRawValueOnUntyped { + get { + return ResourceManager.GetString("ODataJsonValueSerializer_MissingRawValueOnUntyped", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A type name was not provided for an instance of ODataCollectionValue.. + /// + internal static string ODataJsonValueSerializer_MissingTypeNameOnCollection { + get { + return ResourceManager.GetString("ODataJsonValueSerializer_MissingTypeNameOnCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt to write an entity reference link inside a navigation link after a resource set has been written inside the same navigation link in a request was detected. In Json requests, all entity reference links inside a navigation link have to be written before all resource sets inside the same navigation link.. + /// + internal static string ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest { + get { + return ResourceManager.GetString("ODataJsonWriter_EntityReferenceLinkAfterResourceSetInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataResourceSet.InstanceAnnotations collection must be empty for expanded resource sets. Custom instance annotations are not supported on expanded resource sets.. + /// + internal static string ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet { + get { + return ResourceManager.GetString("ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified ODataJsonDateTimeFormat is not supported.. + /// + internal static string ODataJsonWriter_UnsupportedDateTimeFormat { + get { + return ResourceManager.GetString("ODataJsonWriter_UnsupportedDateTimeFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to serialize an object in a collection as it is not a supported ODataValue.. + /// + internal static string ODataJsonWriter_UnsupportedValueInCollection { + get { + return ResourceManager.GetString("ODataJsonWriter_UnsupportedValueInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of type '{0}' is not supported and cannot be converted to a JSON representation.. + /// + internal static string ODataJsonWriter_UnsupportedValueType { + get { + return ResourceManager.GetString("ODataJsonWriter_UnsupportedValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An attempt was made to modify the message. The message cannot be modified.. + /// + internal static string ODataMessage_MustNotModifyMessage { + get { + return ResourceManager.GetString("ODataMessage_MustNotModifyMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delta are only supported in responses.. + /// + internal static string ODataMessageReader_DeltaInRequest { + get { + return ResourceManager.GetString("ODataMessageReader_DeltaInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DetectPayloadKind or DetectPayloadKindAsync was called more than once; DetectPayloadKind or DetectPayloadKindAsync can only be called once.. + /// + internal static string ODataMessageReader_DetectPayloadKindMultipleTimes { + get { + return ResourceManager.GetString("ODataMessageReader_DetectPayloadKindMultipleTimes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The entity set can only be specified if metadata is made available to the reader.. + /// + internal static string ODataMessageReader_EntitySetSpecifiedWithoutMetadata { + get { + return ResourceManager.GetString("ODataMessageReader_EntitySetSpecifiedWithoutMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A top-level error cannot be read from request payloads. Top-level errors are only supported in responses.. + /// + internal static string ODataMessageReader_ErrorPayloadInRequest { + get { + return ResourceManager.GetString("ODataMessageReader_ErrorPayloadInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected type for a collection reader is of kind '{0}'. Only types of Primitive or ComplexType kind can be specified as the expected type for a collection reader.. + /// + internal static string ODataMessageReader_ExpectedCollectionTypeWrongKind { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedCollectionTypeWrongKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected type for property reading is of entity collection kind. Top-level properties can only be of primitive, complex, primitive collection or complex collection kind.. + /// + internal static string ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedPropertyTypeEntityCollectionKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected type for property reading is of entity kind. Top-level properties cannot be of entity type.. + /// + internal static string ODataMessageReader_ExpectedPropertyTypeEntityKind { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedPropertyTypeEntityKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected type for property reading is Edm.Stream. Top-level properties cannot be of stream type.. + /// + internal static string ODataMessageReader_ExpectedPropertyTypeStream { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedPropertyTypeStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The expected type can only be specified if metadata is made available to the reader.. + /// + internal static string ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedTypeSpecifiedWithoutMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The expected type for a value is of kind '{0}'. Only types of Primitive kind can be specified as the expected type for reading a value.. + /// + internal static string ODataMessageReader_ExpectedValueTypeWrongKind { + get { + return ResourceManager.GetString("ODataMessageReader_ExpectedValueTypeWrongKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GetFormat was called before reading was started. GetFormat can only be called after a read method was called or a reader was created.. + /// + internal static string ODataMessageReader_GetFormatCalledBeforeReadingStarted { + get { + return ResourceManager.GetString("ODataMessageReader_GetFormatCalledBeforeReadingStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A metadata document cannot be read from request payloads. Metadata documents are only supported in responses.. + /// + internal static string ODataMessageReader_MetadataDocumentInRequest { + get { + return ResourceManager.GetString("ODataMessageReader_MetadataDocumentInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A missing or empty content type header was found when trying to read a message. The content type header is required.. + /// + internal static string ODataMessageReader_NoneOrEmptyContentTypeHeader { + get { + return ResourceManager.GetString("ODataMessageReader_NoneOrEmptyContentTypeHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation import can only be specified if metadata is made available to the reader.. + /// + internal static string ODataMessageReader_OperationImportSpecifiedWithoutMetadata { + get { + return ResourceManager.GetString("ODataMessageReader_OperationImportSpecifiedWithoutMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation can only be specified if metadata is made available to the reader.. + /// + internal static string ODataMessageReader_OperationSpecifiedWithoutMetadata { + get { + return ResourceManager.GetString("ODataMessageReader_OperationSpecifiedWithoutMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A parameter payload cannot be read from a response payload. Parameter payloads are only supported in requests.. + /// + internal static string ODataMessageReader_ParameterPayloadInResponse { + get { + return ResourceManager.GetString("ODataMessageReader_ParameterPayloadInResponse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMessageReader is using the server behavior for WCF Data Services, as specified in its settings. Payload kind detection is not supported when using the WCF Data services server behavior.. + /// + internal static string ODataMessageReader_PayloadKindDetectionInServerMode { + get { + return ResourceManager.GetString("ODataMessageReader_PayloadKindDetectionInServerMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Payload kind detection has not completed. Read or create methods cannot be called on the ODataMessageReader before payload kind detection is complete.. + /// + internal static string ODataMessageReader_PayloadKindDetectionRunning { + get { + return ResourceManager.GetString("ODataMessageReader_PayloadKindDetectionRunning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMessageReader has already been used to read a message payload. An ODataMessageReader can only be used once to read a payload for a given message.. + /// + internal static string ODataMessageReader_ReaderAlreadyUsed { + get { + return ResourceManager.GetString("ODataMessageReader_ReaderAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A service document cannot be read from request payloads. Service documents are only supported in responses.. + /// + internal static string ODataMessageReader_ServiceDocumentInRequest { + get { + return ResourceManager.GetString("ODataMessageReader_ServiceDocumentInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' with singleton cardinality on type '{1}' was specified for reading a collection of entity reference links. A navigation property with collection cardinality has to be provided.. + /// + internal static string ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks { + get { + return ResourceManager.GetString("ODataMessageReader_SingletonNavigationPropertyForEntityReferenceLinks", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The wildcard '*' was detected in the value '{0}' of the content type header. The value of the content type header cannot contain wildcards.. + /// + internal static string ODataMessageReader_WildcardInContentType { + get { + return ResourceManager.GetString("ODataMessageReader_WildcardInContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write async in request payload.. + /// + internal static string ODataMessageWriter_AsyncInRequest { + get { + return ResourceManager.GetString("ODataMessageWriter_AsyncInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The requested buffer capacity {0} exceeds the max buffer size.. + /// + internal static string ODataMessageWriter_Buffer_Maximum_Size_Exceeded { + get { + return ResourceManager.GetString("ODataMessageWriter_Buffer_Maximum_Size_Exceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot set message headers for the invalid payload kind '{0}'.. + /// + internal static string ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotSetHeadersWithInvalidPayloadKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings when CreateODataParameterWriter is called with a non-null operation.. + /// + internal static string ODataMessageWriter_CannotSpecifyOperationWithoutModel { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotSpecifyOperationWithoutModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The WriteError method or the WriteErrorAsync method on ODataMessageWriter cannot be called after the WriteValue method or the WriteValueAsync method is called. In OData, writing an in-stream error for raw values is not supported.. + /// + internal static string ODataMessageWriter_CannotWriteInStreamErrorForRawValues { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotWriteInStreamErrorForRawValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings in order to write a metadata document.. + /// + internal static string ODataMessageWriter_CannotWriteMetadataWithoutModel { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotWriteMetadataWithoutModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write the value 'null' in raw format.. + /// + internal static string ODataMessageWriter_CannotWriteNullInRawFormat { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotWriteNullInRawFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream property '{0}' cannot be written to the payload as a top level property.. + /// + internal static string ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotWriteStreamPropertyAsTopLevelProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write the value 'null' in top level property; return 204 instead.. + /// + internal static string ODataMessageWriter_CannotWriteTopLevelNull { + get { + return ResourceManager.GetString("ODataMessageWriter_CannotWriteTopLevelNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write delta in request payload.. + /// + internal static string ODataMessageWriter_DeltaInRequest { + get { + return ResourceManager.GetString("ODataMessageWriter_DeltaInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Top-level entity reference link collection payloads are not allowed in requests.. + /// + internal static string ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed { + get { + return ResourceManager.GetString("ODataMessageWriter_EntityReferenceLinksInRequestNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error cannot be written to a request payload. Errors are only supported in responses.. + /// + internal static string ODataMessageWriter_ErrorPayloadInRequest { + get { + return ResourceManager.GetString("ODataMessageWriter_ErrorPayloadInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The payload kind '{0}' used in the last call to ODataUtils.SetHeadersForPayload is incompatible with the payload being written, which is of kind '{1}'.. + /// + internal static string ODataMessageWriter_IncompatiblePayloadKinds { + get { + return ResourceManager.GetString("ODataMessageWriter_IncompatiblePayloadKinds", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A JsonPaddingFunctionName was specified, but the content-type '{0}' is not supported with Json Padding.. + /// + internal static string ODataMessageWriter_JsonPaddingOnInvalidContentType { + get { + return ResourceManager.GetString("ODataMessageWriter_JsonPaddingOnInvalidContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided implementation of IJsonWriterFactory returned null for arguments: isIeee754Compatible '{0}', encoding '{1}'. The factory should return a concrete IJsonWriter implementation.. + /// + internal static string ODataMessageWriter_JsonWriterFactory_ReturnedNull { + get { + return ResourceManager.GetString("ODataMessageWriter_JsonWriterFactory_ReturnedNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A metadata document cannot be written to request payloads. Metadata documents are only supported in responses.. + /// + internal static string ODataMessageWriter_MetadataDocumentInRequest { + get { + return ResourceManager.GetString("ODataMessageWriter_MetadataDocumentInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' specified as the collection's item type is not primitive, enum or complex. An ODataCollectionWriter can only write collections of primitive, enum or complex values.. + /// + internal static string ODataMessageWriter_NonCollectionType { + get { + return ResourceManager.GetString("ODataMessageWriter_NonCollectionType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not allowed to write top level property '{0}' with 'ODataResourceValue' or collection of resource value.. + /// + internal static string ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue { + get { + return ResourceManager.GetString("ODataMessageWriter_NotAllowedWriteTopLevelPropertyWithResourceValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A service document cannot be written to request payloads. Service documents are only supported in responses.. + /// + internal static string ODataMessageWriter_ServiceDocumentInRequest { + get { + return ResourceManager.GetString("ODataMessageWriter_ServiceDocumentInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The WriteError method or the WriteErrorAsync method on the ODataMessageWriter has already been called to write an error payload. Only a single error payload can be written with each ODataMessageWriter instance.. + /// + internal static string ODataMessageWriter_WriteErrorAlreadyCalled { + get { + return ResourceManager.GetString("ODataMessageWriter_WriteErrorAlreadyCalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMessageWriter has already been used to write a message payload. An ODataMessageWriter can only be used once to write a payload for a given message.. + /// + internal static string ODataMessageWriter_WriterAlreadyUsed { + get { + return ResourceManager.GetString("ODataMessageWriter_WriterAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Both startResourceXmlCustomizationCallback and endResourceXmlCustomizationCallback must be either null or non-null.. + /// + internal static string ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSpecifiedBoth { + get { + return ResourceManager.GetString("ODataMessageWriterSettings_MessageWriterSettingsXmlCustomizationCallbacksMustBeSp" + + "ecifiedBoth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required.. + /// + internal static string ODataMetadataBuilder_MissingEntityInstanceUri { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingEntityInstanceUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required.. + /// + internal static string ODataMetadataBuilder_MissingEntitySetUri { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingEntitySetUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parent id or contained context url is missing which is required to compute id for contained instance. Specify ODataUri in the ODataMessageWriterSettings or return parent id or context url in the payload.. + /// + internal static string ODataMetadataBuilder_MissingParentIdOrContextUrl { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingParentIdOrContextUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments.. + /// + internal static string ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix { + get { + return ResourceManager.GetString("ODataMetadataBuilder_MissingSegmentForEntitySetUriSuffix", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Id cannot be computed, since the navigation source '{0}' cannot be resolved to a known entity set from model.. + /// + internal static string ODataMetadataBuilder_UnknownEntitySet { + get { + return ResourceManager.GetString("ODataMetadataBuilder_UnknownEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The metadata document could not be read from the message content.{0}. + /// + internal static string ODataMetadataInputContext_ErrorReadingMetadata { + get { + return ResourceManager.GetString("ODataMetadataInputContext_ErrorReadingMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The metadata document could not be written as specified.\r\n{0}. + /// + internal static string ODataMetadataOutputContext_ErrorWritingMetadata { + get { + return ResourceManager.GetString("ODataMetadataOutputContext_ErrorWritingMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The JSON metadata is not supported at this platform. It's only supported at platform implementing .NETStardard 2.0.. + /// + internal static string ODataMetadataOutputContext_NotSupportJsonMetadata { + get { + return ResourceManager.GetString("ODataMetadataOutputContext_NotSupportJsonMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ServiceRoot property in ODataMessageWriterSettings.ODataUri must be set when writing a payload.. + /// + internal static string ODataOutputContext_MetadataDocumentUriMissing { + get { + return ResourceManager.GetString("ODataOutputContext_MetadataDocumentUriMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The format '{0}' does not support writing a payload of kind '{1}'.. + /// + internal static string ODataOutputContext_UnsupportedPayloadKindForFormat { + get { + return ResourceManager.GetString("ODataOutputContext_UnsupportedPayloadKindForFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous.. + /// + internal static string ODataParameterReaderCore_AsyncCallOnSyncReader { + get { + return ResourceManager.GetString("ODataParameterReaderCore_AsyncCallOnSyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' method has already been called for the parameter '{1}'. Only one create reader method call is allowed for each resource, resource set, or collection parameter.. + /// + internal static string ODataParameterReaderCore_CreateReaderAlreadyCalled { + get { + return ResourceManager.GetString("ODataParameterReaderCore_CreateReaderAlreadyCalled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple parameters with the name '{0}' were found in the request payload.. + /// + internal static string ODataParameterReaderCore_DuplicateParametersInPayload { + get { + return ResourceManager.GetString("ODataParameterReaderCore_DuplicateParametersInPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot call the method '{0}' in state '{1}'.. + /// + internal static string ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState { + get { + return ResourceManager.GetString("ODataParameterReaderCore_InvalidCreateReaderMethodCalledForState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' in the request payload is not a valid parameter for the operation '{1}'.. + /// + internal static string ODataParameterReaderCore_ParameterNameNotInMetadata { + get { + return ResourceManager.GetString("ODataParameterReaderCore_ParameterNameNotInMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One or more parameters of the operation '{0}' are missing from the request payload. The missing parameters are: {1}.. + /// + internal static string ODataParameterReaderCore_ParametersMissingInPayload { + get { + return ResourceManager.GetString("ODataParameterReaderCore_ParametersMissingInPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'.. + /// + internal static string ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState { + get { + return ResourceManager.GetString("ODataParameterReaderCore_ReadOrReadAsyncCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state. '{1}' must be called in this state, and the created reader must be in the 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called.. + /// + internal static string ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextReadOrReadAsyncCall { + get { + return ResourceManager.GetString("ODataParameterReaderCore_SubReaderMustBeCreatedAndReadToCompletionBeforeTheNextRe" + + "adOrReadAsyncCall", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state and '{1}' was called but the created reader is not in the 'Completed' state. The created reader must be in 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called.. + /// + internal static string ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAsyncCall { + get { + return ResourceManager.GetString("ODataParameterReaderCore_SubReaderMustBeInCompletedStateBeforeTheNextReadOrReadAs" + + "yncCall", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous.. + /// + internal static string ODataParameterReaderCore_SyncCallOnAsyncReader { + get { + return ResourceManager.GetString("ODataParameterReaderCore_SyncCallOnAsyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CreateParameterWriter was called on a response message. A parameter payload is only allowed in a request message.. + /// + internal static string ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage { + get { + return ResourceManager.GetString("ODataParameterWriter_CannotCreateParameterWriterOnResponseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Writing an in-stream error is not supported when writing a parameter payload.. + /// + internal static string ODataParameterWriter_InStreamErrorNotSupported { + get { + return ResourceManager.GetString("ODataParameterWriter_InStreamErrorNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous.. + /// + internal static string ODataParameterWriterCore_AsyncCallOnSyncWriter { + get { + return ResourceManager.GetString("ODataParameterWriterCore_AsyncCallOnSyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateCollectionWriter on a parameter that is not of Edm type kind 'Collection'.. + /// + internal static string ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceSetWriter on a parameter that is not of Edm type kind 'Collection(Entity)' or 'Collection(Complex)'.. + /// + internal static string ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTy" + + "peKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceWriter on a parameter that is not of Edm type kind 'Entity' or 'Complex'.. + /// + internal static string ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WriteEnd can only be called after WriteStart and after the previously created sub-writer has completed.. + /// + internal static string ODataParameterWriterCore_CannotWriteEnd { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The writer is in either the 'Error' or 'Completed' state. No further writes can be performed on this writer.. + /// + internal static string ODataParameterWriterCore_CannotWriteInErrorOrCompletedState { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteInErrorOrCompletedState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WriteValue and CreateCollectionWriter can only be called after WriteStart and before WriteEnd; they cannot be called until the previously created sub-writer is completed.. + /// + internal static string ODataParameterWriterCore_CannotWriteParameter { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WriteStart can only be called once, and it must be called before writing anything else.. + /// + internal static string ODataParameterWriterCore_CannotWriteStart { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value for parameter '{0}' is of type '{1}'. WriteValue can only write null, ODataEnumValue and primitive types that are not Stream type.. + /// + internal static string ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteValueOnNonSupportedValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' is of Edm type kind '{1}'. You cannot call WriteValue on a parameter that is not of Edm type kinds 'Primitive' or 'Enum'.. + /// + internal static string ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind { + get { + return ResourceManager.GetString("ODataParameterWriterCore_CannotWriteValueOnNonValueTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' has already been written. Duplicate parameter names are not allowed in the parameter payload.. + /// + internal static string ODataParameterWriterCore_DuplicatedParameterNameNotAllowed { + get { + return ResourceManager.GetString("ODataParameterWriterCore_DuplicatedParameterNameNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameters {0} of the operation '{1}' could not be found when writing the parameter payload. All parameters present in the operation must be written to the parameter payload.. + /// + internal static string ODataParameterWriterCore_MissingParameterInParameterPayload { + get { + return ResourceManager.GetString("ODataParameterWriterCore_MissingParameterInParameterPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name '{0}' is not a recognized parameter name for operation '{1}'.. + /// + internal static string ODataParameterWriterCore_ParameterNameNotFoundInOperation { + get { + return ResourceManager.GetString("ODataParameterWriterCore_ParameterNameNotFoundInOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous.. + /// + internal static string ODataParameterWriterCore_SyncCallOnAsyncWriter { + get { + return ResourceManager.GetString("ODataParameterWriterCore_SyncCallOnAsyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create an ODataPrimitiveValue from null; use ODataNullValue instead.. + /// + internal static string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull { + get { + return ResourceManager.GetString("ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataPrimitiveValue was instantiated with a value of type '{0}'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types.. + /// + internal static string ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType { + get { + return ResourceManager.GetString("ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The element with name '{0}' is not a valid collection item. The name of the collection item element must be 'element' and it must belong to the '{1}' namespace.. + /// + internal static string ODataPropertyAndValueDeserializer_InvalidCollectionElement { + get { + return ResourceManager.GetString("ODataPropertyAndValueDeserializer_InvalidCollectionElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' was found in the {{http://docs.oasis-open.org/odata/ns/metadata}}:properties element, and it is declared as a navigation property.. + /// + internal static string ODataPropertyAndValueDeserializer_NavigationPropertyInProperties { + get { + return ResourceManager.GetString("ODataPropertyAndValueDeserializer_NavigationPropertyInProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataReaderCore_AsyncCallOnSyncReader { + get { + return ResourceManager.GetString("ODataReaderCore_AsyncCallOnSyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CreateReadStream was called in an invalid state. CreateReadStream can only be called once in ReaderState.Stream.. + /// + internal static string ODataReaderCore_CreateReadStreamCalledInInvalidState { + get { + return ResourceManager.GetString("ODataReaderCore_CreateReadStreamCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CreateTextReader was called in an invalid state. CreateTextReader can only be called once in ReaderState.Stream.. + /// + internal static string ODataReaderCore_CreateTextReaderCalledInInvalidState { + get { + return ResourceManager.GetString("ODataReaderCore_CreateTextReaderCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calling Read or ReadAsync on an ODataReader instance is not allowed in state '{0}'.. + /// + internal static string ODataReaderCore_NoReadCallsAllowed { + get { + return ResourceManager.GetString("ODataReaderCore_NoReadCallsAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Read called with an open stream or textreader. Please close any open streams or text readers before calling Read.. + /// + internal static string ODataReaderCore_ReadCalledWithOpenStream { + get { + return ResourceManager.GetString("ODataReaderCore_ReadCalledWithOpenStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataReader.ReadAsync or ODataReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'.. + /// + internal static string ODataReaderCore_ReadOrReadAsyncCalledInInvalidState { + get { + return ResourceManager.GetString("ODataReaderCore_ReadOrReadAsyncCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataReaderCore_SyncCallOnAsyncReader { + get { + return ResourceManager.GetString("ODataReaderCore_SyncCallOnAsyncReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was requested on an IODataRequestMessage instance. For asynchronous operations to succeed, the request message instance must implement IODataRequestMessageAsync.. + /// + internal static string ODataRequestMessage_AsyncNotAvailable { + get { + return ResourceManager.GetString("ODataRequestMessage_AsyncNotAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The IODataRequestMessage.GetStream or IODataRequestMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream.. + /// + internal static string ODataRequestMessage_MessageStreamIsNull { + get { + return ResourceManager.GetString("ODataRequestMessage_MessageStreamIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The IODataRequestMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null.. + /// + internal static string ODataRequestMessage_StreamTaskIsNull { + get { + return ResourceManager.GetString("ODataRequestMessage_StreamTaskIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of a property '{0}' in ODataResource cannot be of type ODataResourceValue or collection of ODataResourceValue.. + /// + internal static string ODataResource_PropertyValueCannotBeODataResourceValue { + get { + return ResourceManager.GetString("ODataResource_PropertyValueCannotBeODataResourceValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataResource of type '{0}' is found without key properties. When writing without a user model, each resource must contain at least one property whose 'ODataProperty.SerializationInfo.PropertyKind' set to 'ODataPropertyKind.Key'. When writing with a user model, the entity type '{0}' defined in the model must define at least one key property.. + /// + internal static string ODataResourceMetadataContext_EntityTypeWithNoKeyProperties { + get { + return ResourceManager.GetString("ODataResourceMetadataContext_EntityTypeWithNoKeyProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' is a non-primitive value. All key and etag properties must be of primitive types.. + /// + internal static string ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues { + get { + return ResourceManager.GetString("ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key property '{0}' on type '{1}' has a null value. Key properties must not have null values.. + /// + internal static string ODataResourceMetadataContext_NullKeyValue { + get { + return ResourceManager.GetString("ODataResourceMetadataContext_NullKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource set may contain a next page link, a delta link or neither, but must not contain both.. + /// + internal static string ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink { + get { + return ResourceManager.GetString("ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When writing a JSON response, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResourceSerializationInfo must be set on the ODataResource or ODataResourceSet that is being written.. + /// + internal static string ODataResourceTypeContext_MetadataOrSerializationInfoMissing { + get { + return ResourceManager.GetString("ODataResourceTypeContext_MetadataOrSerializationInfoMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When writing a JSON response in full metadata mode, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResource.TypeName must be set.. + /// + internal static string ODataResourceTypeContext_ODataResourceTypeNameMissing { + get { + return ResourceManager.GetString("ODataResourceTypeContext_ODataResourceTypeNameMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was requested on an IODataResponseMessage instance. For asynchronous operations to succeed, the response message instance must implement IODataResponseMessageAsync.. + /// + internal static string ODataResponseMessage_AsyncNotAvailable { + get { + return ResourceManager.GetString("ODataResponseMessage_AsyncNotAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The IODataResponseMessage.GetStream or IODataResponseMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream.. + /// + internal static string ODataResponseMessage_MessageStreamIsNull { + get { + return ResourceManager.GetString("ODataResponseMessage_MessageStreamIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The IODataResponseMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null.. + /// + internal static string ODataResponseMessage_StreamTaskIsNull { + get { + return ResourceManager.GetString("ODataResponseMessage_StreamTaskIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to TypeSegment cannot be the only segment in a $select.. + /// + internal static string ODataSelectPath_CannotOnlyHaveTypeSegment { + get { + return ResourceManager.GetString("ODataSelectPath_CannotOnlyHaveTypeSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a segment of type '{0} in a select path, but only TypeSegment, NavigationPropertySegment, PropertySegment, OperationSegment or OpenPropertySegments are allowed.. + /// + internal static string ODataSelectPath_InvalidSelectPathSegmentType { + get { + return ResourceManager.GetString("ODataSelectPath_InvalidSelectPathSegmentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A navigation property can only be the last segment in $select.. + /// + internal static string ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment { + get { + return ResourceManager.GetString("ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An operation can only be the last segment in $select.. + /// + internal static string ODataSelectPath_OperationSegmentCanOnlyBeLastSegment { + get { + return ResourceManager.GetString("ODataSelectPath_OperationSegmentCanOnlyBeLastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is not a valid count option.. + /// + internal static string ODataUriParser_InvalidCount { + get { + return ResourceManager.GetString("ODataUriParser_InvalidCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An error occurred while parsing part of the URI.. + /// + internal static string ODataUriParserException_GeneralError { + get { + return ResourceManager.GetString("ODataUriParserException_GeneralError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type verification failed. Expected non-nullable type '{0}' but received a null value.. + /// + internal static string ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type verification failed. Expected type '{0}' but received non-matching null value with associated type '{1}'.. + /// + internal static string ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertFromUriLiteralNullTypeVerificationFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The overflow exception caught for expected type '{0}'. '{1}'.. + /// + internal static string ODataUriUtils_ConvertFromUriLiteralOverflowNumber { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertFromUriLiteralOverflowNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An IEdmTypeReference must be provided with a matching IEdmModel. No model was provided.. + /// + internal static string ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type verification failed. Expected type '{0}' but received the value '{1}'.. + /// + internal static string ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not supported when converting to a URI literal.. + /// + internal static string ODataUriUtils_ConvertToUriLiteralUnsupportedType { + get { + return ResourceManager.GetString("ODataUriUtils_ConvertToUriLiteralUnsupportedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception thrown by invalid rule {0}. {1}. + /// + internal static string ODataUrlValidationError_InvalidRule { + get { + return ResourceManager.GetString("ODataUrlValidationError_InvalidRule", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is missing a $select clause. All property paths, expands, and selects of complex types should include a $select statement.. + /// + internal static string ODataUrlValidationError_SelectRequired { + get { + return ResourceManager.GetString("ODataUrlValidationError_SelectRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of type '{0}' could not be converted to a raw string.. + /// + internal static string ODataUtils_CannotConvertValueToRawString { + get { + return ResourceManager.GetString("ODataUtils_CannotConvertValueToRawString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A default MIME type could not be found for the requested payload in format '{0}'.. + /// + internal static string ODataUtils_DidNotFindDefaultMediaType { + get { + return ResourceManager.GetString("ODataUtils_DidNotFindDefaultMediaType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An OData version of {0} was specified and the maximum supported OData version is {1}.. + /// + internal static string ODataUtils_MaxProtocolVersionExceeded { + get { + return ResourceManager.GetString("ODataUtils_MaxProtocolVersionExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided model does not contain an entity container.. + /// + internal static string ODataUtils_ModelDoesNotHaveContainer { + get { + return ResourceManager.GetString("ODataUtils_ModelDoesNotHaveContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' of the OData-Version HTTP header is invalid. Only '4.0' and '4.01' are supported as values for the OData-Version header.. + /// + internal static string ODataUtils_UnsupportedVersionHeader { + get { + return ResourceManager.GetString("ODataUtils_UnsupportedVersionHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid enum value was specified for the version number.. + /// + internal static string ODataUtils_UnsupportedVersionNumber { + get { + return ResourceManager.GetString("ODataUtils_UnsupportedVersionNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A relative URI value '{0}' was specified in the data to write, but a base URI was not specified for the writer. A base URI must be set when using relative URI values.. + /// + internal static string ODataWriter_RelativeUriUsedWithoutBaseUriSpecified { + get { + return ResourceManager.GetString("ODataWriter_RelativeUriUsedWithoutBaseUriSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' is a stream property, but it is not a property of an ODataResource instance. In OData, stream properties must be properties of ODataResource instances.. + /// + internal static string ODataWriter_StreamPropertiesMustBePropertiesOfODataResource { + get { + return ResourceManager.GetString("ODataWriter_StreamPropertiesMustBePropertiesOfODataResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An asynchronous operation was called on a synchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataWriterCore_AsyncCallOnSyncWriter { + get { + return ResourceManager.GetString("ODataWriterCore_AsyncCallOnSyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write a deleted resource, link, deleted link, or nested delta resource set within a resource set; they must be written within a delta resource set.. + /// + internal static string ODataWriterCore_CannotWriteDeltaWithResourceSetWriter { + get { + return ResourceManager.GetString("ODataWriterCore_CannotWriteDeltaWithResourceSetWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write a top-level resource set with a writer that was created to write a top-level resource.. + /// + internal static string ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter { + get { + return ResourceManager.GetString("ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot write a top-level resource with a writer that was created to write a top-level resource set.. + /// + internal static string ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter { + get { + return ResourceManager.GetString("ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A deferred link was written into a request. In requests, each nested resource info must have a resource set, resource, or entity reference link written into it.. + /// + internal static string ODataWriterCore_DeferredLinkInRequest { + get { + return ResourceManager.GetString("ODataWriterCore_DeferredLinkInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataResourceSet.DeltaLink property must be null for expanded resource sets. Delta link is not supported on expanded resource sets.. + /// + internal static string ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet { + get { + return ResourceManager.GetString("ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Id or key properties were found. A resource in a delta payload requires an ID or key properties be specified.. + /// + internal static string ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties { + get { + return ResourceManager.GetString("ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity reference link was written without a surrounding navigation link. The WriteEntityReferenceLink or WriteEntityReferenceLinkAsync methods can only be used when writing the content of a navigation link.. + /// + internal static string ODataWriterCore_EntityReferenceLinkWithoutNavigationLink { + get { + return ResourceManager.GetString("ODataWriterCore_EntityReferenceLinkWithoutNavigationLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid state transition has been detected in an OData writer. Cannot transition from state '{0}' to state '{1}'.. + /// + internal static string ODataWriterCore_InvalidStateTransition { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidStateTransition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}' when writing an OData 4.0 payload. To write content to a deleted resource, please specify ODataVersion 4.01 or greater in MessageWriterSettings.. + /// + internal static string ODataWriterCore_InvalidTransitionFrom40DeletedResource { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFrom40DeletedResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. Nothing further can be written once the writer has completed.. + /// + internal static string ODataWriterCore_InvalidTransitionFromCompleted { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. Nothing can be written once the writer entered the error state.. + /// + internal static string ODataWriterCore_InvalidTransitionFromError { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set.. + /// + internal static string ODataWriterCore_InvalidTransitionFromExpandedLink { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromExpandedLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. You must first call ODataWriter.WriteEnd to finish writing a null ODataResource.. + /// + internal static string ODataWriterCore_InvalidTransitionFromNullResource { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromNullResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a property or a nested resource.. + /// + internal static string ODataWriterCore_InvalidTransitionFromResource { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a resource.. + /// + internal static string ODataWriterCore_InvalidTransitionFromResourceSet { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set.. + /// + internal static string ODataWriterCore_InvalidTransitionFromStart { + get { + return ResourceManager.GetString("ODataWriterCore_InvalidTransitionFromStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one item was written into the content of a nested resource. In OData, a nested resource can only contain more than one item in its content when ODataNestedResourceInfo.IsCollection set to true, and the writer is writing a request.. + /// + internal static string ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent { + get { + return ResourceManager.GetString("ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nested content is not allowed in an OData 4.0 deleted entry. For content in deleted entries, please specify OData 4.01 or greater.. + /// + internal static string ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry { + get { + return ResourceManager.GetString("ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Path property in ODataMessageWriterSettings.ODataUri must be set when writing contained elements.. + /// + internal static string ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement { + get { + return ResourceManager.GetString("ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Attempted to write a value for a property {0} whose value has already been written.. + /// + internal static string ODataWriterCore_PropertyValueAlreadyWritten { + get { + return ResourceManager.GetString("ODataWriterCore_PropertyValueAlreadyWritten", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataResourceSet.Count must be null for request payloads. Query counts are only supported in responses.. + /// + internal static string ODataWriterCore_QueryCountInRequest { + get { + return ResourceManager.GetString("ODataWriterCore_QueryCountInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The DeltaLink must be null for request payloads. Delta links are only supported in responses.. + /// + internal static string ODataWriterCore_QueryDeltaLinkInRequest { + get { + return ResourceManager.GetString("ODataWriterCore_QueryDeltaLinkInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The NextPageLink must be null for request payloads. Next page links are only supported in responses.. + /// + internal static string ODataWriterCore_QueryNextLinkInRequest { + get { + return ResourceManager.GetString("ODataWriterCore_QueryNextLinkInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataWriter.Write or ODataWriter.WriteEnd was called while streaming a value. Stream or TextWriter must be disposed before calling additional methods on ODataWriter.. + /// + internal static string ODataWriterCore_StreamNotDisposed { + get { + return ResourceManager.GetString("ODataWriterCore_StreamNotDisposed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A synchronous operation was called on an asynchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous.. + /// + internal static string ODataWriterCore_SyncCallOnAsyncWriter { + get { + return ResourceManager.GetString("ODataWriterCore_SyncCallOnAsyncWriter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ODataWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Resource', 'ResourceSet', 'NavigationLink', and 'NavigationLinkWithContent'.. + /// + internal static string ODataWriterCore_WriteEndCalledInInvalidState { + get { + return ResourceManager.GetString("ODataWriterCore_WriteEndCalledInInvalidState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A relative URI value '{0}' was specified in the payload, but no base URI for it was found. When the payload contains a relative URI, there must be an xml:base in the payload or else a base URI must specified in the reader settings.. + /// + internal static string ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified { + get { + return ResourceManager.GetString("ODataXmlDeserializer_RelativeUriUsedWithoutBaseUriSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in a top-level error value. In OData, the value of a top-level error value can have no more than one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element. + /// + internal static string ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName { + get { + return ResourceManager.GetString("ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in an inner error value. In OData, the value of an inner error value can have at most one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element.. + /// + internal static string ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName { + get { + return ResourceManager.GetString("ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'type' attribute on element {{http://www.w3.org/2005/Atom}}:content is either missing or has an invalid value '{0}'. Only 'application/xml' and 'application/atom+xml' are supported as the value of the 'type' attribute on the {{http://www.w3.org/2005/Atom}}:content element.. + /// + internal static string ODataXmlResourceDeserializer_ContentWithWrongType { + get { + return ResourceManager.GetString("ODataXmlResourceDeserializer_ContentWithWrongType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open navigation properties are not supported on OpenTypes. Property name: '{0}'.. + /// + internal static string OpenNavigationPropertiesNotSupportedOnOpenTypes { + get { + return ResourceManager.GetString("OpenNavigationPropertiesNotSupportedOnOpenTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The return type from the operation is not possible with the given entity set.. + /// + internal static string OperationSegment_CannotReturnNull { + get { + return ResourceManager.GetString("OperationSegment_CannotReturnNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No type could be computed for this Segment since there were multiple possible operations with varying return types.. + /// + internal static string OperationSegment_ReturnTypeForMultipleOverloads { + get { + return ResourceManager.GetString("OperationSegment_ReturnTypeForMultipleOverloads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $value cannot be applied to a collection.. + /// + internal static string PathParser_CannotUseValueOnCollection { + get { + return ResourceManager.GetString("PathParser_CannotUseValueOnCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. $ref cannot be applied to the segment '{0}' since $ref can only follow an entity segment or entity collection segment.. + /// + internal static string PathParser_EntityReferenceNotSupported { + get { + return ResourceManager.GetString("PathParser_EntityReferenceNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type cast segment '{0}' after a collection which is not of entity or complex type is not allowed.. + /// + internal static string PathParser_TypeCastOnlyAllowedAfterStructuralCollection { + get { + return ResourceManager.GetString("PathParser_TypeCastOnlyAllowedAfterStructuralCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type cast segment '{0}' on {1} '{2}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation.. + /// + internal static string PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint { + get { + return ResourceManager.GetString("PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' does not inherit from and is not a base type of '{1}'. The type of '{2}' must be related to the Type of the EntitySet.. + /// + internal static string PathParser_TypeMustBeRelatedToSet { + get { + return ResourceManager.GetString("PathParser_TypeMustBeRelatedToSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information.. + /// + internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone { + get { + return ResourceManager.GetString("PlatformHelper_DateTimeOffsetMustContainTimeZone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An annotation with name '{0}' for property '{1}' was detected after the property, or after an annotation for another property. In OData, annotations for a property must be in a single group and must appear before the property they annotate.. + /// + internal static string PropertyAnnotationAfterTheProperty { + get { + return ResourceManager.GetString("PropertyAnnotationAfterTheProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Query option '{0}' was specified more than once, but it must be specified at most once.. + /// + internal static string QueryOptionUtils_QueryParameterMustBeSpecifiedOnce { + get { + return ResourceManager.GetString("QueryOptionUtils_QueryParameterMustBeSpecifiedOnce", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value returned by the '{0}' property cannot be modified until the end of the owning resource is reported by the reader.. + /// + internal static string ReaderUtils_EnumerableModified { + get { + return ResourceManager.GetString("ReaderUtils_EnumerableModified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert the literal '{0}' to the expected type '{1}'.. + /// + internal static string ReaderValidationUtils_CannotConvertPrimitiveValue { + get { + return ResourceManager.GetString("ReaderValidationUtils_CannotConvertPrimitiveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' refers to the item type '{1}' which is not assignable to the expected item type '{2}'.. + /// + internal static string ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType { + get { + return ResourceManager.GetString("ReaderValidationUtils_ContextUriDoesNotReferTypeAssignableToExpectedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the entity set with name '{1}'; however, the name of the expected entity set is '{2}' and does not match the entity set referenced in the context URI.. + /// + internal static string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet { + get { + return ResourceManager.GetString("ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the entity type with name '{1}'; however, the name of the expected entity type is '{2}' which is not compatible with the entity type with name '{1}'.. + /// + internal static string ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType { + get { + return ResourceManager.GetString("ReaderValidationUtils_ContextUriValidationInvalidExpectedEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the declaring type of the expected property is '{3}'.. + /// + internal static string ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes { + get { + return ResourceManager.GetString("ReaderValidationUtils_ContextUriValidationNonMatchingDeclaringTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the name of the expected property is '{3}'.. + /// + internal static string ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames { + get { + return ResourceManager.GetString("ReaderValidationUtils_ContextUriValidationNonMatchingPropertyNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No URI value was found for an entity reference link. A single URI value was expected.. + /// + internal static string ReaderValidationUtils_EntityReferenceLinkMissingUri { + get { + return ResourceManager.GetString("ReaderValidationUtils_EntityReferenceLinkMissingUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base URI '{0}' specified in ODataMessageReaderSettings.BaseUri is invalid; it must be either null or an absolute URI.. + /// + internal static string ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute { + get { + return ResourceManager.GetString("ReaderValidationUtils_MessageReaderSettingsBaseUriMustBeNullOrAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property or operation import name '{0}' was read from the payload; however, the name of the expected property or operation import is '{1}'.. + /// + internal static string ReaderValidationUtils_NonMatchingPropertyNames { + get { + return ResourceManager.GetString("ReaderValidationUtils_NonMatchingPropertyNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values.. + /// + internal static string ReaderValidationUtils_NullNamedValueForNonNullableType { + get { + return ResourceManager.GetString("ReaderValidationUtils_NullNamedValueForNonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=True]'. The expected type '{1}[Nullable=True]' cannot be null but it can have null values.. + /// + internal static string ReaderValidationUtils_NullNamedValueForNullableType { + get { + return ResourceManager.GetString("ReaderValidationUtils_NullNamedValueForNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was found with the expected type '{0}[Nullable=False]'. The expected type '{0}[Nullable=False]' does not allow null values.. + /// + internal static string ReaderValidationUtils_NullValueForNonNullableType { + get { + return ResourceManager.GetString("ReaderValidationUtils_NullValueForNonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was found for a collection of type '{0}[Nullable=True]. Collection-valued properties with Nullable=True can contain null values, but collection-valued properties cannot themselves be null.. + /// + internal static string ReaderValidationUtils_NullValueForNullableType { + get { + return ResourceManager.GetString("ReaderValidationUtils_NullValueForNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.. + /// + internal static string ReaderValidationUtils_ResourceWithoutType { + get { + return ResourceManager.GetString("ReaderValidationUtils_ResourceWithoutType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The context URI '{0}' references the type '{1}'; however the expected type is '{2}'.. + /// + internal static string ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType { + get { + return ResourceManager.GetString("ReaderValidationUtils_TypeInContextUriDoesNotMatchExpectedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds is not set to ODataUndeclaredPropertyBehaviorKinds.None. When reading request payloads, the ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds property must be set to ODataUndeclaredPropertyBehaviorKinds.None; other values are not supported.. + /// + internal static string ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest { + get { + return ResourceManager.GetString("ReaderValidationUtils_UndeclaredPropertyBehaviorKindSpecifiedOnRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'.. + /// + internal static string ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint { + get { + return ResourceManager.GetString("ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value.. + /// + internal static string ReaderValidationUtils_ValueWithoutType { + get { + return ResourceManager.GetString("ReaderValidationUtils_ValueWithoutType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Batched service action '{0}' cannot be invoked because it was bound to an entity created in the same changeset.. + /// + internal static string RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset { + get { + return ResourceManager.GetString("RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $each set-based operation cannot be applied on single entities or singletons. Entity type: '{0}'.. + /// + internal static string RequestUriProcessor_CannotApplyEachOnSingleEntities { + get { + return ResourceManager.GetString("RequestUriProcessor_CannotApplyEachOnSingleEntities", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $filter path segment cannot be applied on single entities or singletons. Entity type: '{0}'.. + /// + internal static string RequestUriProcessor_CannotApplyFilterOnSingleEntities { + get { + return ResourceManager.GetString("RequestUriProcessor_CannotApplyFilterOnSingleEntities", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. Since the segment '{0}' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource.. + /// + internal static string RequestUriProcessor_CannotQueryCollections { + get { + return ResourceManager.GetString("RequestUriProcessor_CannotQueryCollections", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A composable escape function must have a valid operation passed as a parameter.. + /// + internal static string RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter { + get { + return ResourceManager.GetString("RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. $count cannot be applied to the segment '{0}' since $count can only follow an entity set, a collection navigation property, a structural property of collection type, an operation returning collection type or an operation import returning collection type.. + /// + internal static string RequestUriProcessor_CountNotSupported { + get { + return ResourceManager.GetString("RequestUriProcessor_CountNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid, the segment $count cannot be applied to the root of the service.. + /// + internal static string RequestUriProcessor_CountOnRoot { + get { + return ResourceManager.GetString("RequestUriProcessor_CountOnRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid, the segment $each cannot be applied to the root of the service.. + /// + internal static string RequestUriProcessor_EachOnRoot { + get { + return ResourceManager.GetString("RequestUriProcessor_EachOnRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty segment encountered in request URL. Please make sure that a valid request URL is specified.. + /// + internal static string RequestUriProcessor_EmptySegmentInRequestUrl { + get { + return ResourceManager.GetString("RequestUriProcessor_EmptySegmentInRequestUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The UrlEscape function '{0}' must have exactly one non-binding parameter of type 'Edm.String'.. + /// + internal static string RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter { + get { + return ResourceManager.GetString("RequestUriProcessor_EscapeFunctionMustHaveOneStringParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid, the segment $filter cannot be applied to the root of the service.. + /// + internal static string RequestUriProcessor_FilterOnRoot { + get { + return ResourceManager.GetString("RequestUriProcessor_FilterOnRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The $filter path segment must be in the form $filter(expression), where the expression resolves to a boolean.. + /// + internal static string RequestUriProcessor_FilterPathSegmentSyntaxError { + get { + return ResourceManager.GetString("RequestUriProcessor_FilterPathSegmentSyntaxError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Forbidden. + /// + internal static string RequestUriProcessor_Forbidden { + get { + return ResourceManager.GetString("RequestUriProcessor_Forbidden", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel.. + /// + internal static string RequestUriProcessor_FoundInvalidFunctionImport { + get { + return ResourceManager.GetString("RequestUriProcessor_FoundInvalidFunctionImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' specified in the URI is neither a base type nor a sub-type of the previously-specified type '{1}'.. + /// + internal static string RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType { + get { + return ResourceManager.GetString("RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataPathSegment provided (Id = {0}) is not an EntitySetSegment.. + /// + internal static string RequestUriProcessor_InvalidValueForEntitySegment { + get { + return ResourceManager.GetString("RequestUriProcessor_InvalidValueForEntitySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The KeySegment provided (Id = {0}) is either null, having no keys, or does not target a single resource.. + /// + internal static string RequestUriProcessor_InvalidValueForKeySegment { + get { + return ResourceManager.GetString("RequestUriProcessor_InvalidValueForKeySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Segments with multiple key values must specify them in 'name=value' form.. + /// + internal static string RequestUriProcessor_KeysMustBeNamed { + get { + return ResourceManager.GetString("RequestUriProcessor_KeysMustBeNamed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. The segment '{0}' must refer to a navigation property since the previous segment identifier is '{1}'.. + /// + internal static string RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment { + get { + return ResourceManager.GetString("RequestUriProcessor_LinkSegmentMustBeFollowedByEntitySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. There must a segment specified after the '{0}' segment and the segment must refer to a entity resource.. + /// + internal static string RequestUriProcessor_MissingSegmentAfterLink { + get { + return ResourceManager.GetString("RequestUriProcessor_MissingSegmentAfterLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. The segment '{0}' must be the last segment in the URI because it is one of the following: $ref, $batch, $count, $value, $metadata, a named media resource, an action, a noncomposable function, an action import, a noncomposable function import, an operation with void return type, or an operation import with void return type.. + /// + internal static string RequestUriProcessor_MustBeLeafSegment { + get { + return ResourceManager.GetString("RequestUriProcessor_MustBeLeafSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. The bound function binding to '{0}' does not match the composability of the escape function in the URI. . + /// + internal static string RequestUriProcessor_NoBoundEscapeFunctionSupported { + get { + return ResourceManager.GetString("RequestUriProcessor_NoBoundEscapeFunctionSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no navigation sources found to apply '{0}'.. + /// + internal static string RequestUriProcessor_NoNavigationSourceFound { + get { + return ResourceManager.GetString("RequestUriProcessor_NoNavigationSourceFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only a single operation can follow $each.. + /// + internal static string RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment { + get { + return ResourceManager.GetString("RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found an operation bound to a non-entity type.. + /// + internal static string RequestUriProcessor_OperationSegmentBoundToANonEntityType { + get { + return ResourceManager.GetString("RequestUriProcessor_OperationSegmentBoundToANonEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid, the segment $ref cannot be applied to the root of the service.. + /// + internal static string RequestUriProcessor_RefOnRoot { + get { + return ResourceManager.GetString("RequestUriProcessor_RefOnRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource not found for the segment '{0}'.. + /// + internal static string RequestUriProcessor_ResourceNotFound { + get { + return ResourceManager.GetString("RequestUriProcessor_ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request URI is not valid. The segment '{0}' cannot include key predicates, however it may end with empty parenthesis.. + /// + internal static string RequestUriProcessor_SegmentDoesNotSupportKeyPredicates { + get { + return ResourceManager.GetString("RequestUriProcessor_SegmentDoesNotSupportKeyPredicates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bad Request - Error in query syntax.. + /// + internal static string RequestUriProcessor_SyntaxError { + get { + return ResourceManager.GetString("RequestUriProcessor_SyntaxError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target Entity Set of Navigation Property '{0}' could not be found. This is most likely an error in the IEdmModel.. + /// + internal static string RequestUriProcessor_TargetEntitySetNotFound { + get { + return ResourceManager.GetString("RequestUriProcessor_TargetEntitySetNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The segment '{1}' in the request URI is not valid. The segment '{0}' refers to a primitive property, function, or service operation, so the only supported value from the next segment is '$value'.. + /// + internal static string RequestUriProcessor_ValueSegmentAfterScalarPropertySegment { + get { + return ResourceManager.GetString("RequestUriProcessor_ValueSegmentAfterScalarPropertySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource of type '{0}' was found in a resource set that otherwise has entries of type '{1}'. In OData, all entries in a resource set must have a common base type.. + /// + internal static string ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes { + get { + return ResourceManager.GetString("ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties.. + /// + internal static string SelectBinder_MultiLevelPathInSelect { + get { + return ResourceManager.GetString("SelectBinder_MultiLevelPathInSelect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When parsing a select clause a '*' segment was found immediately after a type segment in a property path. In OData, a '*' segment cannot appear following a type segment.. + /// + internal static string SelectedPropertiesNode_StarSegmentAfterTypeSegment { + get { + return ResourceManager.GetString("SelectedPropertiesNode_StarSegmentAfterTypeSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When parsing a select clause a '*' segment was found before last segment of a property path. In OData, a '*' segment can only appear as last segment of a property path.. + /// + internal static string SelectedPropertiesNode_StarSegmentNotLastSegment { + get { + return ResourceManager.GetString("SelectedPropertiesNode_StarSegmentNotLastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to It's not allowed to append '{0}' after wildcard.. + /// + internal static string SelectExpandBinder_InvalidIdentifierAfterWildcard { + get { + return ResourceManager.GetString("SelectExpandBinder_InvalidIdentifierAfterWildcard", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to It's not allowed to nest query options within '{0}' selection.. + /// + internal static string SelectExpandBinder_InvalidQueryOptionNestedSelection { + get { + return ResourceManager.GetString("SelectExpandBinder_InvalidQueryOptionNestedSelection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found a system token, '{0}', while parsing a select clause.. + /// + internal static string SelectExpandBinder_SystemTokenInSelect { + get { + return ResourceManager.GetString("SelectExpandBinder_SystemTokenInSelect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property '{0}' is of an unrecognized EdmPropertyKind.. + /// + internal static string SelectExpandBinder_UnknownPropertyType { + get { + return ResourceManager.GetString("SelectExpandBinder_UnknownPropertyType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Trying to follow type segments on a segment that isn't a type. Segment was '{0}'.. + /// + internal static string SelectExpandPathBinder_FollowNonTypeSegment { + get { + return ResourceManager.GetString("SelectExpandPathBinder_FollowNonTypeSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only properties specified in $expand can be traversed in $select query options. Selected item was '{0}'.. + /// + internal static string SelectionItemBinder_NoExpandForSelectedProperty { + get { + return ResourceManager.GetString("SelectionItemBinder_NoExpandForSelectedProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inner or start path segments must be navigation properties in $select.. + /// + internal static string SelectionItemBinder_NonNavigationPathToken { + get { + return ResourceManager.GetString("SelectionItemBinder_NonNavigationPathToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found multiple select terms with same select path '{0}' at one $select, please combine them together.. + /// + internal static string SelectTreeNormalizer_MultipleSelecTermWithSamePathFound { + get { + return ResourceManager.GetString("SelectTreeNormalizer_MultipleSelecTermWithSamePathFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No service for type '{0}' has been registered.. + /// + internal static string ServiceProviderExtensions_NoServiceRegistered { + get { + return ResourceManager.GetString("ServiceProviderExtensions_NoServiceRegistered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid PrimitiveTypeKind {0}. A Stream item must be of type binary or string, or none if unknown.". + /// + internal static string StreamItemInvalidPrimitiveKind { + get { + return ResourceManager.GetString("StreamItemInvalidPrimitiveKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to String item should be single/double quoted: '{0}'.. + /// + internal static string StringItemShouldBeQuoted { + get { + return ResourceManager.GetString("StringItemShouldBeQuoted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value '{0}' for $count query option found. Valid values are '{1}'.. + /// + internal static string SyntacticTree_InvalidCountQueryOptionValue { + get { + return ResourceManager.GetString("SyntacticTree_InvalidCountQueryOptionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value '{0}' for $index query option found. The $index query option requires an integer value.. + /// + internal static string SyntacticTree_InvalidIndexQueryOptionValue { + get { + return ResourceManager.GetString("SyntacticTree_InvalidIndexQueryOptionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value '{0}' for $skip query option found. The $skip query option requires a non-negative integer value.. + /// + internal static string SyntacticTree_InvalidSkipQueryOptionValue { + get { + return ResourceManager.GetString("SyntacticTree_InvalidSkipQueryOptionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid value '{0}' for $top query option found. The $top query option requires a non-negative integer value.. + /// + internal static string SyntacticTree_InvalidTopQueryOptionValue { + get { + return ResourceManager.GetString("SyntacticTree_InvalidTopQueryOptionValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The maximum depth setting must be a number greater than zero.. + /// + internal static string SyntacticTree_MaxDepthInvalid { + get { + return ResourceManager.GetString("SyntacticTree_MaxDepthInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified URI '{0}' must be absolute.. + /// + internal static string SyntacticTree_UriMustBeAbsolute { + get { + return ResourceManager.GetString("SyntacticTree_UriMustBeAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a qualified type name. A qualified type name is expected.. + /// + internal static string TypeUtils_TypeNameIsNotQualified { + get { + return ResourceManager.GetString("TypeUtils_TypeNameIsNotQualified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The CLR literal of type '{0}' is not supported to be written as a Uri part.. + /// + internal static string UriBuilder_NotSupportedClrLiteral { + get { + return ResourceManager.GetString("UriBuilder_NotSupportedClrLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to QueryToken '{0}' is not supported to be written as a Uri part.. + /// + internal static string UriBuilder_NotSupportedQueryToken { + get { + return ResourceManager.GetString("UriBuilder_NotSupportedQueryToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given uri custom type parser already exists.. + /// + internal static string UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists { + get { + return ResourceManager.GetString("UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An existing custom UriTypeParser is already registered to the given EdmTypeReference '{0}'.. + /// + internal static string UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists { + get { + return ResourceManager.GetString("UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get parent structured type for term '{0}' to auto populate all navigation properties.. + /// + internal static string UriExpandParser_ParentStructuredTypeIsNull { + get { + return ResourceManager.GetString("UriExpandParser_ParentStructuredTypeIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Term '{0}' is not valid in a $expand expression, as only $level option is allowed when the expanded navigation property is star.. + /// + internal static string UriExpandParser_TermIsNotValidForStar { + get { + return ResourceManager.GetString("UriExpandParser_TermIsNotValidForStar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Term '{0}' is not valid in a $expand expression, no option is allowed when the expanded navigation property is */$ref.. + /// + internal static string UriExpandParser_TermIsNotValidForStarRef { + get { + return ResourceManager.GetString("UriExpandParser_TermIsNotValidForStarRef", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Term '{0}' is not valid in a $expand expression as multiple stars are not allowed.. + /// + internal static string UriExpandParser_TermWithMultipleStarNotAllowed { + get { + return ResourceManager.GetString("UriExpandParser_TermWithMultipleStarNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The handler property for context '{0}' should not return null.. + /// + internal static string UriParser_ContextHandlerCanNotBeNull { + get { + return ResourceManager.GetString("UriParser_ContextHandlerCanNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty parenthesis not allowed.. + /// + internal static string UriParser_EmptyParenthesis { + get { + return ResourceManager.GetString("UriParser_EmptyParenthesis", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The result of parsing $expand contained at least {0} items, but the maximum allowed is {1}.. + /// + internal static string UriParser_ExpandCountExceeded { + get { + return ResourceManager.GetString("UriParser_ExpandCountExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The result of parsing $expand was at least {0} items deep, but the maximum allowed is {1}.. + /// + internal static string UriParser_ExpandDepthExceeded { + get { + return ResourceManager.GetString("UriParser_ExpandDepthExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing expand option on navigation property '{0}'. If a parenthesis expression follows an expanded navigation property, then at least one expand option must be provided.. + /// + internal static string UriParser_MissingExpandOption { + get { + return ResourceManager.GetString("UriParser_MissingExpandOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing select option on property '{0}'. If a parenthesis expression follows a selected property, then at least one query option must be provided.. + /// + internal static string UriParser_MissingSelectOption { + get { + return ResourceManager.GetString("UriParser_MissingSelectOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A service root URI must be provided to the ODataUriParser in order to use this method.. + /// + internal static string UriParser_NeedServiceRootForThisOverload { + get { + return ResourceManager.GetString("UriParser_NeedServiceRootForThisOverload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The limit must be greater than or equal to zero. + /// + internal static string UriParser_NegativeLimit { + get { + return ResourceManager.GetString("UriParser_NegativeLimit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter 'relativeUri' must be a relative Uri if serviceRoot is not specified.. + /// + internal static string UriParser_RelativeUriMustBeRelative { + get { + return ResourceManager.GetString("UriParser_RelativeUriMustBeRelative", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not valid for $select or $expand, only structured types are allowed.. + /// + internal static string UriParser_TypeInvalidForSelectExpand { + get { + return ResourceManager.GetString("UriParser_TypeInvalidForSelectExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The URI '{0}' must be an absolute URI.. + /// + internal static string UriParser_UriMustBeAbsolute { + get { + return ResourceManager.GetString("UriParser_UriMustBeAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given type prefix literal name '{0}' must contain letters or '.' only.. + /// + internal static string UriParserHelper_InvalidPrefixLiteral { + get { + return ResourceManager.GetString("UriParserHelper_InvalidPrefixLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one keys match the name '{0}' were found.. + /// + internal static string UriParserMetadata_MultipleMatchingKeysFound { + get { + return ResourceManager.GetString("UriParserMetadata_MultipleMatchingKeysFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one navigation sources match the name '{0}' were found in model.. + /// + internal static string UriParserMetadata_MultipleMatchingNavigationSourcesFound { + get { + return ResourceManager.GetString("UriParserMetadata_MultipleMatchingNavigationSourcesFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one parameters match the name '{0}' were found.. + /// + internal static string UriParserMetadata_MultipleMatchingParametersFound { + get { + return ResourceManager.GetString("UriParserMetadata_MultipleMatchingParametersFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one properties match the name '{0}' were found in type '{1}'.. + /// + internal static string UriParserMetadata_MultipleMatchingPropertiesFound { + get { + return ResourceManager.GetString("UriParserMetadata_MultipleMatchingPropertiesFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one types match the name '{0}' were found in model.. + /// + internal static string UriParserMetadata_MultipleMatchingTypesFound { + get { + return ResourceManager.GetString("UriParserMetadata_MultipleMatchingTypesFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to parse string to Geography.. + /// + internal static string UriPrimitiveTypeParsers_FailedToParseStringToGeography { + get { + return ResourceManager.GetString("UriPrimitiveTypeParsers_FailedToParseStringToGeography", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to parse '{0}' of Edm type '{1}' to primitive type.. + /// + internal static string UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue { + get { + return ResourceManager.GetString("UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 'as' expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_AsExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_AsExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expecting a Star token but got: '{0}'.. + /// + internal static string UriQueryExpressionParser_CannotCreateStarTokenFromNonStar { + get { + return ResourceManager.GetString("UriQueryExpressionParser_CannotCreateStarTokenFromNonStar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ')' or ',' expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_CloseParenOrCommaExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_CloseParenOrCommaExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ')' or operator expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_CloseParenOrOperatorExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_CloseParenOrOperatorExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expression expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_ExpressionExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_ExpressionExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only $filter and $search query options are allowed within $count.. + /// + internal static string UriQueryExpressionParser_IllegalQueryOptioninDollarCount { + get { + return ResourceManager.GetString("UriQueryExpressionParser_IllegalQueryOptioninDollarCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The inner most expand transformation requires a filter transformation at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_InnerMostExpandRequireFilter { + get { + return ResourceManager.GetString("UriQueryExpressionParser_InnerMostExpandRequireFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' expected at position {1} in '{2}'.. + /// + internal static string UriQueryExpressionParser_KeywordOrIdentifierExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_KeywordOrIdentifierExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '(' expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_OpenParenExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_OpenParenExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expression expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_PropertyPathExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_PropertyPathExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The range variable '{0}' has already been declared.. + /// + internal static string UriQueryExpressionParser_RangeVariableAlreadyDeclared { + get { + return ResourceManager.GetString("UriQueryExpressionParser_RangeVariableAlreadyDeclared", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Recursion depth exceeded allowed limit.. + /// + internal static string UriQueryExpressionParser_TooDeep { + get { + return ResourceManager.GetString("UriQueryExpressionParser_TooDeep", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unrecognized '{0}' literal '{1}' at '{2}' in '{3}'.. + /// + internal static string UriQueryExpressionParser_UnrecognizedLiteral { + get { + return ResourceManager.GetString("UriQueryExpressionParser_UnrecognizedLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unrecognized '{0}' literal '{1}' at '{2}' in '{3}' with reason '{4}'.. + /// + internal static string UriQueryExpressionParser_UnrecognizedLiteralWithReason { + get { + return ResourceManager.GetString("UriQueryExpressionParser_UnrecognizedLiteralWithReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unrecognized with '{0}' at '{1}' in '{2}'.. + /// + internal static string UriQueryExpressionParser_UnrecognizedWithMethod { + get { + return ResourceManager.GetString("UriQueryExpressionParser_UnrecognizedWithMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 'with' expected at position {0} in '{1}'.. + /// + internal static string UriQueryExpressionParser_WithExpected { + get { + return ResourceManager.GetString("UriQueryExpressionParser_WithExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The URI part '{0}' is not valid because there's no leading escape character.. + /// + internal static string UriQueryPathParser_InvalidEscapeUri { + get { + return ResourceManager.GetString("UriQueryPathParser_InvalidEscapeUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The URI '{0}' is not valid because it is not based on '{1}'.. + /// + internal static string UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri { + get { + return ResourceManager.GetString("UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bad Request: there was an error in the query syntax.. + /// + internal static string UriQueryPathParser_SyntaxError { + get { + return ResourceManager.GetString("UriQueryPathParser_SyntaxError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Too many segments in URI.. + /// + internal static string UriQueryPathParser_TooManySegments { + get { + return ResourceManager.GetString("UriQueryPathParser_TooManySegments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Count option must be a boolean value, it is set to '{0}' instead.. + /// + internal static string UriSelectParser_InvalidCountOption { + get { + return ResourceManager.GetString("UriSelectParser_InvalidCountOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Levels option must be a non-negative integer or 'max', it is set to '{0}' instead.. + /// + internal static string UriSelectParser_InvalidLevelsOption { + get { + return ResourceManager.GetString("UriSelectParser_InvalidLevelsOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skip option must be a non-negative integer, it is set to '{0}' instead.. + /// + internal static string UriSelectParser_InvalidSkipOption { + get { + return ResourceManager.GetString("UriSelectParser_InvalidSkipOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Top option must be a non-negative integer, it is set to '{0}' instead.. + /// + internal static string UriSelectParser_InvalidTopOption { + get { + return ResourceManager.GetString("UriSelectParser_InvalidTopOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found system token '{0}' in select or expand clause '{1}'.. + /// + internal static string UriSelectParser_SystemTokenInSelectExpand { + get { + return ResourceManager.GetString("UriSelectParser_SystemTokenInSelectExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Term '{0}' is not valid in a $select or $expand expression.. + /// + internal static string UriSelectParser_TermIsNotValid { + get { + return ResourceManager.GetString("UriSelectParser_TermIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The DateTimeOffset text '{0}' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.. + /// + internal static string UriUtils_DateTimeOffsetInvalidFormat { + get { + return ResourceManager.GetString("UriUtils_DateTimeOffsetInvalidFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The UrlValidator used to validate an ODataUri must use the same Model as the ODataUriParser.. + /// + internal static string UriValidator_ValidatorMustUseSameModelAsParser { + get { + return ResourceManager.GetString("UriValidator_ValidatorMustUseSameModelAsParser", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Metadata' property on an {0} must be set to a non-null value.. + /// + internal static string ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata { + get { + return ResourceManager.GetString("ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Target' property on an {0} must be set to a non-null value.. + /// + internal static string ValidationUtils_ActionsAndFunctionsMustSpecifyTarget { + get { + return ResourceManager.GetString("ValidationUtils_ActionsAndFunctionsMustSpecifyTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Name' property on an ODataAssociationLink must be set to a non-empty string.. + /// + internal static string ValidationUtils_AssociationLinkMustSpecifyName { + get { + return ResourceManager.GetString("ValidationUtils_AssociationLinkMustSpecifyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Url' property on an ODataAssociationLink must be set to a non-null value that represents the association or associations the link references.. + /// + internal static string ValidationUtils_AssociationLinkMustSpecifyUrl { + get { + return ResourceManager.GetString("ValidationUtils_AssociationLinkMustSpecifyUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' enumerable contains a null item. This enumerable cannot contain null items.. + /// + internal static string ValidationUtils_EnumerableContainsANullItem { + get { + return ResourceManager.GetString("ValidationUtils_EnumerableContainsANullItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An incompatible primitive type '{0}[Nullable={1}]' was found for an item that was expected to be of type '{2}[Nullable={3}]'.. + /// + internal static string ValidationUtils_IncompatiblePrimitiveItemType { + get { + return ResourceManager.GetString("ValidationUtils_IncompatiblePrimitiveItemType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as '{0}', but the type specified in the metadata is '{1}'.. + /// + internal static string ValidationUtils_IncompatibleType { + get { + return ResourceManager.GetString("ValidationUtils_IncompatibleType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'.. + /// + internal static string ValidationUtils_IncorrectTypeKind { + get { + return ResourceManager.GetString("ValidationUtils_IncorrectTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incompatible type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'.. + /// + internal static string ValidationUtils_IncorrectTypeKindNoTypeName { + get { + return ResourceManager.GetString("ValidationUtils_IncorrectTypeKindNoTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value with type '{0}' was found, which is of kind '{1}'. Value can only be of kind 'Primitive', 'Complex' or 'Collection'.. + /// + internal static string ValidationUtils_IncorrectValueTypeKind { + get { + return ResourceManager.GetString("ValidationUtils_IncorrectValueTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The boundary delimiter '{0}' is invalid. A boundary delimiter must be non-null, be non-empty, and have a maximum of {1} characters.. + /// + internal static string ValidationUtils_InvalidBatchBoundaryDelimiterLength { + get { + return ResourceManager.GetString("ValidationUtils_InvalidBatchBoundaryDelimiterLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type name '{0}' is an invalid collection type name; a collection type name must be in the format 'Collection(<itemTypeName>)'.. + /// + internal static string ValidationUtils_InvalidCollectionTypeName { + get { + return ResourceManager.GetString("ValidationUtils_InvalidCollectionTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An invalid collection type kind '{0}' was found. In OData, collection types must be of kind 'Collection'.. + /// + internal static string ValidationUtils_InvalidCollectionTypeReference { + get { + return ResourceManager.GetString("ValidationUtils_InvalidCollectionTypeReference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered a property '{0}' that was expected to be a reference to a location in the $metadata document but does not contain a '#' character or is otherwise not a valid metadata reference property. A metadata reference property must contain a '#' and be a valid absolute URI or begin with a '#' and be a valid URI fragment.. + /// + internal static string ValidationUtils_InvalidMetadataReferenceProperty { + get { + return ResourceManager.GetString("ValidationUtils_InvalidMetadataReferenceProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Name' property on an ODataNestedResourceInfo must be set to a non-empty string.. + /// + internal static string ValidationUtils_LinkMustSpecifyName { + get { + return ResourceManager.GetString("ValidationUtils_LinkMustSpecifyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The depth limit for entries in nested expanded navigation links was reached. The number of nested expanded entries cannot exceed {0}.. + /// + internal static string ValidationUtils_MaxDepthOfNestedEntriesExceeded { + get { + return ResourceManager.GetString("ValidationUtils_MaxDepthOfNestedEntriesExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be a stream property because it is not of kind EdmPrimitiveTypeKind.Stream.. + /// + internal static string ValidationUtils_MismatchPropertyKindForStreamProperty { + get { + return ResourceManager.GetString("ValidationUtils_MismatchPropertyKindForStreamProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property with name '{0}' on type '{1}' has kind '{2}', but it is expected to be of kind 'Navigation'.. + /// + internal static string ValidationUtils_NavigationPropertyExpected { + get { + return ResourceManager.GetString("ValidationUtils_NavigationPropertyExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nested collection instances are not allowed.. + /// + internal static string ValidationUtils_NestedCollectionsAreNotSupported { + get { + return ResourceManager.GetString("ValidationUtils_NestedCollectionsAreNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was detected in the items of a collection property value; non-nullable instances of collection types do not support null values as items.. + /// + internal static string ValidationUtils_NonNullableCollectionElementsMustNotBeNull { + get { + return ResourceManager.GetString("ValidationUtils_NonNullableCollectionElementsMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A primitive value was specified; however, a value of the non-primitive type '{0}' was expected.. + /// + internal static string ValidationUtils_NonPrimitiveTypeForPrimitiveValue { + get { + return ResourceManager.GetString("ValidationUtils_NonPrimitiveTypeForPrimitiveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was found in a collection, but the expected collection item type '{0}' does not allow null values.. + /// + internal static string ValidationUtils_NullCollectionItemForNonNullableType { + get { + return ResourceManager.GetString("ValidationUtils_NullCollectionItemForNonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An open collection property '{0}' was found. In OData, open collection properties are not supported.. + /// + internal static string ValidationUtils_OpenCollectionProperty { + get { + return ResourceManager.GetString("ValidationUtils_OpenCollectionProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An open stream property '{0}' was found. In OData, open stream properties are not supported.. + /// + internal static string ValidationUtils_OpenStreamProperty { + get { + return ResourceManager.GetString("ValidationUtils_OpenStreamProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property name '{0}' is invalid; property names must not contain any of the reserved characters {1}.. + /// + internal static string ValidationUtils_PropertiesMustNotContainReservedChars { + get { + return ResourceManager.GetString("ValidationUtils_PropertiesMustNotContainReservedChars", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' does not exist on type '{1}'. Make sure to only use property names that are defined by the type or mark the type as open type.. + /// + internal static string ValidationUtils_PropertyDoesNotExistOnType { + get { + return ResourceManager.GetString("ValidationUtils_PropertyDoesNotExistOnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The maximum recursion depth limit was reached. The depth of nested values in a single property cannot exceed {0}.. + /// + internal static string ValidationUtils_RecursionDepthLimitReached { + get { + return ResourceManager.GetString("ValidationUtils_RecursionDepthLimitReached", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Name' property on a resource collection with the 'Url' '{0}' must be set to a non-null value.. + /// + internal static string ValidationUtils_ResourceMustSpecifyName { + get { + return ResourceManager.GetString("ValidationUtils_ResourceMustSpecifyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Url' property on a resource collection must be set to a non-null value.. + /// + internal static string ValidationUtils_ResourceMustSpecifyUrl { + get { + return ResourceManager.GetString("ValidationUtils_ResourceMustSpecifyUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource with type '{0}' was found, but it is not assignable to the expected type '{1}'. The type specified in the resource must be equal to either the expected type or a derived type.. + /// + internal static string ValidationUtils_ResourceTypeNotAssignableToExpectedType { + get { + return ResourceManager.GetString("ValidationUtils_ResourceTypeNotAssignableToExpectedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource with type '{0}' was found with a media resource, but this entity type is not a media link resource (MLE). When the type is not an MLE entity, the resource cannot have a media resource.. + /// + internal static string ValidationUtils_ResourceWithMediaResourceAndNonMLEType { + get { + return ResourceManager.GetString("ValidationUtils_ResourceWithMediaResourceAndNonMLEType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource with type '{0}' was found without a media resource, but this entity type is a media link resource (MLE). When the type is an MLE entity, the resource must have a media resource.. + /// + internal static string ValidationUtils_ResourceWithoutMediaResourceAndMLEType { + get { + return ResourceManager.GetString("ValidationUtils_ResourceWithoutMediaResourceAndMLEType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A service document element without a Url was detected; a service document element must have a non-null Url value.. + /// + internal static string ValidationUtils_ServiceDocumentElementUrlMustNotBeNull { + get { + return ResourceManager.GetString("ValidationUtils_ServiceDocumentElementUrlMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataStreamReferenceValue item was found in a collection property value, which is not allowed. Collection properties can only have primitive and complex values as items.. + /// + internal static string ValidationUtils_StreamReferenceValuesNotSupportedInCollections { + get { + return ResourceManager.GetString("ValidationUtils_StreamReferenceValuesNotSupportedInCollections", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An empty type name was found; the name of a type cannot be an empty string.. + /// + internal static string ValidationUtils_TypeNameMustNotBeEmpty { + get { + return ResourceManager.GetString("ValidationUtils_TypeNameMustNotBeEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A type named '{0}' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.. + /// + internal static string ValidationUtils_UnrecognizedTypeName { + get { + return ResourceManager.GetString("ValidationUtils_UnrecognizedTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported primitive type. A primitive type could not be determined for an instance of type '{0}'.. + /// + internal static string ValidationUtils_UnsupportedPrimitiveType { + get { + return ResourceManager.GetString("ValidationUtils_UnsupportedPrimitiveType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A null value was detected when enumerating the collections in a workspace. Workspace collections cannot be null.. + /// + internal static string ValidationUtils_WorkspaceResourceMustNotContainNullItem { + get { + return ResourceManager.GetString("ValidationUtils_WorkspaceResourceMustNotContainNullItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid duration value.. + /// + internal static string ValueParser_InvalidDuration { + get { + return ResourceManager.GetString("ValueParser_InvalidDuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot convert a value of type '{0}' to the string representation of a primitive value.. + /// + internal static string ValueUtils_CannotConvertValueToPrimitive { + get { + return ResourceManager.GetString("ValueUtils_CannotConvertValueToPrimitive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An association link with name '{0}' could not be written to the request payload. Association links are only supported in responses.. + /// + internal static string WriterValidationUtils_AssociationLinkInRequest { + get { + return ResourceManager.GetString("WriterValidationUtils_AssociationLinkInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The collection property '{0}' has a null value, which is not allowed. In OData, collection properties cannot have null values.. + /// + internal static string WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue { + get { + return ResourceManager.GetString("WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A default stream ODataStreamReferenceValue was detected with a 'ContentType' property but without a ReadLink value. In OData, a default stream must either have both a content type and a read link, or neither of them.. + /// + internal static string WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink { + get { + return ResourceManager.GetString("WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A default stream ODataStreamReferenceValue was detected with a 'ReadLink' property but without a ContentType value. In OData, a default stream must either have both a content type and a read link, or neither of them.. + /// + internal static string WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType { + get { + return ResourceManager.GetString("WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'ODataEntityReferenceLinks.Links' enumerable contains a null item. This enumerable cannot contain null items.. + /// + internal static string WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull { + get { + return ResourceManager.GetString("WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataEntityReferenceLink with a null Url was detected; an ODataEntityReferenceLink must have a non-null Url.. + /// + internal static string WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull { + get { + return ResourceManager.GetString("WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A resource with an empty ID value was detected. In OData, a resource must either a non-empty ID value or no ID value.. + /// + internal static string WriterValidationUtils_EntriesMustHaveNonEmptyId { + get { + return ResourceManager.GetString("WriterValidationUtils_EntriesMustHaveNonEmptyId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the actual payload is a resource set.. + /// + internal static string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the metadata declares it as resource set.. + /// + internal static string WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the actual payload is a resource.. + /// + internal static string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the metadata declares it as a resource.. + /// + internal static string WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource, but the metadata declares it as resource set.. + /// + internal static string WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource set, but the metadata declares it as a resource.. + /// + internal static string WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata { + get { + return ResourceManager.GetString("WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base URI '{0}' specified in ODataMessageWriterSettings.BaseUri is invalid; it must either be null or an absolute URI.. + /// + internal static string WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute { + get { + return ResourceManager.GetString("WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A JSON Padding function was specified on ODataMessageWriterSettings when trying to write a request message. JSON Padding is only for writing responses.. + /// + internal static string WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage { + get { + return ResourceManager.GetString("WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service document URI '{0}' specified is invalid; it must be either null or an absolute URI.. + /// + internal static string WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute { + get { + return ResourceManager.GetString("WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No TypeName was found for an ODataResource of an open property, ODataResource or custom instance annotation, even though metadata was specified. If a model is passed to the writer, each complex value on an open property, resource or custom instance annotation must have a type name.. + /// + internal static string WriterValidationUtils_MissingTypeNameWithMetadata { + get { + return ResourceManager.GetString("WriterValidationUtils_MissingTypeNameWithMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo.Url property on an navigation link '{0}' is null. The ODataNestedResourceInfo.Url property must be set to a non-null value that represents the entity or entities the navigation link references.. + /// + internal static string WriterValidationUtils_NavigationLinkMustSpecifyUrl { + get { + return ResourceManager.GetString("WriterValidationUtils_NavigationLinkMustSpecifyUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataNestedResourceInfo.IsCollection property on a nested resource info '{0}' is null. The ODataNestedResourceInfo.IsCollection property must be specified when writing a nested resource into a request.. + /// + internal static string WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection { + get { + return ResourceManager.GetString("WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of a resource in an expanded link is not compatible with the element type '{1}' of the expanded link. Entries in an expanded link must have entity types that are assignable to the element type of the expanded link.. + /// + internal static string WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType { + get { + return ResourceManager.GetString("WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataResourceSet.NextPageLink must be null for request payloads. A next link is only supported in responses.. + /// + internal static string WriterValidationUtils_NextPageLinkInRequest { + get { + return ResourceManager.GetString("WriterValidationUtils_NextPageLinkInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}[Nullable=False]' of type '{1}' has a null value, which is not allowed.. + /// + internal static string WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue { + get { + return ResourceManager.GetString("WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An action or a function with metadata '{0}' was detected when writing a request; actions and functions are only supported in responses.. + /// + internal static string WriterValidationUtils_OperationInRequest { + get { + return ResourceManager.GetString("WriterValidationUtils_OperationInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataProperty instance without a name was detected; an ODataProperty must have a non-null, non-empty name.. + /// + internal static string WriterValidationUtils_PropertiesMustHaveNonEmptyName { + get { + return ResourceManager.GetString("WriterValidationUtils_PropertiesMustHaveNonEmptyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'ODataResource.Properties' enumerable contains a null item. This enumerable cannot contain null items.. + /// + internal static string WriterValidationUtils_PropertyMustNotBeNull { + get { + return ResourceManager.GetString("WriterValidationUtils_PropertyMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream property '{0}' has a null value, which is not allowed. In OData, stream properties cannot have null values.. + /// + internal static string WriterValidationUtils_StreamPropertiesMustNotHaveNullValue { + get { + return ResourceManager.GetString("WriterValidationUtils_StreamPropertiesMustNotHaveNullValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The stream property {0} in a request payload cannot contain etag, editLink, or readLink values.. + /// + internal static string WriterValidationUtils_StreamPropertyInRequest { + get { + return ResourceManager.GetString("WriterValidationUtils_StreamPropertyInRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataStreamReferenceValue was detected with an empty string 'ContentType' property. In OData, a stream resource must either have a non-empty content type or it must be null.. + /// + internal static string WriterValidationUtils_StreamReferenceValueEmptyContentType { + get { + return ResourceManager.GetString("WriterValidationUtils_StreamReferenceValueEmptyContentType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataStreamReferenceValue was detected with null values for both EditLink and ReadLink. In OData, a stream resource must have at least an edit link or a read link.. + /// + internal static string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink { + get { + return ResourceManager.GetString("WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An ODataStreamReferenceValue was detected with an ETag but without an edit link. In OData, a stream resource must have an edit link to have an ETag.. + /// + internal static string WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag { + get { + return ResourceManager.GetString("WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'.. + /// + internal static string WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint { + get { + return ResourceManager.GetString("WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An XML node of type '{0}' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes.. + /// + internal static string XmlReaderExtension_InvalidNodeInStringValue { + get { + return ResourceManager.GetString("XmlReaderExtension_InvalidNodeInStringValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An XML node of type '{0}' was found at the root level. The root level of an OData payload must contain a single XML element and no text nodes.. + /// + internal static string XmlReaderExtension_InvalidRootNode { + get { + return ResourceManager.GetString("XmlReaderExtension_InvalidRootNode", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.OData.Core/SRResources.resx b/src/Microsoft.OData.Core/SRResources.resx new file mode 100644 index 0000000000..8fea11fe95 --- /dev/null +++ b/src/Microsoft.OData.Core/SRResources.resx @@ -0,0 +1,2597 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Value cannot be empty1. + + + Value cannot be empty. + + + An asynchronous operation was requested on an IODataRequestMessage instance. For asynchronous operations to succeed, the request message instance must implement IODataRequestMessageAsync. + + + The IODataRequestMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null. + + + The IODataRequestMessage.GetStream or IODataRequestMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream. + + + An asynchronous operation was requested on an IODataResponseMessage instance. For asynchronous operations to succeed, the response message instance must implement IODataResponseMessageAsync. + + + The IODataResponseMessageAsync.GetStreamAsync method returned null. An asynchronous method that returns a task can never return null. + + + The IODataResponseMessage.GetStream or IODataResponseMessageAsync.GetStreamAsync method returned a null stream value. The message can never return a null stream. + + + A writer or stream has been disposed with data still in the buffer. You must call Flush or FlushAsync before calling Dispose when some data has already been written. + + + The format '{0}' does not support writing a payload of kind '{1}'. + + + The format '{0}' does not support reading a payload of kind '{1}'. + + + The ServiceRoot property in ODataMessageWriterSettings.ODataUri must be set when writing a payload. + + + A relative URI value '{0}' was specified in the data to write, but the metadata document URI or the metadata for the item to be written was not specified for the writer. The metadata document URI and the metadata for the item to be written must be provided to the writer when using relative URI values. + + + A relative URI value '{0}' was specified in the data to write, but a base URI was not specified for the writer. A base URI must be set when using relative URI values. + + + The property '{0}' is a stream property, but it is not a property of an ODataResource instance. In OData, stream properties must be properties of ODataResource instances. + + + An invalid state transition has been detected in an OData writer. Cannot transition from state '{0}' to state '{1}'. + + + Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set. + + + Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a property or a nested resource. + + + Cannot transition from state '{0}' to state '{1}' when writing an OData 4.0 payload. To write content to a deleted resource, please specify ODataVersion 4.01 or greater in MessageWriterSettings. + + + Cannot transition from state '{0}' to state '{1}'. You must first call ODataWriter.WriteEnd to finish writing a null ODataResource. + + + Cannot transition from state '{0}' to state '{1}'. The only valid action in state '{0}' is to write a resource. + + + Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write a resource or a resource set. + + + Cannot transition from state '{0}' to state '{1}'. Nothing further can be written once the writer has completed. + + + Cannot transition from state '{0}' to state '{1}'. Nothing can be written once the writer entered the error state. + + + Cannot transition from state '{0}' to state '{1}'. State transition is not allowed while writing an expanded navigation property, complex property or complex collection property. + + + Cannot transition from state '{0}' to state '{1}'. Nested resource can only be written within a delta resource. + + + WriteStart(expandedResourceSet) was called in an invalid state ('{0}'); WriteStart(expandedResourceSet) is only supported in state 'ExpandedNavigationProperty'. + + + ODataWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Resource', 'ResourceSet', 'NavigationLink', and 'NavigationLinkWithContent'. + + + ODataWriter.Write or ODataWriter.WriteEnd was called while streaming a value. Stream or TextWriter must be disposed before calling additional methods on ODataWriter. + + + No Id or key properties were found. A resource in a delta payload requires an ID or key properties be specified. + + + The ODataResourceSet.Count must be null for request payloads. Query counts are only supported in responses. + + + The NextPageLink must be null for request payloads. Next page links are only supported in responses. + + + The DeltaLink must be null for request payloads. Delta links are only supported in responses. + + + Cannot write a deleted resource, link, deleted link, or nested delta resource set within a resource set; they must be written within a delta resource set. + + + Nested content is not allowed in an OData 4.0 deleted entry. For content in deleted entries, please specify OData 4.01 or greater. + + + Cannot write a top-level resource set with a writer that was created to write a top-level resource. + + + Cannot write a top-level resource with a writer that was created to write a top-level resource set. + + + A synchronous operation was called on an asynchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous writer. Calls on a writer instance must be either all synchronous or all asynchronous. + + + An entity reference link was written without a surrounding navigation link. The WriteEntityReferenceLink or WriteEntityReferenceLinkAsync methods can only be used when writing the content of a navigation link. + + + A deferred link was written into a request. In requests, each nested resource info must have a resource set, resource, or entity reference link written into it. + + + More than one item was written into the content of a nested resource. In OData, a nested resource can only contain more than one item in its content when ODataNestedResourceInfo.IsCollection set to true, and the writer is writing a request. + + + The ODataResourceSet.DeltaLink property must be null for expanded resource sets. Delta link is not supported on expanded resource sets. + + + The Path property in ODataMessageWriterSettings.ODataUri must be set when writing contained elements. + + + Multiple properties with the name '{0}' were detected in a resource or a complex value. In OData, duplicate property names are not allowed. + + + Multiple annotations with the name '{0}' were detected. In OData, duplicate annotations are not allowed. + + + Multiple annotations with the name '{0}' were detected for the property with name '{1}'. In OData, duplicate annotations are not allowed. + + + Multiple annotations with the name '{0}' were detected for the instance annotation with name '{1}'. In OData, duplicate annotations are not allowed. + + + An annotation with name '{0}' for property '{1}' was detected after the property, or after an annotation for another property. In OData, annotations for a property must be in a single group and must appear before the property they annotate. + + + Cannot convert a value of type '{0}' to the string representation of a primitive value. + + + The value of type '{0}' is not supported and cannot be converted to a JSON representation. + + + Unable to serialize an object in a collection as it is not a supported ODataValue. + + + The specified ODataJsonDateTimeFormat is not supported. + + + An error occurred while processing the OData message. + + + An error was read from the payload. See the 'Error' property for more details. + + + An error occurred while parsing part of the URI. + + + '{0}' is missing a $select clause. All property paths, expands, and selects of complex types should include a $select statement. + + + Exception thrown by invalid rule {0}. {1} + + + The ODataMessageWriter has already been used to write a message payload. An ODataMessageWriter can only be used once to write a payload for a given message. + + + Top-level entity reference link collection payloads are not allowed in requests. + + + An error cannot be written to a request payload. Errors are only supported in responses. + + + A service document cannot be written to request payloads. Service documents are only supported in responses. + + + A metadata document cannot be written to request payloads. Metadata documents are only supported in responses. + + + Cannot write delta in request payload. + + + Cannot write async in request payload. + + + Cannot write the value 'null' in top level property; return 204 instead. + + + Cannot write the value 'null' in raw format. + + + Cannot set message headers for the invalid payload kind '{0}'. + + + The payload kind '{0}' used in the last call to ODataUtils.SetHeadersForPayload is incompatible with the payload being written, which is of kind '{1}'. + + + The stream property '{0}' cannot be written to the payload as a top level property. + + + The WriteError method or the WriteErrorAsync method on the ODataMessageWriter has already been called to write an error payload. Only a single error payload can be written with each ODataMessageWriter instance. + + + The WriteError method or the WriteErrorAsync method on ODataMessageWriter cannot be called after the WriteValue method or the WriteValueAsync method is called. In OData, writing an in-stream error for raw values is not supported. + + + No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings in order to write a metadata document. + + + No model was specified in the ODataMessageWriterSettings; a model has to be provided in the ODataMessageWriterSettings when CreateODataParameterWriter is called with a non-null operation. + + + A JsonPaddingFunctionName was specified, but the content-type '{0}' is not supported with Json Padding. + + + The type '{0}' specified as the collection's item type is not primitive, enum or complex. An ODataCollectionWriter can only write collections of primitive, enum or complex values. + + + Not allowed to write top level property '{0}' with 'ODataResourceValue' or collection of resource value. + + + The provided implementation of IJsonWriterFactory returned null for arguments: isIeee754Compatible '{0}', encoding '{1}'. The factory should return a concrete IJsonWriter implementation. + + + The requested buffer capacity {0} exceeds the max buffer size. + + + Both startResourceXmlCustomizationCallback and endResourceXmlCustomizationCallback must be either null or non-null. + + + Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write the collection or to write nothing at all. + + + Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or to write the end of the collection. + + + Cannot transition from state '{0}' to state '{1}'. The only valid actions in state '{0}' are to write an item or the end of the collection. + + + ODataCollectionWriter.WriteEnd was called in an invalid state ('{0}'); WriteEnd is only supported in states 'Start', 'Collection', and 'Item'. + + + A synchronous operation was called on an asynchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous. + + + An asynchronous operation was called on a synchronous collection writer. All calls on a collection writer instance must be either synchronous or asynchronous. + + + An invalid HTTP method '{0}' was detected for a request in a change set. Requests in change sets only support the HTTP methods 'POST', 'PUT', 'DELETE', and 'PATCH'. + + + The header with name '{0}' was not present in the header collection of the batch operation. + + + Multiple headers with names that match '{0}', when using a case insensitive comparison, have been added. When case-insensitive header names are used, at most one header can be added for each name. + + + Writing an in-stream error is not supported when writing a parameter payload. + + + CreateParameterWriter was called on a response message. A parameter payload is only allowed in a request message. + + + A synchronous operation was called on an asynchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous. + + + An asynchronous operation was called on a synchronous parameter writer. All calls on a parameter writer instance must be either synchronous or asynchronous. + + + WriteStart can only be called once, and it must be called before writing anything else. + + + WriteValue and CreateCollectionWriter can only be called after WriteStart and before WriteEnd; they cannot be called until the previously created sub-writer is completed. + + + WriteEnd can only be called after WriteStart and after the previously created sub-writer has completed. + + + The writer is in either the 'Error' or 'Completed' state. No further writes can be performed on this writer. + + + The parameter '{0}' has already been written. Duplicate parameter names are not allowed in the parameter payload. + + + The parameter '{0}' is of Edm type kind '{1}'. You cannot call WriteValue on a parameter that is not of Edm type kinds 'Primitive' or 'Enum'. + + + The value for parameter '{0}' is of type '{1}'. WriteValue can only write null, ODataEnumValue and primitive types that are not Stream type. + + + The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateCollectionWriter on a parameter that is not of Edm type kind 'Collection'. + + + The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceWriter on a parameter that is not of Edm type kind 'Entity' or 'Complex'. + + + The parameter '{0}' is of Edm type kind '{1}'. You cannot call CreateResourceSetWriter on a parameter that is not of Edm type kind 'Collection(Entity)' or 'Collection(Complex)'. + + + The name '{0}' is not a recognized parameter name for operation '{1}'. + + + The parameters {0} of the operation '{1}' could not be found when writing the parameter payload. All parameters present in the operation must be written to the parameter payload. + + + ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync was called while a stream being used to write operation content, obtained from the operation message by using GetStream or GetStreamAsync, was still active. This is not allowed. ODataBatchWriter.Flush or ODataBatchWriter.FlushAsync can only be called when an active stream for the operation content does not exist. + + + An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndBatch with an active change set; you must first call ODataBatchWriter.WriteEndChangeset. + + + An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteStartChangeset with an active change set; you must first call ODataBatchWriter.WriteEndChangeset. + + + An invalid method call on ODataBatchWriter was detected. You cannot call ODataBatchWriter.WriteEndChangeset without an active change set; you must first call ODataBatchWriter.WriteStartChangeset. + + + An invalid method call on ODataBatchWriter was detected. After creating the writer, the only valid methods are ODataBatchWriter.WriteStartBatch and ODataBatchWriter.FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. After calling WriteStartBatch, the only valid methods on ODataBatchWriter are WriteStartChangeset, CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndBatch, and FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. After calling WriteStartChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteEndChangeset, and FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. After calling CreateOperationRequestMessage or CreateOperationResponseMessage, the only valid methods on ODataBatchWriter are WriteStartChangeset, WriteEndChangeset, WriteEndBatch, and FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. You cannot use the batch writer while another writer is writing the content of an operation. Dispose the stream for the operation before continuing to use the ODataBatchWriter. + + + An invalid method call on ODataBatchWriter was detected. After writing the content of an operation, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndChangeset, WriteEndBatch and FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. After calling WriteEndChangeset, the only valid methods on ODataBatchWriter are CreateOperationRequestMessage, CreateOperationResponseMessage, WriteStartChangeset, WriteEndBatch, and FlushAsync. + + + An invalid method call on ODataBatchWriter was detected. You can only call ODataBatchWriter.FlushAsync after ODataBatchWriter.WriteEndBatch has been called. + + + When writing a batch response, you cannot create a batch operation request message. + + + When writing a batch request, you cannot create a batch operation response message. + + + The current batch message contains too many parts. Only batch messages with a maximum number of '{0}' query operations and change sets are allowed. + + + The current change set contains too many operations. Only change sets with a maximum number of '{0}' operations are allowed. + + + A synchronous operation was called on an asynchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous batch writer. Calls on a batch writer instance must be either all synchronous or all asynchronous. + + + The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01. + + + The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when a batch is being written by using ODataBatchWriter. In OData, writing an in-stream error for a batch payload is not supported. + + + The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. + + + The relative URI '{0}' was specified in a batch operation, but a base URI was not specified for the batch writer or batch reader. When the relative URI is a reference to a content ID, the content ID does not exist in the current change set. + + + An attempt to change the properties of the message or to retrieve the payload stream for the message has failed. Either the payload stream has already been requested or the processing of the message has been completed. In both cases, no more changes can be made to the message. + + + Cannot access a closed stream. + + + When reading a batch response, you cannot create a batch operation request message. + + + When reading a batch request, you cannot create a batch operation response message. + + + The method CreateOperationRequestMessage was called in state '{0}', which is not allowed. CreateOperationRequestMessage can only be called in state 'Operation'. + + + A request message for the operation has already been created. You cannot create a request message for the same operation multiple times. + + + A response message for the operation has already been created. You cannot create a response message for the same operation multiple times. + + + The method CreateOperationResponseMessage was called in state '{0}', which is not allowed. CreateOperationResponseMessage can only be called in state 'Operation'. + + + You cannot use a batch reader while the stream for the content of an operation is still active. You must first dispose the operation stream before further calls to the batch reader are made. + + + A synchronous operation was called on an asynchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous batch reader. Calls on a batch reader instance must be either all synchronous or all asynchronous. + + + ODataBatchReader.ReadAsync or ODataBatchReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. + + + The current batch message contains too many parts. A maximum number of '{0}' query operations and change sets are allowed in a batch message. + + + The current change set contains too many operations. A maximum number of '{0}' operations are allowed in a change set. + + + An operation was detected, but no message was created for it. You must create a message for every operation found in a batch or change set. + + + Reader mode is not setup correctly. + + + Json batch format requires top level property name 'requests' or 'response' but it is missing. + + + The content ID '{0}' was found more than once in the same change set or same batch request. Content IDs have to be unique across all operations of a change set for OData V4.0 and have to be unique across all operations in the whole batch request for OData V4.01. + + + The atomicityGroup ID [{0}] was found duplicated in the batch request. AtomicityGroup IDs have to be adjacent, otherwise would be detected as duplicated. + + + Request property [{0}] is required but is missing. + + + The dependsOn request Id [{0}] is same as atomicityGroup property value [{1}], and is not allowed. + + + The dependsOn request Id [{0}] is same as id property value [{1}], and it is not allowed. + + + The dependsOn request Id [{0}] is part of atomic group [{1}]. Therefore dependsOn property should refer to atomic group Id [{1}] instead. + + + The dependsOn Id: [{0}] in request [{1}] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed. + + + Absolute URI {0} is not start with the base URI [{1}] specified by the operation message. + + + Request Id reference [{0}] in Uri [{1}] is not found in effective depends-on-Ids [{2}] of the request. + + + Group id or changeset GUID cannot be null. + + + Message with id [{0}] is positioned incorrectly: all messages of same groupId [{1}] must be adjacent. + + + Changeset boundary must have been set by now. + + + The message header '{0}' is invalid. The header value must be of the format '<header name="">: <header value="">'. + + + The request line '{0}' is invalid. The request line at the start of each operation must be of the format 'HttpMethod RequestUrl HttpVersion'. + + + The response line '{0}' is invalid. The response line at the start of each operation must be of the format 'HttpVersion StatusCode StatusCodeString'. + + + The HTTP version '{0}' used in a batch operation request or response is not valid. The value must be '{1}'. + + + The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value. + + + The 'Content-Type' header is missing. The 'Content-Type' header must be specified for each MIME part of a batch message. + + + A missing or invalid '{0}' header was found. The '{0}' header must be specified for each batch operation, and its value must be '{1}'. + + + The '{0}' header value '{1}' is invalid. When this is the start of the change set, the value must be '{2}'; otherwise it must be '{3}'. + + + The content length header '{0}' is not valid. The content length header must be a valid Int32 literal and must be greater than or equal to 0. + + + The header '{0}' was specified multiple times. Each header must appear only once in a batch part. + + + Nested change sets in a batch payload are not supported. + + + Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for operation payloads. They are not supported in batch or change set parts. + + + Encountered an unexpected end of input while reading the batch payload. + + + Too many white spaces after a boundary delimiter and before the terminating line resource set. For security reasons, the total number of characters for a boundary including white spaces must not exceed {0}. + + + Unknown property name '{0}' for message in batch. + + + Duplicate property name '{0}' for request in batch. + + + Duplicate header name '{0}' for request in batch. + + + Unexpected reader.NodeType: {0}. + + + Unknown/undefined type, new type that needs to be supported: {0}? + + + When not writing an async response, you cannot create an async response message. + + + You cannot create an async response message more than once. + + + A synchronous operation was called on an asynchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous async writer. Calls on an async writer instance must be either all synchronous or all asynchronous. + + + The WriteError and WriteErrorAsync methods on ODataMessageWriter cannot be called when an async message is being written by using ODataAsyncWriter. In OData, writing an in-stream error for an async payload is not supported. + + + The message header '{0}' is invalid. The header value must be of the format '<header name="">: <header value="">'. + + + When not reading an async response, you cannot create an async response message. + + + The response line '{0}' is invalid. The response line at the start of the async response must be of the format 'HttpVersion StatusCode StatusCodeString'. + + + The HTTP version '{0}' used in an async response is not valid. The value must be '{1}'. + + + The HTTP status code '{0}' is invalid. An HTTP status code must be an integer value. + + + The header '{0}' was specified multiple times. Each header must appear only once. + + + Invalid multi-byte encoding '{0}' detected. Multi-byte encodings other than UTF-8 are only supported for async payloads. They are not supported in batch or change set parts. + + + Invalid new line '{0}' encountered. Should be '\r\n'. + + + Encountered an unexpected end of input while reading the async payload. Could be due to calling CreateResponseMessage() more than once. + + + A synchronous operation was called on an asynchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous async reader. Calls on an async reader instance must be either all synchronous or all asynchronous. + + + The MIME type '{0}' is invalid or unspecified. + + + The MIME type '{0}' requires a '/' character between type and subtype, such as 'text/plain'. + + + The MIME type '{0}' requires a subtype definition. + + + The MIME type is missing a parameter value for a parameter with the name '{0}'. + + + The MIME type is missing a parameter name for a parameter definition. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the escape character '{3}' is not inside a quoted-string. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because it terminates with the escape character '{3}'. In a quoted-string, the escape characters must always be followed by a character. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the closing quote character was not found for the quoted-string. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the character '{3}' is not allowed in a quoted-string. For more information, see RFC 2616, Sections 3.6 and 2.2. + + + The value for the Content-Type header is missing. + + + The MIME type '{0}' requires a semi-colon character (';') before a parameter definition. + + + An invalid quality value was detected in the header string '{0}'; quality values must start with '0' or '1' but not with '{1}'. + + + An invalid quality value '{0}' was detected in the header string '{1}'; quality values must be in the range [0, 1]. + + + An error occurred when converting the character '{0}' to an integer. + + + The separator ',' was missing between charset values in the header '{0}'. + + + A separator character was missing between charset values in the header '{0}'. + + + An invalid (empty) charset name found in the header '{0}'. + + + An unexpected end of the q-Value was detected in the header '{0}'. + + + The expected literal '{0}' was not found at position '{1}' in the string '{2}'. + + + The string '{0}' cannot be converted into a supported HTTP method. The only supported HTTP methods are GET, DELETE, PUT, POST and PATCH. + + + The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a recognized separator. The supported separators are ',', ';', and '='. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token is expected but a quoted-string is found instead. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because a token or a quoted-string is expected at this position but were not found. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because '{3}' is not a valid separator after a quoted-string. + + + An error occurred when parsing the HTTP header '{0}'. The header value '{1}' is incorrect at position '{2}' because the header value should not end with the separator '{3}'. + + + The character set '{0}' is not supported. + + + A supported MIME type could not be found that matches the acceptable MIME types for the request. The supported type(s) '{0}' do not match any of the acceptable MIME types '{1}'. + + + A supported MIME type could not be found that matches the content type of the response. None of the supported type(s) '{0}' matches the content type '{1}'. + + + The specified content type '{0}' contains either no media type or more than one media type, which is not allowed. You must specify exactly one media type as the content type. + + + The content type '{0}' specifies a batch payload; however, the payload either does not include a batch boundary or includes more than one boundary. In OData, batch payload content types must specify exactly one batch boundary in the '{1}' parameter of the content type. + + + Expected literal type token but found token '{0}'. + + + The type '{0}' is not supported when converting to a URI literal. + + + An IEdmTypeReference must be provided with a matching IEdmModel. No model was provided. + + + The overflow exception caught for expected type '{0}'. '{1}'. + + + Type verification failed. Expected type '{0}' but received the value '{1}'. + + + Type verification failed. Expected type '{0}' but received non-matching null value with associated type '{1}'. + + + Type verification failed. Expected non-nullable type '{0}' but received a null value. + + + The value of type '{0}' could not be converted to a raw string. + + + A default MIME type could not be found for the requested payload in format '{0}'. + + + The value '{0}' of the OData-Version HTTP header is invalid. Only '4.0' and '4.01' are supported as values for the OData-Version header. + + + An OData version of {0} was specified and the maximum supported OData version is {1}. + + + An invalid enum value was specified for the version number. + + + The provided model does not contain an entity container. + + + The value returned by the '{0}' property cannot be modified until the end of the owning resource is reported by the reader. + + + A null value was found with the expected type '{0}[Nullable=False]'. The expected type '{0}[Nullable=False]' does not allow null values. + + + A null value was found for a collection of type '{0}[Nullable=True]. Collection-valued properties with Nullable=True can contain null values, but collection-valued properties cannot themselves be null. + + + A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=False]'. The expected type '{1}[Nullable=False]' does not allow null values. + + + A null value was found for the property named '{0}', which has the expected type '{1}[Nullable=True]'. The expected type '{1}[Nullable=True]' cannot be null but it can have null values. + + + No URI value was found for an entity reference link. A single URI value was expected. + + + A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value. + + + A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified. + + + Cannot convert the literal '{0}' to the expected type '{1}'. + + + The base URI '{0}' specified in ODataMessageReaderSettings.BaseUri is invalid; it must be either null or an absolute URI. + + + The ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds is not set to ODataUndeclaredPropertyBehaviorKinds.None. When reading request payloads, the ODataMessageReaderSettings.UndeclaredPropertyBehaviorKinds property must be set to ODataUndeclaredPropertyBehaviorKinds.None; other values are not supported. + + + The context URI '{0}' references the entity set with name '{1}'; however, the name of the expected entity set is '{2}' and does not match the entity set referenced in the context URI. + + + The context URI '{0}' references the entity type with name '{1}'; however, the name of the expected entity type is '{2}' which is not compatible with the entity type with name '{1}'. + + + The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the name of the expected property is '{3}'. + + + The context URI '{0}' references the property with name '{1}' on type '{2}'; however, the declaring type of the expected property is '{3}'. + + + The property or operation import name '{0}' was read from the payload; however, the name of the expected property or operation import is '{1}'. + + + The context URI '{0}' references the type '{1}'; however the expected type is '{2}'. + + + The context URI '{0}' refers to the item type '{1}' which is not assignable to the expected item type '{2}'. + + + The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'. + + + The ODataMessageReader has already been used to read a message payload. An ODataMessageReader can only be used once to read a payload for a given message. + + + A top-level error cannot be read from request payloads. Top-level errors are only supported in responses. + + + A service document cannot be read from request payloads. Service documents are only supported in responses. + + + A metadata document cannot be read from request payloads. Metadata documents are only supported in responses. + + + Delta are only supported in responses. + + + The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The expected type can only be specified if metadata is made available to the reader. + + + The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The entity set can only be specified if metadata is made available to the reader. + + + The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation import can only be specified if metadata is made available to the reader. + + + The parameter '{0}' is specified with a non-null value, but no metadata is available for the reader. The operation can only be specified if metadata is made available to the reader. + + + The expected type for a collection reader is of kind '{0}'. Only types of Primitive or ComplexType kind can be specified as the expected type for a collection reader. + + + The expected type for property reading is of entity collection kind. Top-level properties can only be of primitive, complex, primitive collection or complex collection kind. + + + The expected type for property reading is of entity kind. Top-level properties cannot be of entity type. + + + The expected type for property reading is Edm.Stream. Top-level properties cannot be of stream type. + + + The expected type for a value is of kind '{0}'. Only types of Primitive kind can be specified as the expected type for reading a value. + + + A missing or empty content type header was found when trying to read a message. The content type header is required. + + + The wildcard '*' was detected in the value '{0}' of the content type header. The value of the content type header cannot contain wildcards. + + + GetFormat was called before reading was started. GetFormat can only be called after a read method was called or a reader was created. + + + DetectPayloadKind or DetectPayloadKindAsync was called more than once; DetectPayloadKind or DetectPayloadKindAsync can only be called once. + + + Payload kind detection has not completed. Read or create methods cannot be called on the ODataMessageReader before payload kind detection is complete. + + + The ODataMessageReader is using the server behavior for WCF Data Services, as specified in its settings. Payload kind detection is not supported when using the WCF Data services server behavior. + + + A parameter payload cannot be read from a response payload. Parameter payloads are only supported in requests. + + + The navigation property '{0}' with singleton cardinality on type '{1}' was specified for reading a collection of entity reference links. A navigation property with collection cardinality has to be provided. + + + An attempt was made to modify the message. The message cannot be modified. + + + An attempt was made to modify the message. The message cannot be modified. + + + A synchronous operation was called on an asynchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous. + + + An asynchronous operation was called on a synchronous reader. Calls on a reader instance must be either all synchronous or all asynchronous. + + + ODataReader.ReadAsync or ODataReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. + + + CreateReadStream was called in an invalid state. CreateReadStream can only be called once in ReaderState.Stream. + + + CreateTextReader was called in an invalid state. CreateTextReader can only be called once in ReaderState.Stream. + + + Read called with an open stream or textreader. Please close any open streams or text readers before calling Read. + + + Calling Read or ReadAsync on an ODataReader instance is not allowed in state '{0}'. + + + Attempted to write a value for a property {0} whose value has already been written. + + + A node of type '{0}' was read from the JSON reader when trying to read the resources of a resource set. A 'StartObject' or 'EndArray' node was expected. + + + Cannot convert a value of type 'Edm.Int32' to the expected target type '{0}'. + + + Cannot convert a value of type 'Edm.Double' to the expected target type '{0}'. + + + Cannot convert a value of type 'Edm.Boolean' to the expected target type '{0}'. + + + Cannot convert a value of type 'Edm.Decimal' to the expected target type '{0}'. + + + Cannot convert a value of type 'Edm.DateTime' to the expected target type '{0}'. + + + Cannot convert a value of type 'Edm.DateTimeOffset' to the expected target type '{0}'. + + + Cannot convert a value to target type '{0}' because of conflict between input format string/number and parameter 'IEEE754Compatible' false/true. + + + Multiple '{0}' properties were found in an error or inner error object. In OData, an error or inner error must have at most one '{0}' property. + + + Multiple operations have the same 'Metadata' property value of '{0}'. The 'Target' property value of these operations must be set to a non-null value. + + + Multiple operations have the same 'Metadata' property value of '{0}' and the same 'Target' property value of '{1}'. When multiple operations have the same 'Metadata' property value, their 'Target' property values must be unique. + + + A property with name '{0}' was found in the error object when reading a top-level error. In OData, a top-level error object must have exactly one property with name 'error'. + + + A property with name '{0}' was found in the message value of a top-level error. In OData, the message value of a top-level error value can only have properties with name 'lang' or 'value'. + + + ODataCollectionReader.ReadAsync or ODataCollectionReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. + + + A synchronous operation was called on an asynchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous. + + + An asynchronous operation was called on a synchronous collection reader. All calls on a collection reader instance must be either synchronous or asynchronous. + + + The current state of the collection reader is '{0}'; however, the expected item type of a collection reader can only be set in state '{1}'. + + + ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in an invalid state. No further calls can be made to the reader in state '{0}'. + + + A synchronous operation was called on an asynchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous. + + + An asynchronous operation was called on a synchronous parameter reader. All calls on a parameter reader instance must be either synchronous or asynchronous. + + + ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state. '{1}' must be called in this state, and the created reader must be in the 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called. + + + ODataParameterReader.ReadAsync or ODataParameterReader.Read was called in the '{0}' state and '{1}' was called but the created reader is not in the 'Completed' state. The created reader must be in 'Completed' state before the next ODataParameterReader.ReadAsync or ODataParameterReader.Read can be called. + + + You cannot call the method '{0}' in state '{1}'. + + + The '{0}' method has already been called for the parameter '{1}'. Only one create reader method call is allowed for each resource, resource set, or collection parameter. + + + The parameter '{0}' in the request payload is not a valid parameter for the operation '{1}'. + + + Multiple parameters with the name '{0}' were found in the request payload. + + + One or more parameters of the operation '{0}' are missing from the request payload. The missing parameters are: {1}. + + + The 'Metadata' property on an {0} must be set to a non-null value. + + + The 'Target' property on an {0} must be set to a non-null value. + + + The '{0}' enumerable contains a null item. This enumerable cannot contain null items. + + + The 'Name' property on an ODataAssociationLink must be set to a non-empty string. + + + The 'Url' property on an ODataAssociationLink must be set to a non-null value that represents the association or associations the link references. + + + An empty type name was found; the name of a type cannot be an empty string. + + + The property '{0}' does not exist on type '{1}'. Make sure to only use property names that are defined by the type or mark the type as open type. + + + The 'Url' property on a resource collection must be set to a non-null value. + + + The 'Name' property on a resource collection with the 'Url' '{0}' must be set to a non-null value. + + + A service document element without a Url was detected; a service document element must have a non-null Url value. + + + A primitive value was specified; however, a value of the non-primitive type '{0}' was expected. + + + Unsupported primitive type. A primitive type could not be determined for an instance of type '{0}'. + + + An incompatible primitive type '{0}[Nullable={1}]' was found for an item that was expected to be of type '{2}[Nullable={3}]'. + + + A null value was detected in the items of a collection property value; non-nullable instances of collection types do not support null values as items. + + + Type name '{0}' is an invalid collection type name; a collection type name must be in the format 'Collection(<itemTypeName>)'. + + + A type named '{0}' could not be resolved by the model. When a model is available, each type name must resolve to a valid type. + + + Incompatible type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. + + + Incompatible type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. + + + A value with type '{0}' was found, which is of kind '{1}'. Value can only be of kind 'Primitive', 'Complex' or 'Collection'. + + + The 'Name' property on an ODataNestedResourceInfo must be set to a non-empty string. + + + The property '{0}' cannot be a stream property because it is not of kind EdmPrimitiveTypeKind.Stream. + + + Nested collection instances are not allowed. + + + An ODataStreamReferenceValue item was found in a collection property value, which is not allowed. Collection properties can only have primitive and complex values as items. + + + A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as '{0}', but the type specified in the metadata is '{1}'. + + + An open collection property '{0}' was found. In OData, open collection properties are not supported. + + + An open stream property '{0}' was found. In OData, open stream properties are not supported. + + + An invalid collection type kind '{0}' was found. In OData, collection types must be of kind 'Collection'. + + + A resource with type '{0}' was found with a media resource, but this entity type is not a media link resource (MLE). When the type is not an MLE entity, the resource cannot have a media resource. + + + A resource with type '{0}' was found without a media resource, but this entity type is a media link resource (MLE). When the type is an MLE entity, the resource must have a media resource. + + + A resource with type '{0}' was found, but it is not assignable to the expected type '{1}'. The type specified in the resource must be equal to either the expected type or a derived type. + + + A property with name '{0}' on type '{1}' has kind '{2}', but it is expected to be of kind 'Navigation'. + + + The boundary delimiter '{0}' is invalid. A boundary delimiter must be non-null, be non-empty, and have a maximum of {1} characters. + + + The maximum recursion depth limit was reached. The depth of nested values in a single property cannot exceed {0}. + + + The depth limit for entries in nested expanded navigation links was reached. The number of nested expanded entries cannot exceed {0}. + + + A null value was found in a collection, but the expected collection item type '{0}' does not allow null values. + + + The property name '{0}' is invalid; property names must not contain any of the reserved characters {1}. + + + A null value was detected when enumerating the collections in a workspace. Workspace collections cannot be null. + + + Encountered a property '{0}' that was expected to be a reference to a location in the $metadata document but does not contain a '#' character or is otherwise not a valid metadata reference property. A metadata reference property must contain a '#' and be a valid absolute URI or begin with a '#' and be a valid URI fragment. + + + The 'ODataResource.Properties' enumerable contains a null item. This enumerable cannot contain null items. + + + An ODataProperty instance without a name was detected; an ODataProperty must have a non-null, non-empty name. + + + No TypeName was found for an ODataResource of an open property, ODataResource or custom instance annotation, even though metadata was specified. If a model is passed to the writer, each complex value on an open property, resource or custom instance annotation must have a type name. + + + The ODataResourceSet.NextPageLink must be null for request payloads. A next link is only supported in responses. + + + A default stream ODataStreamReferenceValue was detected with a 'ContentType' property but without a ReadLink value. In OData, a default stream must either have both a content type and a read link, or neither of them. + + + A default stream ODataStreamReferenceValue was detected with a 'ReadLink' property but without a ContentType value. In OData, a default stream must either have both a content type and a read link, or neither of them. + + + An ODataStreamReferenceValue was detected with null values for both EditLink and ReadLink. In OData, a stream resource must have at least an edit link or a read link. + + + An ODataStreamReferenceValue was detected with an ETag but without an edit link. In OData, a stream resource must have an edit link to have an ETag. + + + An ODataStreamReferenceValue was detected with an empty string 'ContentType' property. In OData, a stream resource must either have a non-empty content type or it must be null. + + + A resource with an empty ID value was detected. In OData, a resource must either a non-empty ID value or no ID value. + + + The base URI '{0}' specified in ODataMessageWriterSettings.BaseUri is invalid; it must either be null or an absolute URI. + + + An ODataEntityReferenceLink with a null Url was detected; an ODataEntityReferenceLink must have a non-null Url. + + + The 'ODataEntityReferenceLinks.Links' enumerable contains a null item. This enumerable cannot contain null items. + + + The type '{0}' of a resource in an expanded link is not compatible with the element type '{1}' of the expanded link. Entries in an expanded link must have entity types that are assignable to the element type of the expanded link. + + + The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the actual payload is a resource. + + + The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the actual payload is a resource set. + + + The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource set, but the metadata declares it as a resource. + + + The ODataNestedResourceInfo with the URL value '{0}' specifies in its 'IsCollection' property that its payload is a resource, but the metadata declares it as resource set. + + + The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource set, but the metadata declares it as a resource. + + + The content of the ODataNestedResourceInfo with the URL value '{0}' is a resource, but the metadata declares it as resource set. + + + The collection property '{0}' has a null value, which is not allowed. In OData, collection properties cannot have null values. + + + The property '{0}[Nullable=False]' of type '{1}' has a null value, which is not allowed. + + + The stream property '{0}' has a null value, which is not allowed. In OData, stream properties cannot have null values. + + + An action or a function with metadata '{0}' was detected when writing a request; actions and functions are only supported in responses. + + + An association link with name '{0}' could not be written to the request payload. Association links are only supported in responses. + + + The stream property {0} in a request payload cannot contain etag, editLink, or readLink values. + + + The service document URI '{0}' specified is invalid; it must be either null or an absolute URI. + + + The ODataNestedResourceInfo.Url property on an navigation link '{0}' is null. The ODataNestedResourceInfo.Url property must be set to a non-null value that represents the entity or entities the navigation link references. + + + The ODataNestedResourceInfo.IsCollection property on a nested resource info '{0}' is null. The ODataNestedResourceInfo.IsCollection property must be specified when writing a nested resource into a request. + + + A JSON Padding function was specified on ODataMessageWriterSettings when trying to write a request message. JSON Padding is only for writing responses. + + + The value type '{0}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation on {1} '{2}'. + + + An XML node of type '{0}' was found in a string value. An element with a string value can only contain Text, CDATA, SignificantWhitespace, Whitespace or Comment nodes. + + + An XML node of type '{0}' was found at the root level. The root level of an OData payload must contain a single XML element and no text nodes. + + + The metadata document could not be read from the message content.{0} + + + The metadata document could not be written as specified.\r\n{0} + + + The JSON metadata is not supported at this platform. It's only supported at platform implementing .NETStardard 2.0. + + + A relative URI value '{0}' was specified in the payload, but no base URI for it was found. When the payload contains a relative URI, there must be an xml:base in the payload or else a base URI must specified in the reader settings. + + + The element with name '{0}' is not a valid collection item. The name of the collection item element must be 'element' and it must belong to the '{1}' namespace. + + + The property '{0}' on type '{1}' was found in the {{http://docs.oasis-open.org/odata/ns/metadata}}:properties element, and it is declared as a navigation property. + + + Writing null value for the instance annotation '{0}' is not allowed. The instance annotation '{0}' has the expected type '{1}[Nullable=False]'. + + + When resolving operations '{0}' the group returned has both actions and functions with an invalid IEdmModel. + + + Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return non-bound operations. + + + Invalid implementation of an IEdmModel, an operation '{0}' was found using the IEdmModel method 'FindDeclaredBoundOperations' should never return bound operations without any parameters. + + + Value '{0}' was either too large or too small for a '{1}'. + + + The 'type' attribute on element {{http://www.w3.org/2005/Atom}}:content is either missing or has an invalid value '{0}'. Only 'application/xml' and 'application/atom+xml' are supported as the value of the 'type' attribute on the {{http://www.w3.org/2005/Atom}}:content element. + + + Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in a top-level error value. In OData, the value of a top-level error value can have no more than one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element + + + Multiple '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' elements were found in an inner error value. In OData, the value of an inner error value can have at most one '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' element. + + + An invalid item type kind '{0}' was found. Items in a collection can only be of type kind 'Primitive' or 'Complex', but not of type kind '{0}'. + + + An item of type kind '{0}' was found in a collection that otherwise has items of type kind '{1}'. In OData, all items in a collection must have the same type kind. + + + An item with type name '{0}' was found in a collection of items with type name '{1}'. In OData, all items in a collection must have the same type name. + + + A resource of type '{0}' was found in a resource set that otherwise has entries of type '{1}'. In OData, all entries in a resource set must have a common base type. + + + The maximum number of bytes allowed to be read from the stream has been exceeded. After the last read operation, a total of {0} bytes has been read from the stream; however a maximum of {1} bytes is allowed. + + + The custom type resolver set in ODataMessageWriterSettings.EnableWcfDataServicesClientBehavior returned 'null' when resolving the type '{0}'. When a custom type resolver is specified, it cannot return null. + + + The method 'FindDeclaredBoundOperations' on the IEdmModel has thrown an exception when looking for operations with a binding type {0}. See inner exception for more details. + + + The type '{0}' was found for a primitive value. In OData, the type '{0}' is not a supported primitive type. + + + Incompatible primitive type kinds were found. The type '{0}' was found to be of kind '{2}' instead of the expected kind '{1}'. + + + Incompatible primitive type kinds were found. Found type kind '{0}' instead of the expected kind '{1}'. + + + A value with primitive kind '{0}' cannot be converted into a primitive object value. + + + The property '{0}' is not declared on the non-open type '{1}'. + + + The entity set '{0}' doesn't have the 'OData.EntitySetUri' annotation. This annotation is required. + + + The entity set '{0}' has a URI '{1}' which has no path segments. An entity set URI suffix cannot be appended to a URI without path segments. + + + Neither the 'OData.EntityInstanceUri' nor the 'OData.EntitySetUriSuffix' annotation was found for entity set '{0}'. One of these annotations is required. + + + Parent id or contained context url is missing which is required to compute id for contained instance. Specify ODataUri in the ODataMessageWriterSettings or return parent id or context url in the payload. + + + The Id cannot be computed, since the navigation source '{0}' cannot be resolved to a known entity set from model. + + + The entity type '{0}' is not compatible with the base type '{1}' of the provided entity set '{2}'. When an entity type is specified for an OData resource set or resource reader, it has to be the same or a subtype of the base type of the specified entity set. + + + ODataMessageReader.DetectPayloadKind was called for a request payload. Payload kind detection is only supported for responses in Json. + + + The parameter '{0}' is specified with a null value. For Json, the '{0}' argument to the 'CreateParameterReader' method cannot be null. + + + Parsing Json resource sets or entries in requests without entity set is not supported. Pass in the entity set as a parameter to ODataMessageReader.CreateODataResourceReader or ODataMessageReader.CreateODataResourceSetReader method. + + + Parsing Json payloads without a model is only supported for error payloads. + + + An attempt to read a collection request payload without specifying a collection item type was detected. When reading collection payloads in requests, an expected item type has to be provided. + + + The required instance annotation 'odata.context' was not found at the beginning of a response payload. + + + The annotation '{0}' was targeting the instance annotation '{1}'. Only the '{2}' annotation is allowed to target an instance annotation. + + + The annotation '{0}' is found targeting the instance annotation '{1}'. However the value for the instance annotation '{1}' is not found immediately after. In Json, an annotation targeting an instance annotation must be immediately followed by the value of the targeted instance annotation. + + + An attempt to write an entity reference link inside a navigation link after a resource set has been written inside the same navigation link in a request was detected. In Json requests, all entity reference links inside a navigation link have to be written before all resource sets inside the same navigation link. + + + The ODataResourceSet.InstanceAnnotations collection must be empty for expanded resource sets. Custom instance annotations are not supported on expanded resource sets. + + + Neither an expected type nor a type name in the OData object model was provided for a resource value. When writing a request payload, either an expected type or a type name has to be specified. + + + Neither an expected type nor a type name in the OData object model was provided for a collection property. When writing a request payload, either an expected type or a type name has to be specified. + + + When writing a JSON response, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResourceSerializationInfo must be set on the ODataResource or ODataResourceSet that is being written. + + + When writing a JSON response in full metadata mode, a user model must be specified and the entity set and entity type must be passed to the ODataMessageWriter.CreateODataResourceWriter method or the ODataResource.TypeName must be set. + + + The base type '{0}' of the entity set specified for writing a payload is not assignable from the specified entity type '{1}'. When an entity type is specified it has to be the same or derived from the base type of the entity set. + + + The collection type name for the top level collection is unknown. When writing a response, the item type must be passed to the ODataMessageWriter.CreateODataCollectionWriter method or the ODataCollectionStartSerializationInfo must be set on the ODataCollectionStart. + + + Context URL for payload kind '{0}' is not supported. + + + The stream value must be a property of an ODataResource instance. + + + The navigationSource for resource or resource set is unknown or the Type is null. When writing a response, the navigation source or the type must be passed to the ODataMessageWriter.CreateODataResourceWriter/ODataMessageWriter.CreateODataResourceSetWriter method or the ODataResourceSerializationInfo must be set on the resource/resource set. + + + The ODataMessageWriterSetting.ODataUri must be set when writing individual property. + + + The type name for the top level property is unknown. When writing a response, the ODataValue must have a type name on itself or have a SerializationTypeNameAnnotation. + + + The Path property '{0}' of ODataMessageWriterSetting.ODataUri must end with the navigation property which the contained elements being written belong to. + + + The annotation '{0}' was found. This annotation is either not recognized or not expected at the current position. + + + The property '{0}' has a property annotation '{1}'. This annotation is either not recognized or not expected at the current position. + + + An OData property annotation '{0}' was found. This property annotation is either not recognized or not expected at the current position. + + + A property with name '{0}' was found. This property is either not recognized or not expected at the current position. + + + No top-level properties were found. A top-level property or collection in Json must be represented as a JSON object with exactly one property which is not an annotation. + + + A top-level property with name '{0}' was found in the payload; however, property and collection payloads must always have a top-level property with name '{1}'. + + + The 'odata.type' instance annotation value '{0}' is not a valid type name. The value of the 'odata.type' instance annotation must be a non-empty string. + + + One or more property annotations for property '{0}' were found in the top-level property or collection payload without the property to annotate. Top-level property and collection payloads must contain a single property, with optional annotations for this property. + + + One or more property annotations for property '{0}' were found in the resource value without the property to annotate. Resource values must only contain property annotations for existing properties. + + + A complex property with an '{0}' property annotation was found. Complex properties must not have the '{0}' property annotation, instead the '{0}' should be specified as an instance annotation in the complex value. + + + The 'odata.type' instance annotation in a resource object is not the first property of the object. In OData, the 'odata.type' instance annotation must be the first property of the resource object. + + + The property '{0}' has a property annotation '{1}'. Primitive, complex, collection or open properties can only have an 'odata.type' property annotation. + + + The property with name '{0}' was found after the data property with name '{1}'. If a type is specified for a data property, it must appear before the data property. + + + An '{0}' annotation was read inside a JSON object representing a primitive value; type annotations for primitive values have to be property annotations of the owning property. + + + A top-level property with an invalid primitive null value was found. In OData, top-level properties with null value have to be serialized as JSON object with an '{0}' annotation that has the value '{1}'. + + + Encountered a metadata reference property '{0}' in a scope other than a resource. In OData, a property name with a '#' character indicates a reference into the metadata and is only supported for describing operations bound to a resource. + + + The property with name '{0}' was found in a null payload. In OData, no properties or OData annotations can appear in a null payload. + + + A collection type of '{0}' was specified for a non-collection value. + + + A non-collection type of '{0}' was specified for a collection value. + + + The property with name '{0}' was found with a value node of type '{1}'; however, a resource value of type '{2}' was expected. + + + The value specified for the spatial property was not valid. You must specify a valid spatial value. + + + If a primitive value is representing a resource, the resource must be null. + + + The '{0}' instance or property annotation has a null value. In OData, the '{0}' instance or property annotation must have a non-null string value. + + + An '{0}' annotation was found with an invalid value. In OData, the only valid value for the '{0}' annotation is '{1}'. + + + The InstanceAnnotations collection has more than one instance annotations with the name '{0}'. All instance annotation names must be unique within the collection. + + + A null metadata document URI was found in the payload. Metadata document URIs must not be null. + + + The context URI '{0}' is not valid for the expected payload kind '{1}'. + + + The context URI '{0}' references the entity set or type '{1}'. However, no entity set or type with name '{1}' is declared in the metadata. + + + A '$select' query option was found for the payload kind '{0}'. In OData, a '$select' query option is only supported for payload kinds 'Resource' and 'ResourceSet'. + + + No model was specified for the ODataMessageReader. A message reader requires a model for Json payload to be specified in the ODataMessageReader constructor. + + + The context URL '{0}' is invalid. + + + Last segment in context URL '{0}' should not be KeySegment. + + + The top level context URL '{0}' should be an absolute Uri. + + + Invalid primitive value '{0}' for @removed annotation. @removed annotation must be a JSON object, optionally containing a 'reason' property. + + + The 'odata.type' instance annotation in a resource object is preceded by an invalid property. In OData, the 'odata.type' instance annotation must be either the first property in the JSON object or the second if the 'odata.context' instance annotation is present. + + + The '{0}' instance annotation in a resource object is preceded by a property or property annotation. In OData, the '{0}' instance annotation must be before any property or property annotation in a resource object. + + + Encountered a deleted entity when reading a non-delta response payload. Deleted entities are only supported in request payloads and delta responses. + + + A node of type '{0}' was read from the JSON reader when trying to read the start of the content of a resource set; however, a node of type 'StartArray' was expected. + + + Did not find the required '{0}' property for the expected resource set. + + + A node of type '{0}' was read from the JSON reader when trying to read the entries of a typed resource set; however, a node of type 'StartObject' or 'EndArray', or a null value, was expected. + + + A property annotation for a property with name '{0}' was found when reading a top-level resource set. No property annotations, only instance annotations are allowed when reading top-level resource sets. + + + A property with name '{0}' was found when reading a top-level resource set. No properties other than the resource set property with name '{1}' are allowed. + + + A property '{0}' which only has property annotations in the payload but no property value is declared to be of type '{1}'. In OData, only navigation properties and named streams can be represented as properties without values. + + + A stream property {0} was found in a Json request payload. Stream properties are only supported in responses. + + + The stream property '{0}' has a property annotation '{1}'. Stream property can only have the 'odata.mediaEditLink', 'odata.mediaReadLink', 'odata.mediaEtag' and 'odata.mediaContentType' property annotations. + + + A stream property '{0}' has a value in the payload. In OData, stream property must not have a value, it must only use property annotations. + + + The navigation property '{0}' has a property annotation '{1}'. Deferred navigation links can only have the 'odata.navigationLink' and 'odata.associationLink' property annotations. + + + A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartObject' node or 'PrimitiveValue' node with null value was expected. + + + A node of type '{0}' was read from the JSON reader when trying to read the contents of the property '{1}'; however, a 'StartArray' node was expected. + + + A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property '{0}'; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected. + + + The navigation property '{0}' has a property annotation '{1}'. Expanded resource navigation links can only have the 'odata.context', 'odata.navigationLink' and 'odata.associationLink' property annotations. + + + The navigation property '{0}' has a property annotation '{1}'. Expanded resource set navigation links can only have the 'odata.context', 'odata.navigationLink', 'odata.associationLink' and 'odata.nextLink' property annotations + + + The property '{0}' has a property annotation '{1}'. The complex collection property can only have the 'odata.count', 'odata.type' and 'odata.nextLink' property annotations. + + + Multiple property annotations '{0}' were found when reading the nested resource '{1}'. Only a single property annotation '{0}' can be specified for a nested resource. + + + A property annotation '{0}' was found after the property '{1}' it is annotating. Only the 'odata.nextLink' property annotation can be used after the property it is annotating. + + + The navigation property '{0}' has a property annotation '{1}'. Navigation links in request payloads can only have the '{2}' property annotation. + + + The resource reference navigation property '{0}' has a property annotation '{1}' with an array value. Resource reference navigation properties can only have a property annotation '{1}' with a string value. + + + The resource set reference navigation property '{0}' has a property annotation '{1}' with a string value. Resource set reference navigation properties can only have a property annotation '{1}' with an array value. + + + The value of '{0}' property annotation is an empty array. The '{0}' property annotation must have a non-empty array as its value. + + + The navigation property '{0}' has no expanded value and no '{1}' property annotation. Navigation property in request without expanded value must have the '{1}' property annotation. + + + The resource reference navigation property '{0}' has both the '{1}' property annotation as well as a value. Resource reference navigation properties can have either '{1}' property annotations or values, but not both. + + + An undeclared property '{0}' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values. + + + Encountered the operation '{0}' which can not be resolved to an ODataAction or ODataFunction. + + + Multiple '{0}' properties were found for an operation '{1}'. In OData, an operation can have at most one '{0}' property. + + + Multiple target bindings encountered for the operation '{0}' but the 'target' property was not found in an operation value. To differentiate between multiple target bindings, each operation value must have exactly one 'target' property. + + + A metadata reference property was found in a Json request payload. Metadata reference properties are only supported in responses. + + + The '{0}' property of the operation '{1}' cannot have a null value. + + + Encountered a reference into metadata '{0}' which does not refer to the known metadata url '{1}'. Open metadata reference properties are not supported. + + + A relative URI value '{0}' was specified in the payload, but the {1} annotation is missing from the payload. The payload must only contain absolute URIs or the {1} annotation must be on the payload. + + + The {0} annotation is missing from the payload. + + + When trying to read the start of a collection, the expected collection property with name '{0}' was not found. + + + A node of type '{0}' was read from the JSON reader when trying to read the items of a collection; however, a 'StartArray' node was expected. + + + A property or annotation for a property with name '{0}' or an instance annotation with name '{0}' was found after reading the items of a top-level collection. No additional properties or annotations are allowed after the collection property. + + + An 'odata.type' annotation with value '{0}' was found for a top-level collection payload; however, top-level collections must specify a collection type. + + + A node of type '{0}' was read from the JSON reader when trying to read the start of an entity reference link. In Json, entity reference links must be objects. + + + A property annotation with name '{0}' was detected when reading an entity reference link; entity reference links do not support property annotations. + + + An instance annotation with name '{0}' or a property annotation for the property with name '{0}' was found when reading an entity reference link. No OData property or instance annotations are allowed when reading entity reference links. + + + A property with name '{0}' was found when reading an entity reference link. No properties other than the entity reference link property with name '{1}' are allowed. + + + The required property '{0}' for an entity reference link was not found. + + + Multiple '{0}' properties were found in an entity reference link object; however, a single '{0}' property was expected. + + + The '{0}' property of an entity reference link object cannot have a null value. + + + A property annotation was found for entity reference links; however, entity reference links only support instance annotations. + + + A property with name '{0}' or a property annotation for a property with name '{0}' was found when trying to read a collection of entity reference links; however, a property with name '{1}' was expected. + + + A property annotation for a property with name '{0}' was found when reading an entity reference links payload. No property annotations, only instance annotations are allowed when reading entity reference links. + + + Did not find the required '{0}' property for an entity reference links payload. + + + The '{0}' property of an operation '{1}' in '{2}' cannot have a null value. + + + Found a node of type '{1}' when starting to read the '{0}' operations value, however a node of type 'StartObject' was expected. The '{0}' operations value must have an object value. + + + Multiple '{0}' properties were found in a service document. In OData, a service document must have exactly one '{0}' property. + + + Multiple '{0}' properties were found in a service document element. In OData, a service document element must have exactly one '{0}' property. + + + No '{0}' property was found for a service document. In OData, a service document must have exactly one '{0}' property. + + + Encountered a service document element without a '{0}' property. In service documents, service document elements must contain a '{0}' property. + + + An unrecognized property annotation '{0}' was found in a '{1}' object in a service document. OData property annotations are not allowed in workspaces. + + + An unrecognized instance annotation '{0}' was found in a '{1}' object in a service document. OData instance annotations are not allowed in workspaces. + + + An unrecognized property annotation '{0}' was found in a service document element. OData property annotations are not allowed in service document elements. + + + An unrecognized instance annotation '{0}' was found in a service document element. OData instance annotations are not allowed in service document elements. + + + Encountered unexpected property '{0}' in a service document element. In service documents, service document element may only have '{1}' and '{2}' properties. + + + Encountered unexpected property '{0}' in a service document. The top level object of a service document may only have a '{1}' property. + + + Encountered a property annotation for the property '{0}' which wasn't immediately followed by the property. Property annotations must occur directly before the property being annotated. + + + An OData property annotation was found for a parameter payload; however, parameter payloads do not support OData property annotations. + + + One or more property annotations for property '{0}' were found in a parameter payload without the property to annotate. Parameter payloads must not contain property annotations for properties that are not in the payload. + + + The parameter '{0}' is of the '{1}' primitive type, which is not supported in Json. + + + When trying to read a null collection parameter value in Json, a node of type '{0}' with the value '{1}' was read from the JSON reader; however, a primitive 'null' value was expected. + + + The parameter '{0}' is of an unsupported type kind '{1}'. Only primitive, enum, complex, primitive collection, enum collection and complex collection types are supported. + + + When parsing a select clause a '*' segment was found before last segment of a property path. In OData, a '*' segment can only appear as last segment of a property path. + + + When parsing a select clause a '*' segment was found immediately after a type segment in a property path. In OData, a '*' segment cannot appear following a type segment. + + + An OData property annotation '{0}' was found in an error payload; however, error payloads do not support OData property annotations. + + + An OData instance annotation '{0}' was found in an error payload; however, error payloads do not support OData instance annotations. + + + One or more property annotations for property '{0}' were found in an error payload without the property to annotate. Error payloads must not contain property annotations for properties that are not in the payload. + + + A property with name '{0}' was found in the error value of a top-level error. In OData, a top-level error value can only have properties with name 'code', 'message', or 'innererror', or custom instance annotations. + + + The entity type '{0}' has no key properties. Entity types must define at least one key property. + + + The key property '{0}' on type '{1}' has a null value. Key properties must not have null values. + + + An ODataResource of type '{0}' is found without key properties. When writing without a user model, each resource must contain at least one property whose 'ODataProperty.SerializationInfo.PropertyKind' set to 'ODataPropertyKind.Key'. When writing with a user model, the entity type '{0}' defined in the model must define at least one key property. + + + The key property '{0}' on type '{1}' has a null value. Key properties must not have null values. + + + The property '{0}' on type '{1}' is a non-primitive value. All key and etag properties must be of primitive types. + + + The value of a property '{0}' in ODataResource cannot be of type ODataResourceValue or collection of ODataResourceValue. + + + The primitive property '{0}' on type '{1}' has a value which is not a primitive value. + + + The entity instance value of type '{0}' doesn't have a value for property '{1}'. To compute an entity's metadata, its key and concurrency-token property values must be provided. + + + Cannot create an ODataPrimitiveValue from null; use ODataNullValue instead. + + + An ODataPrimitiveValue was instantiated with a value of type '{0}'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types. + + + '{0}' is an invalid instance annotation name. An instance annotation name must contain a period that is not at the start or end of the name. + + + '{0}' is a reserved instance annotation name because it starts with '{1}'. Reserved names are not allowed for custom instance annotations. + + + '{0}' is an invalid instance annotation name. + + + The value of an instance annotation cannot be of type ODataStreamReferenceValue. + + + A type name was not provided for an instance of ODataCollectionValue. + + + A raw value was not provided for an instance of ODataUntypedValue. + + + Encountered an 'annotation' element without a 'term' attribute. All 'annotation' elements must have a 'term' attribute. + + + The value of the 'type' attribute on an 'annotation' element was '{0}', which is incompatible with the '{1}' attribute. + + + Encountered the attribute '{0}' on a non-empty 'annotation' element. If attribute value notation is used to specify the annotation's value, then there can be no body to the element. + + + Encountered an 'annotation' element with more than one attribute from following set: 'int', 'string', 'decimal', 'float', and 'bool'. Only one such attribute may appear on an 'annotation' element. + + + The pattern '{0}' is not a valid pattern to match an annotation. It must contain at least one '.' separating the namespace and the name segments of an annotation. + + + The pattern '{0}' is not a valid pattern to match an annotation. It must not contain a namespace or name segment that is empty. + + + The pattern '{0}' is not a supported pattern to match an annotation. It must not contain '*' as part of a segment. + + + The pattern '{0}' is not a supported pattern to match an annotation. '*' must be the last segment of the pattern. + + + The specified URI '{0}' must be absolute. + + + The maximum depth setting must be a number greater than zero. + + + Invalid value '{0}' for $skip query option found. The $skip query option requires a non-negative integer value. + + + Invalid value '{0}' for $top query option found. The $top query option requires a non-negative integer value. + + + Invalid value '{0}' for $count query option found. Valid values are '{1}'. + + + Invalid value '{0}' for $index query option found. The $index query option requires an integer value. + + + Query option '{0}' was specified more than once, but it must be specified at most once. + + + The CLR literal of type '{0}' is not supported to be written as a Uri part. + + + QueryToken '{0}' is not supported to be written as a Uri part. + + + Recursion depth exceeded allowed limit. + + + Expression expected at position {0} in '{1}'. + + + '(' expected at position {0} in '{1}'. + + + ')' or ',' expected at position {0} in '{1}'. + + + ')' or operator expected at position {0} in '{1}'. + + + Only $filter and $search query options are allowed within $count. + + + Expecting a Star token but got: '{0}'. + + + The range variable '{0}' has already been declared. + + + 'as' expected at position {0} in '{1}'. + + + 'with' expected at position {0} in '{1}'. + + + Unrecognized with '{0}' at '{1}' in '{2}'. + + + Expression expected at position {0} in '{1}'. + + + '{0}' expected at position {1} in '{2}'. + + + The inner most expand transformation requires a filter transformation at position {0} in '{1}'. + + + The URI '{0}' is not valid because it is not based on '{1}'. + + + Bad Request: there was an error in the query syntax. + + + Too many segments in URI. + + + The URI part '{0}' is not valid because there's no leading escape character. + + + The DateTimeOffset text '{0}' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range. + + + Inner or start path segments must be navigation properties in $select. + + + The parameter alias value expression is not string value. + + + An unsupported query token kind '{0}' was found. + + + Could not find a property named '{1}' on type '{0}'. + + + Can not resolve the segment identifier '{0}' in query option. + + + Property '{0}' is not declared on type '{1}' or is not a key property. Only key properties can be used in key lookups. + + + Could not find a function named '{0}' with parameters '{1}'. + + + An unnamed key value was used in a key lookup on a type '{0}' which has more than one key property. Unnamed key value can only be used on a type with one key property. + + + A key property '{0}' was found twice in a key lookup. Each key property can be specified just once in a key lookup. + + + A key lookup on type '{0}' didn't specify values for all key properties. All key properties must be specified in a key lookup. + + + Expression of type '{0}' cannot be converted to type '{1}'. + + + The $filter expression must evaluate to a single boolean value. + + + The $orderby expression must evaluate to a single value of primitive type. + + + A PropertyAccessQueryToken without a parent was encountered outside of $filter or $orderby expression. The PropertyAccessQueryToken without a parent token is only allowed inside $filter or $orderby expressions. + + + The operand for a binary operator '{0}' is not a single value. Binary operators require both operands to be single values. + + + The operand for a unary operator '{0}' is not a single value. Unary operators require the operand to be a single value. + + + The left operand for the IN operation is not a single value. IN operations require the left operand to be a single value and the right operand to be a collection value. + + + The right operand for the IN operation is not a collection value. IN operations require the left operand to be a single value and the right operand to be a collection value. + + + The parent value for a property access of a property '{0}' is not a single value. Property access can only be applied to a single value. + + + The next token in a CountSegmentNode must be a collection. + + + A binary operator with incompatible types was detected. Found operand types '{0}' and '{1}' for operator kind '{2}'. + + + A unary operator with an incompatible type was detected. Found operand type '{0}' for operator kind '{1}'. + + + An unknown function with name '{0}' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed. + + + The argument for an invocation of a function with name '{0}' is not a single value. All arguments for this function must be single values. + + + No function signature for the function with name '{0}' matches the specified arguments. The function signatures considered are: {1}. + + + A token of kind '{0}' was bound to the value null; this is invalid. A query token must always be bound to a non-null query node. + + + The value '{0}' is not a non-negative integer value. In OData, the $top query option must specify a non-negative integer value. + + + The value '{0}' is not a non-negative integer value. In OData, the $skip query option must specify a non-negative integer value. + + + The bind state cannot be null. In OData, the bind state for query options should not be null and there should be query options in the object. + + + The bind method cannot be null. In OData, the processing of query options should have a corresponding bind method. + + + Encountered invalid type cast. '{0}' is not assignable from '{1}'. + + + Any/All may only be used following a collection. + + + The parameter '{0}' is not in scope. + + + A navigation property can only follow single entity nodes. + + + The Any/All query expression must evaluate to a single boolean value. + + + The Cast or IsOf expression has an invalid number of operands: number of operands is '{0}' and it should be 1 or 2. + + + Cast or IsOf Function must have a type in its arguments. + + + The Cast and IsOf functions do not support collection arguments or types. + + + Collection open properties are not supported in this release. + + + Can only bind segments that are Navigation, Structural, Complex, or Collections. We found a segment '{0}' that isn't any of those. Please revise the query. + + + The '{0}' option cannot be applied to the query path. '{0}' can only be applied to a collection of entities. + + + String item should be single/double quoted: '{0}'. + + + Invalid PrimitiveTypeKind {0}. A Stream item must be of type binary or string, or none if unknown." + + + $apply/aggregate expression '{0}' operation does not support value type '{1}'. + + + $apply/aggregate does not support method '{0}'. + + + $apply/aggregate expression token kind '{0}' not supported. + + + $apply/aggregate expression '{0}' must evaluate to a single value. + + + $apply/groupby grouping expression '{0}' must evaluate to a property access value. + + + $apply clause does not support type '{0}'. + + + $apply/groupby not support '{0}' as child transformation + + + There are unsupported aggregation expressions in the transformation node. + + + Cannot find a suitable overload for function '{0}' that takes '{1}' arguments. + + + Found a Uri function '{0}' with a parent token. Uri functions cannot have parent tokens. + + + Found a function '{0}' on an open property. Functions on open properties are not supported. + + + Parameter or entity key names must be unique. There is most likely an error in the model. + + + '{0}' is not a valid count option. + + + The child type '{0}' in a cast was not an entity type. Casts can only be performed on entity types. + + + Enumeration type value can only be casted to or from string. + + + The string '{0}' is not a valid enumeration type constant. + + + Invalid content-id '{0}' for batch reference segment. + + + Property '{0}' is of an unrecognized EdmPropertyKind. + + + It's not allowed to append '{0}' after wildcard. + + + It's not allowed to nest query options within '{0}' selection. + + + Found a system token, '{0}', while parsing a select clause. + + + Only properties specified in $expand can be traversed in $select query options. Selected item was '{0}'. + + + Trying to follow type segments on a segment that isn't a type. Segment was '{0}'. + + + Found a path with multiple navigation properties or a bad complex property path in a select clause. Please reword your query such that each level of select or expand only contains either TypeSegments or Properties. + + + Trying to traverse a non-normalized expand tree. + + + The type '{0}' is not defined in the model. + + + Property '{0}' on type '{1}' is not a navigation property or complex property. Only navigation properties can be expanded. + + + Found a path within a select or expand query option that isn't ended by a non-type segment. + + + Trying to parse a type segment path that is too long. + + + Found a path traversing multiple navigation properties. Please rephrase the query such that each expand path contains only type segments and navigation properties. + + + The $level option on navigation property '{0}' is not allowed, because the related entity type '{1}' could not be cast to source entity type '{2}'. + + + Segment '{0}' is not valid in expand path. Before navigation property, only type segment or entity or complex property can exist. + + + The navigation property must have a target multiplicity of 'One' or 'ZeroOrOne' to create a SingleNavigationNode. + + + An entity type '{0}' was given to NonEntityParameterQueryNode. Use EntityParameterQueryNode instead. + + + The navigation property must have a target multiplicity of 'Many' to create a CollectionNavigationNode. + + + A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is not structural. + + + A node of this kind requires the associated property to be a structural, non-collection type, but property '{0}' is a collection. + + + A node of this kind requires the associated property to be a structural, collection type, but property '{0}' is not a collection. + + + Only static Entity Set reference expressions are supported currently. + + + An instance of CollectionFunctionCallNode can only be created with a primitive, complex or enum collection type. For functions returning a collection of entities, use EntityCollectionFunctionCallNode instead. + + + An instance of EntityCollectionFunctionCallNode can only be created with an entity collection type. For functions returning a collection of primitive or complex values, use CollectionFunctionCallNode instead. + + + An instance of SingleValueFunctionCallNode can only be created with a primitive, complex or enum type. For functions returning a single entity, use SingleEntityFunctionCallNode instead. + + + An instance of InNode can only be created where the item types of the right operand '{0}' and the left operand '{1}' can be compared. + + + Found a segment that isn't a path while parsing the path within a select or expand query option. + + + Found multiple select terms with same select path '{0}' at one $select, please combine them together. + + + Term '{0}' is not valid in a $expand expression, as only $level option is allowed when the expanded navigation property is star. + + + Term '{0}' is not valid in a $expand expression, no option is allowed when the expanded navigation property is */$ref. + + + Cannot get parent structured type for term '{0}' to auto populate all navigation properties. + + + Term '{0}' is not valid in a $expand expression as multiple stars are not allowed. + + + Term '{0}' is not valid in a $select or $expand expression. + + + Top option must be a non-negative integer, it is set to '{0}' instead. + + + Skip option must be a non-negative integer, it is set to '{0}' instead. + + + Count option must be a boolean value, it is set to '{0}' instead. + + + Levels option must be a non-negative integer or 'max', it is set to '{0}' instead. + + + Found system token '{0}' in select or expand clause '{1}'. + + + Missing expand option on navigation property '{0}'. If a parenthesis expression follows an expanded navigation property, then at least one expand option must be provided. + + + Empty parenthesis not allowed. + + + Missing select option on property '{0}'. If a parenthesis expression follows a selected property, then at least one query option must be provided. + + + Parameter 'relativeUri' must be a relative Uri if serviceRoot is not specified. + + + A service root URI must be provided to the ODataUriParser in order to use this method. + + + The URI '{0}' must be an absolute URI. + + + The limit must be greater than or equal to zero + + + The result of parsing $expand contained at least {0} items, but the maximum allowed is {1}. + + + The result of parsing $expand was at least {0} items deep, but the maximum allowed is {1}. + + + The type '{0}' is not valid for $select or $expand, only structured types are allowed. + + + The handler property for context '{0}' should not return null. + + + More than one properties match the name '{0}' were found in type '{1}'. + + + More than one navigation sources match the name '{0}' were found in model. + + + More than one types match the name '{0}' were found in model. + + + More than one keys match the name '{0}' were found. + + + More than one parameters match the name '{0}' were found. + + + The UrlValidator used to validate an ODataUri must use the same Model as the ODataUriParser. + + + The request URI is not valid. $ref cannot be applied to the segment '{0}' since $ref can only follow an entity segment or entity collection segment. + + + $value cannot be applied to a collection. + + + The type '{0}' does not inherit from and is not a base type of '{1}'. The type of '{2}' must be related to the Type of the EntitySet. + + + Type cast segment '{0}' after a collection which is not of entity or complex type is not allowed. + + + Type cast segment '{0}' on {1} '{2}' is not allowed due to an Org.OData.Validation.V1.DerivedTypeConstraint annotation. + + + A resource set may contain a next page link, a delta link or neither, but must not contain both. + + + The last segment, and only the last segment, can be a navigation property in $expand. + + + The last segment must be a navigation property or type segment in $expand. + + + Found a segment of type '{0} in an expand path, but only NavigationProperty, Property and Type segments are allowed. + + + TypeSegment cannot be the only segment in a $select. + + + Found a segment of type '{0} in a select path, but only TypeSegment, NavigationPropertySegment, PropertySegment, OperationSegment or OpenPropertySegments are allowed. + + + An operation can only be the last segment in $select. + + + A navigation property can only be the last segment in $select. + + + The target Entity Set of Navigation Property '{0}' could not be found. This is most likely an error in the IEdmModel. + + + The function overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. + + + No type could be computed for this Segment since there were multiple possible operations with varying return types. + + + The return type from the operation is not possible with the given entity set. + + + Unable to resolve function overloads to a single function. There was more than one function in the model with name '{0}' and parameter names '{1}'. + + + Multiple action overloads were found with the same binding parameter for '{0}'. + + + Multiple action import overloads were found with the same binding parameter for '{0}'. + + + Multiple action import and function import overloads for '{0}' were found. + + + Multiple action and function overloads for '{0}' were found. + + + The operation overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. + + + The operation import overloads matching '{0}' are invalid. This is most likely an error in the IEdmModel. + + + The given custom function '{0}' already exists as a Built-In function. Consider use 'addAsOverloadToBuiltInFunction = true' parameter. + + + The given custom function '{0}' already exists as a Built-In function in one of it's overloads. Thus cannot override the Built-In function. + + + The given function name '{0}' already exists as a custom function with the same overload. + + + The ODataPathSegment provided (Id = {0}) is not an EntitySetSegment. + + + The KeySegment provided (Id = {0}) is either null, having no keys, or does not target a single resource. + + + $filter path segment cannot be applied on single entities or singletons. Entity type: '{0}'. + + + $each set-based operation cannot be applied on single entities or singletons. Entity type: '{0}'. + + + The $filter path segment must be in the form $filter(expression), where the expression resolves to a boolean. + + + There are no navigation sources found to apply '{0}'. + + + Only a single operation can follow $each. + + + Empty segment encountered in request URL. Please make sure that a valid request URL is specified. + + + Bad Request - Error in query syntax. + + + The request URI is not valid, the segment $count cannot be applied to the root of the service. + + + The request URI is not valid, the segment $filter cannot be applied to the root of the service. + + + The request URI is not valid, the segment $each cannot be applied to the root of the service. + + + The request URI is not valid, the segment $ref cannot be applied to the root of the service. + + + The request URI is not valid. The segment '{0}' must be the last segment in the URI because it is one of the following: $ref, $batch, $count, $value, $metadata, a named media resource, an action, a noncomposable function, an action import, a noncomposable function import, an operation with void return type, or an operation import with void return type. + + + The request URI is not valid. The segment '{0}' must refer to a navigation property since the previous segment identifier is '{1}'. + + + The request URI is not valid. There must a segment specified after the '{0}' segment and the segment must refer to a entity resource. + + + The request URI is not valid. $count cannot be applied to the segment '{0}' since $count can only follow an entity set, a collection navigation property, a structural property of collection type, an operation returning collection type or an operation import returning collection type. + + + The request URI is not valid. Since the segment '{0}' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource. + + + The request URI is not valid. The segment '{0}' cannot include key predicates, however it may end with empty parenthesis. + + + The segment '{1}' in the request URI is not valid. The segment '{0}' refers to a primitive property, function, or service operation, so the only supported value from the next segment is '$value'. + + + The type '{0}' specified in the URI is neither a base type nor a sub-type of the previously-specified type '{1}'. + + + Open navigation properties are not supported on OpenTypes. Property name: '{0}'. + + + Error processing request stream. In batch mode, a resource can be cross-referenced only for bind/unbind operations. + + + The response requires that version {0} of the protocol be used, but the MaxProtocolVersion of the data service is set to {1}. + + + The number of keys specified in the URI does not match number of key properties for the resource '{0}'. + + + The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared key of the resource '{0}'. + + + The key in the request URI is not valid for resource '{0}'. Ensure that the names and number of key properties match the declared or alternate key properties for the resource '{0}'. + + + Segments with multiple key values must specify them in 'name=value' form. + + + Resource not found for the segment '{0}'. + + + Batched service action '{0}' cannot be invoked because it was bound to an entity created in the same changeset. + + + Forbidden + + + Found an operation bound to a non-entity type. + + + The request URI is not valid. The bound function binding to '{0}' does not match the composability of the escape function in the URI. + + + The UrlEscape function '{0}' must have exactly one non-binding parameter of type 'Edm.String'. + + + A composable escape function must have a valid operation passed as a parameter. + + + An internal error '{0}' occurred. + + + A non-negative integer value was expected, but the value '{0}' is not a valid non-negative integer. + + + A positive integer value was expected, but the value '{0}' is not a valid positive integer. + + + A positive long value was expected; however, the value '{0}' is not a valid positive long value. + + + Value cannot be null or empty. + + + Only $ref is allowed with star in $expand option. + + + $count is not allowed in $select option. + + + No property is allowed after $count segment. + + + No property is allowed after $ref segment. + + + No segment is allowed before star in $expand. + + + An identifier was expected at position {0}. + + + There is an unterminated string literal at position {0} in '{1}'. + + + Syntax error: character '{0}' is not valid at position {1} in '{2}'. + + + Syntax error at position {0} in '{1}'. + + + There is an unterminated literal at position {0} in '{1}'. + + + A digit was expected at position {0} in '{1}'. + + + Found an unbalanced bracket expression. + + + Numeric string '{0}' is not a valid Int32/Int64/Double/Decimal. + + + An unrecognized escape sequence '\\{0}' was found at position {1} in '{2}'. + + + Unrecognized '{0}' literal '{1}' at '{2}' in '{3}'. + + + Unrecognized '{0}' literal '{1}' at '{2}' in '{3}' with reason '{4}'. + + + Failed to parse '{0}' of Edm type '{1}' to primitive type. + + + Failed to parse string to Geography. + + + The given uri custom type parser already exists. + + + An existing custom UriTypeParser is already registered to the given EdmTypeReference '{0}'. + + + The given type prefix literal name '{0}' must contain letters or '.' only. + + + The given type literal prefix '{0}' already exists as a custom uri type literal prefix. + + + The value '{0}' is not a valid duration value. + + + The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. + + + Invalid JSON. An unexpected comma was found in scope '{0}'. A comma is only valid between properties of an object or between elements of an array. + + + Invalid JSON. A array closure mismatch occurred. A '{0}' was expected to match '{1}', but instead '{2}' was found. + + + Invalid JSON. More than one value was found at the root of the JSON content. JSON content can only have one value at the root level, which is an array, an object or a primitive value. + + + Invalid JSON. Unexpected end of input was found in JSON content. Not all object and array scopes were closed. + + + Invalid JSON. Unexpected token '{0}'. + + + Invalid JSON. A token was not recognized in the JSON content. + + + Invalid JSON. A colon character ':' is expected after the property name '{0}', but none was found. + + + Invalid JSON. An unrecognized escape sequence '{0}' was found in a JSON string value. + + + Invalid JSON. Unexpected end of input reached while processing a JSON string value. + + + Invalid JSON. The value '{0}' is not a valid number. + + + Invalid Binary value. The value '{0}' is not a valid Base64 encoded value. + + + Invalid JSON. A comma character ',' was expected in scope '{0}'. Every two elements in an array and properties of an object must be separated by commas. + + + Invalid JSON. The property name '{0}' is not valid. The name of a property cannot be empty. + + + Cannot increase the JSON reader buffer to hold the input JSON which has very long token. + + + Cannot access the Value property while streaming a value. Please dispose the StreamReader or TextReader before continuing. + + + Cannot call Read while streaming a value. Please dispose the StreamReader or TextReader before continuing. + + + Cannot create a Stream in the current state. A Stream can only be created for reading a JSON string value when positioned on, and before accessing, the value. + + + Cannot create a TextReader in the current state. A TextReader can only be created for reading a JSON string value when positioned on, and before accessing, the value. + + + An unexpected '{1}' node was found when reading from the JSON reader. A '{0}' node was expected. + + + An unexpected '{1}' node was found for property named '{2}' when reading from the JSON reader. A '{0}' node was expected. + + + Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value. + + + Cannot read the value '{0}' as a quoted JSON string value. + + + Cannot read the value '{0}' as a double numeric value. + + + An unexpected instance annotation name '{0}' was found when reading from the JSON reader, In OData, Instance annotation name must start with @. + + + The buffer from pool cannot be null or less than the required minimal size '{0}'. + + + No service for type '{0}' has been registered. + + + The value '{0}' is not a qualified type name. A qualified type name is expected. + + \ No newline at end of file diff --git a/src/Microsoft.OData.Core/SelectedPropertiesNode.cs b/src/Microsoft.OData.Core/SelectedPropertiesNode.cs index f99630802b..03436cfcc2 100644 --- a/src/Microsoft.OData.Core/SelectedPropertiesNode.cs +++ b/src/Microsoft.OData.Core/SelectedPropertiesNode.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData using Microsoft.OData.Metadata; using Microsoft.OData.UriParser; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -682,7 +682,7 @@ private IEnumerable GetMatchingTypeSegments(IEdmStructur { if (typeSegmentChild.hasWildcard) { - throw new ODataException(ODataErrorStrings.SelectedPropertiesNode_StarSegmentAfterTypeSegment); + throw new ODataException(SRResources.SelectedPropertiesNode_StarSegmentAfterTypeSegment); } yield return typeSegmentChild; @@ -759,7 +759,7 @@ private void ParsePathSegment(string[] segments, int index) { if (isStar) { - throw new ODataException(ODataErrorStrings.SelectedPropertiesNode_StarSegmentNotLastSegment); + throw new ODataException(SRResources.SelectedPropertiesNode_StarSegmentNotLastSegment); } SelectedPropertiesNode childNode = this.EnsureChildNode(currentSegment, false); diff --git a/src/Microsoft.OData.Core/TypeNameOracle.cs b/src/Microsoft.OData.Core/TypeNameOracle.cs index 142ae5968c..591ecd02d8 100644 --- a/src/Microsoft.OData.Core/TypeNameOracle.cs +++ b/src/Microsoft.OData.Core/TypeNameOracle.cs @@ -9,6 +9,7 @@ namespace Microsoft.OData #region Namespaces using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -42,7 +43,7 @@ internal static IEdmType ResolveAndValidateTypeName(IEdmModel model, string type // if we have metadata, the type name of a resource must not be null if (model.IsUserModel()) { - throw new ODataException(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + throw new ODataException(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); } return null; @@ -50,7 +51,7 @@ internal static IEdmType ResolveAndValidateTypeName(IEdmModel model, string type if (typeName.Length == 0) { - throw new ODataException(Strings.ValidationUtils_TypeNameMustNotBeEmpty); + throw new ODataException(SRResources.ValidationUtils_TypeNameMustNotBeEmpty); } if (!model.IsUserModel()) @@ -62,7 +63,7 @@ internal static IEdmType ResolveAndValidateTypeName(IEdmModel model, string type IEdmType resolvedType = MetadataUtils.ResolveTypeNameForWrite(model, typeName); if (resolvedType == null) { - throw new ODataException(Strings.ValidationUtils_UnrecognizedTypeName(typeName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, typeName)); } if (resolvedType.TypeKind != EdmTypeKind.Untyped) @@ -276,7 +277,7 @@ protected static string GetTypeNameFromValue(object value) IEdmPrimitiveTypeReference primitiveTypeReference = EdmLibraryExtensions.GetPrimitiveTypeReference(value.GetType()); if (primitiveTypeReference == null) { - throw new ODataException(Strings.ValidationUtils_UnsupportedPrimitiveType(value.GetType().FullName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_UnsupportedPrimitiveType, value.GetType().FullName)); } return primitiveTypeReference.FullName(); @@ -293,7 +294,7 @@ private static void ValidateIfTypeNameMissing(string typeName, IEdmModel model, // if we have metadata, the type name of an open (dynamic) property value must not be null if (typeName == null && model.IsUserModel() && isOpenPropertyType) { - throw new ODataException(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + throw new ODataException(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); } } diff --git a/src/Microsoft.OData.Core/TypeUtils.cs b/src/Microsoft.OData.Core/TypeUtils.cs index dd1b506435..e297b263a9 100644 --- a/src/Microsoft.OData.Core/TypeUtils.cs +++ b/src/Microsoft.OData.Core/TypeUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData { + using Microsoft.OData.Core; #region Namespaces using System; using System.Diagnostics; @@ -105,7 +106,7 @@ internal static void ParseQualifiedTypeName(string qualifiedTypeName, out string int separator = qualifiedTypeName.LastIndexOf(".", StringComparison.Ordinal); if (separator == -1) { - throw new ODataException(Strings.TypeUtils_TypeNameIsNotQualified(qualifiedTypeName)); + throw new ODataException(Error.Format(SRResources.TypeUtils_TypeNameIsNotQualified, qualifiedTypeName)); } namespaceName = qualifiedTypeName.Substring(0, separator); diff --git a/src/Microsoft.OData.Core/Uri/ODataUri.cs b/src/Microsoft.OData.Core/Uri/ODataUri.cs index a95f033e59..883ec59194 100644 --- a/src/Microsoft.OData.Core/Uri/ODataUri.cs +++ b/src/Microsoft.OData.Core/Uri/ODataUri.cs @@ -13,6 +13,7 @@ namespace Microsoft.OData using System.Linq; using Microsoft.OData.UriParser.Aggregation; using Microsoft.OData.UriParser; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -112,7 +113,7 @@ public Uri ServiceRoot if (!value.IsAbsoluteUri) { - throw new ODataException(Strings.WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute(UriUtils.UriToString(value))); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute, UriUtils.UriToString(value))); } this.serviceRoot = UriUtils.EnsureTaillingSlash(value); diff --git a/src/Microsoft.OData.Core/Uri/ODataUriConversionUtils.cs b/src/Microsoft.OData.Core/Uri/ODataUriConversionUtils.cs index eef925352f..b961a30840 100644 --- a/src/Microsoft.OData.Core/Uri/ODataUriConversionUtils.cs +++ b/src/Microsoft.OData.Core/Uri/ODataUriConversionUtils.cs @@ -15,7 +15,7 @@ using Microsoft.OData.Evaluation; using Microsoft.OData.Json; using Microsoft.OData.Metadata; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData { @@ -116,7 +116,7 @@ internal static object VerifyAndCoerceUriPrimitiveLiteral( { if (!expectedTypeReference.IsNullable) { - throw new ODataException(ODataErrorStrings.ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType(expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ODataUriUtils_ConvertFromUriLiteralNullOnNonNullableType, expectedTypeReference.FullName())); } return nullValue; @@ -126,7 +126,7 @@ internal static object VerifyAndCoerceUriPrimitiveLiteral( IEdmPrimitiveTypeReference expectedPrimitiveTypeReference = expectedTypeReference.AsPrimitiveOrNull(); if (expectedPrimitiveTypeReference == null) { - throw new ODataException(ODataErrorStrings.ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure(expectedTypeReference.FullName(), literalValue)); + throw new ODataException(Error.Format(SRResources.ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure, expectedTypeReference.FullName(), literalValue)); } object coercedResult = CoerceNumericType(primitiveValue, expectedPrimitiveTypeReference.PrimitiveDefinition()); @@ -151,7 +151,7 @@ internal static object VerifyAndCoerceUriPrimitiveLiteral( return primitiveValue; } - throw new ODataException(ODataErrorStrings.ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure(expectedPrimitiveTypeReference.FullName(), literalValue)); + throw new ODataException(Error.Format(SRResources.ODataUriUtils_ConvertFromUriLiteralTypeVerificationFailure, expectedPrimitiveTypeReference.FullName(), literalValue)); } /// @@ -699,7 +699,7 @@ private static object ConvertToTargetType(IEdmPrimitiveType targetEdmType, Func< } catch (OverflowException ex) { - throw new ODataException(ODataErrorStrings.ODataUriUtils_ConvertFromUriLiteralOverflowNumber(targetEdmType.FullName(), ex.Message)); + throw new ODataException(Error.Format(SRResources.ODataUriUtils_ConvertFromUriLiteralOverflowNumber, targetEdmType.FullName(), ex.Message)); } } } diff --git a/src/Microsoft.OData.Core/Uri/ODataUriUtils.cs b/src/Microsoft.OData.Core/Uri/ODataUriUtils.cs index abf778d161..3c247a81a0 100644 --- a/src/Microsoft.OData.Core/Uri/ODataUriUtils.cs +++ b/src/Microsoft.OData.Core/Uri/ODataUriUtils.cs @@ -10,7 +10,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Metadata; using Microsoft.OData.UriParser; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData { @@ -46,7 +46,7 @@ public static object ConvertFromUriLiteral(string value, ODataVersion version, I ExceptionUtils.CheckArgumentNotNull(value, "value"); if (typeReference != null && model == null) { - throw new ODataException(ODataErrorStrings.ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel); + throw new ODataException(SRResources.ODataUriUtils_ConvertFromUriLiteralTypeRefWithoutModel); } if (model == null) diff --git a/src/Microsoft.OData.Core/UriParser/Aggregation/AggregateTransformationNode.cs b/src/Microsoft.OData.Core/UriParser/Aggregation/AggregateTransformationNode.cs index 20e3a14dee..97a4506d0a 100644 --- a/src/Microsoft.OData.Core/UriParser/Aggregation/AggregateTransformationNode.cs +++ b/src/Microsoft.OData.Core/UriParser/Aggregation/AggregateTransformationNode.cs @@ -6,10 +6,7 @@ namespace Microsoft.OData.UriParser.Aggregation { - using System; using System.Collections.Generic; - using System.Linq; - using ODataErrorStrings = Microsoft.OData.Strings; /// /// Node representing a aggregate transformation. diff --git a/src/Microsoft.OData.Core/UriParser/Aggregation/ApplyBinder.cs b/src/Microsoft.OData.Core/UriParser/Aggregation/ApplyBinder.cs index 736a6461e5..a01d4c2ae7 100644 --- a/src/Microsoft.OData.Core/UriParser/Aggregation/ApplyBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Aggregation/ApplyBinder.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser.Aggregation { @@ -154,7 +154,7 @@ private AggregateExpressionBase BindAggregateExpressionToken(AggregateTokenBase } default: - throw new ODataException(ODataErrorStrings.ApplyBinder_UnsupportedAggregateKind(aggregateToken.Kind)); + throw new ODataException(Error.Format(SRResources.ApplyBinder_UnsupportedAggregateKind, aggregateToken.Kind)); } } @@ -188,7 +188,7 @@ private IEdmTypeReference CreateAggregateExpressionTypeReference(SingleValueNode return expressionType; default: throw new ODataException( - ODataErrorStrings.ApplyBinder_AggregateExpressionIncompatibleTypeForMethod(expression, + Error.Format(SRResources.ApplyBinder_AggregateExpressionIncompatibleTypeForMethod, expression, expressionPrimitiveKind)); } @@ -246,7 +246,7 @@ private GroupByTransformationNode BindGroupByToken(GroupByToken token) else { throw new ODataException( - ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue(propertyToken.Identifier)); + Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, propertyToken.Identifier)); } } @@ -263,7 +263,7 @@ private GroupByTransformationNode BindGroupByToken(GroupByToken token) } else { - throw new ODataException(ODataErrorStrings.ApplyBinder_UnsupportedGroupByChild(token.Child.Kind)); + throw new ODataException(Error.Format(SRResources.ApplyBinder_UnsupportedGroupByChild, token.Child.Kind)); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/BinaryOperatorBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/BinaryOperatorBinder.cs index 2862481480..344b6c7a21 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/BinaryOperatorBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/BinaryOperatorBinder.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using System; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind binary operators. @@ -69,7 +69,7 @@ internal static void PromoteOperandTypes(BinaryOperatorKind binaryOperatorKind, { string leftTypeName = left.TypeReference == null ? "" : left.TypeReference.FullName(); string rightTypeName = right.TypeReference == null ? "" : right.TypeReference.FullName(); - throw new ODataException(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError(leftTypeName, rightTypeName, binaryOperatorKind)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, leftTypeName, rightTypeName, binaryOperatorKind)); } left = MetadataBindingUtils.ConvertToTypeIfNeeded(left, leftType); @@ -87,7 +87,7 @@ private SingleValueNode GetOperandFromToken(BinaryOperatorKind operatorKind, Que SingleValueNode operand = this.bindMethod(queryToken) as SingleValueNode; if (operand == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_BinaryOperatorOperandNotSingleValue(operatorKind.ToString())); + throw new ODataException(Error.Format(SRResources.MetadataBinder_BinaryOperatorOperandNotSingleValue, operatorKind.ToString())); } return operand; diff --git a/src/Microsoft.OData.Core/UriParser/Binders/BindingState.cs b/src/Microsoft.OData.Core/UriParser/Binders/BindingState.cs index 36898f90fd..346358f71c 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/BindingState.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/BindingState.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Encapsulates the state of metadata binding. @@ -174,7 +174,7 @@ internal void RecurseEnter() // TODO: add BindingLimit, use uniform error message if (this.BindingRecursionDepth > this.configuration.Settings.FilterLimit) { - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + throw new ODataException(SRResources.UriQueryExpressionParser_TooDeep); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/CountSegmentBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/CountSegmentBinder.cs index fc443135c2..88df2a7882 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/CountSegmentBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/CountSegmentBinder.cs @@ -6,7 +6,7 @@ namespace Microsoft.OData.UriParser { - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind a Count segment token. @@ -49,7 +49,7 @@ internal QueryNode BindCountSegment(CountSegmentToken countSegmentToken) if(node == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_CountSegmentNextTokenNotCollectionValue); + throw new ODataException(SRResources.MetadataBinder_CountSegmentNextTokenNotCollectionValue); } FilterClause filterClause = null; diff --git a/src/Microsoft.OData.Core/UriParser/Binders/DottedIdentifierBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/DottedIdentifierBinder.cs index 411f65a64e..31675fe0b6 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/DottedIdentifierBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/DottedIdentifierBinder.cs @@ -4,10 +4,9 @@ // //--------------------------------------------------------------------- -using System.Diagnostics; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -75,7 +74,7 @@ internal QueryNode BindDottedIdentifier(DottedIdentifierToken dottedIdentifierTo } else { - throw new ODataException(ODataErrorStrings.Binder_IsNotValidEnumConstant(dottedIdentifierToken.Identifier)); + throw new ODataException(Error.Format(SRResources.Binder_IsNotValidEnumConstant, dottedIdentifierToken.Identifier)); } } else @@ -95,7 +94,7 @@ internal QueryNode BindDottedIdentifier(DottedIdentifierToken dottedIdentifierTo } else { - throw new ODataException(ODataErrorStrings.CastBinder_ChildTypeIsNotEntity(dottedIdentifierToken.Identifier)); + throw new ODataException(Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, dottedIdentifierToken.Identifier)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/EndPathBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/EndPathBinder.cs index e3abf19750..27d937e0f2 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/EndPathBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/EndPathBinder.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind an end path token, which could be several things. @@ -96,7 +96,7 @@ internal static SingleValueNode CreateParentFromImplicitRangeVariable(BindingSta // If the Parent is null, then it must be referring to the implicit $it parameter if (state.ImplicitRangeVariable == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyAccessWithoutParentParameter); + throw new ODataException(SRResources.MetadataBinder_PropertyAccessWithoutParentParameter); } return NodeFactory.CreateRangeVariableReferenceNode(state.ImplicitRangeVariable); @@ -118,7 +118,7 @@ internal SingleValueOpenPropertyAccessNode GeneratePropertyAccessQueryForOpenTyp } else { - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyNotDeclared( + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, parentNode.TypeReference.FullName(), endPathToken.Identifier)); } @@ -148,7 +148,7 @@ internal QueryNode BindEndPath(EndPathToken endPathToken) if (state.IsCollapsed && !IsAggregatedProperty(endPathToken)) { - throw new ODataException(ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue(endPathToken.Identifier)); + throw new ODataException(Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, endPathToken.Identifier)); } // Now that we have the parent type, can find its corresponding EDM type @@ -198,7 +198,7 @@ internal QueryNode BindEndPath(EndPathToken endPathToken) return boundFunction; } - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyAccessSourceNotSingleValue(endPathToken.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyAccessSourceNotSingleValue, endPathToken.Identifier)); } /// diff --git a/src/Microsoft.OData.Core/UriParser/Binders/FilterBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/FilterBinder.cs index 7c8b971ec2..ec3c3d3aef 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/FilterBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/FilterBinder.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class responsible for binding a syntactic filter expression into a bound tree of semantic nodes. @@ -51,7 +51,7 @@ internal FilterClause BindFilter(QueryToken filter) if (expressionResultNode == null || (expressionResultNode.TypeReference != null && !expressionResultNode.TypeReference.IsODataPrimitiveTypeKind())) { - throw new ODataException(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue); + throw new ODataException(SRResources.MetadataBinder_FilterExpressionNotSingleValue); } // The type may be null here if the query statically represents the null literal or an open property. @@ -62,7 +62,7 @@ internal FilterClause BindFilter(QueryToken filter) if (primitiveExpressionResultType == null || primitiveExpressionResultType.PrimitiveKind() != EdmPrimitiveTypeKind.Boolean) { - throw new ODataException(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue); + throw new ODataException(SRResources.MetadataBinder_FilterExpressionNotSingleValue); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/FunctionCallBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/FunctionCallBinder.cs index d8c70e78cd..7c22cdaa71 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/FunctionCallBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/FunctionCallBinder.cs @@ -14,7 +14,7 @@ using System.Linq; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -79,7 +79,7 @@ internal static SingleValueNode[] ValidateArgumentsAreSingleValue(string functio SingleValueNode argumentNode = argumentNodes[i] as SingleValueNode; if (argumentNode == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_FunctionArgumentNotSingleValue(functionName)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_FunctionArgumentNotSingleValue, functionName)); } ret[i] = argumentNode; @@ -112,7 +112,7 @@ internal static KeyValuePair MatchSigna KeyValuePair found = nameSignatures.FirstOrDefault(pair => pair.Value.ArgumentTypes.Length == argumentCount); if (found.Equals(TypePromotionUtils.NotFoundKeyValuePair)) { - throw new ODataException(ODataErrorStrings.FunctionCallBinder_CannotFindASuitableOverload(functionCallToken, argumentTypes.Length)); + throw new ODataException(Error.Format(SRResources.FunctionCallBinder_CannotFindASuitableOverload, functionCallToken, argumentTypes.Length)); } else { @@ -128,7 +128,7 @@ internal static KeyValuePair MatchSigna TypePromotionUtils.FindBestFunctionSignature(nameSignatures, argumentNodes, functionCallToken); if (nameSignature.Equals(TypePromotionUtils.NotFoundKeyValuePair)) { - throw new ODataException(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + throw new ODataException(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, functionCallToken, UriFunctionsHelper.BuildFunctionSignatureListDescription(functionCallToken, nameSignatures.Select(sig => sig.Value)))); } @@ -170,7 +170,7 @@ internal static IList> Get if (!customFound && !builtInFound) { // Not found in both built-in and custom. - throw new ODataException(ODataErrorStrings.MetadataBinder_UnknownFunction(functionCallToken)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_UnknownFunction, functionCallToken)); } if (!customFound) @@ -288,7 +288,7 @@ private QueryNode BindAsUriFunction(FunctionCallToken functionCallToken, List BindSegmentParameters(ODataUriPa // TODO: considering another better exception if (paraToken.ValueToken is EndPathToken) { - throw new ODataException(Strings.MetadataBinder_ParameterNotInScope( + throw new ODataException(Error.Format(SRResources.MetadataBinder_ParameterNotInScope, string.Format(CultureInfo.InvariantCulture, "{0}={1}", paraToken.ParameterName, (paraToken.ValueToken as EndPathToken).Identifier))); } @@ -717,7 +717,7 @@ private static IEdmTypeReference ValidateIsOfOrCast(BindingState state, bool isC if (args.Count != 1 && args.Count != 2) { throw new ODataErrorException( - ODataErrorStrings.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands(args.Count)); + Error.Format(SRResources.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands, args.Count)); } ConstantNode typeArgument = args.Last() as ConstantNode; @@ -730,12 +730,12 @@ private static IEdmTypeReference ValidateIsOfOrCast(BindingState state, bool isC if (returnType == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + throw new ODataException(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } if (returnType.IsCollection()) { - throw new ODataException(ODataErrorStrings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + throw new ODataException(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } // if we only have one argument, then add the implicit range variable as the first argument. @@ -751,7 +751,7 @@ private static IEdmTypeReference ValidateIsOfOrCast(BindingState state, bool isC } else if (!(args[0] is SingleValueNode)) { - throw new ODataException(ODataErrorStrings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + throw new ODataException(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } if (isCast && (args.Count == 2)) @@ -760,7 +760,7 @@ private static IEdmTypeReference ValidateIsOfOrCast(BindingState state, bool isC if ((args[0].GetEdmTypeReference() is IEdmEnumTypeReference) && !string.Equals(typeArgument.Value as string, Microsoft.OData.Metadata.EdmConstants.EdmStringTypeName, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.CastBinder_EnumOnlyCastToOrFromString); + throw new ODataException(SRResources.CastBinder_EnumOnlyCastToOrFromString); } // throw if cast not-string to enum : @@ -783,7 +783,7 @@ private static IEdmTypeReference ValidateIsOfOrCast(BindingState state, bool isC } } - throw new ODataException(ODataErrorStrings.CastBinder_EnumOnlyCastToOrFromString); + throw new ODataException(SRResources.CastBinder_EnumOnlyCastToOrFromString); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/InBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/InBinder.cs index 5f6cebeb58..fac47b0beb 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/InBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/InBinder.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using System.Text; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind the In operator. @@ -87,7 +87,7 @@ private SingleValueNode GetSingleValueOperandFromToken(QueryToken queryToken) SingleValueNode operand = this.bindMethod(queryToken) as SingleValueNode; if (operand == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_LeftOperandNotSingleValue); + throw new ODataException(SRResources.MetadataBinder_LeftOperandNotSingleValue); } return operand; @@ -177,7 +177,7 @@ private CollectionNode GetCollectionOperandFromToken(QueryToken queryToken, IEdm if (operand == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_RightOperandNotCollectionValue); + throw new ODataException(SRResources.MetadataBinder_RightOperandNotCollectionValue); } return operand; @@ -240,14 +240,14 @@ private static string NormalizeStringCollectionItems(string literalText) } else { - throw new ODataException(ODataErrorStrings.StringItemShouldBeQuoted(subStr)); + throw new ODataException(Error.Format(SRResources.StringItemShouldBeQuoted, subStr)); } break; default: // any other character between items is not valid. - throw new ODataException(ODataErrorStrings.StringItemShouldBeQuoted(ch)); + throw new ODataException(Error.Format(SRResources.StringItemShouldBeQuoted, ch)); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/InnerPathTokenBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/InnerPathTokenBinder.cs index 58890a29ea..9d97824207 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/InnerPathTokenBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/InnerPathTokenBinder.cs @@ -9,7 +9,7 @@ using System.Linq; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -52,7 +52,7 @@ internal static SingleResourceNode EnsureParentIsResourceForNavProp(SingleValueN if (parentResource == null) { // TODO: update error message #644 - throw new ODataException(ODataErrorStrings.MetadataBinder_NavigationPropertyNotFollowingSingleEntityType); + throw new ODataException(SRResources.MetadataBinder_NavigationPropertyNotFollowingSingleEntityType); } return parentResource; @@ -152,7 +152,7 @@ internal QueryNode BindInnerPathSegment(InnerPathToken segmentToken) } } - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyAccessSourceNotSingleValue(segmentToken.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyAccessSourceNotSingleValue, segmentToken.Identifier)); } // Using the parent and name of this token, we try to get the IEdmProperty it represents @@ -169,7 +169,7 @@ internal QueryNode BindInnerPathSegment(InnerPathToken segmentToken) if (singleValueParent.TypeReference != null && !singleValueParent.TypeReference.Definition.IsOpen()) { throw new ODataException( - ODataErrorStrings.MetadataBinder_PropertyNotDeclared( + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, parent.GetEdmTypeReference().FullName(), segmentToken.Identifier)); } @@ -204,7 +204,7 @@ internal QueryNode BindInnerPathSegment(InnerPathToken segmentToken) IEdmNavigationProperty navigationProperty = property as IEdmNavigationProperty; if (navigationProperty == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_IllegalSegmentType(property.Name)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_IllegalSegmentType, property.Name)); } SingleResourceNode parentResource = EnsureParentIsResourceForNavProp(singleValueParent); diff --git a/src/Microsoft.OData.Core/UriParser/Binders/KeyBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/KeyBinder.cs index ffb7d13b55..66f98fc02a 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/KeyBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/KeyBinder.cs @@ -13,7 +13,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind key values. @@ -63,7 +63,7 @@ internal QueryNode BindKeyValues(CollectionResourceNode collectionNode, IEnumera } else { - throw new ODataException(ODataErrorStrings.MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues(collectionNode.ItemStructuredType.FullName())); + throw new ODataException(Error.Format(SRResources.MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues, collectionNode.ItemStructuredType.FullName())); } } @@ -140,7 +140,7 @@ private bool TryBindToKeys(CollectionResourceNode collectionNode, IEnumerable ProcessQueryOptions(BindingState bindingState, Met { if (bindingState == null || bindingState.QueryOptions == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_QueryOptionsBindStateCannotBeNull); + throw new ODataException(SRResources.MetadataBinder_QueryOptionsBindStateCannotBeNull); } if (bindMethod == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_QueryOptionsBindMethodCannotBeNull); + throw new ODataException(SRResources.MetadataBinder_QueryOptionsBindMethodCannotBeNull); } List customQueryOptionNodes = new List(); @@ -203,12 +202,12 @@ protected internal QueryNode Bind(QueryToken token) result = this.BindCountSegment((CountSegmentToken)token); break; default: - throw new ODataException(ODataErrorStrings.MetadataBinder_UnsupportedQueryTokenKind(token.Kind)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_UnsupportedQueryTokenKind, token.Kind)); } if (result == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_BoundNodeCannotBeNull(token.Kind)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_BoundNodeCannotBeNull, token.Kind)); } this.BindingState.RecurseLeave(); diff --git a/src/Microsoft.OData.Core/UriParser/Binders/MetadataBindingUtils.cs b/src/Microsoft.OData.Core/UriParser/Binders/MetadataBindingUtils.cs index 963796e7e5..d817b415cf 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/MetadataBindingUtils.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/MetadataBindingUtils.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using Microsoft.OData.Edm; using Microsoft.OData; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Helper methods for metadata binding. @@ -77,12 +77,12 @@ internal static SingleValueNode ConvertToTypeIfNeeded(SingleValueNode source, IE return new ConstantNode(new ODataEnumValue(enumMember.Name, enumType.ToString()), literalText, targetTypeReference); } - throw new ODataException(ODataErrorStrings.Binder_IsNotValidEnumConstant(memberName)); + throw new ODataException(Error.Format(SRResources.Binder_IsNotValidEnumConstant, memberName)); } if (!TypePromotionUtils.CanConvertTo(source, source.TypeReference, targetTypeReference)) { - throw new ODataException(ODataErrorStrings.MetadataBinder_CannotConvertToType(source.TypeReference.FullName(), targetTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.MetadataBinder_CannotConvertToType, source.TypeReference.FullName(), targetTypeReference.FullName())); } else { @@ -203,7 +203,7 @@ internal static void VerifyCollectionNode(CollectionNode node, bool enableCaseIn { if (!enumType.ContainsMember(enumValue.Value, comparison)) { - throw new ODataException(ODataErrorStrings.Binder_IsNotValidEnumConstant(enumValue.Value)); + throw new ODataException(Error.Format(SRResources.Binder_IsNotValidEnumConstant, enumValue.Value)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/OrderByBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/OrderByBinder.cs index 041352e487..6d6395bfdc 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/OrderByBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/OrderByBinder.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Linq; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class to handle the binding of orderby tokens. @@ -75,7 +75,7 @@ private OrderByClause ProcessSingleOrderBy(BindingState state, OrderByClause the !expressionResultNode.TypeReference.IsODataEnumTypeKind() && !expressionResultNode.TypeReference.IsODataTypeDefinitionTypeKind())) { - throw new ODataException(ODataErrorStrings.MetadataBinder_OrderByExpressionNotSingleValue); + throw new ODataException(SRResources.MetadataBinder_OrderByExpressionNotSingleValue); } OrderByClause orderByNode = new OrderByClause( diff --git a/src/Microsoft.OData.Core/UriParser/Binders/ParameterAliasBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/ParameterAliasBinder.cs index 1b47ad4f66..9fe1b7b876 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/ParameterAliasBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/ParameterAliasBinder.cs @@ -6,6 +6,7 @@ using Microsoft.OData.Metadata; using Microsoft.OData.Edm; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -92,7 +93,7 @@ private SingleValueNode ParseAndBindParameterAliasValueExpression(BindingState b if (result == null) { // TODO: add string resource - throw new ODataException(Strings.MetadataBinder_ParameterAliasValueExpressionNotSingleValue); + throw new ODataException(SRResources.MetadataBinder_ParameterAliasValueExpressionNotSingleValue); } return result; diff --git a/src/Microsoft.OData.Core/UriParser/Binders/RangeVariableBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/RangeVariableBinder.cs index a64041c184..d0862b4627 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/RangeVariableBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/RangeVariableBinder.cs @@ -5,7 +5,7 @@ //--------------------------------------------------------------------- using System.Linq; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -28,7 +28,7 @@ internal static SingleValueNode BindRangeVariableToken(RangeVariableToken rangeV if (rangeVariable == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_ParameterNotInScope(rangeVariableToken.Name)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_ParameterNotInScope, rangeVariableToken.Name)); } return NodeFactory.CreateRangeVariableReferenceNode(rangeVariable); diff --git a/src/Microsoft.OData.Core/UriParser/Binders/SearchBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/SearchBinder.cs index 5f18799f21..ea9280427e 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/SearchBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/SearchBinder.cs @@ -6,8 +6,6 @@ namespace Microsoft.OData.UriParser { - using ODataErrorStrings = Microsoft.OData.Strings; - /// /// Class responsible for binding a syntactic filter expression into a bound tree of semantic nodes. /// diff --git a/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandBinder.cs index f325b0e1cc..43d9082166 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandBinder.cs @@ -12,7 +12,7 @@ using Microsoft.OData.Metadata; using Microsoft.OData.Edm; using Microsoft.OData.UriParser.Aggregation; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -167,7 +167,7 @@ public SelectExpandClause Bind(ExpandToken expandToken, SelectToken selectToken) { if ((selectPathItem.HasOptions && OverLaps(selectPathItem, existingItem)) || (existingItem.HasOptions && OverLaps(existingItem, selectPathItem))) { - throw new ODataException(ODataErrorStrings.SelectTreeNormalizer_MultipleSelecTermWithSamePathFound(ToPathString(selectTermToken.PathToProperty))); + throw new ODataException(Error.Format(SRResources.SelectTreeNormalizer_MultipleSelecTermWithSamePathFound, ToPathString(selectTermToken.PathToProperty))); } // two items without options are identical -- for backward compat just ignore the new one @@ -354,14 +354,14 @@ private SelectItem GenerateExpandItem(ExpandTermToken tokenIn) IEdmProperty edmProperty = this.configuration.Resolver.ResolveProperty(currentLevelEntityType, firstNonTypeToken.Identifier); if (edmProperty == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyNotDeclared(currentLevelEntityType.FullTypeName(), currentToken.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, currentLevelEntityType.FullTypeName(), currentToken.Identifier)); } IEdmNavigationProperty currentNavProp = edmProperty as IEdmNavigationProperty; IEdmStructuralProperty currentComplexProp = edmProperty as IEdmStructuralProperty; if (currentNavProp == null && currentComplexProp == null) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty(currentToken.Identifier, currentLevelEntityType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty, currentToken.Identifier, currentLevelEntityType.FullTypeName())); } if (currentComplexProp != null) @@ -384,7 +384,7 @@ private SelectItem GenerateExpandItem(ExpandTermToken tokenIn) if (derivedType == null) { // Exception example: The type Fully.Qualified.Namespace.UndefinedType is not defined in the model. - throw new ODataException(ODataErrorStrings.ExpandItemBinder_CannotFindType(firstNonTypeToken.NextToken.Identifier)); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_CannotFindType, firstNonTypeToken.NextToken.Identifier)); } // In this example: $expand=Customer/Fully.Qualified.Namespace.VipCustomer @@ -395,7 +395,7 @@ private SelectItem GenerateExpandItem(ExpandTermToken tokenIn) // ensure that we're always dealing with proper V4 syntax if (firstNonTypeToken?.NextToken?.NextToken != null && !hasDerivedTypeSegment) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); + throw new ODataException(SRResources.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); } if ((firstNonTypeToken.NextToken != null && !hasDerivedTypeSegment) || @@ -414,7 +414,7 @@ private SelectItem GenerateExpandItem(ExpandTermToken tokenIn) } else { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); + throw new ODataException(SRResources.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); } } @@ -641,7 +641,7 @@ private bool ProcessWildcardTokenPath(SelectTermToken selectToken, out SelectIte // * or Namespace.* if (pathToken.NextToken != null) { - throw new ODataException(ODataErrorStrings.SelectExpandBinder_InvalidIdentifierAfterWildcard(pathToken.NextToken.Identifier)); + throw new ODataException(Error.Format(SRResources.SelectExpandBinder_InvalidIdentifierAfterWildcard, pathToken.NextToken.Identifier)); } VerifyNoQueryOptionsNested(selectToken, pathToken.Identifier); @@ -673,7 +673,7 @@ private List ProcessSelectTokenPath(PathSegmentToken tokenIn) tokenIn = firstNonTypeToken as NonSystemToken; if (tokenIn == null) { - throw new ODataException(ODataErrorStrings.SelectExpandBinder_SystemTokenInSelect(firstNonTypeToken.Identifier)); + throw new ODataException(Error.Format(SRResources.SelectExpandBinder_SystemTokenInSelect, firstNonTypeToken.Identifier)); } } @@ -742,7 +742,7 @@ private List ProcessSelectTokenPath(PathSegmentToken tokenIn) } else { - throw new ODataException(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + throw new ODataException(SRResources.SelectBinder_MultiLevelPathInSelect); } } @@ -774,21 +774,21 @@ private List ProcessSelectTokenPath(PathSegmentToken tokenIn) // non-navigation cases do not allow further segments in $select. if (tokenIn.NextToken != null) { - throw new ODataException(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + throw new ODataException(SRResources.SelectBinder_MultiLevelPathInSelect); } // Later, we can consider to create a "DynamicOperationSegment" to handle this. // But now, Let's throw exception. if (lastSegment == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_InvalidIdentifierInQueryOption(tokenIn.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_InvalidIdentifierInQueryOption, tokenIn.Identifier)); } // navigation property is not allowed to append sub path in the selection. NavigationPropertySegment navPropSegment = pathSoFar.LastOrDefault() as NavigationPropertySegment; if (navPropSegment != null && tokenIn.NextToken != null) { - throw new ODataException(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + throw new ODataException(SRResources.SelectBinder_MultiLevelPathInSelect); } return pathSoFar; @@ -825,7 +825,7 @@ private IEdmNavigationProperty ParseComplexTypesBeforeNavigation(IEdmStructuralP if (currentToken.NextToken == null) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty(currentToken.Identifier, edmProperty.DeclaringType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty, currentToken.Identifier, edmProperty.DeclaringType.FullTypeName())); } currentToken = currentToken.NextToken; @@ -841,7 +841,7 @@ private IEdmNavigationProperty ParseComplexTypesBeforeNavigation(IEdmStructuralP IEdmStructuredType currentType = complexType as IEdmStructuredType; if (currentType == null) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_InvaidSegmentInExpand(currentToken.Identifier)); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_InvaidSegmentInExpand, currentToken.Identifier)); } if (currentToken.IsNamespaceOrContainerQualified()) @@ -852,7 +852,7 @@ private IEdmNavigationProperty ParseComplexTypesBeforeNavigation(IEdmStructuralP IEdmProperty property = this.configuration.Resolver.ResolveProperty(currentType, currentToken.Identifier); if (edmProperty == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyNotDeclared(currentType.FullTypeName(), currentToken.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, currentType.FullTypeName(), currentToken.Identifier)); } IEdmStructuralProperty complexProp = property as IEdmStructuralProperty; @@ -868,7 +868,7 @@ private IEdmNavigationProperty ParseComplexTypesBeforeNavigation(IEdmStructuralP } else { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty(currentToken.Identifier, currentType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty, currentToken.Identifier, currentType.FullTypeName())); } } @@ -891,7 +891,7 @@ private static LevelsClause ParseLevels(long? levelsOption, IEdmType sourceType, if (sourceType != null && relatedType != null && !UriEdmHelpers.IsRelatedTo(sourceType, relatedType)) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType(property.Name, relatedType.FullTypeName(), sourceType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType, property.Name, relatedType.FullTypeName(), sourceType.FullTypeName())); } return new LevelsClause(levelsOption.Value < 0, levelsOption.Value); @@ -961,7 +961,7 @@ private static void VerifySelectedPath(SelectTermToken selectedToken) if (current is SystemToken) { // It's not allowed to set a system token in a select clause. - throw new ODataException(ODataErrorStrings.SelectExpandBinder_SystemTokenInSelect(current.Identifier)); + throw new ODataException(Error.Format(SRResources.SelectExpandBinder_SystemTokenInSelect, current.Identifier)); } current = current.NextToken; @@ -995,7 +995,7 @@ private static void VerifyNoQueryOptionsNested(SelectTermToken selectToken, stri selectToken.TopOption != null || selectToken.SkipOption != null) { - throw new ODataException(ODataErrorStrings.SelectExpandBinder_InvalidQueryOptionNestedSelection(identifier)); + throw new ODataException(Error.Format(SRResources.SelectExpandBinder_InvalidQueryOptionNestedSelection, identifier)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandPathBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandPathBinder.cs index 348f787c53..2758e1f134 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandPathBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/SelectExpandPathBinder.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using System.Collections.Generic; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Walk down a chain of type segments, checking that we find the correct type at each level. @@ -32,7 +32,7 @@ public static IEnumerable FollowTypeSegments(PathSegmentToken if (!firstTypeToken.IsNamespaceOrContainerQualified()) { - throw new ODataException(ODataErrorStrings.SelectExpandPathBinder_FollowNonTypeSegment(firstTypeToken.Identifier)); + throw new ODataException(Error.Format(SRResources.SelectExpandPathBinder_FollowNonTypeSegment, firstTypeToken.Identifier)); } int index = 0; @@ -45,7 +45,7 @@ public static IEnumerable FollowTypeSegments(PathSegmentToken if (currentLevelType == null) { // TODO: fix this error message? - throw new ODataException(ODataErrorStrings.ExpandItemBinder_CannotFindType(currentToken.Identifier)); + throw new ODataException(Error.Format(SRResources.ExpandItemBinder_CannotFindType, currentToken.Identifier)); } UriEdmHelpers.CheckRelatedTo(previousLevelEntityType, currentLevelType); @@ -56,7 +56,7 @@ public static IEnumerable FollowTypeSegments(PathSegmentToken if (index >= maxDepth) { - throw new ODataException(ODataErrorStrings.ExpandItemBinder_PathTooDeep); + throw new ODataException(SRResources.ExpandItemBinder_PathTooDeep); } } diff --git a/src/Microsoft.OData.Core/UriParser/Binders/SelectPathSegmentTokenBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/SelectPathSegmentTokenBinder.cs index 8e88ff26fb..5360194533 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/SelectPathSegmentTokenBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/SelectPathSegmentTokenBinder.cs @@ -8,12 +8,11 @@ namespace Microsoft.OData.UriParser { using System; using System.Collections.Generic; - using System.Diagnostics; using System.Linq; using Edm.Vocabularies; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Builds segments from tokens within $select. @@ -49,7 +48,7 @@ public static ODataPathSegment ConvertNonTypeTokenToSegment(PathSegmentToken tok // Don't allow selecting odata control information if (String.Compare(namespaceName, ODataConstants.ODataPrefix, StringComparison.OrdinalIgnoreCase) == 0) { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(tokenIn.Identifier)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, tokenIn.Identifier)); } return new AnnotationSegment(new EdmTerm(namespaceName, termName, EdmCoreModel.Instance.GetUntyped())); @@ -59,7 +58,7 @@ public static ODataPathSegment ConvertNonTypeTokenToSegment(PathSegmentToken tok if ((state?.IsCollapsed ?? false) && !(state?.AggregatedPropertyNames?.Contains(endPathToken) ?? false)) { - throw new ODataException(ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue(tokenIn.Identifier)); + throw new ODataException(Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, tokenIn.Identifier)); } if (TryBindAsDeclaredProperty(tokenIn, edmType, resolver, out nextSegment)) @@ -88,7 +87,7 @@ public static ODataPathSegment ConvertNonTypeTokenToSegment(PathSegmentToken tok return new DynamicPathSegment(tokenIn.Identifier); } - throw new ODataException(ODataErrorStrings.MetadataBinder_PropertyNotDeclared(edmType.FullTypeName(), tokenIn.Identifier)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, edmType.FullTypeName(), tokenIn.Identifier)); } /// @@ -230,7 +229,7 @@ private static bool TryBindAsDeclaredProperty(PathSegmentToken tokenIn, IEdmStru return true; } - throw new ODataException(ODataErrorStrings.SelectExpandBinder_UnknownPropertyType(prop.Name)); + throw new ODataException(Error.Format(SRResources.SelectExpandBinder_UnknownPropertyType, prop.Name)); } /// diff --git a/src/Microsoft.OData.Core/UriParser/Binders/UnaryOperatorBinder.cs b/src/Microsoft.OData.Core/UriParser/Binders/UnaryOperatorBinder.cs index d9a7b3e006..970227d077 100644 --- a/src/Microsoft.OData.Core/UriParser/Binders/UnaryOperatorBinder.cs +++ b/src/Microsoft.OData.Core/UriParser/Binders/UnaryOperatorBinder.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System.Diagnostics; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Class that knows how to bind unary operators. @@ -61,7 +61,7 @@ private static IEdmTypeReference PromoteOperandType(SingleValueNode operand, Una if (!TypePromotionUtils.PromoteOperandType(unaryOperatorKind, ref typeReference)) { string typeName = operand.TypeReference == null ? "" : operand.TypeReference.FullName(); - throw new ODataException(ODataErrorStrings.MetadataBinder_IncompatibleOperandError(typeName, unaryOperatorKind)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_IncompatibleOperandError, typeName, unaryOperatorKind)); } return typeReference; @@ -77,7 +77,7 @@ private SingleValueNode GetOperandFromToken(UnaryOperatorToken unaryOperatorToke SingleValueNode operand = this.bindMethod(unaryOperatorToken.Operand) as SingleValueNode; if (operand == null) { - throw new ODataException(ODataErrorStrings.MetadataBinder_UnaryOperatorOperandNotSingleValue(unaryOperatorToken.OperatorKind.ToString())); + throw new ODataException(Error.Format(SRResources.MetadataBinder_UnaryOperatorOperandNotSingleValue, unaryOperatorToken.OperatorKind.ToString())); } return operand; diff --git a/src/Microsoft.OData.Core/UriParser/CustomUriFunctions.cs b/src/Microsoft.OData.Core/UriParser/CustomUriFunctions.cs index 8386eb828d..9105307253 100644 --- a/src/Microsoft.OData.Core/UriParser/CustomUriFunctions.cs +++ b/src/Microsoft.OData.Core/UriParser/CustomUriFunctions.cs @@ -12,6 +12,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion @@ -66,7 +67,7 @@ public static void AddCustomUriFunction(string functionName, FunctionSignatureWi if (existingBuiltInFunctionOverload.Any(builtInFunction => AreFunctionsSignatureEqual(functionSignature, builtInFunction))) { - throw new ODataException(Strings.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature(functionName)); + throw new ODataException(Error.Format(SRResources.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature, functionName)); } } @@ -202,7 +203,7 @@ private static void AddCustomFunction(string customFunctionName, FunctionSignatu if (isOverloadAlreadyExist) { // Throw if already exists - User is stupid (inserted the same function twice) - throw new ODataException(Strings.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists(customFunctionName)); + throw new ODataException(Error.Format(SRResources.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists, customFunctionName)); } // Add the custom function as an overload to the same function name diff --git a/src/Microsoft.OData.Core/UriParser/CustomUriLiteralPrefixes.cs b/src/Microsoft.OData.Core/UriParser/CustomUriLiteralPrefixes.cs index 5d17e7f6c2..17885439c4 100644 --- a/src/Microsoft.OData.Core/UriParser/CustomUriLiteralPrefixes.cs +++ b/src/Microsoft.OData.Core/UriParser/CustomUriLiteralPrefixes.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.UriParser using System; using System.Collections.Generic; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion @@ -56,7 +56,7 @@ public static void AddCustomLiteralPrefix(string literalPrefix, IEdmTypeReferenc // Check if literal does already exists if (CustomLiteralPrefixesOfEdmTypes.ContainsKey(literalPrefix)) { - throw new ODataException(ODataErrorStrings.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists(literalPrefix)); + throw new ODataException(Error.Format(SRResources.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists, literalPrefix)); } CustomLiteralPrefixesOfEdmTypes.Add(literalPrefix, literalEdmTypeReference); diff --git a/src/Microsoft.OData.Core/UriParser/ExceptionUtil.cs b/src/Microsoft.OData.Core/UriParser/ExceptionUtil.cs index 99e60f59e6..bf81e6722a 100644 --- a/src/Microsoft.OData.Core/UriParser/ExceptionUtil.cs +++ b/src/Microsoft.OData.Core/UriParser/ExceptionUtil.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.UriParser { + using Microsoft.OData.Core; using Microsoft.OData.Edm; /// @@ -19,7 +20,7 @@ internal static class ExceptionUtil internal static ODataException CreateResourceNotFoundError(string identifier) { // 404: Not Found - return ResourceNotFoundError(Strings.RequestUriProcessor_ResourceNotFound(identifier)); + return ResourceNotFoundError(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, identifier)); } /// Creates a new "Resource Not Found" exception. @@ -35,7 +36,7 @@ internal static ODataException ResourceNotFoundError(string errorMessage) /// A new exception to indicate a syntax error. internal static ODataException CreateSyntaxError() { - return CreateBadRequestError(Strings.RequestUriProcessor_SyntaxError); + return CreateBadRequestError(SRResources.RequestUriProcessor_SyntaxError); } /// @@ -59,7 +60,7 @@ internal static void ThrowIfTypesUnrelated(IEdmType type, IEdmType secondType, s { if (!UriEdmHelpers.IsRelatedTo(type.AsElementType(), secondType.AsElementType())) { - throw new ODataException(Strings.PathParser_TypeMustBeRelatedToSet(type, secondType, segmentName)); + throw new ODataException(Error.Format(SRResources.PathParser_TypeMustBeRelatedToSet, type, secondType, segmentName)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/ExpressionLexer.cs b/src/Microsoft.OData.Core/UriParser/ExpressionLexer.cs index db5f3d1b4e..266ee3f73a 100644 --- a/src/Microsoft.OData.Core/UriParser/ExpressionLexer.cs +++ b/src/Microsoft.OData.Core/UriParser/ExpressionLexer.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.UriParser using System.Globalization; using Microsoft.OData; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -266,12 +266,12 @@ internal ReadOnlySpan ReadDottedIdentifier(bool acceptStar) // if we accept a star and this is the last token in the identifier, then we're ok... otherwise we throw. if (!acceptStar || (this.PeekNextToken().Kind != ExpressionTokenKind.End && this.PeekNextToken().Kind != ExpressionTokenKind.Comma)) { - throw ParseError(ODataErrorStrings.ExpressionLexer_SyntaxError(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_SyntaxError, this.textPos, this.Text)); } } else { - throw ParseError(ODataErrorStrings.ExpressionLexer_SyntaxError(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_SyntaxError, this.textPos, this.Text)); } } @@ -366,7 +366,7 @@ internal void ValidateToken(ExpressionTokenKind t) { if (this.token.Kind != t) { - throw ParseError(ODataErrorStrings.ExpressionLexer_SyntaxError(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_SyntaxError, this.textPos, this.Text)); } } @@ -626,7 +626,7 @@ protected virtual ExpressionToken NextTokenImplementation(out Exception error) if (this.textPos == this.TextLen) { - error = ParseError(ODataErrorStrings.ExpressionLexer_UnterminatedStringLiteral(this.textPos, this.Text)); + error = ParseError(Error.Format(SRResources.ExpressionLexer_UnterminatedStringLiteral, this.textPos, this.Text)); } this.NextChar(); @@ -703,14 +703,14 @@ protected virtual ExpressionToken NextTokenImplementation(out Exception error) if (this.textPos == this.TextLen) { - error = ParseError(ODataErrorStrings.ExpressionLexer_SyntaxError(this.textPos, this.Text)); + error = ParseError(Error.Format(SRResources.ExpressionLexer_SyntaxError, this.textPos, this.Text)); t = ExpressionTokenKind.Unknown; break; } if (!this.IsValidStartingCharForIdentifier) { - error = ParseError(ODataErrorStrings.ExpressionLexer_InvalidCharacter(this.ch, this.textPos, this.Text)); + error = ParseError(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, this.ch, this.textPos, this.Text)); t = ExpressionTokenKind.Unknown; break; } @@ -730,7 +730,7 @@ protected virtual ExpressionToken NextTokenImplementation(out Exception error) break; } - error = ParseError(ODataErrorStrings.ExpressionLexer_InvalidCharacter(this.ch, this.textPos, this.Text)); + error = ParseError(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, this.ch, this.textPos, this.Text)); t = ExpressionTokenKind.Unknown; break; } @@ -814,7 +814,7 @@ private void HandleQuotedValues() if (this.ch == null) { - throw ParseError(ODataErrorStrings.ExpressionLexer_UnterminatedLiteral(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_UnterminatedLiteral, this.textPos, this.Text)); } this.NextChar(); @@ -879,7 +879,7 @@ private ExpressionTokenKind GetBuiltInTypesLiteralPrefixWithQuotedValue(ReadOnly else if (tokenText.Equals(ExpressionConstants.KeywordNull, StringComparison.OrdinalIgnoreCase)) { // typed null literals are not supported. - throw ParseError(ODataErrorStrings.ExpressionLexer_SyntaxError(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_SyntaxError, this.textPos, this.Text)); } else { @@ -1197,7 +1197,7 @@ private static ExpressionTokenKind MakeBestGuessOnNoSuffixStr(ReadOnlySpan return ExpressionTokenKind.DoubleLiteral; } - throw new ODataException(ODataErrorStrings.ExpressionLexer_InvalidNumericString(numericStr.ToString())); + throw new ODataException(Error.Format(SRResources.ExpressionLexer_InvalidNumericString, numericStr.ToString())); } /// @@ -1233,7 +1233,7 @@ private void AdvanceThroughBalancedExpression(char startingCharacter, char endin if (this.ch == null) { - throw new ODataException(ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + throw new ODataException(SRResources.ExpressionLexer_UnbalancedBracketExpression); } this.NextChar(); @@ -1265,7 +1265,7 @@ private void ValidateDigit() { if (!this.IsValidDigit) { - throw ParseError(ODataErrorStrings.ExpressionLexer_DigitExpected(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_DigitExpected, this.textPos, this.Text)); } } diff --git a/src/Microsoft.OData.Core/UriParser/ExpressionLexerLiteralExtensions.cs b/src/Microsoft.OData.Core/UriParser/ExpressionLexerLiteralExtensions.cs index efb7877aaf..2dc0b1ec06 100644 --- a/src/Microsoft.OData.Core/UriParser/ExpressionLexerLiteralExtensions.cs +++ b/src/Microsoft.OData.Core/UriParser/ExpressionLexerLiteralExtensions.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.UriParser using System; using System.Diagnostics; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -66,7 +66,7 @@ internal static object ReadLiteralToken(this ExpressionLexer expressionLexer) return TryParseLiteral(expressionLexer); } - throw new ODataException(ODataErrorStrings.ExpressionLexer_ExpectedLiteralToken(expressionLexer.CurrentToken.Text.ToString())); + throw new ODataException(Error.Format(SRResources.ExpressionLexer_ExpectedLiteralToken, expressionLexer.CurrentToken.Text.ToString())); } /// @@ -100,7 +100,7 @@ private static object ParseTypedLiteral(this ExpressionLexer expressionLexer, IE if (typeParsingException == null) { - message = ODataErrorStrings.UriQueryExpressionParser_UnrecognizedLiteral( + message = Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedLiteral, targetTypeReference.FullName(), tokenText, expressionLexer.CurrentToken.Position, @@ -110,7 +110,7 @@ private static object ParseTypedLiteral(this ExpressionLexer expressionLexer, IE } else { - message = ODataErrorStrings.UriQueryExpressionParser_UnrecognizedLiteralWithReason( + message = Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedLiteralWithReason, targetTypeReference.FullName(), tokenText, expressionLexer.CurrentToken.Position, diff --git a/src/Microsoft.OData.Core/UriParser/ExpressionToken.cs b/src/Microsoft.OData.Core/UriParser/ExpressionToken.cs index 2f07ae3193..7a44f3693c 100644 --- a/src/Microsoft.OData.Core/UriParser/ExpressionToken.cs +++ b/src/Microsoft.OData.Core/UriParser/ExpressionToken.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData.UriParser using System; using System.Diagnostics; + using Microsoft.OData.Core; using Microsoft.OData.Edm; #endregion Namespaces @@ -97,7 +98,7 @@ internal ReadOnlySpan GetIdentifier() { if (this.Kind != ExpressionTokenKind.Identifier) { - string message = Strings.ExpressionToken_IdentifierExpected(this.Position); + string message = Error.Format(SRResources.ExpressionToken_IdentifierExpected, this.Position); throw new ODataException(message); } diff --git a/src/Microsoft.OData.Core/UriParser/ODataQueryOptionParser.cs b/src/Microsoft.OData.Core/UriParser/ODataQueryOptionParser.cs index 9b1033eba8..2c6610bdb0 100644 --- a/src/Microsoft.OData.Core/UriParser/ODataQueryOptionParser.cs +++ b/src/Microsoft.OData.Core/UriParser/ODataQueryOptionParser.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; using Microsoft.OData.UriParser.Aggregation; @@ -229,7 +230,7 @@ public SelectExpandClause ParseSelectAndExpand() IEdmStructuredType structuredType = this.targetEdmType as IEdmStructuredType; if (structuredType == null) { - throw new ODataException(Strings.UriParser_TypeInvalidForSelectExpand(this.targetEdmType)); + throw new ODataException(Error.Format(SRResources.UriParser_TypeInvalidForSelectExpand, this.targetEdmType)); } this.selectExpandClause = ParseSelectAndExpandImplementation(selectQuery, expandQuery, this.Configuration, this.odataPathInfo); @@ -525,7 +526,7 @@ private BindingState CreateBindingState(ODataUriParserConfiguration configuratio long topValue; if (!long.TryParse(topQuery, out topValue) || topValue < 0) { - throw new ODataException(Strings.SyntacticTree_InvalidTopQueryOptionValue(topQuery)); + throw new ODataException(Error.Format(SRResources.SyntacticTree_InvalidTopQueryOptionValue, topQuery)); } return topValue; @@ -547,7 +548,7 @@ private BindingState CreateBindingState(ODataUriParserConfiguration configuratio long skipValue; if (!long.TryParse(skipQuery, out skipValue) || skipValue < 0) { - throw new ODataException(Strings.SyntacticTree_InvalidSkipQueryOptionValue(skipQuery)); + throw new ODataException(Error.Format(SRResources.SyntacticTree_InvalidSkipQueryOptionValue, skipQuery)); } return skipValue; @@ -571,7 +572,7 @@ private BindingState CreateBindingState(ODataUriParserConfiguration configuratio long indexValue; if (!long.TryParse(indexQuery, out indexValue)) { - throw new ODataException(Strings.SyntacticTree_InvalidIndexQueryOptionValue(indexQuery)); + throw new ODataException(Error.Format(SRResources.SyntacticTree_InvalidIndexQueryOptionValue, indexQuery)); } return indexValue; @@ -599,7 +600,7 @@ private BindingState CreateBindingState(ODataUriParserConfiguration configuratio case ExpressionConstants.KeywordFalse: return false; default: - throw new ODataException(Strings.ODataUriParser_InvalidCount(count)); + throw new ODataException(Error.Format(SRResources.ODataUriParser_InvalidCount, count)); } } @@ -697,7 +698,7 @@ private bool TryGetQueryOption(string name, out string value) return true; } - throw new ODataException(Strings.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce( + throw new ODataException(Error.Format(SRResources.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, isNoDollarQueryOptionsEnabled ? string.Format(CultureInfo.InvariantCulture, "${0}/{0}", nameWithoutDollarPrefix ?? trimmedName) : trimmedName)); } #endregion private methods diff --git a/src/Microsoft.OData.Core/UriParser/ODataUnrecognizedPathException.cs b/src/Microsoft.OData.Core/UriParser/ODataUnrecognizedPathException.cs index 048d51fa48..b167867106 100644 --- a/src/Microsoft.OData.Core/UriParser/ODataUnrecognizedPathException.cs +++ b/src/Microsoft.OData.Core/UriParser/ODataUnrecognizedPathException.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.UriParser { + using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Diagnostics; @@ -25,7 +26,7 @@ public sealed class ODataUnrecognizedPathException : ODataException /// current system culture. /// public ODataUnrecognizedPathException() - : this((string)Strings.ODataUriParserException_GeneralError, (Exception)null) + : this((string)SRResources.ODataUriParserException_GeneralError, (Exception)null) { } diff --git a/src/Microsoft.OData.Core/UriParser/ODataUriParser.cs b/src/Microsoft.OData.Core/UriParser/ODataUriParser.cs index 8ddfbfa87d..d101a6510f 100644 --- a/src/Microsoft.OData.Core/UriParser/ODataUriParser.cs +++ b/src/Microsoft.OData.Core/UriParser/ODataUriParser.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.UriParser using Microsoft.OData.Edm; using Microsoft.OData.UriParser.Aggregation; using Microsoft.OData.UriParser.Validation; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Main Public API to parse an ODataURI. @@ -76,12 +76,12 @@ public ODataUriParser(IEdmModel model, Uri serviceRoot, Uri uri, IServiceProvide if (serviceRoot == null) { - throw new ODataException(ODataErrorStrings.UriParser_NeedServiceRootForThisOverload); + throw new ODataException(SRResources.UriParser_NeedServiceRootForThisOverload); } if (!serviceRoot.IsAbsoluteUri) { - throw new ODataException(ODataErrorStrings.UriParser_UriMustBeAbsolute(serviceRoot)); + throw new ODataException(Error.Format(SRResources.UriParser_UriMustBeAbsolute, serviceRoot)); } this.configuration = new ODataUriParserConfiguration(model, container); @@ -112,7 +112,7 @@ public ODataUriParser(IEdmModel model, Uri relativeUri, IServiceProvider contain if (relativeUri.IsAbsoluteUri) { - throw new ODataException(Strings.UriParser_RelativeUriMustBeRelative); + throw new ODataException(SRResources.UriParser_RelativeUriMustBeRelative); } this.configuration = new ODataUriParserConfiguration(model, container); @@ -274,7 +274,7 @@ public bool Validate(ODataUrlValidator validator, out IEnumerable /// Settings used by . @@ -121,7 +121,7 @@ public int MaximumExpansionDepth { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.maxExpandDepth = value; @@ -146,7 +146,7 @@ public int MaximumExpansionCount { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.maxExpandCount = value; @@ -179,7 +179,7 @@ internal int SelectExpandLimit { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.selectExpandLimit = value; @@ -207,7 +207,7 @@ internal int FilterLimit { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.filterLimit = value; @@ -235,7 +235,7 @@ internal int OrderByLimit { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.orderByLimit = value; @@ -263,7 +263,7 @@ internal int PathLimit { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.pathLimit = value; @@ -291,7 +291,7 @@ internal int SearchLimit { if (value < 0) { - throw new ODataException(ODataErrorStrings.UriParser_NegativeLimit); + throw new ODataException(SRResources.UriParser_NegativeLimit); } this.searchLimit = value; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/CountSegmentParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/CountSegmentParser.cs index 487b202d8d..a3f8e550b3 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/CountSegmentParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/CountSegmentParser.cs @@ -7,8 +7,7 @@ namespace Microsoft.OData.UriParser { using System; - using System.Globalization; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Syntactic parser for the $count segment. @@ -75,7 +74,7 @@ public CountSegmentToken CreateCountSegmentToken(QueryToken countedInstance) // Check for (), which is not allowed. if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.CloseParen) { - throw new ODataException(ODataErrorStrings.UriParser_EmptyParenthesis); + throw new ODataException(SRResources.UriParser_EmptyParenthesis); } StringComparison comparison = this.UriQueryExpressionParser.EnableCaseInsensitiveBuiltinIdentifier ? @@ -101,7 +100,7 @@ public CountSegmentToken CreateCountSegmentToken(QueryToken countedInstance) } else { - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_IllegalQueryOptioninDollarCount); + throw new ODataException(SRResources.UriQueryExpressionParser_IllegalQueryOptioninDollarCount); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/CustomUriLiteralParsers.cs b/src/Microsoft.OData.Core/UriParser/Parsers/CustomUriLiteralParsers.cs index 681bfacfe7..62bf23030f 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/CustomUriLiteralParsers.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/CustomUriLiteralParsers.cs @@ -6,17 +6,11 @@ using System; using System.Linq; - using Microsoft.OData.Edm; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { - #region Namespaces - - using ODataErrorStrings = Microsoft.OData.Strings; - - #endregion - /// /// This class is the custom literal parser manager and parser. /// Add a Uri custom literal parser through this class. @@ -138,7 +132,7 @@ public static void AddCustomUriLiteralParser(IUriLiteralParser customUriLiteralP { if (CustomUriLiteralParsers.customUriLiteralParsers.Contains(customUriLiteralParser)) { - throw new ODataException(ODataErrorStrings.UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists); + throw new ODataException(SRResources.UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists); } CustomUriLiteralParsers.customUriLiteralParsers = CustomUriLiteralParsers.customUriLiteralParsers.Concat(new IUriLiteralParser[] { customUriLiteralParser }).ToArray(); @@ -162,7 +156,7 @@ public static void AddCustomUriLiteralParser(IEdmTypeReference edmTypeReference, { if (CustomUriLiteralParsers.IsEdmTypeAlreadyRegistered(edmTypeReference)) { - throw new ODataException(ODataErrorStrings.UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists(edmTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists, edmTypeReference.FullName())); } CustomUriLiteralParsers.customUriLiteralParserPerEdmType = CustomUriLiteralParsers.customUriLiteralParserPerEdmType.Concat( diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/ExpandDepthAndCountValidator.cs b/src/Microsoft.OData.Core/UriParser/Parsers/ExpandDepthAndCountValidator.cs index e62dd539ae..b7edf68aa2 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/ExpandDepthAndCountValidator.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/ExpandDepthAndCountValidator.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using System.Diagnostics; using System.Linq; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// A component for walking an expand tree and determining if the depth or number of items exceed user-specified limits. @@ -63,7 +63,7 @@ private void EnsureMaximumCountAndDepthAreNotExceeded(SelectExpandClause expandT Debug.Assert(expandTree != null, "expandTree != null"); if (currentDepth > this.maxDepth) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.UriParser_ExpandDepthExceeded(currentDepth, this.maxDepth)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.UriParser_ExpandDepthExceeded, currentDepth, this.maxDepth)); } foreach (ExpandedNavigationSelectItem expandItem in expandTree.SelectedItems.Where(I => I.GetType() == typeof(ExpandedNavigationSelectItem))) @@ -71,7 +71,7 @@ private void EnsureMaximumCountAndDepthAreNotExceeded(SelectExpandClause expandT this.currentCount++; if (this.currentCount > this.maxCount) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.UriParser_ExpandCountExceeded(this.currentCount, this.maxCount)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.UriParser_ExpandCountExceeded, this.currentCount, this.maxCount)); } this.EnsureMaximumCountAndDepthAreNotExceeded(expandItem.SelectAndExpand, currentDepth + 1); @@ -80,7 +80,7 @@ private void EnsureMaximumCountAndDepthAreNotExceeded(SelectExpandClause expandT this.currentCount += expandTree.SelectedItems.Where(I => I.GetType() == typeof(ExpandedReferenceSelectItem)).Count(); if (this.currentCount > this.maxCount) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.UriParser_ExpandCountExceeded(this.currentCount, this.maxCount)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.UriParser_ExpandCountExceeded, this.currentCount, this.maxCount)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionCallParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionCallParser.cs index 5f5a6a98c1..1c5b24c4ac 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionCallParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionCallParser.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Implementation of IFunctionCallParser that allows functions calls and parses arguments with a provided method. @@ -125,7 +125,7 @@ public FunctionParameterToken[] ParseArgumentListOrEntityKeyList(Action restoreA return null; } - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.Lexer.CurrentToken.Position, this.Lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.Lexer.CurrentToken.Position, this.Lexer.ExpressionText)); } this.Lexer.NextToken(); @@ -147,7 +147,7 @@ public FunctionParameterToken[] ParseArgumentListOrEntityKeyList(Action restoreA return null; } - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.Lexer.CurrentToken.Position, this.Lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.Lexer.CurrentToken.Position, this.Lexer.ExpressionText)); } this.Lexer.NextToken(); @@ -205,7 +205,7 @@ private bool TryReadArgumentsAsNamedValues(out ICollection t.ParameterName).Distinct().Count() != argList.Count) { - throw new ODataException(ODataErrorStrings.FunctionCallParser_DuplicateParameterOrEntityKeyName); + throw new ODataException(SRResources.FunctionCallParser_DuplicateParameterOrEntityKeyName); } return true; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionOverloadResolver.cs b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionOverloadResolver.cs index f38fd2a8c6..2f7bc3b979 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionOverloadResolver.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionOverloadResolver.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Helper class to help bind function overloads. @@ -55,12 +55,12 @@ internal static bool ResolveOperationImportFromList(string identifier, IList 0) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } // If any of the things returned are an action, it better be the only thing returned, and there can't be parameters in the URL @@ -70,17 +70,17 @@ internal static bool ResolveOperationImportFromList(string identifier, IList o.IsFunctionImport())) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationImportOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationImportOverloads, identifier)); } else { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleActionImportOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleActionImportOverloads, identifier)); } } if (parameterNames.Count != 0) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } matchingOperationImport = candidateMatchingOperationImports.Single(); @@ -107,7 +107,7 @@ internal static bool ResolveOperationImportFromList(string identifier, IList 1) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationImportOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationImportOverloads, identifier)); } matchingOperationImport = candidateMatchingOperationImports.Single(); @@ -159,7 +159,7 @@ internal static bool ResolveOperationFromList(string identifier, IList p { if (ExceptionUtils.IsCatchableExceptionType(exc)) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_FoundInvalidOperation(identifier), exc); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_FoundInvalidOperation, identifier), exc); } throw; @@ -181,7 +181,7 @@ internal static bool ResolveOperationFromList(string identifier, IList p { if (foundActionsWhenLookingForFunctions) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } return false; @@ -196,7 +196,7 @@ internal static bool ResolveOperationFromList(string identifier, IList p if (foundActionsWhenLookingForFunctions) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } // If more than one overload matches, try to select based on optional parameters @@ -207,7 +207,7 @@ internal static bool ResolveOperationFromList(string identifier, IList p if (candidatesMatchingOperations.Count > 1) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_NoSingleMatchFound(identifier, string.Join(",", parameterNames.ToArray()))); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, identifier, string.Join(",", parameterNames.ToArray()))); } matchingOperation = candidatesMatchingOperations.Count > 0 ? candidatesMatchingOperations[0] : null; @@ -242,7 +242,7 @@ private static bool ResolveActionFromCandidates(IList candidatesM { if (actionExists) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationOverloads, identifier)); } functionExists = true; @@ -252,7 +252,7 @@ private static bool ResolveActionFromCandidates(IList candidatesM { if (functionExists) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationOverloads, identifier)); } actionExists = true; @@ -263,7 +263,7 @@ private static bool ResolveActionFromCandidates(IList candidatesM { if (candidatesMatchingOperations.Count > 1) { - throw new ODataException(ODataErrorStrings.FunctionOverloadResolver_MultipleActionOverloads(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionOverloadResolver_MultipleActionOverloads, identifier)); } Debug.Assert(!hasParameters); diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionParameterParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionParameterParser.cs index 07d26c230e..7c246060e3 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/FunctionParameterParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/FunctionParameterParser.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Component for parsing function parameters in both $filter/$orderby expressions and in paths. @@ -45,7 +45,7 @@ internal static bool TrySplitOperationParameters(string parenthesisExpression, O // check duplicate names if (splitParameters.Select(t => t.ParameterName).Distinct().Count() != splitParameters.Count) { - throw new ODataException(ODataErrorStrings.FunctionCallParser_DuplicateParameterOrEntityKeyName); + throw new ODataException(SRResources.FunctionCallParser_DuplicateParameterOrEntityKeyName); } return ret; @@ -101,7 +101,7 @@ private static bool TrySplitOperationParameters(this UriQueryExpressionParser pa if (currentToken.Kind == endTokenKind) { // Trailing comma. - throw new ODataException(ODataErrorStrings.ExpressionLexer_SyntaxError(lexer.Position, lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.ExpressionLexer_SyntaxError, lexer.Position, lexer.ExpressionText)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/IdentifierTokenizer.cs b/src/Microsoft.OData.Core/UriParser/Parsers/IdentifierTokenizer.cs index efb9db35c7..168d65b250 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/IdentifierTokenizer.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/IdentifierTokenizer.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System; using System.Collections.Generic; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -107,7 +107,7 @@ public QueryToken ParseStarMemberAccess(QueryToken instance) { if (!this.lexer.CurrentToken.Span.Equals(UriQueryConstants.Star, StringComparison.Ordinal)) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CannotCreateStarTokenFromNonStar(this.lexer.CurrentToken.Text.ToString())); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CannotCreateStarTokenFromNonStar, this.lexer.CurrentToken.Text.ToString())); } this.lexer.NextToken(); diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/ODataPathParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/ODataPathParser.cs index 45e84f9c54..8a3b7d953a 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/ODataPathParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/ODataPathParser.cs @@ -15,7 +15,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Metadata; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -103,7 +103,7 @@ internal static void ExtractSegmentIdentifierAndParenthesisExpression(string seg // However System.Uri removes it, so any empty segment we see is a 404 error. if (identifier.Length == 0) { - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_EmptySegmentInRequestUrl); + throw ExceptionUtil.ResourceNotFoundError(SRResources.RequestUriProcessor_EmptySegmentInRequestUrl); } } @@ -190,7 +190,7 @@ private static bool TryBindingParametersAndMatchingOperationImport(string identi } else { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } } @@ -257,7 +257,7 @@ private static bool TryBindingParametersAndMatchingOperation(string identifier, } else { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, identifier)); } } @@ -290,7 +290,7 @@ private static void CheckSingleResult(bool isSingleResult, string identifier) { if (!isSingleResult) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_CannotQueryCollections(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, identifier)); } } @@ -392,7 +392,7 @@ private static void ThrowIfMustBeLeafSegment(ODataPathSegment previous) { if (operationImport.IsActionImport() || (operationImport.IsFunctionImport() && !((IEdmFunctionImport)operationImport).Function.IsComposable)) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(previous.Identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, previous.Identifier)); } } } @@ -404,7 +404,7 @@ private static void ThrowIfMustBeLeafSegment(ODataPathSegment previous) { if (operation.IsAction() || (operation.IsFunction() && !((IEdmFunction)operation).IsComposable)) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(previous.Identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, previous.Identifier)); } } } @@ -421,7 +421,7 @@ private static void ThrowIfMustBeLeafSegment(ODataPathSegment previous) // Nothing can come after a $metadata, $value or $batch segment. // Nothing can come after a service operation with void return type. // Nothing can come after a collection property. - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(previous.Identifier)); + throw ExceptionUtil.ResourceNotFoundError(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, previous.Identifier)); } } @@ -448,7 +448,7 @@ private bool TryCreateCountSegment(string identifier, string parenthesisExpressi ODataPathSegment previous = this.parsedSegments[this.parsedSegments.Count - 1]; if ((previous.TargetKind != RequestTargetKind.Resource || previous.SingleResult) && previous.TargetKind != RequestTargetKind.Collection) { - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_CountNotSupported(previous.Identifier)); + throw ExceptionUtil.ResourceNotFoundError(Error.Format(SRResources.RequestUriProcessor_CountNotSupported, previous.Identifier)); } this.parsedSegments.Add(CountSegment.Instance); @@ -527,18 +527,18 @@ private bool TryCreateFilterSegment(string segmentText) int index = UriQueryConstants.FilterSegment.Length; if (segmentText.Length <= index + 2 || segmentText[index] != '(' || segmentText[segmentText.Length - 1] != ')') { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_FilterPathSegmentSyntaxError); + throw new ODataException(SRResources.RequestUriProcessor_FilterPathSegmentSyntaxError); } // 3) Extract the expression and perform the rest of the validations on it. if (lastNavigationSource == null) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_NoNavigationSourceFound(UriQueryConstants.FilterSegment)); + throw new ODataException(Error.Format(SRResources.RequestUriProcessor_NoNavigationSourceFound, UriQueryConstants.FilterSegment)); } if (lastNavigationSource is IEdmSingleton || this.parsedSegments.Last() is KeySegment) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_CannotApplyFilterOnSingleEntities(lastNavigationSource.Name)); + throw new ODataException(Error.Format(SRResources.RequestUriProcessor_CannotApplyFilterOnSingleEntities, lastNavigationSource.Name)); } // The "index + 1" is to move past the '(' and the '-2' accounts for the two paren characters. @@ -583,12 +583,12 @@ private bool TryCreateEachSegment(string identifier, string parenthesisExpressio ODataPathSegment prevSegment = this.parsedSegments.Last(); if (lastNavigationSource == null) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_NoNavigationSourceFound(UriQueryConstants.EachSegment)); + throw new ODataException(Error.Format(SRResources.RequestUriProcessor_NoNavigationSourceFound, UriQueryConstants.EachSegment)); } if (lastNavigationSource is IEdmSingleton || prevSegment is KeySegment) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_CannotApplyEachOnSingleEntities(lastNavigationSource.Name)); + throw new ODataException(Error.Format(SRResources.RequestUriProcessor_CannotApplyEachOnSingleEntities, lastNavigationSource.Name)); } EachSegment eachSegment = new EachSegment(lastNavigationSource, prevSegment.TargetEdmType.AsElementType()); @@ -638,7 +638,7 @@ private bool TryCreateEntityReferenceSegment(string identifier, string parenthes { if (navPropSegment.TargetKind != RequestTargetKind.Resource) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.PathParser_EntityReferenceNotSupported(navPropSegment.Identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.PathParser_EntityReferenceNotSupported, navPropSegment.Identifier)); } // If this is a navigation property, find target navigation source @@ -665,7 +665,7 @@ private bool TryCreateEntityReferenceSegment(string identifier, string parenthes if (lastSegment.TargetKind != RequestTargetKind.Resource) { throw ExceptionUtil.CreateBadRequestError( - ODataErrorStrings.PathParser_EntityReferenceNotSupported(lastSegment.Identifier)); + Error.Format(SRResources.PathParser_EntityReferenceNotSupported, lastSegment.Identifier)); } ReferenceSegment referenceSegment = new ReferenceSegment(lastNavigationSource); @@ -677,7 +677,7 @@ private bool TryCreateEntityReferenceSegment(string identifier, string parenthes string nextSegmentText; if (this.TryGetNextSegmentText(out nextSegmentText)) { - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + throw ExceptionUtil.ResourceNotFoundError(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } return true; @@ -800,7 +800,7 @@ private void CreateDynamicPathSegment(ODataPathSegment previous, string identifi // Open navigation properties are not supported on OpenTypes. if (parenthesisExpression != null) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.OpenNavigationPropertiesNotSupportedOnOpenTypes(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.OpenNavigationPropertiesNotSupportedOnOpenTypes, identifier)); } ODataPathSegment segment = new DynamicPathSegment(identifier); @@ -866,25 +866,25 @@ private void CreateFirstSegment(string segmentText) if (this.IdentifierIs(UriQueryConstants.CountSegment, identifier)) { // $count on root: throw - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_CountOnRoot); + throw ExceptionUtil.ResourceNotFoundError(SRResources.RequestUriProcessor_CountOnRoot); } if (this.IdentifierIs(UriQueryConstants.FilterSegment, identifier)) { // $filter on root: throw - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_FilterOnRoot); + throw ExceptionUtil.ResourceNotFoundError(SRResources.RequestUriProcessor_FilterOnRoot); } if (this.IdentifierIs(UriQueryConstants.EachSegment, identifier)) { // $each on root: throw - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_EachOnRoot); + throw ExceptionUtil.ResourceNotFoundError(SRResources.RequestUriProcessor_EachOnRoot); } if (this.IdentifierIs(UriQueryConstants.RefSegment, identifier)) { // $ref on root: throw - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_RefOnRoot); + throw ExceptionUtil.ResourceNotFoundError(SRResources.RequestUriProcessor_RefOnRoot); } if (this.configuration.BatchReferenceCallback != null && ContentIdRegex.IsMatch(identifier)) @@ -1124,12 +1124,12 @@ private bool TryCreateSegmentForOperation(ODataPathSegment previousSegment, stri if (!UriEdmHelpers.IsBindingTypeValid(bindingType)) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_OperationSegmentBoundToANonEntityType); + throw ExceptionUtil.CreateBadRequestError(SRResources.RequestUriProcessor_OperationSegmentBoundToANonEntityType); } if (previousSegment != null && bindingType == null) { - throw new ODataException(ODataErrorStrings.FunctionCallBinder_CallingFunctionOnOpenProperty(identifier)); + throw new ODataException(Error.Format(SRResources.FunctionCallBinder_CallingFunctionOnOpenProperty, identifier)); } CreateOperationSegment(previousSegment, singleOperation, resolvedParameters, identifier, parenthesisExpression); @@ -1151,7 +1151,7 @@ private void CreateOperationSegment(ODataPathSegment previousSegment, IEdmOperat // If previous segment is cross-referenced then we explicitly disallow the service action call if (previousSegment is BatchReferenceSegment) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset(identifier)); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_BatchedActionOnEntityCreatedInSameChangeset, identifier)); } CheckOperationTypeCastSegmentRestriction(singleOperation); @@ -1202,7 +1202,7 @@ private void CreateNextSegment(string text) if (previous.TargetKind == RequestTargetKind.Primitive) { // only $value is allowed after a primitive property - throw ExceptionUtil.ResourceNotFoundError(ODataErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment(previous.Identifier, text)); + throw ExceptionUtil.ResourceNotFoundError(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, previous.Identifier, text)); } // $ref @@ -1352,7 +1352,7 @@ private bool TryBindEscapeFunction() // i.e. we should throw for entitySet(key):/ComposableEscapeFunctionPath::/InvalidEscapeFunction if (!TryBindEscapeFunction()) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter); + throw ExceptionUtil.CreateBadRequestError(SRResources.RequestUriProcessor_ComposableEscapeFunctionShouldHaveValidParameter); } } @@ -1393,7 +1393,7 @@ private bool TryCreateTypeNameSegment(ODataPathSegment previous, string identifi if (!targetEdmType.IsOrInheritsFrom(previousEdmType) && !previousEdmType.IsOrInheritsFrom(targetEdmType)) { - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType(targetEdmType.FullTypeName(), previousEdmType.FullTypeName())); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, targetEdmType.FullTypeName(), previousEdmType.FullTypeName())); } CheckTypeCastSegmentRestriction(previous, targetEdmType); @@ -1419,7 +1419,7 @@ private bool TryCreateTypeNameSegment(ODataPathSegment previous, string identifi } else { - throw new ODataException(Strings.PathParser_TypeCastOnlyAllowedAfterStructuralCollection(identifier)); + throw new ODataException(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedAfterStructuralCollection, identifier)); } } } @@ -1489,7 +1489,7 @@ private void CreatePropertySegment(ODataPathSegment previous, IEdmProperty prope && navigationSource is IEdmUnknownEntitySet) { // Specifically not throwing ODataUriParserException since it's more an an internal server error - throw new ODataException(ODataErrorStrings.RequestUriProcessor_TargetEntitySetNotFound(property.Name)); + throw new ODataException(Error.Format(SRResources.RequestUriProcessor_TargetEntitySetNotFound, property.Name)); } segment = new NavigationPropertySegment(navigationProperty, navigationSource); @@ -1583,13 +1583,13 @@ private void CheckDollarEachSegmentRestrictions(int index) // Only one segment is allowed after $each... if (numOfSegmentsAfterDollarEach > 1) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); + throw new ODataException(SRResources.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); } // And if there exists a single segment after $each, then it must be an OperationSegment. if (!(this.parsedSegments[index + 1] is OperationSegment)) { - throw new ODataException(ODataErrorStrings.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); + throw new ODataException(SRResources.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); } } } @@ -1749,7 +1749,7 @@ private static void VerifyDerivedTypeConstraints(IEdmModel model, IEdmVocabulary return; } - throw new ODataException(Strings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint(fullTypeName, kind, name)); + throw new ODataException(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, fullTypeName, kind, name)); } private bool TryResolveEscapeFunction(ODataPathSegment previous, out string qualifiedName, out string parenthesisExpression, out bool anotherEscapeFunctionStarts, out IEdmFunction function) @@ -1811,7 +1811,7 @@ private bool TryResolveEscapeFunction(ODataPathSegment previous, out string qual if (function == null) { // We need to throw because we have consumed segments from the queue and we don't put them back. This is fair because early checks did show an escape function bound to the type. - throw ExceptionUtil.CreateBadRequestError(ODataErrorStrings.RequestUriProcessor_NoBoundEscapeFunctionSupported(bindingType.FullTypeName())); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.RequestUriProcessor_NoBoundEscapeFunctionSupported, bindingType.FullTypeName())); } parenthesisExpression = function.Parameters.ElementAt(1).Name + "='" + (isComposableRequired ? identifier.Substring(0, identifier.Length - 1) : identifier) + "'"; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/SearchParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/SearchParser.cs index bb7d6d8623..19be3d91e9 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/SearchParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/SearchParser.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser #region Namespaces using System; using System.Diagnostics; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -167,7 +167,7 @@ private QueryToken ParsePrimary() this.lexer.NextToken(); break; default: - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_ExpressionExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.RecurseLeave(); @@ -182,14 +182,14 @@ private QueryToken ParseParenExpression() { if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); QueryToken result = this.ParseExpression(); if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrOperatorExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -218,7 +218,7 @@ private void RecurseEnter() this.recursionDepth++; if (this.recursionDepth > this.maxDepth) { - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + throw new ODataException(SRResources.UriQueryExpressionParser_TooDeep); } } diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/SegmentKeyHandler.cs b/src/Microsoft.OData.Core/UriParser/Parsers/SegmentKeyHandler.cs index af3eea5905..c59fc98575 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/SegmentKeyHandler.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/SegmentKeyHandler.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -166,7 +166,7 @@ private static KeySegment CreateKeySegment(ODataPathSegment segment, KeySegment if (!key.AreValuesNamed && key.ValueCount > 1 && resolver.GetType() == typeof(ODataUriResolver)) { - throw ExceptionUtil.CreateBadRequestError(ErrorStrings.RequestUriProcessor_KeysMustBeNamed); + throw ExceptionUtil.CreateBadRequestError(SRResources.RequestUriProcessor_KeysMustBeNamed); } IEnumerable> keyPairs; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandOptionParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandOptionParser.cs index 859506dbd8..de2b478fd7 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandOptionParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandOptionParser.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Globalization; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Parser that knows how to parse expand options that could come after the path part of an expand term. @@ -130,7 +130,7 @@ internal SelectTermToken BuildSelectTermToken(PathSegmentToken pathToken, string // Check for (), which is not allowed. if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.CloseParen) { - throw new ODataException(ODataErrorStrings.UriParser_MissingSelectOption(pathToken.Identifier)); + throw new ODataException(Error.Format(SRResources.UriParser_MissingSelectOption, pathToken.Identifier)); } StringComparison comparison = this.enableCaseInsensitiveBuiltinIdentifier ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; @@ -182,7 +182,7 @@ internal SelectTermToken BuildSelectTermToken(PathSegmentToken pathToken, string } else { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, this.lexer.ExpressionText)); } } @@ -193,7 +193,7 @@ internal SelectTermToken BuildSelectTermToken(PathSegmentToken pathToken, string // Either there was no '(' at all or we just read past the ')' so we should be at the end if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.End) { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, this.lexer.ExpressionText)); } return new SelectTermToken(pathToken, filterOption, orderByOptions, topOption, skipOption, countOption, searchOption, selectOption, computeOption); @@ -237,7 +237,7 @@ internal List BuildExpandTermToken(PathSegmentToken pathToken, // Check for (), which is not allowed. if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.CloseParen) { - throw new ODataException(ODataErrorStrings.UriParser_MissingExpandOption(pathToken.Identifier)); + throw new ODataException(Error.Format(SRResources.UriParser_MissingExpandOption, pathToken.Identifier)); } StringComparison comparison = this.enableCaseInsensitiveBuiltinIdentifier ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; @@ -304,7 +304,7 @@ internal List BuildExpandTermToken(PathSegmentToken pathToken, } else { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, this.lexer.ExpressionText)); } } @@ -315,7 +315,7 @@ internal List BuildExpandTermToken(PathSegmentToken pathToken, // Either there was no '(' at all or we just read past the ')' so we should be at the end if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.End) { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, this.lexer.ExpressionText)); } // TODO, there should be some check here in case pathToken identifier is $ref, select, expand and levels options are not allowed. @@ -337,7 +337,7 @@ private List BuildStarExpandTermToken(PathSegmentToken pathToke { if (this.parentStructuredType == null) { - throw new ODataException(ODataErrorStrings.UriExpandParser_ParentStructuredTypeIsNull(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriExpandParser_ParentStructuredTypeIsNull, this.lexer.ExpressionText)); } List expandTermTokenList = new List(); @@ -367,7 +367,7 @@ private List BuildStarExpandTermToken(PathSegmentToken pathToke // Check for (), which is not allowed. if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.CloseParen) { - throw new ODataException(ODataErrorStrings.UriParser_MissingExpandOption(pathToken.Identifier)); + throw new ODataException(Error.Format(SRResources.UriParser_MissingExpandOption, pathToken.Identifier)); } // Only level option is supported by expand. @@ -387,7 +387,7 @@ private List BuildStarExpandTermToken(PathSegmentToken pathToke else { // no option is allowed when expand with star per specification - throw new ODataException(ODataErrorStrings.UriExpandParser_TermIsNotValidForStarRef(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriExpandParser_TermIsNotValidForStarRef, this.lexer.ExpressionText)); } break; @@ -395,7 +395,7 @@ private List BuildStarExpandTermToken(PathSegmentToken pathToke default: { - throw new ODataException(ODataErrorStrings.UriExpandParser_TermIsNotValidForStar(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriExpandParser_TermIsNotValidForStar, this.lexer.ExpressionText)); } } } @@ -407,7 +407,7 @@ private List BuildStarExpandTermToken(PathSegmentToken pathToke // Either there was no '(' at all or we just read past the ')' so we should be at the end if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.End) { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, this.lexer.ExpressionText)); } foreach (var navigationProperty in this.parentStructuredType.NavigationProperties()) @@ -475,7 +475,7 @@ private IEnumerable ParseInnerOrderBy() long top; if (!long.TryParse(topText, out top) || top < 0) { - throw new ODataException(ODataErrorStrings.UriSelectParser_InvalidTopOption(topText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_InvalidTopOption, topText)); } return top; @@ -495,7 +495,7 @@ private IEnumerable ParseInnerOrderBy() long skip; if (!long.TryParse(skipText, out skip) || skip < 0) { - throw new ODataException(ODataErrorStrings.UriSelectParser_InvalidSkipOption(skipText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, skipText)); } return skip; @@ -519,7 +519,7 @@ private IEnumerable ParseInnerOrderBy() return false; default: - throw new ODataException(ODataErrorStrings.UriSelectParser_InvalidCountOption(countText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_InvalidCountOption, countText)); } } @@ -632,7 +632,7 @@ private ExpandToken ParseInnerExpand(PathSegmentToken pathToken) } else if (!long.TryParse(levelsText, NumberStyles.None, CultureInfo.InvariantCulture, out level) || level < 0) { - throw new ODataException(ODataErrorStrings.UriSelectParser_InvalidLevelsOption(levelsText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_InvalidLevelsOption, levelsText)); } else { diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandParser.cs index 976b734484..224d66a6f9 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/SelectExpandParser.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser using System; using System.Collections.Generic; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Object that knows how to parse a select or expand expression. That is, a path to a property, @@ -275,7 +275,7 @@ private ExpandToken ParseCommaSeparatedExpandList(Func 0) { - throw new ODataException(ODataErrorStrings.UriExpandParser_TermWithMultipleStarNotAllowed(this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriExpandParser_TermWithMultipleStarNotAllowed, this.lexer.ExpressionText)); } starTermTokens = termParsingFunc(); @@ -321,7 +321,7 @@ private ExpandToken ParseCommaSeparatedExpandList(Func /// Sub-parser that uses to parse a single select or expand term. @@ -96,7 +96,7 @@ private void CheckPathLength(int pathLength) { if (pathLength > this.maxPathLength) { - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + throw new ODataException(SRResources.UriQueryExpressionParser_TooDeep); } } @@ -113,7 +113,7 @@ private PathSegmentToken ParseSegment(PathSegmentToken previousSegment, bool all && (!allowRef || !this.lexer.CurrentToken.Span.Equals(UriQueryConstants.RefSegment, StringComparison.Ordinal)) && !this.lexer.CurrentToken.Span.Equals(UriQueryConstants.CountSegment, StringComparison.Ordinal)) { - throw new ODataException(ODataErrorStrings.UriSelectParser_SystemTokenInSelectExpand(this.lexer.CurrentToken.Text.ToString(), this.lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_SystemTokenInSelectExpand, this.lexer.CurrentToken.Text.ToString(), this.lexer.ExpressionText)); } // Some check here to throw exception, prop1/*/prop2 and */$ref/prop and prop1/$count/prop2 will throw exception, all are $expand cases. @@ -122,24 +122,24 @@ private PathSegmentToken ParseSegment(PathSegmentToken previousSegment, bool all if (previousSegment != null && previousSegment.Identifier == UriQueryConstants.Star && !this.lexer.CurrentToken.GetIdentifier().Equals(UriQueryConstants.RefSegment, StringComparison.Ordinal)) { // Star can only be followed with $ref. $count is not supported with star as expand option - throw new ODataException(ODataErrorStrings.ExpressionToken_OnlyRefAllowWithStarInExpand); + throw new ODataException(SRResources.ExpressionToken_OnlyRefAllowWithStarInExpand); } else if (previousSegment != null && previousSegment.Identifier == UriQueryConstants.RefSegment) { // $ref should not have more property followed. - throw new ODataException(ODataErrorStrings.ExpressionToken_NoPropAllowedAfterRef); + throw new ODataException(SRResources.ExpressionToken_NoPropAllowedAfterRef); } else if (previousSegment != null && previousSegment.Identifier == UriQueryConstants.CountSegment) { // $count should not have more property followed. e.g $expand=NavProperty/$count/MyProperty - throw new ODataException(ODataErrorStrings.ExpressionToken_NoPropAllowedAfterDollarCount); + throw new ODataException(SRResources.ExpressionToken_NoPropAllowedAfterDollarCount); } } if (this.lexer.CurrentToken.Span.Equals(UriQueryConstants.CountSegment, StringComparison.Ordinal) && isSelect) { // $count is not allowed in $select e.g $select=NavProperty/$count - throw new ODataException(ODataErrorStrings.ExpressionToken_DollarCountNotAllowedInSelect); + throw new ODataException(SRResources.ExpressionToken_DollarCountNotAllowedInSelect); } ReadOnlySpan propertyName; @@ -153,12 +153,12 @@ private PathSegmentToken ParseSegment(PathSegmentToken previousSegment, bool all // "*/$ref" is supported in expand if (this.lexer.PeekNextToken().Kind == ExpressionTokenKind.Slash && isSelect) { - throw new ODataException(ODataErrorStrings.ExpressionToken_IdentifierExpected(this.lexer.Position)); + throw new ODataException(Error.Format(SRResources.ExpressionToken_IdentifierExpected, this.lexer.Position)); } else if (previousSegment != null && !isSelect) { // expand option like "customer?$expand=VIPCustomer/*" is not allowed as specification does not allowed any property before *. - throw new ODataException(ODataErrorStrings.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); + throw new ODataException(SRResources.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); } propertyName = this.lexer.CurrentToken.Span; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/UriParserHelper.cs b/src/Microsoft.OData.Core/UriParser/Parsers/UriParserHelper.cs index 52fc30cae4..80fb1e9bfa 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/UriParserHelper.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/UriParserHelper.cs @@ -13,7 +13,7 @@ namespace Microsoft.OData.UriParser using System.Globalization; using System.Linq; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion @@ -176,7 +176,7 @@ internal static void ValidatePrefixLiteral(string typePrefixLiteralName) if (!isLettersOnly) { throw new ArgumentException( - string.Format(CultureInfo.InvariantCulture, ODataErrorStrings.UriParserHelper_InvalidPrefixLiteral(typePrefixLiteralName))); + string.Format(CultureInfo.InvariantCulture, Error.Format(SRResources.UriParserHelper_InvalidPrefixLiteral, typePrefixLiteralName))); } } @@ -279,7 +279,7 @@ internal static string ReadQueryOption(ExpressionLexer lexer) { if (lexer.CurrentToken.Kind != ExpressionTokenKind.Equal) { - throw new ODataException(ODataErrorStrings.UriSelectParser_TermIsNotValid(lexer.ExpressionText)); + throw new ODataException(Error.Format(SRResources.UriSelectParser_TermIsNotValid, lexer.ExpressionText)); } // get the full text from the current location onward diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/UriPathParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/UriPathParser.cs index 0220903b79..9b92499350 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/UriPathParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/UriPathParser.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Diagnostics; @@ -46,7 +47,7 @@ public virtual ICollection ParsePathIntoSegments(Uri fullUri, Uri servic if (!UriUtils.UriInvariantInsensitiveIsBaseOf(serviceBaseUri, fullUri)) { - throw new ODataException(Strings.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri(fullUri, serviceBaseUri)); + throw new ODataException(Error.Format(SRResources.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri, fullUri, serviceBaseUri)); } // COMPAT 29: Slash in key lookup breaks URI parser @@ -90,7 +91,7 @@ public virtual ICollection ParsePathIntoSegments(Uri fullUri, Uri servic if (segments.Count == this.maxSegments) { - throw new ODataException(Strings.UriQueryPathParser_TooManySegments); + throw new ODataException(SRResources.UriQueryPathParser_TooManySegments); } segments.Add(Uri.UnescapeDataString(segment)); @@ -100,7 +101,7 @@ public virtual ICollection ParsePathIntoSegments(Uri fullUri, Uri servic } catch (FormatException uriFormatException) { - throw new ODataException(Strings.UriQueryPathParser_SyntaxError, uriFormatException); + throw new ODataException(SRResources.UriQueryPathParser_SyntaxError, uriFormatException); } } } diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/UriPrimitiveTypeParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/UriPrimitiveTypeParser.cs index 88e8c0739b..c8884775eb 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/UriPrimitiveTypeParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/UriPrimitiveTypeParser.cs @@ -13,7 +13,7 @@ using Microsoft.OData.Metadata; using Microsoft.OData.Edm; using Microsoft.Spatial; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -235,7 +235,7 @@ private bool TryUriStringToPrimitive(string text, IEdmTypeReference targetType, break; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.UriPrimitiveTypeParser_TryUriStringToPrimitive)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.UriPrimitiveTypeParser_TryUriStringToPrimitive)); } return true; @@ -254,7 +254,7 @@ private bool TryUriStringToPrimitive(string text, IEdmTypeReference targetType, catch (Exception primitiveParserException) { exception = new UriLiteralParsingException( - string.Format(CultureInfo.InvariantCulture, ODataErrorStrings.UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue(text, targetType), + string.Format(CultureInfo.InvariantCulture, Error.Format(SRResources.UriPrimitiveTypeParsers_FailedToParseTextToPrimitiveValue, text, targetType), primitiveParserException)); targetValue = null; return false; diff --git a/src/Microsoft.OData.Core/UriParser/Parsers/UriQueryExpressionParser.cs b/src/Microsoft.OData.Core/UriParser/Parsers/UriQueryExpressionParser.cs index fc6ac1065d..8b28d03930 100644 --- a/src/Microsoft.OData.Core/UriParser/Parsers/UriQueryExpressionParser.cs +++ b/src/Microsoft.OData.Core/UriParser/Parsers/UriQueryExpressionParser.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.UriParser.Aggregation; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -270,7 +270,7 @@ internal ComputeToken ParseCompute() // '(' if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } lexer.NextToken(); @@ -292,7 +292,7 @@ internal ComputeToken ParseCompute() // ")" if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -340,7 +340,7 @@ internal ExpandToken ParseExpand() // '(' if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -373,7 +373,7 @@ internal ExpandToken ParseExpand() : new ExpandToken(nestedExpand.ExpandTerms.Concat(tempNestedExpand.ExpandTerms)); break; default: - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected(supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } } } @@ -381,7 +381,7 @@ internal ExpandToken ParseExpand() // Leaf level expands require filter if (filterToken == null && nestedExpand == null) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_InnerMostExpandRequireFilter, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } ExpandTermToken expandTermToken = new ExpandTermToken(pathToken, filterToken, null, null, null, null, null, null, null, nestedExpand); @@ -390,7 +390,7 @@ internal ExpandToken ParseExpand() // ")" if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -433,7 +433,7 @@ internal IEnumerable ParseApply(string apply) transformationTokens.Add(ParseExpand()); break; default: - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected(supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } // '/' indicates there are more transformations @@ -464,7 +464,7 @@ internal List ParseAggregateExpressions() // '(' if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -486,7 +486,7 @@ internal List ParseAggregateExpressions() // ")" if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -549,7 +549,7 @@ internal GroupByToken ParseGroupBy() // '(' if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -557,7 +557,7 @@ internal GroupByToken ParseGroupBy() // '(' if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -570,7 +570,7 @@ internal GroupByToken ParseGroupBy() if (expression == null) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_ExpressionExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } properties.Add(expression); @@ -586,7 +586,7 @@ internal GroupByToken ParseGroupBy() // ")" if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrOperatorExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -605,14 +605,14 @@ internal GroupByToken ParseGroupBy() } else { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected(ExpressionConstants.KeywordAggregate, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, ExpressionConstants.KeywordAggregate, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } } // ")" if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -778,7 +778,7 @@ private static LiteralToken ParseTypedLiteral(ExpressionLexer lexer, IEdmTypeRef if (typeParsingException == null) { - message = ODataErrorStrings.UriQueryExpressionParser_UnrecognizedLiteral( + message = Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedLiteral, targetTypeName, tokenText, lexer.CurrentToken.Position, @@ -788,7 +788,7 @@ private static LiteralToken ParseTypedLiteral(ExpressionLexer lexer, IEdmTypeRef } else { - message = ODataErrorStrings.UriQueryExpressionParser_UnrecognizedLiteralWithReason( + message = Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedLiteralWithReason, targetTypeName, tokenText, lexer.CurrentToken.Position, @@ -1130,7 +1130,7 @@ private QueryToken ParsePrimaryStart() QueryToken primitiveLiteralToken = TryParseLiteral(this.lexer); if (primitiveLiteralToken == null) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_ExpressionExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } return primitiveLiteralToken; @@ -1146,14 +1146,14 @@ private QueryToken ParseParenExpression() { if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); QueryToken result = this.ParseExpression(); if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrOperatorExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -1191,7 +1191,7 @@ private QueryToken ParseAnyAll(QueryToken parent, bool isAny) this.lexer.NextToken(); if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } this.lexer.NextToken(); @@ -1213,7 +1213,7 @@ private QueryToken ParseAnyAll(QueryToken parent, bool isAny) string parameter = this.lexer.CurrentToken.GetIdentifier().ToString(); if (!this.parameters.Add(parameter)) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared(parameter)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_RangeVariableAlreadyDeclared, parameter)); } // read the ':' separating the range variable from the expression. @@ -1224,7 +1224,7 @@ private QueryToken ParseAnyAll(QueryToken parent, bool isAny) QueryToken expr = this.ParseExpression(); if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } // forget about the range variable after parsing the expression for this lambda. @@ -1275,7 +1275,7 @@ private AggregationMethodDefinition ParseAggregateWith() { if (!TokenIdentifierIs(ExpressionConstants.KeywordWith)) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_WithExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_WithExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } lexer.NextToken(); @@ -1305,7 +1305,7 @@ private AggregationMethodDefinition ParseAggregateWith() if (!methodLabel.Contains(OData.ExpressionConstants.SymbolDot, StringComparison.Ordinal)) { throw ParseError( - ODataErrorStrings.UriQueryExpressionParser_UnrecognizedWithMethod( + Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedWithMethod, methodLabel.ToString(), identifierStartPosition, this.lexer.ExpressionText)); @@ -1322,7 +1322,7 @@ private StringLiteralToken ParseAggregateAs() { if (!TokenIdentifierIs(ExpressionConstants.KeywordAs)) { - throw ParseError(ODataErrorStrings.UriQueryExpressionParser_AsExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); + throw ParseError(Error.Format(SRResources.UriQueryExpressionParser_AsExpected, this.lexer.CurrentToken.Position, this.lexer.ExpressionText)); } lexer.NextToken(); @@ -1356,7 +1356,7 @@ private void RecurseEnter() this.recursionDepth++; if (this.recursionDepth > this.maxDepth) { - throw new ODataException(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + throw new ODataException(SRResources.UriQueryExpressionParser_TooDeep); } } diff --git a/src/Microsoft.OData.Core/UriParser/QueryNodeUtils.cs b/src/Microsoft.OData.Core/UriParser/QueryNodeUtils.cs index 2c2b266966..f01c4f8e3d 100644 --- a/src/Microsoft.OData.Core/UriParser/QueryNodeUtils.cs +++ b/src/Microsoft.OData.Core/UriParser/QueryNodeUtils.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -136,7 +136,7 @@ internal static IEdmPrimitiveTypeReference GetBinaryOperatorResultType(IEdmPrimi return left; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.QueryNodeUtils_BinaryOperatorResultType_UnreachableCodepath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.QueryNodeUtils_BinaryOperatorResultType_UnreachableCodepath)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/QueryOptionUtils.cs b/src/Microsoft.OData.Core/UriParser/QueryOptionUtils.cs index 94ef783d58..b1fd981599 100644 --- a/src/Microsoft.OData.Core/UriParser/QueryOptionUtils.cs +++ b/src/Microsoft.OData.Core/UriParser/QueryOptionUtils.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.UriParser { + using Microsoft.OData.Core; #region Namespaces using System; @@ -69,7 +70,7 @@ internal static string GetQueryOptionValue(this List que } else { - throw new ODataException(Strings.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce(queryOptionName)); + throw new ODataException(Error.Format(SRResources.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, queryOptionName)); } } } @@ -101,7 +102,7 @@ internal static string GetQueryOptionValueAndRemove(this List @@ -46,7 +47,7 @@ public override IEnumerable> ResolveKeys(IEdmEntity if (!TryResolveAlternateKeys(type, namedValues, convertFunc, out IEnumerable> alternateConvertedPairs)) { - throw ExceptionUtil.CreateBadRequestError(Strings.BadRequest_KeyOrAlternateKeyMismatch(type.FullName())); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.BadRequest_KeyOrAlternateKeyMismatch, type.FullName())); } return alternateConvertedPairs; @@ -111,7 +112,7 @@ private bool TryResolveKeys(IEdmEntityType type, IDictionary nam var list = namedValues.Keys.Where(key => string.Equals(kvp.Key, key, StringComparison.OrdinalIgnoreCase)).ToList(); if (list.Count > 1) { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingKeysFound(kvp.Key)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingKeysFound, kvp.Key)); } else if (list.Count == 0) { diff --git a/src/Microsoft.OData.Core/UriParser/Resolver/ODataUriResolver.cs b/src/Microsoft.OData.Core/UriParser/Resolver/ODataUriResolver.cs index e1fda6b4ce..24492b3356 100644 --- a/src/Microsoft.OData.Core/UriParser/Resolver/ODataUriResolver.cs +++ b/src/Microsoft.OData.Core/UriParser/Resolver/ODataUriResolver.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; @@ -108,7 +109,7 @@ public virtual IEdmNavigationSource ResolveNavigationSource(IEdmModel model, str if (cachedResults.Count > 1) { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingNavigationSourcesFound(identifier)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingNavigationSourcesFound, identifier)); } } @@ -134,7 +135,7 @@ public virtual IEdmNavigationSource ResolveNavigationSource(IEdmModel model, str } else { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingNavigationSourcesFound(identifier)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingNavigationSourcesFound, identifier)); } } @@ -171,7 +172,7 @@ public virtual IEdmProperty ResolveProperty(IEdmStructuredType type, string prop } else { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingPropertiesFound(propertyName, type.FullTypeName())); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingPropertiesFound, propertyName, type.FullTypeName())); } } @@ -204,7 +205,7 @@ public virtual IEdmTerm ResolveTerm(IEdmModel model, string termName) if (results.Count > 1) { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingTypesFound(termName)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingTypesFound, termName)); } return results[0]; @@ -236,7 +237,7 @@ public virtual IEdmSchemaType ResolveType(IEdmModel model, string typeName) if (results.Count > 1) { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingTypesFound(typeName)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingTypesFound, typeName)); } return results[0]; @@ -383,7 +384,7 @@ public virtual IDictionary ResolveOpera // ensure parameter name exists if (functionParameter == null) { - throw new ODataException(Strings.ODataParameterWriterCore_ParameterNameNotFoundInOperation(item.Key, operation.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_ParameterNameNotFoundInOperation, item.Key, operation.Name)); } result.Add(functionParameter, item.Value); @@ -411,7 +412,7 @@ public virtual IEnumerable> ResolveKeys(IEdmEntityT IEnumerable keys = type.Key(); if (keys.Count() != positionalValues.Count) { - throw ExceptionUtil.CreateBadRequestError(Strings.BadRequest_KeyCountMismatch(type.FullName())); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.BadRequest_KeyCountMismatch, type.FullName())); } var keyPairList = new List>(positionalValues.Count); @@ -447,7 +448,7 @@ public virtual IEnumerable> ResolveKeys(IEdmEntityT if (!TryResolveKeys(type, namedValues, convertFunc, out IEnumerable> resolvedKeys)) { - throw ExceptionUtil.CreateBadRequestError(Strings.BadRequest_KeyMismatch(type.FullName())); + throw ExceptionUtil.CreateBadRequestError(Error.Format(SRResources.BadRequest_KeyMismatch, type.FullName())); } return resolvedKeys; @@ -554,7 +555,7 @@ internal static IEdmOperationParameter ResolveOperationParameterNameCaseInsensit } else { - throw new ODataException(Strings.UriParserMetadata_MultipleMatchingParametersFound(identifier)); + throw new ODataException(Error.Format(SRResources.UriParserMetadata_MultipleMatchingParametersFound, identifier)); } } diff --git a/src/Microsoft.OData.Core/UriParser/Resolver/StringAsEnumResolver.cs b/src/Microsoft.OData.Core/UriParser/Resolver/StringAsEnumResolver.cs index 49af7a8b09..39896dcf41 100644 --- a/src/Microsoft.OData.Core/UriParser/Resolver/StringAsEnumResolver.cs +++ b/src/Microsoft.OData.Core/UriParser/Resolver/StringAsEnumResolver.cs @@ -10,6 +10,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; + using Microsoft.OData.Core; using Microsoft.OData.Edm; /// @@ -87,7 +88,7 @@ public override IDictionary ResolveOper // ensure parameter name exists if (functionParameter == null) { - throw new ODataException(Strings.ODataParameterWriterCore_ParameterNameNotFoundInOperation(item.Key, operation.Name)); + throw new ODataException(Error.Format(SRResources.ODataParameterWriterCore_ParameterNameNotFoundInOperation, item.Key, operation.Name)); } SingleValueNode newVal = item.Value; diff --git a/src/Microsoft.OData.Core/UriParser/SearchLexer.cs b/src/Microsoft.OData.Core/UriParser/SearchLexer.cs index 9bd09981e4..ddc46fdf13 100644 --- a/src/Microsoft.OData.Core/UriParser/SearchLexer.cs +++ b/src/Microsoft.OData.Core/UriParser/SearchLexer.cs @@ -6,6 +6,7 @@ namespace Microsoft.OData.UriParser { + using Microsoft.OData.Core; #region Namespaces using System; using System.Collections.Generic; @@ -86,7 +87,7 @@ protected override ExpressionToken NextTokenImplementation(out Exception error) if (this.textPos == this.TextLen) { - throw ParseError(Strings.ExpressionLexer_UnterminatedStringLiteral(this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_UnterminatedStringLiteral, this.textPos, this.Text)); } this.NextChar(); @@ -122,7 +123,7 @@ protected override ExpressionToken NextTokenImplementation(out Exception error) if (this.token.Text.IsEmpty) { - throw ParseError(Strings.ExpressionToken_IdentifierExpected(this.token.Position)); + throw ParseError(Error.Format(SRResources.ExpressionToken_IdentifierExpected, this.token.Position)); } } @@ -132,7 +133,7 @@ protected override ExpressionToken NextTokenImplementation(out Exception error) { Match match = InvalidWordPattern.Match(this.token.Text.ToString()); int index = match.Groups[0].Index; - throw ParseError(Strings.ExpressionLexer_InvalidCharacter(this.token.Span[index], this.token.Position + index, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, this.token.Span[index], this.token.Position + index, this.Text)); } this.token.Kind = ExpressionTokenKind.StringLiteral; @@ -177,7 +178,7 @@ private void NextCharWithEscape() if (!this.ch.HasValue || EscapeSequenceSet.IndexOf(this.ch.Value, StringComparison.Ordinal) < 0) { - throw ParseError(Strings.ExpressionLexer_InvalidEscapeSequence(this.ch, this.textPos, this.Text)); + throw ParseError(Error.Format(SRResources.ExpressionLexer_InvalidEscapeSequence, this.ch, this.textPos, this.Text)); } } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/AggregatedCollectionPropertyNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/AggregatedCollectionPropertyNode.cs index 46d202ebc8..3a493d8951 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/AggregatedCollectionPropertyNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/AggregatedCollectionPropertyNode.cs @@ -6,7 +6,7 @@ using System; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -50,12 +50,12 @@ public AggregatedCollectionPropertyNode(CollectionNavigationNode source, IEdmPro if (property.PropertyKind != EdmPropertyKind.Structural) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessShouldBeNonEntityProperty(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, property.Name)); } if (property.Type.IsCollection()) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessTypeShouldNotBeCollection(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessTypeShouldNotBeCollection, property.Name)); } this.source = source; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/BatchReferenceSegment.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/BatchReferenceSegment.cs index 58306bdd28..f7daafad4b 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/BatchReferenceSegment.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/BatchReferenceSegment.cs @@ -7,10 +7,8 @@ namespace Microsoft.OData.UriParser { #region Namespaces - - using System.Diagnostics.CodeAnalysis; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -48,7 +46,7 @@ public BatchReferenceSegment(string contentId, IEdmType edmType, IEdmEntitySetBa ExceptionUtils.CheckArgumentNotNull(contentId, "contentId"); if (!ODataPathParser.ContentIdRegex.IsMatch(contentId)) { - throw new ODataException(ODataErrorStrings.BatchReferenceSegment_InvalidContentID(contentId)); + throw new ODataException(Error.Format(SRResources.BatchReferenceSegment_InvalidContentID, contentId)); } this.edmType = edmType; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/BinaryOperatorNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/BinaryOperatorNode.cs index 2ca239b571..68f725a92d 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/BinaryOperatorNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/BinaryOperatorNode.cs @@ -10,7 +10,6 @@ namespace Microsoft.OData.UriParser using Microsoft.OData; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; #endregion Namespaces diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionComplexNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionComplexNode.cs index f6b8fc0803..c36950deaa 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionComplexNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionComplexNode.cs @@ -6,7 +6,7 @@ using System; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -66,7 +66,7 @@ private CollectionComplexNode(IEdmNavigationSource navigationSource, IEdmPropert if (property.PropertyKind != EdmPropertyKind.Structural) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessShouldBeNonEntityProperty(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, property.Name)); } this.property = property; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionFunctionCallNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionFunctionCallNode.cs index 82dd4e4098..99b71db8da 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionFunctionCallNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionFunctionCallNode.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.UriParser using System.Collections.ObjectModel; using System.Linq; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Node to represent a function call that returns a Collection @@ -71,7 +71,7 @@ public CollectionFunctionCallNode(string name, IEnumerable functio if (!this.itemType.IsPrimitive() && !this.itemType.IsComplex() && !this.itemType.IsEnum()) { - throw new ArgumentException(ODataErrorStrings.Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); + throw new ArgumentException(SRResources.Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); } this.source = source; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionNavigationNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionNavigationNode.cs index d294ea51e4..3e6f55ea77 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionNavigationNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionNavigationNode.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -122,7 +122,7 @@ private CollectionNavigationNode(IEdmNavigationProperty navigationProperty) if (navigationProperty.TargetMultiplicity() != EdmMultiplicity.Many) { - throw new ArgumentException(ODataErrorStrings.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity); + throw new ArgumentException(SRResources.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity); } this.navigationProperty = navigationProperty; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionOpenPropertyAccessNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionOpenPropertyAccessNode.cs index 413be4e98f..7f2a1c5aea 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionOpenPropertyAccessNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionOpenPropertyAccessNode.cs @@ -9,7 +9,6 @@ namespace Microsoft.OData.UriParser #region Namespaces using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; #endregion Namespaces diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionPropertyAccessNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionPropertyAccessNode.cs index 3ff3b69ae6..51a7a242da 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionPropertyAccessNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionPropertyAccessNode.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -54,12 +54,12 @@ public CollectionPropertyAccessNode(SingleValueNode source, IEdmProperty propert if (property.PropertyKind != EdmPropertyKind.Structural) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessShouldBeNonEntityProperty(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, property.Name)); } if (!property.Type.IsCollection()) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessTypeMustBeCollection(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessTypeMustBeCollection, property.Name)); } this.source = source; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionResourceFunctionCallNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionResourceFunctionCallNode.cs index ebe14a9825..1cab589a8e 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionResourceFunctionCallNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CollectionResourceFunctionCallNode.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// Node to represent a function call that returns a collection of entities. @@ -81,7 +81,7 @@ public CollectionResourceFunctionCallNode(string name, IEnumerable if (this.structuredTypeReference == null) { // TODO: Update error message #644 - throw new ArgumentException(ODataErrorStrings.Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity); + throw new ArgumentException(SRResources.Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity); } this.source = source; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/CountNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/CountNode.cs index 91ac11437c..f14fd5ef9d 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/CountNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/CountNode.cs @@ -9,7 +9,6 @@ namespace Microsoft.OData.UriParser #region Namespaces using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; #endregion Namespaces diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/InNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/InNode.cs index f4bf7ae6a4..e2ce204438 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/InNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/InNode.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using Microsoft.OData; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -55,7 +55,7 @@ public InNode(SingleValueNode left, CollectionNode right) if (!this.left.GetEdmTypeReference().IsAssignableFrom(this.right.ItemType) && !this.right.ItemType.IsAssignableFrom(this.left.GetEdmTypeReference())) { - throw new ArgumentException(ODataErrorStrings.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType( + throw new ArgumentException(Error.Format(SRResources.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType, this.right.ItemType.FullName(), this.left.GetEdmTypeReference().FullName())); } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/NonResourceRangeVariable.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/NonResourceRangeVariable.cs index 977ba9accb..8578bbd9ad 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/NonResourceRangeVariable.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/NonResourceRangeVariable.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser #region Namespaces using System; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces /// @@ -51,7 +51,7 @@ public NonResourceRangeVariable(string name, IEdmTypeReference typeReference, Co { // TODO: update message #644 throw new ArgumentException( - ODataErrorStrings.Nodes_NonentityParameterQueryNodeWithEntityType(typeReference.FullName())); + Error.Format(SRResources.Nodes_NonentityParameterQueryNodeWithEntityType, typeReference.FullName())); } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataExpandPath.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataExpandPath.cs index 9cedda5b09..4f75c472d8 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataExpandPath.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataExpandPath.cs @@ -9,7 +9,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// A specific type of which can only contain instances of or or of complex. @@ -62,21 +62,21 @@ private void ValidatePath() { if (index == this.Count - 1) { - throw new ODataException(ODataErrorStrings.ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment); + throw new ODataException(SRResources.ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment); } } else if (segment is NavigationPropertySegment) { if (foundNavProp) { - throw new ODataException(ODataErrorStrings.ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty); + throw new ODataException(SRResources.ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty); } foundNavProp = true; } else if (!(segment is TypeSegment)) { - throw new ODataException(ODataErrorStrings.ODataExpandPath_InvalidExpandPathSegment(segment.GetType().Name)); + throw new ODataException(Error.Format(SRResources.ODataExpandPath_InvalidExpandPathSegment, segment.GetType().Name)); } index++; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPath.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPath.cs index 5bf963a1fe..79dab36f78 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPath.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPath.cs @@ -13,6 +13,7 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; + using Microsoft.OData.Core; #endregion Namespaces diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPathExtensions.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPathExtensions.cs index 5283900c10..ae8b10f515 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPathExtensions.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataPathExtensions.cs @@ -14,6 +14,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; + using Microsoft.OData.Core; /// /// Extension methods for . These method provide convenience functions. diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataSelectPath.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataSelectPath.cs index 77ea4e02b9..5fa9dc1c73 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataSelectPath.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/ODataSelectPath.cs @@ -8,7 +8,7 @@ namespace Microsoft.OData.UriParser { using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; /// /// A specific type of which can only contain instances of , , @@ -49,7 +49,7 @@ private void ValidatePath() if (this.Count == 1 && this.FirstSegment is TypeSegment) { - throw new ODataException(ODataErrorStrings.ODataSelectPath_CannotOnlyHaveTypeSegment); + throw new ODataException(SRResources.ODataSelectPath_CannotOnlyHaveTypeSegment); } foreach (ODataPathSegment segment in this) @@ -58,14 +58,14 @@ private void ValidatePath() { if (index != this.Count - 1) { - throw new ODataException(ODataErrorStrings.ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment); + throw new ODataException(SRResources.ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment); } } else if (segment is OperationSegment) { if (index != this.Count - 1) { - throw new ODataException(ODataErrorStrings.ODataSelectPath_OperationSegmentCanOnlyBeLastSegment); + throw new ODataException(SRResources.ODataSelectPath_OperationSegmentCanOnlyBeLastSegment); } } else if (segment is DynamicPathSegment || segment is PropertySegment || segment is TypeSegment || segment is AnnotationSegment) @@ -76,7 +76,7 @@ private void ValidatePath() else { throw new ODataException( - ODataErrorStrings.ODataSelectPath_InvalidSelectPathSegmentType(segment.GetType().Name)); + Error.Format(SRResources.ODataSelectPath_InvalidSelectPathSegmentType, segment.GetType().Name)); } index++; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationImportSegment.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationImportSegment.cs index 5063a9511c..cf5b8f98bb 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationImportSegment.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationImportSegment.cs @@ -10,10 +10,9 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -184,7 +183,7 @@ public override IEdmType EdmType { if (ReferenceEquals(this.computedReturnEdmType, UnknownSentinel)) { - throw new ODataException(ODataErrorStrings.OperationSegment_ReturnTypeForMultipleOverloads); + throw new ODataException(SRResources.OperationSegment_ReturnTypeForMultipleOverloads); } return this.computedReturnEdmType; @@ -256,7 +255,7 @@ private void EnsureTypeAndSetAreCompatable() // Void operations cannot specify return entity set if (this.computedReturnEdmType == null) { - throw new ODataException(ODataErrorStrings.OperationSegment_CannotReturnNull); + throw new ODataException(SRResources.OperationSegment_CannotReturnNull); } // Unwrap the return type if it's a collection @@ -270,7 +269,7 @@ private void EnsureTypeAndSetAreCompatable() // Ensure that the return type is in the same type hierarchy as the entity set provided if (!this.entitySet.EntityType.IsOrInheritsFrom(unwrappedCollectionType) && !unwrappedCollectionType.IsOrInheritsFrom(this.entitySet.EntityType)) { - throw new ODataException(ODataErrorStrings.OperationSegment_CannotReturnNull); + throw new ODataException(SRResources.OperationSegment_CannotReturnNull); } } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationSegment.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationSegment.cs index 7a74eab051..aad2a0089f 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationSegment.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/OperationSegment.cs @@ -10,10 +10,9 @@ namespace Microsoft.OData.UriParser using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -183,7 +182,7 @@ public override IEdmType EdmType { if (ReferenceEquals(this.computedReturnEdmType, UnknownSentinel)) { - throw new ODataException(ODataErrorStrings.OperationSegment_ReturnTypeForMultipleOverloads); + throw new ODataException(SRResources.OperationSegment_ReturnTypeForMultipleOverloads); } return this.computedReturnEdmType; @@ -255,7 +254,7 @@ private void EnsureTypeAndSetAreCompatable() // Void operations cannot specify return entity set if (this.computedReturnEdmType == null) { - throw new ODataException(ODataErrorStrings.OperationSegment_CannotReturnNull); + throw new ODataException(SRResources.OperationSegment_CannotReturnNull); } // Unwrap the return type if it's a collection @@ -269,7 +268,7 @@ private void EnsureTypeAndSetAreCompatable() // Ensure that the return type is in the same type hierarchy as the entity set provided if (!this.entitySet.EntityType.IsOrInheritsFrom(unwrappedCollectionType) && !unwrappedCollectionType.IsOrInheritsFrom(this.entitySet.EntityType)) { - throw new ODataException(ODataErrorStrings.OperationSegment_CannotReturnNull); + throw new ODataException(SRResources.OperationSegment_CannotReturnNull); } } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleComplexNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleComplexNode.cs index 8daaad4666..0f10d9fd7c 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleComplexNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleComplexNode.cs @@ -6,7 +6,7 @@ using System; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -60,7 +60,7 @@ private SingleComplexNode(IEdmNavigationSource navigationSource, IEdmProperty pr if (property.PropertyKind != EdmPropertyKind.Structural) { // TODO: update error message #644 - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessShouldBeNonEntityProperty(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, property.Name)); } this.property = property; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleNavigationNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleNavigationNode.cs index 3793714031..b391ff53b3 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleNavigationNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleNavigationNode.cs @@ -7,7 +7,7 @@ using System; using System.Collections.Generic; using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -75,7 +75,7 @@ internal SingleNavigationNode(IEdmNavigationSource navigationSource, IEdmNavigat EdmMultiplicity multiplicity = navigationProperty.TargetMultiplicity(); if (multiplicity != EdmMultiplicity.One && multiplicity != EdmMultiplicity.ZeroOrOne) { - throw new ArgumentException(ODataErrorStrings.Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity); + throw new ArgumentException(SRResources.Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity); } this.navigationProperty = navigationProperty; @@ -110,7 +110,7 @@ private SingleNavigationNode(IEdmNavigationSource navigationSource, EdmMultiplicity multiplicity = navigationProperty.TargetMultiplicity(); if (multiplicity != EdmMultiplicity.One && multiplicity != EdmMultiplicity.ZeroOrOne) { - throw new ArgumentException(ODataErrorStrings.Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity); + throw new ArgumentException(SRResources.Nodes_CollectionNavigationNode_MustHaveSingleMultiplicity); } this.navigationProperty = navigationProperty; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValueFunctionCallNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValueFunctionCallNode.cs index ab16ea6e79..a313356548 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValueFunctionCallNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValueFunctionCallNode.cs @@ -12,7 +12,7 @@ namespace Microsoft.OData.UriParser using System; using System.Collections.ObjectModel; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -81,7 +81,7 @@ public SingleValueFunctionCallNode(string name, IEnumerable functi if (returnedTypeReference.IsCollection() || !(returnedTypeReference.IsComplex() || returnedTypeReference.IsPrimitive() || returnedTypeReference.IsEnum())) { - throw new ArgumentException(ODataErrorStrings.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); + throw new ArgumentException(SRResources.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); } } diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValuePropertyAccessNode.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValuePropertyAccessNode.cs index 1f75c6d337..75991b2c8b 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValuePropertyAccessNode.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/SingleValuePropertyAccessNode.cs @@ -10,7 +10,7 @@ namespace Microsoft.OData.UriParser using System; using Microsoft.OData.Edm; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -44,12 +44,12 @@ public SingleValuePropertyAccessNode(SingleValueNode source, IEdmProperty proper if (property.PropertyKind != EdmPropertyKind.Structural) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessShouldBeNonEntityProperty(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, property.Name)); } if (property.Type.IsCollection()) { - throw new ArgumentException(ODataErrorStrings.Nodes_PropertyAccessTypeShouldNotBeCollection(property.Name)); + throw new ArgumentException(Error.Format(SRResources.Nodes_PropertyAccessTypeShouldNotBeCollection, property.Name)); } this.source = source; diff --git a/src/Microsoft.OData.Core/UriParser/SemanticAst/ValueSegment.cs b/src/Microsoft.OData.Core/UriParser/SemanticAst/ValueSegment.cs index 488475e11a..12c7bed929 100644 --- a/src/Microsoft.OData.Core/UriParser/SemanticAst/ValueSegment.cs +++ b/src/Microsoft.OData.Core/UriParser/SemanticAst/ValueSegment.cs @@ -5,7 +5,7 @@ //--------------------------------------------------------------------- using Microsoft.OData.Edm; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -31,7 +31,7 @@ public ValueSegment(IEdmType previousType) if (previousType is IEdmCollectionType) { - throw new ODataException(ODataErrorStrings.PathParser_CannotUseValueOnCollection); + throw new ODataException(SRResources.PathParser_CannotUseValueOnCollection); } if (previousType is IEdmEntityType) diff --git a/src/Microsoft.OData.Core/UriParser/TypePromotionUtils.cs b/src/Microsoft.OData.Core/UriParser/TypePromotionUtils.cs index 69b76d3bc8..fae7489eb1 100644 --- a/src/Microsoft.OData.Core/UriParser/TypePromotionUtils.cs +++ b/src/Microsoft.OData.Core/UriParser/TypePromotionUtils.cs @@ -15,7 +15,7 @@ namespace Microsoft.OData.UriParser using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; - using ODataErrorStrings = Microsoft.OData.Strings; + using Microsoft.OData.Core; #endregion Namespaces @@ -710,7 +710,7 @@ private static FunctionSignature[] GetFunctionSignatures(BinaryOperatorKind oper return arithmeticSignatures; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.TypePromotionUtils_GetFunctionSignatures_Binary_UnreachableCodepath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.TypePromotionUtils_GetFunctionSignatures_Binary_UnreachableCodepath)); } } @@ -729,7 +729,7 @@ private static FunctionSignature[] GetFunctionSignatures(UnaryOperatorKind opera case UnaryOperatorKind.Not: return notSignatures; default: - throw new ODataException(ODataErrorStrings.General_InternalError(InternalErrorCodes.TypePromotionUtils_GetFunctionSignatures_Unary_UnreachableCodepath)); + throw new ODataException(Error.Format(SRResources.General_InternalError, InternalErrorCodes.TypePromotionUtils_GetFunctionSignatures_Unary_UnreachableCodepath)); } } diff --git a/src/Microsoft.OData.Core/UriParser/UriEdmHelpers.cs b/src/Microsoft.OData.Core/UriParser/UriEdmHelpers.cs index d36b5836e4..da6f25a9bd 100644 --- a/src/Microsoft.OData.Core/UriParser/UriEdmHelpers.cs +++ b/src/Microsoft.OData.Core/UriParser/UriEdmHelpers.cs @@ -7,6 +7,7 @@ using System.Diagnostics.CodeAnalysis; using Microsoft.OData.Metadata; using Microsoft.OData.Edm; +using Microsoft.OData.Core; namespace Microsoft.OData.UriParser { @@ -55,7 +56,7 @@ public static void CheckRelatedTo(IEdmType parentType, IEdmType childType) // If the parentType is an open property, parentType will be null and can't have an ODataFullName. string parentTypeName = (parentType != null) ? parentType.FullTypeName() : ""; string childTypeName = (childType != null) ? childType.FullTypeName() : ""; - throw new ODataException(Strings.MetadataBinder_HierarchyNotFollowed(childTypeName, parentTypeName)); + throw new ODataException(Error.Format(SRResources.MetadataBinder_HierarchyNotFollowed, childTypeName, parentTypeName)); } } @@ -85,13 +86,13 @@ public static IEdmNavigationProperty GetNavigationPropertyFromExpandPath(ODataPa navPropSegment = currentSegment as NavigationPropertySegment; if (typeSegment == null && navPropSegment == null) { - throw new ODataException(Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath); + throw new ODataException(SRResources.ExpandItemBinder_TypeSegmentNotFollowedByPath); } } if (navPropSegment == null) { - throw new ODataException(Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath); + throw new ODataException(SRResources.ExpandItemBinder_TypeSegmentNotFollowedByPath); } else { diff --git a/src/Microsoft.OData.Core/UriUtils.cs b/src/Microsoft.OData.Core/UriUtils.cs index 1b690bf487..93e291be4e 100644 --- a/src/Microsoft.OData.Core/UriUtils.cs +++ b/src/Microsoft.OData.Core/UriUtils.cs @@ -10,6 +10,7 @@ using System.Globalization; using System.Text.RegularExpressions; using System.Xml; +using Microsoft.OData.Core; using Microsoft.OData.Edm; namespace Microsoft.OData @@ -187,7 +188,7 @@ internal static bool ConvertUriStringToDateTimeOffset(ReadOnlySpan text, o if (m) { // The format should be exactly "yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?" and each field value is within valid range - throw new ODataException(Strings.UriUtils_DateTimeOffsetInvalidFormat(text.ToString()), exception); + throw new ODataException(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, text.ToString()), exception); } return false; @@ -195,7 +196,7 @@ internal static bool ConvertUriStringToDateTimeOffset(ReadOnlySpan text, o catch (ArgumentOutOfRangeException exception) { // This means the timezone number is bigger than 14:00, inclusive exception has detail exception. - throw new ODataException(Strings.UriUtils_DateTimeOffsetInvalidFormat(text.ToString()), exception); + throw new ODataException(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, text.ToString()), exception); } } diff --git a/src/Microsoft.OData.Core/UrlValidation/Rules/RequireSelectRules.cs b/src/Microsoft.OData.Core/UrlValidation/Rules/RequireSelectRules.cs index 1a8ea80c69..ab05f56276 100644 --- a/src/Microsoft.OData.Core/UrlValidation/Rules/RequireSelectRules.cs +++ b/src/Microsoft.OData.Core/UrlValidation/Rules/RequireSelectRules.cs @@ -4,6 +4,7 @@ // //-------- +using Microsoft.OData.Core; using Microsoft.OData.Edm; namespace Microsoft.OData.UriParser.Validation.Rules @@ -74,7 +75,7 @@ private static void CheckAllSelected(string identifier, SelectExpandClause selec private static void AddError(string identifier, ODataUrlValidationContext validationContext) { - validationContext.AddMessage(new ODataUrlValidationMessage(ODataUrlValidationMessageCodes.MissingSelect, Strings.ODataUrlValidationError_SelectRequired(identifier), Severity.Warning)); + validationContext.AddMessage(new ODataUrlValidationMessage(ODataUrlValidationMessageCodes.MissingSelect, Error.Format(SRResources.ODataUrlValidationError_SelectRequired, identifier), Severity.Warning)); } } } diff --git a/src/Microsoft.OData.Core/UrlValidation/ValidationEngine/ODataUrlValidator.cs b/src/Microsoft.OData.Core/UrlValidation/ValidationEngine/ODataUrlValidator.cs index 8b7cb3892a..3a6207967e 100644 --- a/src/Microsoft.OData.Core/UrlValidation/ValidationEngine/ODataUrlValidator.cs +++ b/src/Microsoft.OData.Core/UrlValidation/ValidationEngine/ODataUrlValidator.cs @@ -10,6 +10,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.UriParser.Aggregation; @@ -225,7 +226,7 @@ private bool ValidateByType(object item, Type itemType, ODataUrlValidationContex } catch (Exception e) { - validationContext.AddMessage(ODataUrlValidationMessageCodes.InvalidRule, Strings.ODataUrlValidationError_InvalidRule(rule.RuleName, e.Message), Severity.Warning); + validationContext.AddMessage(ODataUrlValidationMessageCodes.InvalidRule, Error.Format(SRResources.ODataUrlValidationError_InvalidRule, rule.RuleName, e.Message), Severity.Warning); } } } diff --git a/src/Microsoft.OData.Core/ValidationUtils.cs b/src/Microsoft.OData.Core/ValidationUtils.cs index 8455d1b58e..1327260d26 100644 --- a/src/Microsoft.OData.Core/ValidationUtils.cs +++ b/src/Microsoft.OData.Core/ValidationUtils.cs @@ -12,6 +12,7 @@ namespace Microsoft.OData using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; #endregion Namespaces @@ -52,7 +53,7 @@ internal static void ValidateValueTypeKind(EdmTypeKind typeKind, string typeName && typeKind != EdmTypeKind.Collection && typeKind != EdmTypeKind.Untyped) { - throw new ODataException(Strings.ValidationUtils_IncorrectValueTypeKind(typeName, typeKind.ToString())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncorrectValueTypeKind, typeName, typeKind.ToString())); } } @@ -67,7 +68,7 @@ internal static string ValidateCollectionTypeName(string collectionTypeName) if (itemTypeName == null) { - throw new ODataException(Strings.ValidationUtils_InvalidCollectionTypeName(collectionTypeName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_InvalidCollectionTypeName, collectionTypeName)); } return itemTypeName; @@ -87,7 +88,7 @@ internal static void ValidateEntityTypeIsAssignable(IEdmEntityTypeReference expe // Entity types must be assignable if (!EdmLibraryExtensions.IsAssignableFrom(expectedEntityTypeReference.EntityDefinition(), payloadEntityTypeReference.EntityDefinition())) { - throw new ODataException(Strings.ValidationUtils_ResourceTypeNotAssignableToExpectedType(payloadEntityTypeReference.FullName(), expectedEntityTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ResourceTypeNotAssignableToExpectedType, payloadEntityTypeReference.FullName(), expectedEntityTypeReference.FullName())); } } @@ -105,7 +106,7 @@ internal static void ValidateComplexTypeIsAssignable(IEdmComplexType expectedCom // Complex types could be assignable if (!EdmLibraryExtensions.IsAssignableFrom(expectedComplexType, payloadComplexType)) { - throw new ODataException(Strings.ValidationUtils_IncompatibleType(payloadComplexType.FullTypeName(), expectedComplexType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatibleType, payloadComplexType.FullTypeName(), expectedComplexType.FullTypeName())); } } @@ -120,7 +121,7 @@ internal static IEdmCollectionTypeReference ValidateCollectionType(IEdmTypeRefer if (collectionTypeReference != null && !typeReference.IsNonEntityCollectionType()) { - throw new ODataException(Strings.ValidationUtils_InvalidCollectionTypeReference(typeReference.TypeKind())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_InvalidCollectionTypeReference, typeReference.TypeKind())); } return collectionTypeReference; @@ -135,17 +136,17 @@ internal static void ValidateCollectionItem(object item, bool isNullable) { if (!isNullable && item == null) { - throw new ODataException(Strings.ValidationUtils_NonNullableCollectionElementsMustNotBeNull); + throw new ODataException(SRResources.ValidationUtils_NonNullableCollectionElementsMustNotBeNull); } if (item is ODataCollectionValue) { - throw new ODataException(Strings.ValidationUtils_NestedCollectionsAreNotSupported); + throw new ODataException(SRResources.ValidationUtils_NestedCollectionsAreNotSupported); } if (item is ODataStreamReferenceValue) { - throw new ODataException(Strings.ValidationUtils_StreamReferenceValuesNotSupportedInCollections); + throw new ODataException(SRResources.ValidationUtils_StreamReferenceValuesNotSupportedInCollections); } } @@ -157,7 +158,7 @@ internal static void ValidateNullCollectionItem(IEdmTypeReference expectedItemTy { if (expectedItemType != null && expectedItemType.IsODataPrimitiveTypeKind() && !expectedItemType.IsNullable) { - throw new ODataException(Strings.ValidationUtils_NullCollectionItemForNonNullableType(expectedItemType.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_NullCollectionItemForNonNullableType, expectedItemType.FullName())); } } @@ -172,7 +173,7 @@ internal static void ValidateStreamPropertyInfo(IODataStreamReferenceInfo stream Debug.Assert(streamInfo != null, "streamInfo != null"); if (edmProperty != null && !edmProperty.Type.IsStream()) { - throw new ODataException(Strings.ValidationUtils_MismatchPropertyKindForStreamProperty(propertyName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_MismatchPropertyKindForStreamProperty, propertyName)); } } @@ -186,7 +187,7 @@ internal static void IncreaseAndValidateRecursionDepth(ref int recursionDepth, i recursionDepth++; if (recursionDepth > maxDepth) { - throw new ODataException(Strings.ValidationUtils_RecursionDepthLimitReached(maxDepth)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_RecursionDepthLimitReached, maxDepth)); } } @@ -201,7 +202,7 @@ internal static void ValidateOperationNotNull(ODataOperation operation, bool isA if (operation == null) { string enumerableName = isAction ? "ODataResource.Actions" : "ODataResource.Functions"; - throw new ODataException(Strings.ValidationUtils_EnumerableContainsANullItem(enumerableName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_EnumerableContainsANullItem, enumerableName)); } } @@ -216,7 +217,7 @@ internal static void ValidateOperationMetadataNotNull(ODataOperation operation) // ODataOperation must have a Metadata property. if (operation.Metadata == null) { - throw new ODataException(Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(operation.GetType().Name)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, operation.GetType().Name)); } } @@ -231,7 +232,7 @@ internal static void ValidateOperationTargetNotNull(ODataOperation operation) // ODataOperation must have a Target property. if (operation.Target == null) { - throw new ODataException(Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyTarget(operation.GetType().Name)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyTarget, operation.GetType().Name)); } } @@ -251,14 +252,14 @@ internal static void ValidateMediaResource(ODataResourceBase resource, IEdmEntit { if (resourceType.HasStream) { - throw new ODataException(Strings.ValidationUtils_ResourceWithoutMediaResourceAndMLEType(resourceType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ResourceWithoutMediaResourceAndMLEType, resourceType.FullTypeName())); } } else { if (!resourceType.HasStream) { - throw new ODataException(Strings.ValidationUtils_ResourceWithMediaResourceAndNonMLEType(resourceType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ResourceWithMediaResourceAndNonMLEType, resourceType.FullTypeName())); } } } @@ -298,7 +299,7 @@ internal static void ValidateIsExpectedPrimitiveType(object value, IEdmPrimitive if (valuePrimitiveTypeReference == null) { - throw new ODataException(Strings.ValidationUtils_UnsupportedPrimitiveType(value.GetType().FullName)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_UnsupportedPrimitiveType, value.GetType().FullName)); } Debug.Assert(valuePrimitiveTypeReference.IsEquivalentTo(EdmLibraryExtensions.GetPrimitiveTypeReference(value.GetType())), "The value and valuePrimitiveTypeReference don't match."); @@ -312,7 +313,7 @@ internal static void ValidateIsExpectedPrimitiveType(object value, IEdmPrimitive if (!expectedTypeReference.IsODataPrimitiveTypeKind() && !expectedTypeReference.IsODataTypeDefinitionTypeKind()) { // non-primitive type found for primitive value. - throw new ODataException(Strings.ValidationUtils_NonPrimitiveTypeForPrimitiveValue(expectedTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_NonPrimitiveTypeForPrimitiveValue, expectedTypeReference.FullName())); } ValidateMetadataPrimitiveType(expectedTypeReference, valuePrimitiveTypeReference); @@ -345,7 +346,7 @@ internal static void ValidateMetadataPrimitiveType(IEdmTypeReference expectedTyp if (!nullableCompatible || !typeCompatible) { // incompatible type name for value! - throw new ODataException(Strings.ValidationUtils_IncompatiblePrimitiveItemType( + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, typeReferenceFromValue.FullName(), typeReferenceFromValue.IsNullable, expectedTypeReference.FullName(), @@ -362,18 +363,18 @@ internal static void ValidateServiceDocumentElement(ODataServiceDocumentElement { if (serviceDocumentElement == null) { - throw new ODataException(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem); + throw new ODataException(SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem); } // The resource collection URL must not be null; if (serviceDocumentElement.Url == null) { - throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyUrl); + throw new ODataException(SRResources.ValidationUtils_ResourceMustSpecifyUrl); } if (format == ODataFormat.Json && string.IsNullOrEmpty(serviceDocumentElement.Name)) { - throw new ODataException(Strings.ValidationUtils_ResourceMustSpecifyName(serviceDocumentElement.Url.ToString())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_ResourceMustSpecifyName, serviceDocumentElement.Url.ToString())); } } @@ -386,7 +387,7 @@ internal static void ValidateServiceDocumentElementUrl(string serviceDocumentUrl // The service document URL must not be null or empty; if (serviceDocumentUrl == null) { - throw new ODataException(Strings.ValidationUtils_ServiceDocumentElementUrlMustNotBeNull); + throw new ODataException(SRResources.ValidationUtils_ServiceDocumentElementUrlMustNotBeNull); } } @@ -411,7 +412,7 @@ internal static void ValidateTypeKind(EdmTypeKind actualTypeKind, EdmTypeKind ex { if (typeName == null) { - throw new ODataException(Strings.ValidationUtils_IncorrectTypeKindNoTypeName(actualTypeKind.ToString(), expectedTypeKind.ToString())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncorrectTypeKindNoTypeName, actualTypeKind.ToString(), expectedTypeKind.ToString())); } if (actualTypeKind == EdmTypeKind.TypeDefinition && expectedTypeKind == EdmTypeKind.Primitive @@ -421,7 +422,7 @@ internal static void ValidateTypeKind(EdmTypeKind actualTypeKind, EdmTypeKind ex return; } - throw new ODataException(Strings.ValidationUtils_IncorrectTypeKind(typeName, expectedTypeKind.ToString(), actualTypeKind.ToString())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_IncorrectTypeKind, typeName, expectedTypeKind.ToString(), actualTypeKind.ToString())); } } @@ -434,7 +435,7 @@ internal static void ValidateBoundaryString(string boundary) // Boundary string must have at least 1 and no more than 70 characters. if (boundary == null || boundary.Length == 0 || boundary.Length > MaxBoundaryLength) { - throw new ODataException(Strings.ValidationUtils_InvalidBatchBoundaryDelimiterLength(boundary, MaxBoundaryLength)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_InvalidBatchBoundaryDelimiterLength, boundary, MaxBoundaryLength)); } //// NOTE: we do not have to check the validity of the characters in the boundary string @@ -467,7 +468,7 @@ internal static void ValidatePropertyName(string propertyName) string invalidChars = string.Join( ", ", ValidationUtils.InvalidCharactersInPropertyNames.Select(c => string.Format(CultureInfo.InvariantCulture, "'{0}'", c)).ToArray()); - throw new ODataException(Strings.ValidationUtils_PropertiesMustNotContainReservedChars(propertyName, invalidChars)); + throw new ODataException(Error.Format(SRResources.ValidationUtils_PropertiesMustNotContainReservedChars, propertyName, invalidChars)); } } } diff --git a/src/Microsoft.OData.Core/Value/ODataPrimitiveValue.cs b/src/Microsoft.OData.Core/Value/ODataPrimitiveValue.cs index ad81443ea4..a44588d743 100644 --- a/src/Microsoft.OData.Core/Value/ODataPrimitiveValue.cs +++ b/src/Microsoft.OData.Core/Value/ODataPrimitiveValue.cs @@ -7,6 +7,7 @@ namespace Microsoft.OData { using System; + using Microsoft.OData.Core; using Microsoft.OData.Metadata; /// @@ -23,12 +24,12 @@ public ODataPrimitiveValue(object value) { if (value == null) { - throw new ArgumentNullException(Strings.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull, (Exception)null); + throw new ArgumentNullException(SRResources.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull, (Exception)null); } if (!EdmLibraryExtensions.IsPrimitiveType(value.GetType())) { - throw new ODataException(Strings.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType(value.GetType())); + throw new ODataException(Error.Format(SRResources.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType, value.GetType())); } this.Value = value; diff --git a/src/Microsoft.OData.Core/Value/ODataValueUtils.cs b/src/Microsoft.OData.Core/Value/ODataValueUtils.cs index 90acdb7e20..36898af1a4 100644 --- a/src/Microsoft.OData.Core/Value/ODataValueUtils.cs +++ b/src/Microsoft.OData.Core/Value/ODataValueUtils.cs @@ -9,6 +9,7 @@ namespace Microsoft.OData.Service #else using System; using System.Text.Json; +using Microsoft.OData.Core; namespace Microsoft.OData #endif diff --git a/src/Microsoft.OData.Core/WriterValidationUtils.cs b/src/Microsoft.OData.Core/WriterValidationUtils.cs index 7ba8d393b4..0d7c5b9be0 100644 --- a/src/Microsoft.OData.Core/WriterValidationUtils.cs +++ b/src/Microsoft.OData.Core/WriterValidationUtils.cs @@ -12,8 +12,10 @@ namespace Microsoft.OData using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; + using Microsoft.VisualBasic; #endregion Namespaces /// @@ -32,12 +34,12 @@ internal static void ValidateMessageWriterSettings(ODataMessageWriterSettings me if (messageWriterSettings.BaseUri != null && !messageWriterSettings.BaseUri.IsAbsoluteUri) { - throw new ODataException(Strings.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute(UriUtils.UriToString(messageWriterSettings.BaseUri))); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute, UriUtils.UriToString(messageWriterSettings.BaseUri))); } if (messageWriterSettings.HasJsonPaddingFunction() && !writingResponse) { - throw new ODataException(Strings.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage); + throw new ODataException(SRResources.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage); } } @@ -49,7 +51,7 @@ internal static void ValidatePropertyNotNull(ODataPropertyInfo property) { if (property == null) { - throw new ODataException(Strings.WriterValidationUtils_PropertyMustNotBeNull); + throw new ODataException(SRResources.WriterValidationUtils_PropertyMustNotBeNull); } } @@ -62,7 +64,7 @@ internal static void ValidatePropertyName(string propertyName) // Properties must have a non-empty name if (string.IsNullOrEmpty(propertyName)) { - throw new ODataException(Strings.WriterValidationUtils_PropertiesMustHaveNonEmptyName); + throw new ODataException(SRResources.WriterValidationUtils_PropertiesMustHaveNonEmptyName); } ValidationUtils.ValidatePropertyName(propertyName); @@ -94,7 +96,7 @@ internal static IEdmProperty ValidatePropertyDefined( if (throwOnUndeclaredProperty && !owningStructuredType.IsOpen && property == null) { - throw new ODataException(Strings.ValidationUtils_PropertyDoesNotExistOnType(propertyName, owningStructuredType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, propertyName, owningStructuredType.FullTypeName())); } return property; @@ -114,7 +116,7 @@ internal static void ValidatePropertyDefined(PropertySerializationInfo propertyI if (throwOnUndeclaredProperty && propertyInfo.MetadataType.IsUndeclaredProperty && !propertyInfo.MetadataType.IsOpenProperty) { - throw new ODataException(Strings.ValidationUtils_PropertyDoesNotExistOnType(propertyInfo.PropertyName, propertyInfo.MetadataType.OwningType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, propertyInfo.PropertyName, propertyInfo.MetadataType.OwningType.FullTypeName())); } } @@ -145,7 +147,7 @@ internal static IEdmNavigationProperty ValidateNavigationPropertyDefined(string if (property.PropertyKind != EdmPropertyKind.Navigation) { // The property must be a navigation property - throw new ODataException(Strings.ValidationUtils_NavigationPropertyExpected(propertyName, owningType.FullTypeName(), property.PropertyKind.ToString())); + throw new ODataException(Error.Format(SRResources.ValidationUtils_NavigationPropertyExpected, propertyName, owningType.FullTypeName(), property.PropertyKind.ToString())); } return (IEdmNavigationProperty)property; @@ -168,7 +170,7 @@ internal static void ValidateNestedResource(IEdmStructuredType resourceType, IEd // Make sure the entity types are compatible if (!parentNavigationPropertyType.IsAssignableFrom(resourceType)) { - throw new ODataException(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType(resourceType.FullTypeName(), parentNavigationPropertyType.FullTypeName())); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, resourceType.FullTypeName(), parentNavigationPropertyType.FullTypeName())); } } @@ -184,7 +186,7 @@ internal static void ValidateCanWriteOperation(ODataOperation operation, bool wr // Operations are only valid in responses; we fail on them in requests if (!writingResponse) { - throw new ODataException(Strings.WriterValidationUtils_OperationInRequest(operation.Metadata)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, operation.Metadata)); } } @@ -203,7 +205,7 @@ internal static void ValidateResourceSetAtEnd(ODataResourceSet resourceSet, bool // Check that NextPageLink is not set for requests if (writingRequest) { - throw new ODataException(Strings.WriterValidationUtils_NextPageLinkInRequest); + throw new ODataException(SRResources.WriterValidationUtils_NextPageLinkInRequest); } } } @@ -223,7 +225,7 @@ internal static void ValidateDeltaResourceSetAtEnd(ODataDeltaResourceSet resourc // Check that NextPageLink is not set for requests if (writingRequest) { - throw new ODataException(Strings.WriterValidationUtils_NextPageLinkInRequest); + throw new ODataException(SRResources.WriterValidationUtils_NextPageLinkInRequest); } } } @@ -266,17 +268,17 @@ internal static void ValidateStreamReferenceValue(ODataStreamReferenceValue stre if (streamReference.ContentType != null && streamReference.ContentType.Length == 0) { - throw new ODataException(Strings.WriterValidationUtils_StreamReferenceValueEmptyContentType); + throw new ODataException(SRResources.WriterValidationUtils_StreamReferenceValueEmptyContentType); } if (isDefaultStream && streamReference.ReadLink == null && streamReference.ContentType != null) { - throw new ODataException(Strings.WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink); + throw new ODataException(SRResources.WriterValidationUtils_DefaultStreamWithContentTypeWithoutReadLink); } if (isDefaultStream && streamReference.ReadLink != null && streamReference.ContentType == null) { - throw new ODataException(Strings.WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType); + throw new ODataException(SRResources.WriterValidationUtils_DefaultStreamWithReadLinkWithoutContentType); } // Default stream can be completely empty (no links or anything) @@ -287,12 +289,12 @@ internal static void ValidateStreamReferenceValue(ODataStreamReferenceValue stre // That will cause the writer to write the properties outside the content without producing any content element. if (streamReference.EditLink == null && streamReference.ReadLink == null && !isDefaultStream) { - throw new ODataException(Strings.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink); + throw new ODataException(SRResources.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkOrReadLink); } if (streamReference.EditLink == null && streamReference.ETag != null) { - throw new ODataException(Strings.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag); + throw new ODataException(SRResources.WriterValidationUtils_StreamReferenceValueMustHaveEditLinkToHaveETag); } } @@ -315,7 +317,7 @@ internal static void ValidateStreamPropertyInfo(IODataStreamReferenceInfo stream // Read/Write links and ETags on Stream properties are only valid in responses; writers fail if they encounter them in requests. if (streamPropertyInfo != null && streamPropertyInfo.EditLink != null || streamPropertyInfo.ReadLink != null || streamPropertyInfo.ETag != null) { - throw new ODataException(Strings.WriterValidationUtils_StreamPropertyInRequest(propertyName)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_StreamPropertyInRequest, propertyName)); } } } @@ -362,7 +364,7 @@ internal static void ValidatePropertyDerivedTypeConstraint(PropertySerialization } } - throw new ODataException(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(fullTypeName, "property", propertySerializationInfo.PropertyName)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, fullTypeName, "property", propertySerializationInfo.PropertyName)); } /// @@ -374,7 +376,7 @@ internal static void ValidateEntityReferenceLinkNotNull(ODataEntityReferenceLink { if (entityReferenceLink == null) { - throw new ODataException(Strings.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull); + throw new ODataException(SRResources.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull); } } @@ -388,7 +390,7 @@ internal static void ValidateEntityReferenceLink(ODataEntityReferenceLink entity if (entityReferenceLink.Url == null) { - throw new ODataException(Strings.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull); + throw new ODataException(SRResources.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull); } } @@ -418,7 +420,7 @@ internal static IEdmNavigationProperty ValidateNestedResourceInfo( // Navigation link must have a non-empty name if (string.IsNullOrEmpty(nestedResourceInfo.Name)) { - throw new ODataException(Strings.ValidationUtils_LinkMustSpecifyName); + throw new ODataException(SRResources.ValidationUtils_LinkMustSpecifyName); } // If we write an entity reference link, don't validate the multiplicity of the IsCollection @@ -438,8 +440,8 @@ internal static IEdmNavigationProperty ValidateNestedResourceInfo( if (isResourceSetPayload != nestedResourceInfo.IsCollection.Value) { errorTemplate = expandedPayloadKind.Value == ODataPayloadKind.ResourceSet - ? (Func)Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent - : Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent; + ? (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent, obj) + : (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent, obj); } } @@ -459,8 +461,8 @@ internal static IEdmNavigationProperty ValidateNestedResourceInfo( if (!(nestedResourceInfo.IsCollection == false && isEntityReferenceLinkPayload)) { errorTemplate = isCollectionType - ? (Func)Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata - : Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata; + ? (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata, obj) + : (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata, obj); } } @@ -469,8 +471,8 @@ internal static IEdmNavigationProperty ValidateNestedResourceInfo( if (!isEntityReferenceLinkPayload && expandedPayloadKind.HasValue && isCollectionType != isResourceSetPayload) { errorTemplate = isCollectionType - ? (Func)Strings.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata - : Strings.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata; + ? (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata, obj) + : (object obj) => Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata, obj); } } } @@ -510,7 +512,7 @@ internal static void ValidateDerivedTypeConstraint(IEdmStructuredType resourceTy } } - throw new ODataException(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(fullTypeName, itemKind, itemName)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, fullTypeName, itemKind, itemName)); } /// @@ -523,7 +525,7 @@ internal static void ValidateNestedResourceInfoHasCardinality(ODataNestedResourc if (!nestedResourceInfo.IsCollection.HasValue) { - throw new ODataException(Strings.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection(nestedResourceInfo.Name)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection, nestedResourceInfo.Name)); } } @@ -541,27 +543,27 @@ internal static void ValidateNullPropertyValue(IEdmTypeReference expectedPropert { if (expectedPropertyTypeReference.IsNonEntityCollectionType()) { - throw new ODataException(Strings.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue(propertyName)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue, propertyName)); } if (expectedPropertyTypeReference.IsODataPrimitiveTypeKind() && !expectedPropertyTypeReference.IsNullable) { - throw new ODataException(Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue(propertyName, expectedPropertyTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, propertyName, expectedPropertyTypeReference.FullName())); } else if (expectedPropertyTypeReference.IsODataEnumTypeKind() && !expectedPropertyTypeReference.IsNullable) { - throw new ODataException(Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue(propertyName, expectedPropertyTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, propertyName, expectedPropertyTypeReference.FullName())); } else if (expectedPropertyTypeReference.IsStream()) { - throw new ODataException(Strings.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue(propertyName)); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue, propertyName)); } else if (expectedPropertyTypeReference.IsODataComplexTypeKind()) { IEdmComplexTypeReference complexTypeReference = expectedPropertyTypeReference.AsComplex(); if (!complexTypeReference.IsNullable) { - throw new ODataException(Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue(propertyName, expectedPropertyTypeReference.FullName())); + throw new ODataException(Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, propertyName, expectedPropertyTypeReference.FullName())); } } } @@ -577,7 +579,7 @@ private static void ValidateResourceId(Uri id) // TODO: it always passes. Will add more validation or remove the validation after supporting relative Uri. if (id != null && UriUtils.UriToString(id).Length == 0) { - throw new ODataException(Strings.WriterValidationUtils_EntriesMustHaveNonEmptyId); + throw new ODataException(SRResources.WriterValidationUtils_EntriesMustHaveNonEmptyId); } } } diff --git a/src/Microsoft.OData.Core/WriterValidator.cs b/src/Microsoft.OData.Core/WriterValidator.cs index f530dd50c1..c74ca973e7 100644 --- a/src/Microsoft.OData.Core/WriterValidator.cs +++ b/src/Microsoft.OData.Core/WriterValidator.cs @@ -8,6 +8,7 @@ namespace Microsoft.OData { using System.Collections.Generic; using Microsoft.Extensions.ObjectPool; + using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; @@ -161,7 +162,7 @@ public virtual void ValidateTypeReference(IEdmTypeReference typeReferenceFromMet typeReferenceFromValue.Definition)) { throw new ODataException( - Strings.ValidationUtils_IncompatibleType( + Error.Format(SRResources.ValidationUtils_IncompatibleType, typeReferenceFromValue.FullName(), typeReferenceFromMetadata.FullName())); } @@ -173,7 +174,7 @@ public virtual void ValidateTypeReference(IEdmTypeReference typeReferenceFromMet if (typeReferenceFromMetadata.FullName() != typeReferenceFromValue.FullName()) { throw new ODataException( - Strings.ValidationUtils_IncompatibleType( + Error.Format(SRResources.ValidationUtils_IncompatibleType, typeReferenceFromValue.FullName(), typeReferenceFromMetadata.FullName())); } @@ -242,7 +243,7 @@ public void ValidateNullPropertyValue(IEdmTypeReference expectedPropertyTypeRefe // ... // If the property is single-valued and has the null value, the service responds with 204 No Content. // ... - throw new ODataException(Strings.ODataMessageWriter_CannotWriteTopLevelNull); + throw new ODataException(SRResources.ODataMessageWriter_CannotWriteTopLevelNull); } } diff --git a/src/Microsoft.OData.Edm/Csdl/CsdlReader.cs b/src/Microsoft.OData.Edm/Csdl/CsdlReader.cs index 8a871b819a..325a5699c9 100644 --- a/src/Microsoft.OData.Edm/Csdl/CsdlReader.cs +++ b/src/Microsoft.OData.Edm/Csdl/CsdlReader.cs @@ -374,7 +374,7 @@ private List LoadAndParseReferencedCsdlFiles(Version mainCsdlVersion) { if (!reference.Includes.Any() && !reference.IncludeAnnotations.Any()) { - this.RaiseError(EdmErrorCode.ReferenceElementMustContainAtLeastOneIncludeOrIncludeAnnotationsElement, Strings.EdmxParser_InvalidReferenceIncorrectNumberOfIncludes); + this.RaiseError(EdmErrorCode.ReferenceElementMustContainAtLeastOneIncludeOrIncludeAnnotationsElement, SRResources.EdmxParser_InvalidReferenceIncorrectNumberOfIncludes); continue; } @@ -391,7 +391,7 @@ private List LoadAndParseReferencedCsdlFiles(Version mainCsdlVersion) XmlReader referencedXmlReader = this.getReferencedModelReaderFunc(new Uri(reference.Uri, UriKind.RelativeOrAbsolute)); if (referencedXmlReader == null) { - this.RaiseError(EdmErrorCode.UnresolvedReferenceUriInEdmxReference, Strings.EdmxParser_UnresolvedReferenceUriInEdmxReference); + this.RaiseError(EdmErrorCode.UnresolvedReferenceUriInEdmxReference, SRResources.EdmxParser_UnresolvedReferenceUriInEdmxReference); continue; } @@ -449,7 +449,7 @@ private bool TryParseCsdlFileToCsdlModel(out Version csdlVersion, out CsdlModel if (this.reader.LocalName != CsdlConstants.Element_Edmx || !CsdlConstants.SupportedEdmxNamespaces.TryGetValue(this.reader.NamespaceURI, out csdlVersion)) { - this.RaiseError(EdmErrorCode.UnexpectedXmlElement, Edm.Strings.XmlParser_UnexpectedRootElement(this.reader.Name, CsdlConstants.Element_Edmx)); + this.RaiseError(EdmErrorCode.UnexpectedXmlElement, Error.Format(SRResources.XmlParser_UnexpectedRootElement, this.reader.Name, CsdlConstants.Element_Edmx)); return false; } @@ -543,7 +543,7 @@ private Version ParseEdmxElement(Version edmxVersion) Version edmxVersionFromAttribute = null; if (edmxVersionString != null && (!TryParseVersion(edmxVersionString, out edmxVersionFromAttribute) || edmxVersionFromAttribute.Major != edmxVersion.Major)) { - this.RaiseError(EdmErrorCode.InvalidVersionNumber, Edm.Strings.EdmxParser_EdmxVersionMismatch); + this.RaiseError(EdmErrorCode.InvalidVersionNumber, SRResources.EdmxParser_EdmxVersionMismatch); } this.ParseElement(CsdlConstants.Element_Edmx, this.edmxParserLookup); @@ -596,7 +596,7 @@ private void ParseTargetElement(string elementName, Dictionary e else { // Edmx should contain at most one element - either or . - this.RaiseError(EdmErrorCode.UnexpectedXmlElement, Edm.Strings.EdmxParser_BodyElement(CsdlConstants.Element_DataServices)); + this.RaiseError(EdmErrorCode.UnexpectedXmlElement, Error.Format(SRResources.EdmxParser_BodyElement, CsdlConstants.Element_DataServices)); // Read to the end of the element anyway, to let the caller move on to the rest of the document. elementParsers = EmptyParserLookup; @@ -643,7 +643,7 @@ private void ParseSchemaElement() private void RaiseEmptyFile() { - this.RaiseError(EdmErrorCode.EmptyFile, Edm.Strings.XmlParser_EmptySchemaTextReader); + this.RaiseError(EdmErrorCode.EmptyFile, SRResources.XmlParser_EmptySchemaTextReader); } private CsdlLocation Location() diff --git a/src/Microsoft.OData.Edm/Csdl/CsdlWriter.cs b/src/Microsoft.OData.Edm/Csdl/CsdlWriter.cs index 6a77edbab8..23b0c7f8f1 100644 --- a/src/Microsoft.OData.Edm/Csdl/CsdlWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/CsdlWriter.cs @@ -243,7 +243,7 @@ private static bool VerifyAndGetVersion(IEdmModel model, out Version edmxVersion { errors = new EdmError[] { - new EdmError(new CsdlLocation(0, 0), EdmErrorCode.UnknownEdmxVersion, Strings.Serializer_UnknownEdmxVersion(edmxVersion.ToString())) + new EdmError(new CsdlLocation(0, 0), EdmErrorCode.UnknownEdmxVersion, Error.Format(SRResources.Serializer_UnknownEdmxVersion, edmxVersion.ToString())) }; return false; @@ -256,7 +256,7 @@ private static bool VerifyAndGetVersion(IEdmModel model, out Version edmxVersion { errors = new EdmError[] { - new EdmError(new CsdlLocation(0, 0), EdmErrorCode.UnknownEdmVersion, Strings.Serializer_UnknownEdmVersion(edmVersion.ToString())) + new EdmError(new CsdlLocation(0, 0), EdmErrorCode.UnknownEdmVersion, Error.Format(SRResources.Serializer_UnknownEdmVersion, edmVersion.ToString())) }; return false; diff --git a/src/Microsoft.OData.Edm/Csdl/CsdlXmlWriter.cs b/src/Microsoft.OData.Edm/Csdl/CsdlXmlWriter.cs index 5a5dcbdf18..6ff2401dd9 100644 --- a/src/Microsoft.OData.Edm/Csdl/CsdlXmlWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/CsdlXmlWriter.cs @@ -70,7 +70,7 @@ protected override void WriteCsdl() this.WriteODataCsdl(); break; default: - throw new InvalidOperationException(Strings.UnknownEnumVal_CsdlTarget(this.target.ToString())); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_CsdlTarget, this.target.ToString())); } } @@ -89,7 +89,7 @@ protected override async Task WriteCsdlAsync() await this.WriteODataCsdlAsync().ConfigureAwait(false); break; default: - throw new InvalidOperationException(Strings.UnknownEnumVal_CsdlTarget(this.target.ToString())); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_CsdlTarget, this.target.ToString())); } } diff --git a/src/Microsoft.OData.Edm/Csdl/EdmParseException.cs b/src/Microsoft.OData.Edm/Csdl/EdmParseException.cs index 9bd251133f..f0d96bb84e 100644 --- a/src/Microsoft.OData.Edm/Csdl/EdmParseException.cs +++ b/src/Microsoft.OData.Edm/Csdl/EdmParseException.cs @@ -13,7 +13,6 @@ namespace Microsoft.OData.Edm.Csdl using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.OData.Edm.Validation; - using ErrorStrings = Microsoft.OData.Edm.Strings; /// /// Exception type representing a failure to parse an EDM document. Carries the set of errors along with it. @@ -54,7 +53,7 @@ private EdmParseException(List parseErrors) /// The exception message. private static string ConstructMessage(IEnumerable parseErrors) { - return ErrorStrings.EdmParseException_ErrorsEncounteredInEdmx(string.Join(Environment.NewLine, parseErrors.Select(p => p.ToString()).ToArray())); + return Error.Format(SRResources.EdmParseException_ErrorsEncounteredInEdmx, string.Join(Environment.NewLine, parseErrors.Select(p => p.ToString()).ToArray())); } } } \ No newline at end of file diff --git a/src/Microsoft.OData.Edm/Csdl/EdmValueParser.cs b/src/Microsoft.OData.Edm/Csdl/EdmValueParser.cs index e3f5220515..55e472a1c8 100644 --- a/src/Microsoft.OData.Edm/Csdl/EdmValueParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/EdmValueParser.cs @@ -16,6 +16,7 @@ namespace Microsoft.OData.Service namespace Microsoft.OData.Client #else #if ODATA_CORE +using Microsoft.OData.Core; namespace Microsoft.OData #else namespace Microsoft.OData.Edm.Csdl @@ -44,7 +45,7 @@ internal static TimeSpan ParseDuration(string value) { if (value == null || !DayTimeDurationValidator.IsMatch(value)) { - throw new FormatException(Strings.ValueParser_InvalidDuration(value)); + throw new FormatException(String.Format(SRResources.Culture, SRResources.ValueParser_InvalidDuration, value)); } return XmlConvert.ToTimeSpan(value); diff --git a/src/Microsoft.OData.Edm/Csdl/EdmValueWriter.cs b/src/Microsoft.OData.Edm/Csdl/EdmValueWriter.cs index 380bdb215f..3f4065207b 100644 --- a/src/Microsoft.OData.Edm/Csdl/EdmValueWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/EdmValueWriter.cs @@ -68,7 +68,7 @@ internal static string PrimitiveValueAsXml(IEdmPrimitiveValue v) case EdmValueKind.TimeOfDay: return TimeOfDayAsXml(((IEdmTimeOfDayValue)v).Value); default: - throw new NotSupportedException(Edm.Strings.ValueWriter_NonSerializableValue(v.ValueKind)); + throw new NotSupportedException(Error.Format(SRResources.ValueWriter_NonSerializableValue, v.ValueKind)); } } #endif diff --git a/src/Microsoft.OData.Edm/Csdl/JsonElementExtensions.cs b/src/Microsoft.OData.Edm/Csdl/JsonElementExtensions.cs index 5af4600633..26c8822fc7 100644 --- a/src/Microsoft.OData.Edm/Csdl/JsonElementExtensions.cs +++ b/src/Microsoft.OData.Edm/Csdl/JsonElementExtensions.cs @@ -36,7 +36,7 @@ public static T ProcessRequiredProperty(this JsonElement element, else { context.ReportError(EdmErrorCode.MissingRequiredProperty, - Strings.CsdlJsonParser_MissingRequiredPropertyInObject(propertyName, context.Path)); + Error.Format(SRResources.CsdlJsonParser_MissingRequiredPropertyInObject, propertyName, context.Path)); } return value; @@ -144,7 +144,7 @@ public static string ParseAsString(this JsonElement element, JsonParserContext c } context.ReportError(EdmErrorCode.UnexpectedValueKind, - Strings.CsdlJsonParser_UnexpectedJsonValueKind(element.ValueKind, context.Path, "String")); + Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonValueKind, element.ValueKind, context.Path, "String")); return null; } @@ -156,7 +156,7 @@ public static string ParseAsString(this JsonElement element, JsonParserContext c } context.ReportError(EdmErrorCode.UnexpectedValueKind, - Strings.CsdlJsonParser_UnexpectedJsonValueKind(element.ValueKind, context.Path, "Boolean")); + Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonValueKind, element.ValueKind, context.Path, "Boolean")); return null; } @@ -179,7 +179,7 @@ public static string ParseAsString(this JsonElement element, JsonParserContext c } context.ReportError(EdmErrorCode.UnexpectedValueKind, - Strings.CsdlJsonParser_UnexpectedJsonValueKind(element.ValueKind, context.Path, "Integer")); + Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonValueKind, element.ValueKind, context.Path, "Integer")); return default(int?); } @@ -221,7 +221,7 @@ internal static bool ValidateValueKind(this JsonElement element, JsonValueKind e if (element.ValueKind != expectedKind) { context.ReportError(EdmErrorCode.UnexpectedValueKind, - Strings.CsdlJsonParser_UnexpectedJsonValueKind(element.ValueKind, context.Path, expectedKind)); + Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonValueKind, element.ValueKind, context.Path, expectedKind)); return false; } diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/AnnotationJsonParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/AnnotationJsonParser.cs index 1e6b666c3b..fc1c511333 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/AnnotationJsonParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/AnnotationJsonParser.cs @@ -91,7 +91,7 @@ public static CsdlExpressionBase ParseExpression(JsonElement element, JsonParser case JsonValueKind.Undefined: default: - context.ReportError(EdmErrorCode.UnknownElementValueKind, Strings.CsdlJsonParser_UnknownJsonElementValueKind(element.ValueKind, context.Path)); + context.ReportError(EdmErrorCode.UnknownElementValueKind, Error.Format(SRResources.CsdlJsonParser_UnknownJsonElementValueKind, element.ValueKind, context.Path)); return null; } } @@ -129,7 +129,7 @@ private static CsdlExpressionBase ParseNumberExpression(JsonElement element, Jso // Any others? // Report error for unknown number - context.ReportError(EdmErrorCode.InvalidNumberType, Strings.CsdlJsonParser_InvalidJsonNumberType(element, context.Path)); + context.ReportError(EdmErrorCode.InvalidNumberType, Error.Format(SRResources.CsdlJsonParser_InvalidJsonNumberType, element, context.Path)); return null; } @@ -454,7 +454,7 @@ private static CsdlRecordExpression ParseRecordExpression(JsonElement element, J // So far, it's not supported. So report non-fatal error for all the annotations on record. if (propertyName.IndexOf('@', StringComparison.Ordinal) != -1) { - context.ReportError(EdmErrorCode.UnsupportedElement, Strings.CsdlJsonParser_UnsupportedJsonMember(context.Path)); + context.ReportError(EdmErrorCode.UnsupportedElement, Error.Format(SRResources.CsdlJsonParser_UnsupportedJsonMember, context.Path)); return; } diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/Common/EdmXmlDocumentParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/Common/EdmXmlDocumentParser.cs index e42b3edfbe..39fe076778 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/Common/EdmXmlDocumentParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/Common/EdmXmlDocumentParser.cs @@ -36,7 +36,7 @@ internal XmlAttributeInfo GetRequiredAttribute(XmlElementInfo element, string at var attr = element.Attributes[attributeName]; if (attr.IsMissing) { - this.ReportError(element.Location, EdmErrorCode.MissingAttribute, Edm.Strings.XmlParser_MissingAttribute(attributeName, element.Name)); + this.ReportError(element.Location, EdmErrorCode.MissingAttribute, Error.Format(SRResources.XmlParser_MissingAttribute, attributeName, element.Name)); return attr; } @@ -114,7 +114,7 @@ protected void EndItem() int? value; if (!EdmValueParser.TryParseInt(attr.Value, out value)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidInteger, Edm.Strings.ValueParser_InvalidInteger(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidInteger, Error.Format(SRResources.ValueParser_InvalidInteger, attr.Value)); } return value; @@ -131,7 +131,7 @@ protected void EndItem() long? value; if (!EdmValueParser.TryParseLong(attr.Value, out value)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidLong, Edm.Strings.ValueParser_InvalidLong(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidLong, Error.Format(SRResources.ValueParser_InvalidLong, attr.Value)); } return value; @@ -154,7 +154,7 @@ protected void EndItem() { if (!EdmValueParser.TryParseInt(attr.Value, out srid)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidSrid, Edm.Strings.ValueParser_InvalidSrid(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidSrid, Error.Format(SRResources.ValueParser_InvalidSrid, attr.Value)); } } @@ -183,7 +183,7 @@ protected void EndItem() { if (!EdmValueParser.TryParseInt(attr.Value, out scale)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidSrid, Edm.Strings.ValueParser_InvalidScale(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidSrid, Error.Format(SRResources.ValueParser_InvalidScale, attr.Value)); } } @@ -201,7 +201,7 @@ protected void EndItem() int? value; if (!EdmValueParser.TryParseInt(attr.Value, out value)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMaxLength, Edm.Strings.ValueParser_InvalidMaxLength(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMaxLength, Error.Format(SRResources.ValueParser_InvalidMaxLength, attr.Value)); } return value; @@ -224,7 +224,7 @@ protected EdmMultiplicity RequiredMultiplicity(string attributeName) case CsdlConstants.Value_EndMany: return EdmMultiplicity.Many; default: - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMultiplicity, Edm.Strings.CsdlParser_InvalidMultiplicity(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidMultiplicity, Error.Format(SRResources.CsdlParser_InvalidMultiplicity, attr.Value)); break; } } @@ -244,7 +244,7 @@ protected EdmOnDeleteAction RequiredOnDeleteAction(string attributeName) case CsdlConstants.Value_Cascade: return EdmOnDeleteAction.Cascade; default: - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidOnDelete, Edm.Strings.CsdlParser_InvalidDeleteAction(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidOnDelete, Error.Format(SRResources.CsdlParser_InvalidDeleteAction, attr.Value)); break; } } @@ -260,7 +260,7 @@ protected EdmOnDeleteAction RequiredOnDeleteAction(string attributeName) bool? value; if (!EdmValueParser.TryParseBool(attr.Value, out value)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidBoolean, Edm.Strings.ValueParser_InvalidBoolean(attr.Value)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidBoolean, Error.Format(SRResources.ValueParser_InvalidBoolean, attr.Value)); } return value; @@ -379,7 +379,7 @@ protected string ValidateEnumMembersPath(string path) { if (string.IsNullOrEmpty(path.Trim())) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(path)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, path)); } string[] enumValues = path.Split(' ').Where(s => !string.IsNullOrEmpty(s)).ToArray(); @@ -391,12 +391,12 @@ protected string ValidateEnumMembersPath(string path) EdmUtil.IsValidDottedName(segments[0]) && EdmUtil.IsValidUndottedName(segments[1]))) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(path)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, path)); } if (enumType != null && segments[0] != enumType) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(path)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, path)); } enumType = segments[0]; @@ -429,7 +429,7 @@ private string ValidateTypeName(string name) // 'Ref' on its own is not a valid type string. if (typeInformation.Length == 1) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidTypeName, Edm.Strings.CsdlParser_InvalidTypeName(name)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidTypeName, Error.Format(SRResources.CsdlParser_InvalidTypeName, name)); return name; } else @@ -446,7 +446,7 @@ private string ValidateTypeName(string name) } else { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidTypeName, Edm.Strings.CsdlParser_InvalidTypeName(name)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidTypeName, Error.Format(SRResources.CsdlParser_InvalidTypeName, name)); return name; } } @@ -455,7 +455,7 @@ private string ValidateAlias(string name) { if (!EdmUtil.IsValidUndottedName(name)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidQualifiedName, Edm.Strings.CsdlParser_InvalidAlias(name)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidQualifiedName, Error.Format(SRResources.CsdlParser_InvalidAlias, name)); } return name; @@ -468,7 +468,7 @@ private string ValidateEntitySetPath(string path) EdmUtil.IsValidDottedName(segments[0]) && EdmUtil.IsValidUndottedName(segments[1]))) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEntitySetPath, Edm.Strings.CsdlParser_InvalidEntitySetPath(path)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEntitySetPath, Error.Format(SRResources.CsdlParser_InvalidEntitySetPath, path)); } return path; @@ -481,7 +481,7 @@ private string ValidateEnumMemberPath(string path) EdmUtil.IsValidDottedName(segments[0]) && EdmUtil.IsValidUndottedName(segments[1]))) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(path)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, path)); } return path; @@ -491,7 +491,7 @@ private string ValidateQualifiedName(string qualifiedName) { if (!EdmUtil.IsQualifiedName(qualifiedName)) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidQualifiedName, Edm.Strings.CsdlParser_InvalidQualifiedName(qualifiedName)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidQualifiedName, Error.Format(SRResources.CsdlParser_InvalidQualifiedName, qualifiedName)); } return qualifiedName; diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/Common/XmlDocumentParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/Common/XmlDocumentParser.cs index 568842e2cd..d13abf66a2 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/Common/XmlDocumentParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/Common/XmlDocumentParser.cs @@ -487,8 +487,8 @@ private XmlElementInfo ReadElement(string elementName, CsdlLocation elementLocat private void ReportEmptyFile() { string errorMessage = this.DocumentPath == null ? - Edm.Strings.XmlParser_EmptySchemaTextReader : - Edm.Strings.XmlParser_EmptyFile(this.DocumentPath); + SRResources.XmlParser_EmptySchemaTextReader : + Error.Format(SRResources.XmlParser_EmptyFile, this.DocumentPath); this.ReportError( this.Location, @@ -500,8 +500,8 @@ private void ReportUnexpectedRootNamespace(string elementName, string namespaceU { string expectedNamespacesString = string.Join(", ", expectedNamespaces); string errorMessage = string.IsNullOrEmpty(namespaceUri) - ? Edm.Strings.XmlParser_UnexpectedRootElementNoNamespace(expectedNamespacesString) - : Edm.Strings.XmlParser_UnexpectedRootElementWrongNamespace(namespaceUri, expectedNamespacesString); + ? Error.Format(SRResources.XmlParser_UnexpectedRootElementNoNamespace, expectedNamespacesString) + : Error.Format(SRResources.XmlParser_UnexpectedRootElementWrongNamespace, namespaceUri, expectedNamespacesString); this.ReportError( this.Location, EdmErrorCode.UnexpectedXmlElement, @@ -511,17 +511,17 @@ private void ReportUnexpectedRootNamespace(string elementName, string namespaceU private void ReportUnexpectedRootElement(CsdlLocation elementLocation, string elementName, string expectedNamespace) { Debug.Assert(!string.IsNullOrEmpty(expectedNamespace), "UnexpectedRootElementInExpectedNamespace requires a valid expected namespace"); - this.ReportError(elementLocation, EdmErrorCode.UnexpectedXmlElement, Edm.Strings.XmlParser_UnexpectedRootElement(elementName, CsdlConstants.Element_Schema)); + this.ReportError(elementLocation, EdmErrorCode.UnexpectedXmlElement, Error.Format(SRResources.XmlParser_UnexpectedRootElement, elementName, CsdlConstants.Element_Schema)); } private void ReportUnexpectedAttribute(CsdlLocation errorLocation, string attributeName) { - this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlAttribute, Edm.Strings.XmlParser_UnexpectedAttribute(attributeName)); + this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlAttribute, Error.Format(SRResources.XmlParser_UnexpectedAttribute, attributeName)); } private void ReportUnexpectedNodeType(XmlNodeType nodeType) { - this.ReportError(this.Location, EdmErrorCode.UnexpectedXmlNodeType, Edm.Strings.XmlParser_UnexpectedNodeType(nodeType)); + this.ReportError(this.Location, EdmErrorCode.UnexpectedXmlNodeType, Error.Format(SRResources.XmlParser_UnexpectedNodeType, nodeType)); } private void ReportUnexpectedElement(CsdlLocation errorLocation, string elementName) @@ -529,18 +529,18 @@ private void ReportUnexpectedElement(CsdlLocation errorLocation, string elementN // Don't error on unexpected annotations, just ignore if (elementName != CsdlConstants.Element_Annotation) { - this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlElement, Edm.Strings.XmlParser_UnexpectedElement(elementName)); + this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlElement, Error.Format(SRResources.XmlParser_UnexpectedElement, elementName)); } } private void ReportUnusedElement(CsdlLocation errorLocation, string elementName) { - this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlElement, Edm.Strings.XmlParser_UnusedElement(elementName)); + this.ReportError(errorLocation, EdmErrorCode.UnexpectedXmlElement, Error.Format(SRResources.XmlParser_UnusedElement, elementName)); } private void ReportTextNotAllowed(CsdlLocation errorLocation, string textValue) { - this.ReportError(errorLocation, EdmErrorCode.TextNotAllowed, Edm.Strings.XmlParser_TextNotAllowed(textValue)); + this.ReportError(errorLocation, EdmErrorCode.TextNotAllowed, Error.Format(SRResources.XmlParser_TextNotAllowed, textValue)); } #endregion diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParser.cs index d52d0d9a7f..4c4a7c6dcd 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParser.cs @@ -434,7 +434,7 @@ private void ReportOperationReadErrorsIfExist(string entitySetPath, bool isBound { if (entitySetPath != null && !isBound) { - this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEntitySetPath, Edm.Strings.CsdlParser_InvalidEntitySetPathWithUnboundAction(CsdlConstants.Element_Action, name)); + this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidEntitySetPath, Error.Format(SRResources.CsdlParser_InvalidEntitySetPathWithUnboundAction, CsdlConstants.Element_Action, name)); } } @@ -540,7 +540,7 @@ private CsdlEntityContainer OnEntityContainerElement(XmlElementInfo element, Xml if (entityContainerCount++ > 0) { - this.ReportError(this.currentElement.Location, EdmErrorCode.MetadataDocumentCannotHaveMoreThanOneEntityContainer, Edm.Strings.CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer); + this.ReportError(this.currentElement.Location, EdmErrorCode.MetadataDocumentCannotHaveMoreThanOneEntityContainer, SRResources.CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer); } return new CsdlEntityContainer( diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParserBase.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParserBase.cs index b309fa82dc..5df0aff30e 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParserBase.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlDocumentParserBase.cs @@ -155,7 +155,7 @@ protected virtual CsdlTypeReference ParseTypeReference(string typeString, XmlEle { // If childValues is null, then it is the case when a required type attribute was expected. // In this case, we do not report the error as it should already be reported by EdmXmlDocumentParser.RequiredType method. - this.ReportError(parentLocation, EdmErrorCode.MissingType, Edm.Strings.CsdlParser_MissingTypeAttributeOrElement); + this.ReportError(parentLocation, EdmErrorCode.MissingType, SRResources.CsdlParser_MissingTypeAttributeOrElement); } else { @@ -403,7 +403,7 @@ private CsdlLabeledExpression OnLabeledElement(XmlElementInfo element, XmlElemen IEnumerable expressions = childValues.ValuesOfType(); if (expressions.Count() != 1) { - this.ReportError(element.Location, EdmErrorCode.InvalidLabeledElementExpressionIncorrectNumberOfOperands, Edm.Strings.CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands); + this.ReportError(element.Location, EdmErrorCode.InvalidLabeledElementExpressionIncorrectNumberOfOperands, SRResources.CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands); } return new CsdlLabeledExpression( @@ -529,7 +529,7 @@ private CsdlExpressionBase OnIfExpression(XmlElementInfo element, XmlElementValu IEnumerable expressions = childValues.ValuesOfType(); if (expressions.Count() != 3) { - this.ReportError(element.Location, EdmErrorCode.InvalidIfExpressionIncorrectNumberOfOperands, Edm.Strings.CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands); + this.ReportError(element.Location, EdmErrorCode.InvalidIfExpressionIncorrectNumberOfOperands, SRResources.CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands); } return new CsdlIfExpression( @@ -547,7 +547,7 @@ private CsdlExpressionBase OnCastExpression(XmlElementInfo element, XmlElementVa IEnumerable expressions = childValues.ValuesOfType(); if (expressions.Count() != 1) { - this.ReportError(element.Location, EdmErrorCode.InvalidCastExpressionIncorrectNumberOfOperands, Edm.Strings.CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands); + this.ReportError(element.Location, EdmErrorCode.InvalidCastExpressionIncorrectNumberOfOperands, SRResources.CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands); } return new CsdlCastExpression(type, expressions.ElementAtOrDefault(0), element.Location); @@ -561,7 +561,7 @@ private CsdlExpressionBase OnIsOfExpression(XmlElementInfo element, XmlElementVa IEnumerable expressions = childValues.ValuesOfType(); if (expressions.Count() != 1) { - this.ReportError(element.Location, EdmErrorCode.InvalidIsOfExpressionIncorrectNumberOfOperands, Edm.Strings.CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands); + this.ReportError(element.Location, EdmErrorCode.InvalidIsOfExpressionIncorrectNumberOfOperands, SRResources.CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands); } return new CsdlIsOfExpression(type, expressions.ElementAtOrDefault(0), element.Location); diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlJsonParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlJsonParser.cs index ecb073cdbc..924730e4c5 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlJsonParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlJsonParser.cs @@ -92,7 +92,7 @@ internal static CsdlModel ParseCsdlDocument(ref Utf8JsonReader jsonReader, JsonP } } - context.ReportError(EdmErrorCode.UnexpectedElement, Strings.CsdlJsonParser_UnexpectedJsonMember(context.Path, propertyValue.ValueKind)); + context.ReportError(EdmErrorCode.UnexpectedElement, Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonMember, context.Path, propertyValue.ValueKind)); break; } }); @@ -270,7 +270,7 @@ internal static CsdlIncludeAnnotations ParseIncludeAnnotations(JsonElement eleme default: // The item objects doesn't contain vocabulary annotation. context.ReportError(EdmErrorCode.UnexpectedElement, - Strings.CsdlJsonParser_UnexpectedJsonMember(context.Path, propertyValue.ValueKind)); + Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonMember, context.Path, propertyValue.ValueKind)); break; } }); @@ -327,7 +327,7 @@ private static Version ParseVersion(JsonElement element, JsonParserContext conte // This document object MUST contain the member $Version. if (version == null) { - context.ReportError(EdmErrorCode.InvalidVersionNumber, Strings.CsdlJsonParser_InvalidCsdlVersion(context.Path)); + context.ReportError(EdmErrorCode.InvalidVersionNumber, Error.Format(SRResources.CsdlJsonParser_InvalidCsdlVersion, context.Path)); } } diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlParser.cs index 301800dbb7..48015596b2 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/CsdlParser.cs @@ -45,7 +45,7 @@ public static bool TryParse(IEnumerable csdlReaders, out CsdlModel en else { entityModel = null; - errors = new EdmError[] { new EdmError(null, EdmErrorCode.NullXmlReader, Edm.Strings.CsdlParser_NullXmlReader) }; + errors = new EdmError[] { new EdmError(null, EdmErrorCode.NullXmlReader, SRResources.CsdlParser_NullXmlReader) }; return false; } @@ -56,7 +56,7 @@ public static bool TryParse(IEnumerable csdlReaders, out CsdlModel en if (readerCount == 0) { entityModel = null; - errors = new EdmError[] { new EdmError(null, EdmErrorCode.NoReadersProvided, Edm.Strings.CsdlParser_NoReadersProvided) }; + errors = new EdmError[] { new EdmError(null, EdmErrorCode.NoReadersProvided, SRResources.CsdlParser_NoReadersProvided) }; return false; } diff --git a/src/Microsoft.OData.Edm/Csdl/Parsing/SchemaJsonParser.cs b/src/Microsoft.OData.Edm/Csdl/Parsing/SchemaJsonParser.cs index f93d666cde..117e9c1e11 100644 --- a/src/Microsoft.OData.Edm/Csdl/Parsing/SchemaJsonParser.cs +++ b/src/Microsoft.OData.Edm/Csdl/Parsing/SchemaJsonParser.cs @@ -91,7 +91,7 @@ internal static CsdlSchema ParseCsdlSchema(string schemaNamespace, Version versi if (schema.EntityContainers.Count() > 1) { context.ReportError(EdmErrorCode.SchemaCannotHaveMoreThanOneEntityContainer, - Strings.CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer(context.Path)); + Error.Format(SRResources.CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer, context.Path)); } return schema; @@ -1103,7 +1103,7 @@ internal static CsdlTerm ParseCsdlTermType(string name, JsonElement element, Jso case "$BaseTerm": // The value of $BaseTerm is the qualified name of the base term. // Skip it because it's not supported - context.ReportError(EdmErrorCode.UnexpectedElement, Strings.CsdlJsonParser_UnexpectedJsonMember(context.Path, element.ValueKind)); + context.ReportError(EdmErrorCode.UnexpectedElement, Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonMember, context.Path, element.ValueKind)); break; case "$DefaultValue": @@ -1250,7 +1250,7 @@ internal static CsdlOperation ParseCsdlOperation(string name, JsonElement elemen // The value of $Parameter is an array. The array contains one object per parameter. if (propertyValue.ValueKind != JsonValueKind.Array) { - context.ReportError(EdmErrorCode.UnexpectedValueKind, Strings.CsdlJsonParser_UnexpectedJsonValueKind(element.ValueKind, context.Path, "Array")); + context.ReportError(EdmErrorCode.UnexpectedValueKind, Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonValueKind, element.ValueKind, context.Path, "Array")); } else { @@ -1487,13 +1487,13 @@ internal static void ParseCsdlAnnotation(string name, JsonElement element, JsonP } else { - context.ReportError(EdmErrorCode.UnexpectedElement, Strings.CsdlJsonParser_UnexpectedJsonMember(context.Path, element.ValueKind)); + context.ReportError(EdmErrorCode.UnexpectedElement, Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonMember, context.Path, element.ValueKind)); } } private static void ReportUnexpectedElement(JsonElement element, JsonParserContext context) { - context.ReportError(EdmErrorCode.UnexpectedElement, Strings.CsdlJsonParser_UnexpectedJsonMember(context.Path, element.ValueKind)); + context.ReportError(EdmErrorCode.UnexpectedElement, Error.Format(SRResources.CsdlJsonParser_UnexpectedJsonMember, context.Path, element.ValueKind)); } private static void ValidateKind(JsonElement element, JsonParserContext context, string expectedKind, bool required) @@ -1514,7 +1514,7 @@ private static void ValidateKind(JsonElement element, JsonParserContext context, return; } - context.ReportError(EdmErrorCode.MissingRequiredProperty, Strings.CsdlJsonParser_MissingKindMember(context.Path, expectedKind)); + context.ReportError(EdmErrorCode.MissingRequiredProperty, Error.Format(SRResources.CsdlJsonParser_MissingKindMember, context.Path, expectedKind)); } /// diff --git a/src/Microsoft.OData.Edm/Csdl/SchemaWriter.cs b/src/Microsoft.OData.Edm/Csdl/SchemaWriter.cs index 9f3fb1c529..a88c0c671f 100644 --- a/src/Microsoft.OData.Edm/Csdl/SchemaWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/SchemaWriter.cs @@ -79,13 +79,13 @@ internal static bool TryWriteSchema(IEdmModel model, Func wri IEnumerable schemas = new EdmModelSchemaSeparationSerializationVisitor(model).GetSchemas(); if (schemas.Count() > 1 && singleFileExpected) { - errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.SingleFileExpected, Edm.Strings.Serializer_SingleFileExpected) }; + errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.SingleFileExpected, SRResources.Serializer_SingleFileExpected) }; return false; } if (!schemas.Any()) { - errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.NoSchemasProduced, Edm.Strings.Serializer_NoSchemasProduced) }; + errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.NoSchemasProduced, SRResources.Serializer_NoSchemasProduced) }; return false; } @@ -109,13 +109,13 @@ internal static bool TryWriteSchema(IEdmModel model, Func wri IEnumerable schemas = await (new EdmModelSchemaSeparationSerializationVisitor(model)).GetSchemasAsync().ConfigureAwait(false); if (schemas.Count() > 1 && singleFileExpected) { - errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.SingleFileExpected, Edm.Strings.Serializer_SingleFileExpected) }; + errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.SingleFileExpected, SRResources.Serializer_SingleFileExpected) }; return (false, errors); } if (!schemas.Any()) { - errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.NoSchemasProduced, Edm.Strings.Serializer_NoSchemasProduced) }; + errors = new EdmError[] { new EdmError(new CsdlLocation(0, 0), EdmErrorCode.NoSchemasProduced, SRResources.Serializer_NoSchemasProduced) }; return (false, errors); } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedComplexType.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedComplexType.cs index 341974ad28..eb6e0877c8 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedComplexType.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedComplexType.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedComplexType : BadComplexType, IUnresolvedElement { public UnresolvedComplexType(string qualifiedName, EdmLocation location) - : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedComplexType, Edm.Strings.Bad_UnresolvedComplexType(qualifiedName)) }) + : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedComplexType, Error.Format(SRResources.Bad_UnresolvedComplexType, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityContainer.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityContainer.cs index be2c0e1400..1e2cd5a30a 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityContainer.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityContainer.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedEntityContainer : BadEntityContainer, IUnresolvedElement { public UnresolvedEntityContainer(string name, EdmLocation location) - : base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntityContainer, Edm.Strings.Bad_UnresolvedEntityContainer(name)) }) + : base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntityContainer, Error.Format(SRResources.Bad_UnresolvedEntityContainer, name)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntitySet.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntitySet.cs index 741b080817..46dd20d190 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntitySet.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntitySet.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedEntitySet : BadEntitySet, IUnresolvedElement { public UnresolvedEntitySet(string name, IEdmEntityContainer container, EdmLocation location) - : base(name, container, new[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntitySet, Edm.Strings.Bad_UnresolvedEntitySet(name)) }) + : base(name, container, new[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntitySet, Error.Format(SRResources.Bad_UnresolvedEntitySet, name)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityType.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityType.cs index 463959ba35..ccaf822d21 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityType.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEntityType.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedEntityType : BadEntityType, IUnresolvedElement { public UnresolvedEntityType(string qualifiedName, EdmLocation location) - : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntityType, Edm.Strings.Bad_UnresolvedEntityType(qualifiedName)) }) + : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntityType, Error.Format(SRResources.Bad_UnresolvedEntityType, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumMember.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumMember.cs index affca3eae4..d207a6df97 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumMember.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumMember.cs @@ -19,7 +19,7 @@ internal class UnresolvedEnumMember : BadElement, IEdmEnumMember private static readonly Func ComputeValueFunc = (me) => ComputeValue(); public UnresolvedEnumMember(string name, IEdmEnumType declaringType, EdmLocation location) - : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEnumMember, Edm.Strings.Bad_UnresolvedEnumMember(name)) }) + : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEnumMember, Error.Format(SRResources.Bad_UnresolvedEnumMember, name)) }) { this.name = name ?? string.Empty; this.declaringType = declaringType; diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumType.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumType.cs index 6aa5fa3adc..df2ed9974d 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumType.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedEnumType.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedEnumType : BadEnumType, IUnresolvedElement { public UnresolvedEnumType(string qualifiedName, EdmLocation location) - : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEnumType, Edm.Strings.Bad_UnresolvedEnumType(qualifiedName)) }) + : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEnumType, Error.Format(SRResources.Bad_UnresolvedEnumType, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedLabeledElement.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedLabeledElement.cs index e92baee227..38e0bc4251 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedLabeledElement.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedLabeledElement.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedLabeledElement : BadLabeledExpression, IUnresolvedElement { public UnresolvedLabeledElement(string label, EdmLocation location) - : base(label, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedLabeledElement, Edm.Strings.Bad_UnresolvedLabeledElement(label)) }) + : base(label, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedLabeledElement, Error.Format(SRResources.Bad_UnresolvedLabeledElement, label)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedNavigationPropertyPath.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedNavigationPropertyPath.cs index 2e1c15547c..6a992966f3 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedNavigationPropertyPath.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedNavigationPropertyPath.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedNavigationPropertyPath : BadNavigationProperty, IUnresolvedElement { public UnresolvedNavigationPropertyPath(IEdmStructuredType startingType, string path, EdmLocation location) - : base(startingType, path, new[] { new EdmError(location, EdmErrorCode.BadUnresolvedNavigationPropertyPath, Edm.Strings.Bad_UnresolvedNavigationPropertyPath(path, startingType.FullTypeName())) }) + : base(startingType, path, new[] { new EdmError(location, EdmErrorCode.BadUnresolvedNavigationPropertyPath, Error.Format(SRResources.Bad_UnresolvedNavigationPropertyPath, path, startingType.FullTypeName())) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedParameter.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedParameter.cs index 0d8f1e668a..f08dba7eda 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedParameter.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedParameter.cs @@ -16,7 +16,7 @@ internal class UnresolvedParameter : BadElement, IEdmOperationParameter, IUnreso private static readonly Func ComputeTypeFunc = (me) => me.ComputeType(); public UnresolvedParameter(IEdmOperation declaringOperation, string name, EdmLocation location) - : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedParameter, Edm.Strings.Bad_UnresolvedParameter(name)) }) + : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedParameter, Error.Format(SRResources.Bad_UnresolvedParameter, name)) }) { this.Name = name ?? string.Empty; this.DeclaringOperation = declaringOperation; diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedPrimitiveType.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedPrimitiveType.cs index 88d1736eb2..6835ea982e 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedPrimitiveType.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedPrimitiveType.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedPrimitiveType : BadPrimitiveType, IUnresolvedElement { public UnresolvedPrimitiveType(string qualifiedName, EdmLocation location) - : base(qualifiedName, EdmPrimitiveTypeKind.None, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedPrimitiveType, Edm.Strings.Bad_UnresolvedPrimitiveType(qualifiedName)) }) + : base(qualifiedName, EdmPrimitiveTypeKind.None, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedPrimitiveType, Error.Format(SRResources.Bad_UnresolvedPrimitiveType, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedProperty.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedProperty.cs index e0ddf319bc..42c91193fe 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedProperty.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedProperty.cs @@ -11,7 +11,7 @@ namespace Microsoft.OData.Edm.Csdl.CsdlSemantics internal class UnresolvedProperty : BadProperty, IUnresolvedElement { public UnresolvedProperty(IEdmStructuredType declaringType, string name, EdmLocation location) - : base(declaringType, name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedProperty, Edm.Strings.Bad_UnresolvedProperty(name)) }) + : base(declaringType, name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedProperty, Error.Format(SRResources.Bad_UnresolvedProperty, name)) }) { } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedReturn.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedReturn.cs index 40278393d1..3156036d33 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedReturn.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedReturn.cs @@ -16,7 +16,7 @@ internal class UnresolvedReturn : BadElement, IEdmOperationReturn, IUnresolvedEl private static readonly Func ComputeTypeFunc = (me) => me.ComputeType(); public UnresolvedReturn(IEdmOperation declaringOperation, EdmLocation location) - : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedReturn, Edm.Strings.Bad_UnresolvedReturn(declaringOperation.Name)) }) + : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedReturn, Error.Format(SRResources.Bad_UnresolvedReturn, declaringOperation.Name)) }) { this.DeclaringOperation = declaringOperation; } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedType.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedType.cs index 0689caeff5..b8ca8afe93 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedType.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/BadElements/UnresolvedType.cs @@ -18,7 +18,7 @@ internal class UnresolvedType : BadType, IEdmSchemaType, IUnresolvedElement, IEd private readonly string fullName; public UnresolvedType(string qualifiedName, EdmLocation location) - : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedType, Edm.Strings.Bad_UnresolvedType(qualifiedName)) }) + : base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedType, Error.Format(SRResources.Bad_UnresolvedType, qualifiedName)) }) { qualifiedName = qualifiedName ?? string.Empty; EdmUtil.TryGetNamespaceNameFromQualifiedName(qualifiedName, out this.namespaceName, out this.name, out this.fullName); diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsApplyExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsApplyExpression.cs index 06928fbbd7..eed8af3a42 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsApplyExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsApplyExpression.cs @@ -77,7 +77,7 @@ private IEdmFunction ComputeAppliedFunction() int candidateCount = candidateFunctions.Count(); if (candidateCount == 0) { - return new UnresolvedFunction(this.expression.Function, Edm.Strings.Bad_UnresolvedOperation(this.expression.Function), this.Location); + return new UnresolvedFunction(this.expression.Function, Error.Format(SRResources.Bad_UnresolvedOperation, this.expression.Function), this.Location); } candidateFunctions = candidateFunctions.Where(this.IsMatchingFunction); @@ -88,7 +88,7 @@ private IEdmFunction ComputeAppliedFunction() candidateCount = candidateFunctions.Count(); if (candidateCount != 1) { - return new UnresolvedFunction(this.expression.Function, Edm.Strings.Bad_AmbiguousOperation(this.expression.Function), this.Location); + return new UnresolvedFunction(this.expression.Function, Error.Format(SRResources.Bad_AmbiguousOperation, this.expression.Function), this.Location); } return candidateFunctions.Single(); @@ -96,7 +96,7 @@ private IEdmFunction ComputeAppliedFunction() if (candidateCount == 0) { - return new UnresolvedFunction(this.expression.Function, Edm.Strings.Bad_OperationParametersDontMatch(this.expression.Function), this.Location); + return new UnresolvedFunction(this.expression.Function, Error.Format(SRResources.Bad_OperationParametersDontMatch, this.expression.Function), this.Location); } return candidateFunctions.Single(); diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBinaryConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBinaryConstantExpression.cs index 1a8197d632..a9e05834e4 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBinaryConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBinaryConstantExpression.cs @@ -74,7 +74,7 @@ private IEnumerable ComputeErrors() byte[] value; if (!EdmValueParser.TryParseBinary(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidBinary, Edm.Strings.ValueParser_InvalidBinary(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidBinary, Error.Format(SRResources.ValueParser_InvalidBinary, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBooleanConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBooleanConstantExpression.cs index 128aacfa36..8aca2376b3 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBooleanConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsBooleanConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() bool? value; if (!EdmValueParser.TryParseBool(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidBoolean, Edm.Strings.ValueParser_InvalidBoolean(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidBoolean, Error.Format(SRResources.ValueParser_InvalidBoolean, this.expression.Value)) }; } return Enumerable.Empty(); diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateConstantExpression.cs index 07aa3009ca..37e49726b0 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() Date? value; if (!EdmValueParser.TryParseDate(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDate, Edm.Strings.ValueParser_InvalidDate(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDate, Error.Format(SRResources.ValueParser_InvalidDate, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateTimeOffsetConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateTimeOffsetConstantExpression.cs index ccaf6f2edb..ed5f654c6a 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateTimeOffsetConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDateTimeOffsetConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() DateTimeOffset? value; if (!EdmValueParser.TryParseDateTimeOffset(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDateTimeOffset, Edm.Strings.ValueParser_InvalidDateTimeOffset(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDateTimeOffset, Error.Format(SRResources.ValueParser_InvalidDateTimeOffset, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDecimalConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDecimalConstantExpression.cs index c340670d55..0f56cc3e93 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDecimalConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDecimalConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() decimal? value; if (!EdmValueParser.TryParseDecimal(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDecimal, Edm.Strings.ValueParser_InvalidDecimal(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDecimal, Error.Format(SRResources.ValueParser_InvalidDecimal, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDurationConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDurationConstantExpression.cs index 47b5063ce9..be52b04b38 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDurationConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsDurationConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() TimeSpan? value; if (!EdmValueParser.TryParseDuration(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDuration, Edm.Strings.ValueParser_InvalidDuration(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidDuration, Error.Format(SRResources.ValueParser_InvalidDuration, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsEntityContainer.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsEntityContainer.cs index 4685fd9750..f2fbf30edb 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsEntityContainer.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsEntityContainer.cs @@ -214,13 +214,13 @@ private void AddOperationImport(CsdlOperationImport operationImport, List ComputeErrors() { if (!EdmEnumValueParser.TryParseJsonEnumMember(this.expression.EnumMemberPath, this.expression.EnumType, this.Location, out member)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(this.expression.EnumMemberPath)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, this.expression.EnumMemberPath)) }; } } else { if (!EdmEnumValueParser.TryParseEnumMember(this.expression.EnumMemberPath, this.Schema.Model, this.Location, out member)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidEnumMemberPath, Edm.Strings.CsdlParser_InvalidEnumMemberPath(this.expression.EnumMemberPath)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidEnumMemberPath, Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, this.expression.EnumMemberPath)) }; } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsFloatingConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsFloatingConstantExpression.cs index a75ebea8ff..3a1dea2b69 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsFloatingConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsFloatingConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() double? value; if (!EdmValueParser.TryParseFloat(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidFloatingPoint, Edm.Strings.ValueParser_InvalidFloatingPoint(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidFloatingPoint, Error.Format(SRResources.ValueParser_InvalidFloatingPoint, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsGuidConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsGuidConstantExpression.cs index 8d987b3a3d..1948e9b52d 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsGuidConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsGuidConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() Guid? value; if (!EdmValueParser.TryParseGuid(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidGuid, Edm.Strings.ValueParser_InvalidGuid(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidGuid, Error.Format(SRResources.ValueParser_InvalidGuid, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsIntConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsIntConstantExpression.cs index 209a4faaf9..b1812821d7 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsIntConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsIntConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() Int64? value; if (!EdmValueParser.TryParseLong(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidInteger, Edm.Strings.ValueParser_InvalidInteger(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidInteger, Error.Format(SRResources.ValueParser_InvalidInteger, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsModel.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsModel.cs index c1498da377..633ae6d75f 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsModel.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsModel.cs @@ -266,7 +266,7 @@ public IEnumerable Errors string alias; if (mappings.TryGetValue(ns, out alias) && !usedAlias.Add(alias)) { - errors.Add(new EdmError(this.Location(), EdmErrorCode.DuplicateAlias, Strings.CsdlSemantics_DuplicateAlias(ns, alias))); + errors.Add(new EdmError(this.Location(), EdmErrorCode.DuplicateAlias, Error.Format(SRResources.CsdlSemantics_DuplicateAlias, ns, alias))); } } } diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsNavigationProperty.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsNavigationProperty.cs index 93ddef5f24..70b43fb630 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsNavigationProperty.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsNavigationProperty.cs @@ -297,7 +297,7 @@ private IEnumerable ComputeErrors() { // TODO: this should happen at parsing time, which should remove // the code for handling type-ref based collection types and unify this parsing logic - errors = AllocateAndAdd(errors, new EdmError(this.Location, EdmErrorCode.NavigationPropertyWithCollectionTypeCannotHaveNullableAttribute, Strings.CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType)); + errors = AllocateAndAdd(errors, new EdmError(this.Location, EdmErrorCode.NavigationPropertyWithCollectionTypeCannotHaveNullableAttribute, SRResources.CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType)); } var badType = this.TargetEntityType as BadEntityType; diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsTimeOfDayConstantExpression.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsTimeOfDayConstantExpression.cs index dbaa60a467..413276e522 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsTimeOfDayConstantExpression.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsTimeOfDayConstantExpression.cs @@ -73,7 +73,7 @@ private IEnumerable ComputeErrors() TimeOfDay? value; if (!EdmValueParser.TryParseTimeOfDay(this.expression.Value, out value)) { - return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidTimeOfDay, Edm.Strings.ValueParser_InvalidTimeOfDay(this.expression.Value)) }; + return new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidTimeOfDay, Error.Format(SRResources.ValueParser_InvalidTimeOfDay, this.expression.Value)) }; } else { diff --git a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs index 7556a247f5..672c2d32d2 100644 --- a/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs +++ b/src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs @@ -459,7 +459,7 @@ private IEdmVocabularyAnnotatable ComputeTarget() } string qualifiedOperationName = containerName + "/" + operationName; - UnresolvedOperation unresolvedOperation = new UnresolvedOperation(qualifiedOperationName, Edm.Strings.Bad_UnresolvedOperation(qualifiedOperationName), this.Location); + UnresolvedOperation unresolvedOperation = new UnresolvedOperation(qualifiedOperationName, Error.Format(SRResources.Bad_UnresolvedOperation, qualifiedOperationName), this.Location); if (parameterName == CsdlConstants.OperationReturnExternalTarget) { return new UnresolvedReturn(unresolvedOperation, this.Location); @@ -482,7 +482,7 @@ private IEdmVocabularyAnnotatable ComputeTarget() return new UnresolvedProperty(new UnresolvedEntityType(this.model.ReplaceAlias(targetSegments[targetSegments.Length - 2]), this.Location), targetSegments[targetSegments.Length - 1], this.Location); } - return new BadElement(new EdmError[] { new EdmError(this.Location, EdmErrorCode.ImpossibleAnnotationsTarget, Edm.Strings.CsdlSemantics_ImpossibleAnnotationsTarget(target)) }); + return new BadElement(new EdmError[] { new EdmError(this.Location, EdmErrorCode.ImpossibleAnnotationsTarget, Error.Format(SRResources.CsdlSemantics_ImpossibleAnnotationsTarget, target)) }); } } diff --git a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaJsonWriter.cs b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaJsonWriter.cs index 88ec4bb8dc..114a2098e8 100644 --- a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaJsonWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaJsonWriter.cs @@ -3187,7 +3187,7 @@ internal override void WriteOperationImportAttributes(IEdmOperationImport operat } else { - throw new InvalidOperationException(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + throw new InvalidOperationException(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } } } @@ -3209,7 +3209,7 @@ internal override Task WriteOperationImportAttributesAsync(IEdmOperationImport o } else { - throw new InvalidOperationException(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + throw new InvalidOperationException(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } } diff --git a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs index a9bc3b6c5c..9caf93110f 100644 --- a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs +++ b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs @@ -2406,7 +2406,7 @@ private static string GetCsdlNamespace(Version edmVersion) return @namespaces[0]; } - throw new InvalidOperationException(Strings.Serializer_UnknownEdmVersion(edmVersion.ToString())); + throw new InvalidOperationException(Error.Format(SRResources.Serializer_UnknownEdmVersion, edmVersion.ToString())); } /// @@ -2429,7 +2429,7 @@ internal override void WriteOperationImportAttributes(IEdmOperationImport operat } else { - throw new InvalidOperationException(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + throw new InvalidOperationException(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } } } @@ -2454,7 +2454,7 @@ internal override async Task WriteOperationImportAttributesAsync(IEdmOperationIm } else { - throw new InvalidOperationException(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + throw new InvalidOperationException(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } } } diff --git a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSerializationVisitor.cs b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSerializationVisitor.cs index 2db9e587ed..6475441fab 100644 --- a/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSerializationVisitor.cs +++ b/src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSerializationVisitor.cs @@ -68,7 +68,7 @@ public override void VisitEntityContainerElements(IEnumerable(new InvalidOperationException(Edm.Strings.UnknownEnumVal_SchemaElementKind(element.SchemaElementKind))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_SchemaElementKind, element.SchemaElementKind)); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_SchemaElementKind, element.SchemaElementKind))); } } @@ -259,7 +259,7 @@ public void VisitExpression(IEdmExpression expression) this.ProcessExpression(expression); break; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_ExpressionKind(expression.ExpressionKind)); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_ExpressionKind, expression.ExpressionKind)); } } @@ -320,8 +320,8 @@ public Task VisitExpressionAsync(IEdmExpression expression) case EdmExpressionKind.None: return this.ProcessExpressionAsync(expression); default: - Contract.Assert(false, Edm.Strings.UnknownEnumVal_ExpressionKind(expression.ExpressionKind)); - return Task.FromException(new InvalidOperationException(Edm.Strings.UnknownEnumVal_ExpressionKind(expression.ExpressionKind))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_ExpressionKind, expression.ExpressionKind)); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_ExpressionKind, expression.ExpressionKind))); } } @@ -361,7 +361,7 @@ public virtual void VisitEntityContainerElements(IEnumerable(new InvalidOperationException(Edm.Strings.UnknownEnumVal_ContainerElementKind(element.ContainerElementKind.ToString()))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_ContainerElementKind, element.ContainerElementKind.ToString())); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_ContainerElementKind, element.ContainerElementKind.ToString()))); } } @@ -430,7 +430,7 @@ public void VisitTypeReference(IEdmTypeReference reference) this.ProcessUntypedTypeReference(reference as IEdmUntypedTypeReference); break; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_TypeKind(reference.TypeKind().ToString())); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_TypeKind, reference.TypeKind().ToString())); } } @@ -459,8 +459,8 @@ public Task VisitTypeReferenceAsync(IEdmTypeReference reference) case EdmTypeKind.Untyped: return this.ProcessUntypedTypeReferenceAsync(reference as IEdmUntypedTypeReference); default: - Contract.Assert(false, Edm.Strings.UnknownEnumVal_TypeKind(reference.TypeKind().ToString())); - return Task.FromException(new InvalidOperationException(Edm.Strings.UnknownEnumVal_TypeKind(reference.TypeKind().ToString()))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_TypeKind, reference.TypeKind().ToString())); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_TypeKind, reference.TypeKind().ToString()))); } } @@ -516,7 +516,7 @@ public void VisitPrimitiveTypeReference(IEdmPrimitiveTypeReference reference) this.ProcessPrimitiveTypeReference(reference); break; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_PrimitiveKind(reference.PrimitiveKind().ToString())); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_PrimitiveKind, reference.PrimitiveKind().ToString())); } } @@ -566,8 +566,8 @@ public Task VisitPrimitiveTypeReferenceAsync(IEdmPrimitiveTypeReference referenc case EdmPrimitiveTypeKind.None: return this.ProcessPrimitiveTypeReferenceAsync(reference); default: - Contract.Assert(false, Edm.Strings.UnknownEnumVal_PrimitiveKind(reference.PrimitiveKind().ToString())); - return Task.FromException(new InvalidOperationException(Edm.Strings.UnknownEnumVal_PrimitiveKind(reference.PrimitiveKind().ToString()))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_PrimitiveKind, reference.PrimitiveKind().ToString())); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_PrimitiveKind, reference.PrimitiveKind().ToString()))); } } @@ -595,7 +595,7 @@ public void VisitSchemaType(IEdmType definition) this.VisitSchemaType(definition); break; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_TypeKind(definition.TypeKind)); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_TypeKind, definition.TypeKind)); } } @@ -614,8 +614,8 @@ public Task VisitSchemaTypeAsync(IEdmType definition) case EdmTypeKind.None: return this.VisitSchemaTypeAsync(definition); default: - Contract.Assert(false, Edm.Strings.UnknownEnumVal_TypeKind(definition.TypeKind)); - return Task.FromException(new InvalidOperationException(Edm.Strings.UnknownEnumVal_TypeKind(definition.TypeKind))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_TypeKind, definition.TypeKind)); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_TypeKind, definition.TypeKind))); } } @@ -643,7 +643,7 @@ public void VisitProperty(IEdmProperty property) this.ProcessProperty(property); break; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_PropertyKind(property.PropertyKind.ToString())); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_PropertyKind, property.PropertyKind.ToString())); } } @@ -658,8 +658,8 @@ public Task VisitPropertyAsync(IEdmProperty property) case EdmPropertyKind.None: return this.ProcessPropertyAsync(property); default: - Contract.Assert(false, Edm.Strings.UnknownEnumVal_PropertyKind(property.PropertyKind.ToString())); - return Task.FromException(new InvalidOperationException(Edm.Strings.UnknownEnumVal_PropertyKind(property.PropertyKind.ToString()))); + Contract.Assert(false, Error.Format(SRResources.UnknownEnumVal_PropertyKind, property.PropertyKind.ToString())); + return Task.FromException(new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_PropertyKind, property.PropertyKind.ToString()))); } } diff --git a/src/Microsoft.OData.Edm/EdmUtil.cs b/src/Microsoft.OData.Edm/EdmUtil.cs index 073ec93e88..be429fa7f0 100644 --- a/src/Microsoft.OData.Edm/EdmUtil.cs +++ b/src/Microsoft.OData.Edm/EdmUtil.cs @@ -47,7 +47,7 @@ public static class EdmUtil /// The (non-null) value of the MIME type annotation of the or null if no MIME type annotation exists. public static string GetMimeType(this IEdmModel model, IEdmProperty annotatableProperty) { - return GetStringAnnotationValue(model, annotatableProperty, EdmConstants.MimeTypeAttributeName, () => Strings.EdmUtil_NullValueForMimeTypeAnnotation); + return GetStringAnnotationValue(model, annotatableProperty, EdmConstants.MimeTypeAttributeName, () => SRResources.EdmUtil_NullValueForMimeTypeAnnotation); } /// @@ -73,7 +73,7 @@ public static void SetMimeType(this IEdmModel model, IEdmProperty annotatablePro /// The (non-null) value of the MIME type annotation of the or null if no MIME type annotation exists. public static string GetMimeType(this IEdmModel model, IEdmOperation annotatableOperation) { - return GetStringAnnotationValue(model, annotatableOperation, EdmConstants.MimeTypeAttributeName, () => Strings.EdmUtil_NullValueForMimeTypeAnnotation); + return GetStringAnnotationValue(model, annotatableOperation, EdmConstants.MimeTypeAttributeName, () => SRResources.EdmUtil_NullValueForMimeTypeAnnotation); } /// @@ -568,7 +568,7 @@ internal static bool TryGetAnnotation(this IEdmModel model, IEdmElement annotata if (annotationStringValue == null) { // invalid annotation type found - throw new InvalidOperationException(Strings.EdmUtil_InvalidAnnotationValue(localName, annotationValue.GetType().FullName)); + throw new InvalidOperationException(Error.Format(SRResources.EdmUtil_InvalidAnnotationValue, localName, annotationValue.GetType().FullName)); } value = annotationStringValue.Value; diff --git a/src/Microsoft.OData.Edm/ExtensionMethods/EdmElementComparer.cs b/src/Microsoft.OData.Edm/ExtensionMethods/EdmElementComparer.cs index 1d1e834cd3..040a96d802 100644 --- a/src/Microsoft.OData.Edm/ExtensionMethods/EdmElementComparer.cs +++ b/src/Microsoft.OData.Edm/ExtensionMethods/EdmElementComparer.cs @@ -56,7 +56,7 @@ public static bool IsEquivalentTo(this IEdmType thisType, IEdmType otherType) case EdmTypeKind.None: return otherType.TypeKind == EdmTypeKind.None; default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_TypeKind(thisType.TypeKind)); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_TypeKind, thisType.TypeKind)); } } diff --git a/src/Microsoft.OData.Edm/ExtensionMethods/EdmTypeSemantics.cs b/src/Microsoft.OData.Edm/ExtensionMethods/EdmTypeSemantics.cs index c5d100d4c1..b33a5e9b66 100644 --- a/src/Microsoft.OData.Edm/ExtensionMethods/EdmTypeSemantics.cs +++ b/src/Microsoft.OData.Edm/ExtensionMethods/EdmTypeSemantics.cs @@ -1362,7 +1362,7 @@ internal static IEdmPrimitiveTypeReference GetPrimitiveTypeReference(this IEdmPr case EdmPrimitiveTypeKind.GeometryMultiPoint: return new EdmSpatialTypeReference(type, isNullable); default: - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } @@ -1398,7 +1398,7 @@ internal static IEdmTypeReference GetTypeReference(this IEdmType type, bool isNu return new EdmPathTypeReference(pathType, isNullable); } - throw new InvalidOperationException(Edm.Strings.EdmType_UnexpectedEdmType); + throw new InvalidOperationException(SRResources.EdmType_UnexpectedEdmType); } internal static IEdmPrimitiveType UnderlyingType(this IEdmType type) @@ -1446,7 +1446,7 @@ internal static bool CanSpecifyMaxLength(this IEdmPrimitiveType type) private static IEnumerable ConversionError(EdmLocation location, string typeName, string typeKindName) { - return new[] { new EdmError(location, EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, Edm.Strings.TypeSemantics_CouldNotConvertTypeReference(typeName ?? EdmConstants.Value_UnnamedType, typeKindName)) }; + return new[] { new EdmError(location, EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, Error.Format(SRResources.TypeSemantics_CouldNotConvertTypeReference, typeName ?? EdmConstants.Value_UnnamedType, typeKindName)) }; } } } diff --git a/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs b/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs index ff629c5653..1836234484 100644 --- a/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs +++ b/src/Microsoft.OData.Edm/ExtensionMethods/ExtensionMethods.cs @@ -2058,7 +2058,7 @@ public static IEdmProperty FindProperty(this IEdmStructuredType structuredType, { if (edmProperty != null) { - throw new InvalidOperationException(Edm.Strings.MultipleMatchingPropertiesFound(propertyName, structuredType.FullTypeName())); + throw new InvalidOperationException(Error.Format(SRResources.MultipleMatchingPropertiesFound, propertyName, structuredType.FullTypeName())); } edmProperty = property; @@ -2602,7 +2602,7 @@ public static bool TryGetRelativeEntitySetPath(this IEdmOperation operation, IEd new EdmError( operation.Location(), EdmErrorCode.OperationCannotHaveEntitySetPathWithUnBoundOperation, - Strings.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation(operation.Name))); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation, operation.Name))); } return TryGetRelativeEntitySetPath(operation, foundErrors, operation.EntitySetPath, model, operation.Parameters, out parameter, out relativeNavigations, out lastEntityType); @@ -2988,14 +2988,14 @@ internal static string GetPathString(this IEdmTargetPath targetPath) if (container == null) { - throw new InvalidOperationException(Strings.TargetPath_FirstSegmentMustBeIEdmEntityContainer); + throw new InvalidOperationException(SRResources.TargetPath_FirstSegmentMustBeIEdmEntityContainer); } IEdmEntityContainerElement containerElement = targetPath.Segments[1] as IEdmEntityContainerElement; if (containerElement == null) { - throw new InvalidOperationException(Strings.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement); + throw new InvalidOperationException(SRResources.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement); } string[] segments = new string[targetPath.Segments.Count]; @@ -3162,7 +3162,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection if (bindingParameterName == null) { - foundErrors.Add(new EdmError(element.Location(), EdmErrorCode.OperationWithInvalidEntitySetPathMissingCompletePath, Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName(CsdlConstants.Attribute_EntitySetPath))); + foundErrors.Add(new EdmError(element.Location(), EdmErrorCode.OperationWithInvalidEntitySetPathMissingCompletePath, Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName, CsdlConstants.Attribute_EntitySetPath))); return false; } @@ -3181,7 +3181,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathFirstPathParameterNotMatchingFirstParameterName, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), bindingParameterName, parameter.Name))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), bindingParameterName, parameter.Name))); foundRelativePath = false; } @@ -3200,7 +3200,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathWithNonEntityBindingParameter, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), bindingParameterName))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), bindingParameterName))); return false; } @@ -3223,7 +3223,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathUnknownTypeCastSegment, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), pathSegment))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), pathSegment))); foundRelativePath = false; break; @@ -3237,7 +3237,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathTypeCastSegmentMustBeEntityType, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), foundType.FullName()))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), foundType.FullName()))); foundRelativePath = false; break; @@ -3249,7 +3249,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathInvalidTypeCastSegment, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), lastEntityType.FullName(), foundEntityTypeCast.FullName()))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), lastEntityType.FullName(), foundEntityTypeCast.FullName()))); foundRelativePath = false; break; @@ -3266,7 +3266,7 @@ internal static bool TryGetRelativeEntitySetPath(IEdmElement element, Collection new EdmError( element.Location(), EdmErrorCode.InvalidPathUnknownNavigationProperty, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty(CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), pathSegment))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty, CsdlConstants.Attribute_EntitySetPath, EdmModelCsdlSchemaWriter.PathAsXml(pathExpression.PathSegments), pathSegment))); foundRelativePath = false; break; @@ -3307,7 +3307,7 @@ public static IEnumerable AllElements(this IEdmEntit { if (depth <= 0) { - throw new InvalidOperationException(Edm.Strings.Bad_CyclicEntityContainer(container.FullName())); + throw new InvalidOperationException(Error.Format(SRResources.Bad_CyclicEntityContainer, container.FullName())); } CsdlSemanticsEntityContainer semanticsEntityContainer = container as CsdlSemanticsEntityContainer; @@ -3631,7 +3631,7 @@ private static T GetTermValue(this IEdmModel model, IEdmStructuredValue conte if (annotations.Count() != 1) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_NoValueAnnotationOnType(contextType.ToTraceString(), term.ToTraceString())); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_NoValueAnnotationOnType, contextType.ToTraceString(), term.ToTraceString())); } return evaluator(annotations.Single().Value, context, term.Type); @@ -3643,7 +3643,7 @@ private static T GetTermValue(this IEdmModel model, IEdmStructuredValue conte if (annotations.Count() != 1) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_NoValueAnnotationOnType(contextType.ToTraceString(), termName)); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_NoValueAnnotationOnType, contextType.ToTraceString(), termName)); } IEdmVocabularyAnnotation valueAnnotation = annotations.Single(); @@ -3656,7 +3656,7 @@ private static T GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable if (annotations.Count() != 1) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_NoValueAnnotationOnElement(term.ToTraceString())); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_NoValueAnnotationOnElement, term.ToTraceString())); } return evaluator(annotations.Single().Value, null, term.Type); @@ -3668,7 +3668,7 @@ private static T GetTermValue(this IEdmModel model, IEdmVocabularyAnnotatable if (annotations.Count() != 1) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_NoValueAnnotationOnElement(termName)); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_NoValueAnnotationOnElement, termName)); } IEdmVocabularyAnnotation valueAnnotation = annotations.Single(); @@ -3691,7 +3691,7 @@ private static T FindInContainerAndExtendsRecursively(IEdmEntityContainer con if (depth <= 0) { // TODO: p2 add a new string resource for the error message - throw new InvalidOperationException(Edm.Strings.Bad_CyclicEntityContainer(container.FullName())); + throw new InvalidOperationException(Error.Format(SRResources.Bad_CyclicEntityContainer, container.FullName())); } T ret = finderFunc(container, simpleName); @@ -3726,7 +3726,7 @@ private static T AnnotationValue(object annotation) where T : class // [EdmLib] AnnotationValue extension method should use the Clr converter to map annotation value to T. } - throw new InvalidOperationException(Edm.Strings.Annotations_TypeMismatch(annotation.GetType().Name, typeof(T).Name)); + throw new InvalidOperationException(Error.Format(SRResources.Annotations_TypeMismatch, annotation.GetType().Name, typeof(T).Name)); } return null; diff --git a/src/Microsoft.OData.Edm/ExtensionMethods/TargetPathHelper.cs b/src/Microsoft.OData.Edm/ExtensionMethods/TargetPathHelper.cs index 11dbe68f7a..815a34f2fd 100644 --- a/src/Microsoft.OData.Edm/ExtensionMethods/TargetPathHelper.cs +++ b/src/Microsoft.OData.Edm/ExtensionMethods/TargetPathHelper.cs @@ -167,7 +167,7 @@ private static IEdmVocabularyAnnotatable HandleSchemaType(IEdmModel model, List< if (nextSchemaType != null) { - throw new InvalidOperationException(Strings.TypeCast_HierarchyNotFollowed(schemaType, nextSchemaType)); + throw new InvalidOperationException(Error.Format(SRResources.TypeCast_HierarchyNotFollowed, schemaType, nextSchemaType)); } if (schemaType is IEdmStructuredType structuredType) @@ -192,7 +192,7 @@ private static void ValidateSchemaType(IEdmSchemaType schemaType, List - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -using System; -using System.Globalization; -using System.Reflection; -using System.Resources; -using System.Threading; - -namespace Microsoft.OData.Edm -{ - /// - /// AutoGenerated resource class. Usage: - /// - /// string s = EdmRes.GetString(EdmRes.MyIdentifier); - /// - internal sealed class EdmRes { - internal const string EdmPrimitive_UnexpectedKind = "EdmPrimitive_UnexpectedKind"; - internal const string EdmPath_UnexpectedKind = "EdmPath_UnexpectedKind"; - internal const string Annotations_TypeMismatch = "Annotations_TypeMismatch"; - internal const string Constructable_VocabularyAnnotationMustHaveTarget = "Constructable_VocabularyAnnotationMustHaveTarget"; - internal const string Constructable_EntityTypeOrCollectionOfEntityTypeExpected = "Constructable_EntityTypeOrCollectionOfEntityTypeExpected"; - internal const string Constructable_TargetMustBeStock = "Constructable_TargetMustBeStock"; - internal const string TypeSemantics_CouldNotConvertTypeReference = "TypeSemantics_CouldNotConvertTypeReference"; - internal const string EdmModel_CannotUseElementWithTypeNone = "EdmModel_CannotUseElementWithTypeNone"; - internal const string EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel = "EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel"; - internal const string EdmEntityContainer_CannotUseElementWithTypeNone = "EdmEntityContainer_CannotUseElementWithTypeNone"; - internal const string ValueWriter_NonSerializableValue = "ValueWriter_NonSerializableValue"; - internal const string ValueHasAlreadyBeenSet = "ValueHasAlreadyBeenSet"; - internal const string PathSegmentMustNotContainSlash = "PathSegmentMustNotContainSlash"; - internal const string Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType = "Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType"; - internal const string EdmType_UnexpectedEdmType = "EdmType_UnexpectedEdmType"; - internal const string NavigationPropertyBinding_PathIsNotValid = "NavigationPropertyBinding_PathIsNotValid"; - internal const string MultipleMatchingPropertiesFound = "MultipleMatchingPropertiesFound"; - internal const string TargetPath_FirstSegmentMustBeIEdmEntityContainer = "TargetPath_FirstSegmentMustBeIEdmEntityContainer"; - internal const string TargetPath_SecondSegmentMustBeIEdmEntityContainerElement = "TargetPath_SecondSegmentMustBeIEdmEntityContainerElement"; - internal const string TargetPath_SegmentsMustNotContainNullSegment = "TargetPath_SegmentsMustNotContainNullSegment"; - internal const string TypeCast_HierarchyNotFollowed = "TypeCast_HierarchyNotFollowed"; - internal const string Edm_Evaluator_NoTermTypeAnnotationOnType = "Edm_Evaluator_NoTermTypeAnnotationOnType"; - internal const string Edm_Evaluator_NoValueAnnotationOnType = "Edm_Evaluator_NoValueAnnotationOnType"; - internal const string Edm_Evaluator_NoValueAnnotationOnElement = "Edm_Evaluator_NoValueAnnotationOnElement"; - internal const string Edm_Evaluator_UnrecognizedExpressionKind = "Edm_Evaluator_UnrecognizedExpressionKind"; - internal const string Edm_Evaluator_UnboundFunction = "Edm_Evaluator_UnboundFunction"; - internal const string Edm_Evaluator_UnboundPath = "Edm_Evaluator_UnboundPath"; - internal const string Edm_Evaluator_NoContextPath = "Edm_Evaluator_NoContextPath"; - internal const string Edm_Evaluator_FailedTypeAssertion = "Edm_Evaluator_FailedTypeAssertion"; - internal const string Edm_Evaluator_TypeCastNeedsEdmModel = "Edm_Evaluator_TypeCastNeedsEdmModel"; - internal const string EdmModel_Validator_Semantic_SystemNamespaceEncountered = "EdmModel_Validator_Semantic_SystemNamespaceEncountered"; - internal const string EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys = "EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys"; - internal const string EdmModel_Validator_Semantic_DuplicateEndName = "EdmModel_Validator_Semantic_DuplicateEndName"; - internal const string EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey = "EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey"; - internal const string EdmModel_Validator_Semantic_InvalidComplexTypeAbstract = "EdmModel_Validator_Semantic_InvalidComplexTypeAbstract"; - internal const string EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic = "EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic"; - internal const string EdmModel_Validator_Semantic_InvalidKeyNullablePart = "EdmModel_Validator_Semantic_InvalidKeyNullablePart"; - internal const string EdmModel_Validator_Semantic_EntityKeyMustBeScalar = "EdmModel_Validator_Semantic_EntityKeyMustBeScalar"; - internal const string EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne = "EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne"; - internal const string EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne = "EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne"; - internal const string EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass = "EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass"; - internal const string EdmModel_Validator_Semantic_KeyMissingOnEntityType = "EdmModel_Validator_Semantic_KeyMissingOnEntityType"; - internal const string EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole = "EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole"; - internal const string EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame = "EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame"; - internal const string EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType = "EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType"; - internal const string EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation = "EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation"; - internal const string EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified = "EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified"; - internal const string EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate = "EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate"; - internal const string EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint = "EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne = "EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne"; - internal const string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable = "EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable"; - internal const string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable = "EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable"; - internal const string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne = "EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne"; - internal const string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany = "EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany"; - internal const string EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint = "EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint"; - internal const string EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint = "EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint"; - internal const string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd = "EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd"; - internal const string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd = "EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd"; - internal const string EdmModel_Validator_Semantic_InvalidPropertyType = "EdmModel_Validator_Semantic_InvalidPropertyType"; - internal const string EdmModel_Validator_Semantic_BoundOperationMustHaveParameters = "EdmModel_Validator_Semantic_BoundOperationMustHaveParameters"; - internal const string EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional = "EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional"; - internal const string EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType = "EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType"; - internal const string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet = "EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet"; - internal const string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2 = "EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2"; - internal const string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid = "EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid"; - internal const string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid = "EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid"; - internal const string EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType = "EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType"; - internal const string EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation = "EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation"; - internal const string EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument = "EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument"; - internal const string EdmModel_Validator_Semantic_FunctionMustHaveReturnType = "EdmModel_Validator_Semantic_FunctionMustHaveReturnType"; - internal const string EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction = "EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction"; - internal const string EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter = "EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter"; - internal const string EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate = "EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate"; - internal const string EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName = "EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName"; - internal const string EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType = "EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType"; - internal const string EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation = "EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName = "EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName = "EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType = "EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty = "EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment = "EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter = "EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter"; - internal const string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment = "EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment"; - internal const string EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid = "EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid"; - internal const string EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable = "EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable"; - internal const string EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType = "EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType"; - internal const string EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined = "EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined"; - internal const string EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName = "EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName"; - internal const string EdmModel_Validator_Semantic_PropertyNameAlreadyDefined = "EdmModel_Validator_Semantic_PropertyNameAlreadyDefined"; - internal const string EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind = "EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind"; - internal const string EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen = "EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen"; - internal const string EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity = "EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity"; - internal const string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey = "EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey"; - internal const string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType = "EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType"; - internal const string EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity = "EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity"; - internal const string EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect = "EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect"; - internal const string EdmModel_Validator_Semantic_InaccessibleType = "EdmModel_Validator_Semantic_InaccessibleType"; - internal const string EdmModel_Validator_Semantic_AmbiguousType = "EdmModel_Validator_Semantic_AmbiguousType"; - internal const string EdmModel_Validator_Semantic_InvalidNavigationPropertyType = "EdmModel_Validator_Semantic_InvalidNavigationPropertyType"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional = "EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional"; - internal const string EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional = "EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne = "EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne = "EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne"; - internal const string EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties = "EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties"; - internal const string EdmModel_Validator_Semantic_DuplicateDependentProperty = "EdmModel_Validator_Semantic_DuplicateDependentProperty"; - internal const string EdmModel_Validator_Semantic_ScaleOutOfRange = "EdmModel_Validator_Semantic_ScaleOutOfRange"; - internal const string EdmModel_Validator_Semantic_PrecisionOutOfRange = "EdmModel_Validator_Semantic_PrecisionOutOfRange"; - internal const string EdmModel_Validator_Semantic_StringMaxLengthOutOfRange = "EdmModel_Validator_Semantic_StringMaxLengthOutOfRange"; - internal const string EdmModel_Validator_Semantic_MaxLengthOutOfRange = "EdmModel_Validator_Semantic_MaxLengthOutOfRange"; - internal const string EdmModel_Validator_Semantic_EnumMemberValueOutOfRange = "EdmModel_Validator_Semantic_EnumMemberValueOutOfRange"; - internal const string EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined = "EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined"; - internal const string EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly = "EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly"; - internal const string EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull = "EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull"; - internal const string EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm = "EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm"; - internal const string EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml = "EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml"; - internal const string EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue = "EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue"; - internal const string EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName = "EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName"; - internal const string EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType = "EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType"; - internal const string EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType = "EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType"; - internal const string EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType = "EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType"; - internal const string EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType = "EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType"; - internal const string EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType = "EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType"; - internal const string EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType = "EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType"; - internal const string EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType = "EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType"; - internal const string EdmModel_Validator_Semantic_RecordExpressionMissingProperty = "EdmModel_Validator_Semantic_RecordExpressionMissingProperty"; - internal const string EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties = "EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties"; - internal const string EdmModel_Validator_Semantic_DuplicateAnnotation = "EdmModel_Validator_Semantic_DuplicateAnnotation"; - internal const string EdmModel_Validator_Semantic_IncorrectNumberOfArguments = "EdmModel_Validator_Semantic_IncorrectNumberOfArguments"; - internal const string EdmModel_Validator_Semantic_DuplicateEntityContainerName = "EdmModel_Validator_Semantic_DuplicateEntityContainerName"; - internal const string EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType = "EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType"; - internal const string EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType = "EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType"; - internal const string EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange = "EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange"; - internal const string EdmModel_Validator_Semantic_StringConstantLengthOutOfRange = "EdmModel_Validator_Semantic_StringConstantLengthOutOfRange"; - internal const string EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange = "EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange"; - internal const string EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone = "EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone"; - internal const string EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone = "EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone"; - internal const string EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone = "EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone"; - internal const string EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone = "EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone"; - internal const string EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone = "EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone"; - internal const string EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping = "EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping"; - internal const string EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional = "EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional"; - internal const string EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty = "EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty"; - internal const string EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty = "EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty"; - internal const string EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties = "EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties"; - internal const string EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType = "EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType"; - internal const string EdmModel_Validator_Semantic_InaccessibleTerm = "EdmModel_Validator_Semantic_InaccessibleTerm"; - internal const string EdmModel_Validator_Semantic_InaccessibleTarget = "EdmModel_Validator_Semantic_InaccessibleTarget"; - internal const string EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable = "EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable"; - internal const string EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique = "EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique"; - internal const string EdmModel_Validator_Semantic_NoEntitySetsFoundForType = "EdmModel_Validator_Semantic_NoEntitySetsFoundForType"; - internal const string EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType = "EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType"; - internal const string EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet = "EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself = "EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself"; - internal const string EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext = "EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty = "EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames = "EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes = "EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames = "EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes = "EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateBoundActions = "EdmModel_Validator_Semantic_ModelDuplicateBoundActions"; - internal const string EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions = "EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions"; - internal const string EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType = "EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType"; - internal const string EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType = "EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType"; - internal const string EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType = "EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType"; - internal const string EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton = "EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton"; - internal const string EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType = "EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType"; - internal const string EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType = "EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType"; - internal const string EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType = "EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType"; - internal const string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton = "EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton"; - internal const string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet = "EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet"; - internal const string EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty = "EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty"; - internal const string EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty = "EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty"; - internal const string EdmModel_Validator_Syntactic_MissingName = "EdmModel_Validator_Syntactic_MissingName"; - internal const string EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong = "EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong"; - internal const string EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed = "EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed"; - internal const string EdmModel_Validator_Syntactic_MissingNamespaceName = "EdmModel_Validator_Syntactic_MissingNamespaceName"; - internal const string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong = "EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong"; - internal const string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed = "EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed"; - internal const string EdmModel_Validator_Syntactic_PropertyMustNotBeNull = "EdmModel_Validator_Syntactic_PropertyMustNotBeNull"; - internal const string EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange = "EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange"; - internal const string EdmModel_Validator_Syntactic_InterfaceKindValueMismatch = "EdmModel_Validator_Syntactic_InterfaceKindValueMismatch"; - internal const string EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch = "EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch"; - internal const string EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected = "EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected"; - internal const string EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements = "EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements"; - internal const string EdmModel_Validator_Syntactic_NavigationPartnerInvalid = "EdmModel_Validator_Syntactic_NavigationPartnerInvalid"; - internal const string EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy = "EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy"; - internal const string Serializer_SingleFileExpected = "Serializer_SingleFileExpected"; - internal const string Serializer_UnknownEdmVersion = "Serializer_UnknownEdmVersion"; - internal const string Serializer_UnknownEdmxVersion = "Serializer_UnknownEdmxVersion"; - internal const string Serializer_NonInlineOperationImportReturnType = "Serializer_NonInlineOperationImportReturnType"; - internal const string Serializer_ReferencedTypeMustHaveValidName = "Serializer_ReferencedTypeMustHaveValidName"; - internal const string Serializer_OutOfLineAnnotationTargetMustHaveValidName = "Serializer_OutOfLineAnnotationTargetMustHaveValidName"; - internal const string Serializer_NoSchemasProduced = "Serializer_NoSchemasProduced"; - internal const string XmlParser_EmptyFile = "XmlParser_EmptyFile"; - internal const string XmlParser_EmptySchemaTextReader = "XmlParser_EmptySchemaTextReader"; - internal const string XmlParser_MissingAttribute = "XmlParser_MissingAttribute"; - internal const string XmlParser_TextNotAllowed = "XmlParser_TextNotAllowed"; - internal const string XmlParser_UnexpectedAttribute = "XmlParser_UnexpectedAttribute"; - internal const string XmlParser_UnexpectedElement = "XmlParser_UnexpectedElement"; - internal const string XmlParser_UnusedElement = "XmlParser_UnusedElement"; - internal const string XmlParser_UnexpectedNodeType = "XmlParser_UnexpectedNodeType"; - internal const string XmlParser_UnexpectedRootElement = "XmlParser_UnexpectedRootElement"; - internal const string XmlParser_UnexpectedRootElementWrongNamespace = "XmlParser_UnexpectedRootElementWrongNamespace"; - internal const string XmlParser_UnexpectedRootElementNoNamespace = "XmlParser_UnexpectedRootElementNoNamespace"; - internal const string CsdlParser_InvalidEntitySetPathWithUnboundAction = "CsdlParser_InvalidEntitySetPathWithUnboundAction"; - internal const string CsdlParser_InvalidAlias = "CsdlParser_InvalidAlias"; - internal const string CsdlParser_InvalidDeleteAction = "CsdlParser_InvalidDeleteAction"; - internal const string CsdlParser_MissingTypeAttributeOrElement = "CsdlParser_MissingTypeAttributeOrElement"; - internal const string CsdlParser_InvalidEndRoleInRelationshipConstraint = "CsdlParser_InvalidEndRoleInRelationshipConstraint"; - internal const string CsdlParser_InvalidMultiplicity = "CsdlParser_InvalidMultiplicity"; - internal const string CsdlParser_ReferentialConstraintRequiresOneDependent = "CsdlParser_ReferentialConstraintRequiresOneDependent"; - internal const string CsdlParser_ReferentialConstraintRequiresOnePrincipal = "CsdlParser_ReferentialConstraintRequiresOnePrincipal"; - internal const string CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands = "CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands"; - internal const string CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands = "CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands"; - internal const string CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands = "CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands"; - internal const string CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands = "CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands"; - internal const string CsdlParser_InvalidTypeName = "CsdlParser_InvalidTypeName"; - internal const string CsdlParser_InvalidQualifiedName = "CsdlParser_InvalidQualifiedName"; - internal const string CsdlParser_NoReadersProvided = "CsdlParser_NoReadersProvided"; - internal const string CsdlParser_NullXmlReader = "CsdlParser_NullXmlReader"; - internal const string CsdlParser_InvalidEntitySetPath = "CsdlParser_InvalidEntitySetPath"; - internal const string CsdlParser_InvalidEnumMemberPath = "CsdlParser_InvalidEnumMemberPath"; - internal const string CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType = "CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType"; - internal const string CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer = "CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer"; - internal const string CsdlSemantics_ReferentialConstraintMismatch = "CsdlSemantics_ReferentialConstraintMismatch"; - internal const string CsdlSemantics_EnumMemberMustHaveValue = "CsdlSemantics_EnumMemberMustHaveValue"; - internal const string CsdlSemantics_ImpossibleAnnotationsTarget = "CsdlSemantics_ImpossibleAnnotationsTarget"; - internal const string CsdlSemantics_DuplicateAlias = "CsdlSemantics_DuplicateAlias"; - internal const string CsdlJsonParser_UnexpectedJsonValueKind = "CsdlJsonParser_UnexpectedJsonValueKind"; - internal const string CsdlJsonParser_MissingMemberInObject = "CsdlJsonParser_MissingMemberInObject"; - internal const string CsdlJsonParser_UnexpectedJsonMember = "CsdlJsonParser_UnexpectedJsonMember"; - internal const string CsdlJsonParser_CannotReadValueAsType = "CsdlJsonParser_CannotReadValueAsType"; - internal const string CsdlJsonParser_MissingKindMember = "CsdlJsonParser_MissingKindMember"; - internal const string CsdlJsonParser_MissingRequiredPropertyInObject = "CsdlJsonParser_MissingRequiredPropertyInObject"; - internal const string CsdlJsonParser_UnknownJsonElementValueKind = "CsdlJsonParser_UnknownJsonElementValueKind"; - internal const string CsdlJsonParser_InvalidJsonNumberType = "CsdlJsonParser_InvalidJsonNumberType"; - internal const string CsdlJsonParser_UnsupportedJsonMember = "CsdlJsonParser_UnsupportedJsonMember"; - internal const string CsdlJsonParser_InvalidCsdlVersion = "CsdlJsonParser_InvalidCsdlVersion"; - internal const string CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer = "CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer"; - internal const string EdmxParser_EdmxVersionMismatch = "EdmxParser_EdmxVersionMismatch"; - internal const string EdmxParser_BodyElement = "EdmxParser_BodyElement"; - internal const string EdmxParser_InvalidReferenceIncorrectNumberOfIncludes = "EdmxParser_InvalidReferenceIncorrectNumberOfIncludes"; - internal const string EdmxParser_UnresolvedReferenceUriInEdmxReference = "EdmxParser_UnresolvedReferenceUriInEdmxReference"; - internal const string EdmParseException_ErrorsEncounteredInEdmx = "EdmParseException_ErrorsEncounteredInEdmx"; - internal const string ValueParser_InvalidBoolean = "ValueParser_InvalidBoolean"; - internal const string ValueParser_InvalidInteger = "ValueParser_InvalidInteger"; - internal const string ValueParser_InvalidLong = "ValueParser_InvalidLong"; - internal const string ValueParser_InvalidFloatingPoint = "ValueParser_InvalidFloatingPoint"; - internal const string ValueParser_InvalidMaxLength = "ValueParser_InvalidMaxLength"; - internal const string ValueParser_InvalidSrid = "ValueParser_InvalidSrid"; - internal const string ValueParser_InvalidScale = "ValueParser_InvalidScale"; - internal const string ValueParser_InvalidGuid = "ValueParser_InvalidGuid"; - internal const string ValueParser_InvalidDecimal = "ValueParser_InvalidDecimal"; - internal const string ValueParser_InvalidDateTimeOffset = "ValueParser_InvalidDateTimeOffset"; - internal const string ValueParser_InvalidDateTime = "ValueParser_InvalidDateTime"; - internal const string ValueParser_InvalidDate = "ValueParser_InvalidDate"; - internal const string ValueParser_InvalidDuration = "ValueParser_InvalidDuration"; - internal const string ValueParser_InvalidBinary = "ValueParser_InvalidBinary"; - internal const string ValueParser_InvalidTimeOfDay = "ValueParser_InvalidTimeOfDay"; - internal const string UnknownEnumVal_Multiplicity = "UnknownEnumVal_Multiplicity"; - internal const string UnknownEnumVal_SchemaElementKind = "UnknownEnumVal_SchemaElementKind"; - internal const string UnknownEnumVal_TypeKind = "UnknownEnumVal_TypeKind"; - internal const string UnknownEnumVal_PrimitiveKind = "UnknownEnumVal_PrimitiveKind"; - internal const string UnknownEnumVal_ContainerElementKind = "UnknownEnumVal_ContainerElementKind"; - internal const string UnknownEnumVal_CsdlTarget = "UnknownEnumVal_CsdlTarget"; - internal const string UnknownEnumVal_PropertyKind = "UnknownEnumVal_PropertyKind"; - internal const string UnknownEnumVal_ExpressionKind = "UnknownEnumVal_ExpressionKind"; - internal const string Bad_AmbiguousElementBinding = "Bad_AmbiguousElementBinding"; - internal const string Bad_UnresolvedType = "Bad_UnresolvedType"; - internal const string Bad_UnresolvedComplexType = "Bad_UnresolvedComplexType"; - internal const string Bad_UnresolvedEntityType = "Bad_UnresolvedEntityType"; - internal const string Bad_UnresolvedPrimitiveType = "Bad_UnresolvedPrimitiveType"; - internal const string Bad_UnresolvedOperation = "Bad_UnresolvedOperation"; - internal const string Bad_AmbiguousOperation = "Bad_AmbiguousOperation"; - internal const string Bad_OperationParametersDontMatch = "Bad_OperationParametersDontMatch"; - internal const string Bad_UnresolvedEntitySet = "Bad_UnresolvedEntitySet"; - internal const string Bad_UnresolvedEntityContainer = "Bad_UnresolvedEntityContainer"; - internal const string Bad_UnresolvedEnumType = "Bad_UnresolvedEnumType"; - internal const string Bad_UnresolvedEnumMember = "Bad_UnresolvedEnumMember"; - internal const string Bad_UnresolvedProperty = "Bad_UnresolvedProperty"; - internal const string Bad_UnresolvedParameter = "Bad_UnresolvedParameter"; - internal const string Bad_UnresolvedReturn = "Bad_UnresolvedReturn"; - internal const string Bad_UnresolvedLabeledElement = "Bad_UnresolvedLabeledElement"; - internal const string Bad_CyclicEntity = "Bad_CyclicEntity"; - internal const string Bad_CyclicComplex = "Bad_CyclicComplex"; - internal const string Bad_CyclicEntityContainer = "Bad_CyclicEntityContainer"; - internal const string Bad_UnresolvedNavigationPropertyPath = "Bad_UnresolvedNavigationPropertyPath"; - internal const string RuleSet_DuplicateRulesExistInRuleSet = "RuleSet_DuplicateRulesExistInRuleSet"; - internal const string EdmToClr_UnsupportedType = "EdmToClr_UnsupportedType"; - internal const string EdmToClr_StructuredValueMappedToNonClass = "EdmToClr_StructuredValueMappedToNonClass"; - internal const string EdmToClr_IEnumerableOfTPropertyAlreadyHasValue = "EdmToClr_IEnumerableOfTPropertyAlreadyHasValue"; - internal const string EdmToClr_StructuredPropertyDuplicateValue = "EdmToClr_StructuredPropertyDuplicateValue"; - internal const string EdmToClr_CannotConvertEdmValueToClrType = "EdmToClr_CannotConvertEdmValueToClrType"; - internal const string EdmToClr_CannotConvertEdmCollectionValueToClrType = "EdmToClr_CannotConvertEdmCollectionValueToClrType"; - internal const string EdmToClr_TryCreateObjectInstanceReturnedWrongObject = "EdmToClr_TryCreateObjectInstanceReturnedWrongObject"; - internal const string EdmUtil_NullValueForMimeTypeAnnotation = "EdmUtil_NullValueForMimeTypeAnnotation"; - internal const string EdmUtil_InvalidAnnotationValue = "EdmUtil_InvalidAnnotationValue"; - internal const string PlatformHelper_DateTimeOffsetMustContainTimeZone = "PlatformHelper_DateTimeOffsetMustContainTimeZone"; - internal const string Date_InvalidAddedOrSubtractedResults = "Date_InvalidAddedOrSubtractedResults"; - internal const string Date_InvalidDateParameters = "Date_InvalidDateParameters"; - internal const string Date_InvalidParsingString = "Date_InvalidParsingString"; - internal const string Date_InvalidCompareToTarget = "Date_InvalidCompareToTarget"; - internal const string TimeOfDay_InvalidTimeOfDayParameters = "TimeOfDay_InvalidTimeOfDayParameters"; - internal const string TimeOfDay_TicksOutOfRange = "TimeOfDay_TicksOutOfRange"; - internal const string TimeOfDay_ConvertErrorFromTimeSpan = "TimeOfDay_ConvertErrorFromTimeSpan"; - internal const string TimeOfDay_InvalidParsingString = "TimeOfDay_InvalidParsingString"; - internal const string TimeOfDay_InvalidCompareToTarget = "TimeOfDay_InvalidCompareToTarget"; - internal const string EdmVocabularyAnnotations_DidNotFindDefaultValue = "EdmVocabularyAnnotations_DidNotFindDefaultValue"; - internal const string EdmVocabularyAnnotations_TermTypeNotSupported = "EdmVocabularyAnnotations_TermTypeNotSupported"; - internal const string EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation = "EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation"; - - static EdmRes loader = null; - ResourceManager resources; - - internal EdmRes() - { - resources = new System.Resources.ResourceManager("Microsoft.OData.Edm", this.GetType().GetTypeInfo().Assembly); - } - - private static EdmRes GetLoader() - { - if (loader == null) - { - EdmRes sr = new EdmRes(); - Interlocked.CompareExchange(ref loader, sr, null); - } - - return loader; - } - - private static CultureInfo Culture - { - get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; } - } - - public static ResourceManager Resources - { - get - { - return GetLoader().resources; - } - } - - public static string GetString(string name, params object[] args) - { - EdmRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - string res = sys.resources.GetString(name, EdmRes.Culture); - - if (args != null && args.Length > 0) - { - for (int i = 0; i < args.Length; i ++) - { - String value = args[i] as String; - if (value != null && value.Length > 1024) - { - args[i] = value.Substring(0, 1024 - 3) + "..."; - } - } - return String.Format(CultureInfo.CurrentCulture, res, args); - } - else - { - return res; - } - } - - public static string GetString(string name) - { - EdmRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - return sys.resources.GetString(name, EdmRes.Culture); - } - - public static string GetString(string name, out bool usedFallback) - { - // always false for this version of gensr - usedFallback = false; - return GetString(name); - } - } -} diff --git a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.csproj b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.csproj index d6bbdfccab..6e6d2103f1 100644 --- a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.csproj +++ b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.csproj @@ -30,30 +30,6 @@ - - - Microsoft.OData.Edm - true - true - internal - true - Microsoft.OData.Edm.EdmRes - false - true - - - - - - TextTemplatingFileGenerator - Microsoft.OData.Edm.cs - - - TextTemplatingFileGenerator - Parameterized.Microsoft.OData.Edm.cs - - - @@ -118,4 +94,19 @@ + + + True + True + SRResources.resx + + + + + + ResXFileCodeGenerator + SRResources.Designer.cs + + + diff --git a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.tt b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.tt deleted file mode 100644 index 5172b01304..0000000000 --- a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\ResourceClassGenerator2.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData.Edm"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Edm"; - - // The name of the generated resource class. - public const string ResourceClassName = "EdmRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Edm.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt b/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt deleted file mode 100644 index 0d7155d183..0000000000 --- a/src/Microsoft.OData.Edm/Microsoft.OData.Edm.txt +++ /dev/null @@ -1,348 +0,0 @@ -; NOTE: don't use \", use ' instead -; NOTE: don't use #, use ; instead for comments -; NOTE: leave the [strings] alone - -; EDM Model messages -EdmPrimitive_UnexpectedKind=Unexpected primitive type kind. -EdmPath_UnexpectedKind=Unexpected path type kind. -Annotations_TypeMismatch=Annotation of type '{0}' cannot be interpreted as '{1}'. -Constructable_VocabularyAnnotationMustHaveTarget=The annotation must have non-null target. -Constructable_EntityTypeOrCollectionOfEntityTypeExpected=An entity type or a collection of an entity type is expected. -Constructable_TargetMustBeStock=Navigation target entity type must be '{0}'. -TypeSemantics_CouldNotConvertTypeReference=The type '{0}' could not be converted to be a '{1}' type. -EdmModel_CannotUseElementWithTypeNone=An element with type 'None' cannot be used in a model. -EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel=Cannot add more than one entity container to an edm model. -EdmEntityContainer_CannotUseElementWithTypeNone=An element with type 'None' cannot be used in an entity container. -ValueWriter_NonSerializableValue=The value writer cannot write a value of kind '{0}'. -ValueHasAlreadyBeenSet=Value has already been set. -PathSegmentMustNotContainSlash=Path segments must not contain '/' character. -Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType=The number of dependent properties must match the number of key properties on the principal entity type. '{0}' principal properties were provided, but {1} dependent properties were provided. -EdmType_UnexpectedEdmType=Unexpected Edm type. -NavigationPropertyBinding_PathIsNotValid=The navigation property binding path is not valid. -MultipleMatchingPropertiesFound=More than one properties match the name '{0}' were found in type '{1}'. -TargetPath_FirstSegmentMustBeIEdmEntityContainer=First segment must be IEdmEntityContainer. -TargetPath_SecondSegmentMustBeIEdmEntityContainerElement=Second segment must be IEdmEntityContainerElement. -TargetPath_SegmentsMustNotContainNullSegment=Target path segments must not contain a null segment. -TypeCast_HierarchyNotFollowed=Encountered invalid type cast. '{0}' is not assignable from '{1}'. - -; Evaluation messages -Edm_Evaluator_NoTermTypeAnnotationOnType=Type '{0}' must have a single type annotation with term type '{1}'. -Edm_Evaluator_NoValueAnnotationOnType=Type '{0}' must have a single annotation with term '{1}'. -Edm_Evaluator_NoValueAnnotationOnElement=Element must have a single annotation with term '{0}'. -Edm_Evaluator_UnrecognizedExpressionKind=Expression with kind '{0}' cannot be evaluated. -Edm_Evaluator_UnboundFunction=Function '{0}' is not present in the execution environment. -Edm_Evaluator_UnboundPath=Path segment '{0}' has no binding in the execution environment. -Edm_Evaluator_NoContextPath=A containing object cannot be null when getting value of an annotation with Path in the execution environment. -Edm_Evaluator_FailedTypeAssertion=Value fails to match type '{0}'. -Edm_Evaluator_TypeCastNeedsEdmModel=An edm model must be provided for type cast. - -;Error message for Semantic validation rules -EdmModel_Validator_Semantic_SystemNamespaceEncountered=The namespace '{0}' is a system namespace and cannot be used by non-system types. Please choose a different namespace. -EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys=The entity set or singleton '{0}' is based on type '{1}' that has no keys defined. -EdmModel_Validator_Semantic_DuplicateEndName=An end with the name '{0}' is already defined. -EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey=The key specified in entity type '{0}' is not valid. Property '{1}' is referenced more than once in the key element. -EdmModel_Validator_Semantic_InvalidComplexTypeAbstract=The complex type '{0}' is marked as abstract. Abstract complex types are only supported in version 1.1 EDM models. -EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic=The complex type '{0}' has a base type specified. Complex type inheritance is only supported in version 1.1 EDM models. -EdmModel_Validator_Semantic_InvalidKeyNullablePart=The key part '{0}' for type '{1}' is not valid. All parts of the key must be non nullable. -EdmModel_Validator_Semantic_EntityKeyMustBeScalar=The property '{0}' in entity type '{1}' is not valid. All properties that are part of the entity key must be of primitive type. -EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne=The entity type '{0}' has more than one composable escape functions '{1}' defined. -EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne=The entity type '{0}' has more than one non-composable escape functions '{1}' defined. -EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass=The key usage is not valid. '{0}' cannot define keys because one of its base classes '{1}' defines keys. -EdmModel_Validator_Semantic_KeyMissingOnEntityType=The entity type '{0}' has no key defined. Define the key for this entity type. -EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole=The navigation property '{0}' is not valid. The role '{1}' is not defined in relationship '{2}'. -EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame=The navigation property '{0}'is not valid. The from role and to role are the same. -EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType=The navigation property type could not be determined from the role '{0}'. -EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation=An on delete action can only be specified on one end of an association. -EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified=The navigation property '{0}' cannot have 'OnDelete' specified since its multiplicity is '*'. -EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate=Each name and plural name in a relationship must be unique. '{0}' is already defined. -EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint=In relationship '{0}', the principal and dependent role of the referential constraint refers to the same role in the relationship type. -EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne=The principal navigation property '{0}' has an invalid multiplicity. Valid values for the multiplicity of a principal end are '0..1' or '1'. -EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable=Because all dependent properties of the navigation '{0}' are non-nullable, the multiplicity of the principal end must be '1'. -EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable=Because all dependent properties of the navigation '{0}' are nullable, the multiplicity of the principal end must be '0..1'. -EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne=The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties represent the dependent end key, the multiplicity of the dependent end must be '0..1' or '1'. -EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany=The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties don't represent the dependent end key, the the multiplicity of the dependent end must be '*'. -EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint=The number of properties in the dependent and principal role in a relationship constraint must be exactly identical. -EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint=The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint. -EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd=There is no property with name '{0}' defined in the type referred to by role '{1}'. -EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd=The principal end properties in the referential constraint of the association '{0}' do not match the key of the type referred to by role '{1}'. -EdmModel_Validator_Semantic_InvalidPropertyType=A property cannot be of type '{0}'. The property type must be a complex, a primitive, an enum, a type definition or an untyped type, or a collection of complex, primitive, enum types, or type definition. -EdmModel_Validator_Semantic_BoundOperationMustHaveParameters=The Bound operation '{0}' must have at least one parameter. -EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional=Required Parameter '{0}' must not follow an optional parameter. -EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType=The return type is not valid in operation '{0}'. The operation has an unsupported type. -EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet=The operation import '{0}' returns entities of type '{1}' that cannot exist in the entity set '{2}' specified for the operation import. -EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2=The operation import '{0}' returns entities of type '{1}' that cannot be returned by the entity set path specified for the operation import. -EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid=The operation import '{0}' specifies an entity set of kind '{1}' which is not supported in this context. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties. -EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid=The operation import '{0}' specifies an entity set expression which is not valid. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties. -EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType=The operation import '{0}' specifies an entity set but does not return entities. -EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation=The operation import '{0}' imports operation '{1}' that is bound. Only an unbound operation can be imported using an operation import. -EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument=The function import '{0}' should not be included in service document because it has parameter. -EdmModel_Validator_Semantic_FunctionMustHaveReturnType=The function '{0}' must specify a return type. -EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction=The UrlEscape function '{0}' must be a bound function. -EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter=The UrlEscape function '{0}' must have and only have one 'Edm.String' parameter. -EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate=Each parameter name in a operation must be unique. The parameter name '{0}' is already defined. -EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName=Each member name in an EntityContainer must be unique. A member with name '{0}' is already defined. -EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType=The function '{0}' has a different return type than other function overloads with the same name. Functions with the same name must have the same return type. -EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation=The unbound operation '{0}' has an entity set path defined. Entity set path can only be defined on bound operations. -EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName=The attribute '{0}' has an invalid value. The path doesn't contain the binding parameter name. -EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName=The attribute '{0}' is invalid. The first item of the path '{2}' is '{3}' which does not match the first parameter name {3}. The first segment of the entity set path is required to be the name of the first parameter. -EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType=The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that is not an entity type. -EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty=The attribute '{0}' has an invalid value. The path '{1}' has a navigation property segment '{2}' that is unknown. -EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment=The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment that doesn't derive from the entity type '{2}' for type segment '{3}'. -EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter=The attribute '{0}' has an invalid value. The path '{1}' has a binding parameter that references a type '{2}' that is not an entity type. -EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment=The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that cannot be found in the model. -EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid=The operation '{0}' has an entity set path and with an invalid return type. The return type is required to be an entity type or a collection of entity type. -EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable=The operation '{0}' entity set path determined entity type '{1}' is not assignable to the return type '{2}'. -EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType=The operation '{0}' entity set path was determined to be a reference property but the return type is a collection. -EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined=An element with the name '{0}' is already defined. -EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName=The member name '{0}' cannot be used in a type with the same name. Member names cannot be the same as their enclosing type. -EdmModel_Validator_Semantic_PropertyNameAlreadyDefined=Each property name in a type must be unique. Property name '{0}' is already defined. -EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind=The base type kind of a structured type must be the same as its derived type. -EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen=The base type of open type '{0}' is not open type. -EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity=The key property '{0}' must belong to the entity '{1}'. -EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey=The 'Edm.PrimitiveType' cannot be used as the type of a key property '{0}' of an entity type '{1}'. -EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType=The 'Edm.PrimitiveType' cannot be used as the underlying type of '{0}' type '{1}'. -EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity=The dependent property '{0}' must belong to the dependent entity '{1}'. -EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect=The property '{0}' cannot belong to a type other than its declaring type. -EdmModel_Validator_Semantic_InaccessibleType=The named type '{0}' could not be found from the model being validated. -EdmModel_Validator_Semantic_AmbiguousType=The named type '{0}' is ambiguous from the model being validated. -EdmModel_Validator_Semantic_InvalidNavigationPropertyType=The type of the navigation property '{0}' is invalid. The navigation target type must be an entity type or a collection of entity type. The navigation target entity type must match the declaring type of the partner property. -EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional=The target multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and it must have an optional target represented by a collection or a nullable entity type. -EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional=The nullability of the property '{0}' is invalid. If a complex typed property is of the same type (or base type) as its declaring type, then the property represents a recursive containment and the given property must be optional. -EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne=The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and the multiplicity of the navigation source must be zero or one. -EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne=The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is not the same as the target entity type, then the property represents a non-recursive containment and the multiplicity of the navigation source must be exactly one. -EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties=The complex type '{0}' is invalid. A complex type must contain at least one property. -EdmModel_Validator_Semantic_DuplicateDependentProperty=The dependent property '{0}' of navigation property '{1}' is a duplicate. -EdmModel_Validator_Semantic_ScaleOutOfRange=The scale value can range from 0 through the specified precision value. -EdmModel_Validator_Semantic_PrecisionOutOfRange=Precision cannot be negative. -EdmModel_Validator_Semantic_StringMaxLengthOutOfRange=The max length facet specifies the maximum length of an instance of the string type. For unicode equal to 'true', the max length can range from 1 to 2^30, or if 'false', 1 to 2^31. -EdmModel_Validator_Semantic_MaxLengthOutOfRange=Max length can range from 1 to 2^31. -EdmModel_Validator_Semantic_EnumMemberValueOutOfRange=The value of enum member '{0}' exceeds the range of its underlying type. -EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined=Each member name of an enum type must be unique. Enum member name '{0}' is already defined. -EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly=Only entity types can be open types. -EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull=The string reference is invalid because if 'IsUnbounded' is true 'MaxLength' must be null. -EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm=The declared name and namespace of the annotation must match the name and namespace of its xml value. -EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml=The value of an annotation marked to be serialized as an xml element must have a well-formed xml value. -EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue=The value of an annotation marked to be serialized as an xml element must be IEdmStringValue. -EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName=The value of an annotation marked to be serialized as an xml element must be a string representing an xml element with non-empty name and namespace. -EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType=Cannot assert the nullable type '{0}' as a non-nullable type. -EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType=Cannot promote the primitive type '{0}' to the specified primitive type '{1}'. -EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType=Null value cannot have a non-nullable type. -EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType=The type of the expression is incompatible with the asserted type. -EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType=A collection expression is incompatible with a non-collection type. -EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType=A primitive expression is incompatible with a non-primitive type. -EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType=A record expression is incompatible with a non-structured type. -EdmModel_Validator_Semantic_RecordExpressionMissingProperty=The record expression does not have a constructor for a property named '{0}'. -EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties=The type of the record expression is not open and does not contain a property named '{0}'. -EdmModel_Validator_Semantic_DuplicateAnnotation=The annotated element '{0}' has multiple annotations with the term '{1}' and the qualifier '{2}'. -EdmModel_Validator_Semantic_IncorrectNumberOfArguments=The function application provides '{0}' arguments, but the function '{1}' expects '{2}' arguments. -EdmModel_Validator_Semantic_DuplicateEntityContainerName=Each entity container name in a function must be unique. The name '{0}' is already defined. -EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType=The primitive expression is not compatible with the asserted type. -EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType=The enum expression is not compatible with the asserted type. -EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange=The value of the integer constant is out of range for the asserted type. -EdmModel_Validator_Semantic_StringConstantLengthOutOfRange=The value of the string constant is '{0}' characters long, but the max length of its type is '{1}'. -EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange=The value of the binary constant is '{0}' characters long, but the max length of its type is '{1}'. -EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone=A type without other errors must not have kind of none. -EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone=A schema element without other errors must not have kind of none. The kind of schema element '{0}' is none. -EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone=A property without other errors must not have kind of none. The kind of property '{0}' is none. -EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone=A primitive type without other errors must not have kind of none. The kind of primitive type '{0}' is none. -EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone=An entity container element without other errors must not have kind of none. The kind of entity container element '{0}' is none. -EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping=The entity set '{0}' should have only a single mapping for the property '{1}'. -EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional=The binding of the entity set or singleton '{0}' on navigation property '{1}' is invalid, the binding of bidirectional navigation property must be bidirectional if specified. -EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty=The entity set '{0}' is invalid because it is contained by more than one navigation property. -EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty=The type annotation is missing a binding for the property '{0}'. -EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties=They type of the type annotation is not open, and does not contain a property named '{0}'. -EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType=The underlying type of '{0}' is not valid. The underlying type of an enum type must be an integral type. -EdmModel_Validator_Semantic_InaccessibleTerm=The term '{0}' could not be found from the model being validated. -EdmModel_Validator_Semantic_InaccessibleTarget=The target '{0}' could not be found from the model being validated. -EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable=The target '{0}' of the annotation is not allowed in the AppliesTo '{1}' of the term '{2}'.". -EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique=An element already has a direct annotation with the namespace '{0}' and name '{1}'. -EdmModel_Validator_Semantic_NoEntitySetsFoundForType=The association set '{0}' cannot assume an entity set for the role '{2}' because there are no entity sets for the role type '{1}'. -EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType=The association set '{0}' must specify an entity set for the role '{2}' because there are multiple entity sets for the role type '{1}'. -EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet=Because the navigation property '{0}' is recursive, the mapping from the entity set '{1}' must point back to itself. -EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself=The navigation property '{0}' is invalid because it indirectly contains itself. -EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext=The path cannot be resolved in the given context. The segment '{0}' failed to resolve. -EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty=The entity set or singleton '{1}' is not a valid destination for the navigation property '{0}' because it cannot hold an element of the target entity type. -EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames=The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and unordered set of parameter names uniquely identifies a bound function. -EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes=The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and ordered set of parameter types uniquely identifies a bound function. -EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames=The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and unordered set of parameter names uniquely identifies an unbound function. -EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes=The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and ordered set of parameter types uniquely identifies an unbound function. -EdmModel_Validator_Semantic_ModelDuplicateBoundActions=The bound action '{0}' is a duplicate of other bound actions. For bound actions the combination of the namespace, name, and binding parameter type uniquely identifies an bound action. -EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions=The unbound action '{0}' is a duplicate of other unbound actions. For unbound actions the combination of the namespace, and name uniquely identifies an unbound action. -EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType=The bound function overload '{0}' does not have the same return type as other function overloads. Expected type '{1}'. -EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType=The type '{0}' of the entity set '{1}' is not valid, it must be collection of entity type. -EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType=The type '{0}' of the singleton '{1}' is not valid, it must be entity type. -EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton=The navigation property mapping '{0}' is invalid because its type is collection but target to a singleton '{1}'. -EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType=The type '{0}' cannot be the base type of an '{1}' type '{2}'. -EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType=The type '{0}' cannot be used as the type of a property '{1}'. -EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType=The type '{0}' cannot be used as the return type of a function '{1}'. -EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton=The type 'Edm.EntityType' cannot be used as the type of a singleton '{0}' in an entity container. -EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet=The type 'Edm.EntityType' cannot be used as the type of an entity set '{0}' in an entity container. -EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty=The declaring type '{0}' of {1} '{2}' cannot include path type property. -EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty=The type '{0}' of navigation property '{1}' on declaring type '{2}' cannot include path type property. - -;Error message for Syntactic validation rules -EdmModel_Validator_Syntactic_MissingName=The name is missing or not valid. -EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong=The specified name must not be longer than 480 characters: '{0}'. -EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed=The specified name is not allowed: '{0}'. -EdmModel_Validator_Syntactic_MissingNamespaceName=The namespace name is missing or not valid. -EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong=The specified name must not be longer than 480 characters: '{0}'. -EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed=The specified namespace name is not allowed: '{0}'. -EdmModel_Validator_Syntactic_PropertyMustNotBeNull=The value of the property '{0}.{1}' must not be null. -EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange=The property '{0}.{1}' of type '{2}' has value '{3}' that is not a valid enum member. -EdmModel_Validator_Syntactic_InterfaceKindValueMismatch=An object with the value '{0}' of the '{1}.{2}' property must implement '{3}' interface. -EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch=An object implementing '{0}' interface has type definition of kind '{1}'. The type reference interface must match to the kind of the definition. -EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected=The value '{0}' of the property '{1}.{2}' is not semantically valid. A semantically valid model must not contain elements of kind '{0}'. -EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements=The value of the enumeration the property '{0}.{1}' contains a null element. Enumeration properties must not contain null elements. -EdmModel_Validator_Syntactic_NavigationPartnerInvalid=The partner of the navigation property '{0}' must not be the same property, and must point back to the navigation property. -EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy=The chain of base types of type '{0}' is cyclic. - -;Error message for Serializer -Serializer_SingleFileExpected=Single file provided but model cannot be serialized into single file. -Serializer_UnknownEdmVersion=Unknown Edm version '{0}'. -Serializer_UnknownEdmxVersion=Unknown Edmx version '{0}'. -Serializer_NonInlineOperationImportReturnType=The operation import '{0}' could not be serialized because its return type cannot be represented inline. -Serializer_ReferencedTypeMustHaveValidName=A referenced type can not be serialized with an invalid name. The name '{0}' is invalid. -Serializer_OutOfLineAnnotationTargetMustHaveValidName=The annotation can not be serialized with an invalid target name. The name '{0}' is invalid. -Serializer_NoSchemasProduced=No CSDL is written because no schema elements could be produced. This is likely because the model is empty. - -XmlParser_EmptyFile={0} does not contain a schema definition, or the XmlReader provided started at the end of the file. -XmlParser_EmptySchemaTextReader=The source XmlReader does not contain a schema definition or started at the end of the file. -XmlParser_MissingAttribute=Required schema attribute '{0}' is not present on element '{1}'. -XmlParser_TextNotAllowed=The current schema element does not support text '{0}'. -XmlParser_UnexpectedAttribute=The attribute '{0}' was not expected in the given context. -XmlParser_UnexpectedElement=The schema element '{0}' was not expected in the given context. -XmlParser_UnusedElement=Unused schema element: '{0}'. -XmlParser_UnexpectedNodeType=Unexpected XML node type: {0}. -XmlParser_UnexpectedRootElement=The element '{0}' was unexpected for the root element. The root element should be {1}. -XmlParser_UnexpectedRootElementWrongNamespace=The namespace '{0}' is invalid. The root element is expected to belong to one of the following namespaces: '{1}'. -XmlParser_UnexpectedRootElementNoNamespace=The root element has no namespace. The root element is expected to belong to one of the following namespaces: '{0}'. - -; CSDL Parser -CsdlParser_InvalidEntitySetPathWithUnboundAction=The {0} '{1}' is invalid. The entitySetPath value is not allowed when IsBound attribute is false. -CsdlParser_InvalidAlias=The alias '{0}' is not a valid simple name. -CsdlParser_InvalidDeleteAction=The delete action '{0}' is not valid. Action must be: 'None', 'Cascade', or 'Restrict'. -CsdlParser_MissingTypeAttributeOrElement=An XML attribute or sub-element representing an EDM type is missing. -CsdlParser_InvalidEndRoleInRelationshipConstraint=There is no Role with name '{0}' defined in relationship '{1}'. -CsdlParser_InvalidMultiplicity=The multiplicity '{0}' is not valid. Multiplicity must be: '*', '0..1', or '1'. -CsdlParser_ReferentialConstraintRequiresOneDependent=Referential constraints requires one dependent role. Multiple dependent roles were specified for this referential constraint. -CsdlParser_ReferentialConstraintRequiresOnePrincipal=Referential constraints requires one principal role. Multiple principal roles were specified for this referential constraint. -CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands=If expression must contain 3 operands, the first being a boolean test, the second being being evaluated if the first is true, and the third being evaluated if the first is false. -CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands=The IsOf expression must contain 1 operand. -CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands=The Cast expression must contain 1 operand. -CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands=The LabeledElement expression must contain 1 operand. -CsdlParser_InvalidTypeName=The type name '{0}' is invalid. The type name must be that of a primitive type, a fully qualified name or an inline 'Collection' or 'Ref' type. -CsdlParser_InvalidQualifiedName=The qualified name '{0}' is invalid. A qualified name must have a valid namespace or alias, and a valid name. -CsdlParser_NoReadersProvided=A model could not be produced because no XML readers were provided. -CsdlParser_NullXmlReader=A model could not be produced because one of the XML readers was null. -CsdlParser_InvalidEntitySetPath='{0}' is not a valid entity set path. -CsdlParser_InvalidEnumMemberPath='{0}' is not a valid enum member path. -CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType=The 'Nullable' attribute cannot be specified for a navigation property with collection type. -CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer=Metadata document cannot have more than one entity container. -CsdlSemantics_ReferentialConstraintMismatch= There was a mismatch in the principal and dependent ends of the referential constraint. -CsdlSemantics_EnumMemberMustHaveValue=The enumeration member must have a value. -CsdlSemantics_ImpossibleAnnotationsTarget=The annotation target '{0}' could not be resolved because it cannot refer to an annotatable element. -CsdlSemantics_DuplicateAlias=The schema '{0}' contains the alias '{1}' more than once. - -; JsonParser -CsdlJsonParser_UnexpectedJsonValueKind=An unexpected '{0}' value kind was found when parsing the JSON path '{1}'. A '{2}' value kind was expected. -CsdlJsonParser_MissingMemberInObject=A member '{0}' is missing when parsing the JSON path '{1}'. -CsdlJsonParser_UnexpectedJsonMember=A member '{0}' with value type '{1}' is unexpected. -CsdlJsonParser_CannotReadValueAsType=Cannot read the value '{0}' at JSON path '{1}' as '{2}' numeric value. -CsdlJsonParser_MissingKindMember=A schema '{0}' object MUST contain the member '$Kind' with a string value of '{1}'. -CsdlJsonParser_MissingRequiredPropertyInObject=A property '{0}' is missing when parsing the JSON path '{1}'. -CsdlJsonParser_UnknownJsonElementValueKind=Found an unknown value kind '{0}' when parsing the JSON path '{1}'. -CsdlJsonParser_InvalidJsonNumberType=Cannot parse a JSON number '{0}' when parsing the JSON path '{1}'. -CsdlJsonParser_UnsupportedJsonMember=A member at JSON path '{0}' is not supported. -CsdlJsonParser_InvalidCsdlVersion=The version specified at '{0}' is not valid. It should be a string containing either '4.0' or '4.01'. -CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer=The schema object at '{0}' cannot have more than one entity container. - -;EdmxParser -EdmxParser_EdmxVersionMismatch=The EDMX version specified in the 'Version' attribute does not match the version corresponding to the namespace of the 'Edmx' element. -EdmxParser_BodyElement=Unexpected {0} element while parsing Edmx. Edmx is expected to have at most one of 'Runtime' or 'DataServices' elements. -EdmxParser_InvalidReferenceIncorrectNumberOfIncludes=edmx:Reference must contain at least one edmx:Includes or edmx:IncludeAnnotations. -EdmxParser_UnresolvedReferenceUriInEdmxReference=Unresolved Uri found in edmx:Reference, getReferencedModelReaderFunc should not return null when the URI is not a well-known schema. - -;EdxmParseException -EdmParseException_ErrorsEncounteredInEdmx=Encountered the following errors when parsing the CSDL document: \r\n{0} - -; Error message for the value parser -ValueParser_InvalidBoolean=The value '{0}' is not a valid boolean. The value must be 'true' or 'false'. -ValueParser_InvalidInteger=The value '{0}' is not a valid integer. The value must be a valid 32 bit integer. -ValueParser_InvalidLong=The value '{0}' is not a valid integer. The value must be a valid 64 bit integer. -ValueParser_InvalidFloatingPoint=The value '{0}' is not a valid floating point value. -ValueParser_InvalidMaxLength=The value '{0}' is not a valid integer. The value must be a valid 32 bit integer or 'Max'. -ValueParser_InvalidSrid=The value '{0}' is not a valid SRID. The value must either be a 32 bit integer or 'Variable'. -ValueParser_InvalidScale=The value '{0}' is not a valid scale. The value must either be a 32 bit integer or 'Variable'. -ValueParser_InvalidGuid=The value '{0}' is not a valid Guid. -ValueParser_InvalidDecimal=The value '{0}' is not a valid decimal. -ValueParser_InvalidDateTimeOffset=The value '{0}' is not a valid date time offset value. -ValueParser_InvalidDateTime=The value '{0}' is not a valid date time value. -ValueParser_InvalidDate=The value '{0}' is not a valid date value. -ValueParser_InvalidDuration=The value '{0}' is not a valid duration value. -ValueParser_InvalidBinary=The value '{0}' is not a valid binary value. The value must be a hexadecimal string and must not be prefixed by '0x'. -ValueParser_InvalidTimeOfDay=The value '{0}' is not a valid TimeOfDay value. - -;Unknown enumerated type value errors -UnknownEnumVal_Multiplicity=Invalid multiplicity: '{0}' -UnknownEnumVal_SchemaElementKind=Invalid schema element kind: '{0}' -UnknownEnumVal_TypeKind=Invalid type kind: '{0}' -UnknownEnumVal_PrimitiveKind=Invalid primitive kind: '{0}' -UnknownEnumVal_ContainerElementKind=Invalid container element kind: '{0}' -UnknownEnumVal_CsdlTarget=Invalid CSDL target: '{0}' -UnknownEnumVal_PropertyKind=Invalid property kind: '{0}' -UnknownEnumVal_ExpressionKind=Invalid expression kind: '{0}' - -; Error message for 'Bad' types -Bad_AmbiguousElementBinding=The name '{0}' is ambiguous. -Bad_UnresolvedType=The type '{0}' could not be found. -Bad_UnresolvedComplexType=The complex type '{0}' could not be found. -Bad_UnresolvedEntityType=The entity type '{0}' could not be found. -Bad_UnresolvedPrimitiveType=The primitive type '{0}' could not be found. -Bad_UnresolvedOperation=The operation '{0}' could not be found. -Bad_AmbiguousOperation=The operation '{0}' could not be resolved because more than one operation could be used for this application. -Bad_OperationParametersDontMatch=The operation '{0}' could not be resolved because none of the operations with that name take the correct set of parameters. -Bad_UnresolvedEntitySet=The entity set '{0}' could not be found. -Bad_UnresolvedEntityContainer=The entity container '{0}' could not be found. -Bad_UnresolvedEnumType=The enum type '{0}' could not be found. -Bad_UnresolvedEnumMember=The enum member '{0}' could not be found. -Bad_UnresolvedProperty=The property '{0}' could not be found. -Bad_UnresolvedParameter=The parameter '{0}' could not be found. -Bad_UnresolvedReturn=The return of operation '{0}' could not be found. -Bad_UnresolvedLabeledElement=The labeled element '{0}' could not be found. -Bad_CyclicEntity=The entity '{0}' is invalid because its base type is cyclic. -Bad_CyclicComplex=The complex type '{0}' is invalid because its base type is cyclic. -Bad_CyclicEntityContainer=The entity container '{0}' is invalid because its extends hierarchy is cyclic. -Bad_UnresolvedNavigationPropertyPath=A navigation property could not be found for the path '{0}' starting from the type '{1}'. - -; Error messages for validation rulesets -RuleSet_DuplicateRulesExistInRuleSet=The same rule cannot be in the same rule set twice. - -; Error messages for EDM to CLR conversion -EdmToClr_UnsupportedType=Conversion of EDM values to a CLR type with type {0} is not supported. -EdmToClr_StructuredValueMappedToNonClass=Conversion of an EDM structured value is supported only to a CLR class. -EdmToClr_IEnumerableOfTPropertyAlreadyHasValue=Cannot initialize a property '{0}' on an object of type '{1}'. The property already has a value. -EdmToClr_StructuredPropertyDuplicateValue=An EDM structured value contains multiple values for the property '{0}'. Conversion of an EDM structured value with duplicate property values is not supported. -EdmToClr_CannotConvertEdmValueToClrType=Conversion of an EDM value of the type '{0}' to the CLR type '{1}' is not supported. -EdmToClr_CannotConvertEdmCollectionValueToClrType=Conversion of an edm collection value to the CLR type '{0}' is not supported. EDM collection values can be converted to System.Collections.Generic.IEnumerable, System.Collections.Generic.IList or System.Collections.Generic.ICollection. -EdmToClr_TryCreateObjectInstanceReturnedWrongObject=The type '{0}' of the object returned by the TryCreateObjectInstance delegate is not assignable to the expected type '{1}'. - -;Error message for EdmUtil class -EdmUtil_NullValueForMimeTypeAnnotation=The MIME type annotation must not have a null value. -EdmUtil_InvalidAnnotationValue=An annotation of type string was expected for the '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' annotation, but an annotation of type '{1}' was found. - -; Note: The below list of error messages are common to the ODataLib, EdmLib, Spatial, Server and Client projects. -PlatformHelper_DateTimeOffsetMustContainTimeZone=The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. - -;Error message for Build-in type -Date_InvalidAddedOrSubtractedResults=The added or subtracted value results in an un-representable Date. -Date_InvalidDateParameters=The Year '{0}', Month '{1}' and Day '{2}' parameters describe an un-representable Date. -Date_InvalidParsingString=String '{0}' was not recognized as a valid Date. -Date_InvalidCompareToTarget=Target object '{0}' is not an instance with type of Date. -TimeOfDay_InvalidTimeOfDayParameters=The Hour '{0}', Minute '{1}', Second '{2}' and Millisecond '{3}' parameters describe an un-representable TimeOfDay. -TimeOfDay_TicksOutOfRange=The ticks value '{0}' is out of representable TimeOfDay range. -TimeOfDay_ConvertErrorFromTimeSpan=The TimeSpan value '{0}' is out of representable TimeOfDay range. -TimeOfDay_InvalidParsingString=String '{0}' was not recognized as a valid TimeOfDay. -TimeOfDay_InvalidCompareToTarget=Target object '{0}' is not an instance with type of TimeOfDay. -EdmVocabularyAnnotations_DidNotFindDefaultValue=Annotation expressions must specify a value or use a term with a specified default value. Cannot find a default value for the given annotation term, '{0}'. -EdmVocabularyAnnotations_TermTypeNotSupported=Term type '{0}' is not supported for value retrieval. -EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation=Invalid to set inline location for a path target '{0}'. diff --git a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs b/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs deleted file mode 100644 index cf46b2b0dd..0000000000 --- a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.cs +++ /dev/null @@ -1,2724 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -namespace Microsoft.OData.Edm { - using System; - using System.Resources; - - /// - /// Strongly-typed and parameterized string resources. - /// - internal static class Strings { - /// - /// A string like "Unexpected primitive type kind." - /// - internal static string EdmPrimitive_UnexpectedKind - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmPrimitive_UnexpectedKind); - } - } - - /// - /// A string like "Unexpected path type kind." - /// - internal static string EdmPath_UnexpectedKind - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmPath_UnexpectedKind); - } - } - - /// - /// A string like "Annotation of type '{0}' cannot be interpreted as '{1}'." - /// - internal static string Annotations_TypeMismatch(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Annotations_TypeMismatch, p0, p1); - } - - /// - /// A string like "The annotation must have non-null target." - /// - internal static string Constructable_VocabularyAnnotationMustHaveTarget - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Constructable_VocabularyAnnotationMustHaveTarget); - } - } - - /// - /// A string like "An entity type or a collection of an entity type is expected." - /// - internal static string Constructable_EntityTypeOrCollectionOfEntityTypeExpected - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Constructable_EntityTypeOrCollectionOfEntityTypeExpected); - } - } - - /// - /// A string like "Navigation target entity type must be '{0}'." - /// - internal static string Constructable_TargetMustBeStock(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Constructable_TargetMustBeStock, p0); - } - - /// - /// A string like "The type '{0}' could not be converted to be a '{1}' type." - /// - internal static string TypeSemantics_CouldNotConvertTypeReference(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TypeSemantics_CouldNotConvertTypeReference, p0, p1); - } - - /// - /// A string like "An element with type 'None' cannot be used in a model." - /// - internal static string EdmModel_CannotUseElementWithTypeNone - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_CannotUseElementWithTypeNone); - } - } - - /// - /// A string like "Cannot add more than one entity container to an edm model." - /// - internal static string EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel); - } - } - - /// - /// A string like "An element with type 'None' cannot be used in an entity container." - /// - internal static string EdmEntityContainer_CannotUseElementWithTypeNone - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmEntityContainer_CannotUseElementWithTypeNone); - } - } - - /// - /// A string like "The value writer cannot write a value of kind '{0}'." - /// - internal static string ValueWriter_NonSerializableValue(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueWriter_NonSerializableValue, p0); - } - - /// - /// A string like "Value has already been set." - /// - internal static string ValueHasAlreadyBeenSet - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueHasAlreadyBeenSet); - } - } - - /// - /// A string like "Path segments must not contain '/' character." - /// - internal static string PathSegmentMustNotContainSlash - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.PathSegmentMustNotContainSlash); - } - } - - /// - /// A string like "The number of dependent properties must match the number of key properties on the principal entity type. '{0}' principal properties were provided, but {1} dependent properties were provided." - /// - internal static string Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType, p0, p1); - } - - /// - /// A string like "Unexpected Edm type." - /// - internal static string EdmType_UnexpectedEdmType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmType_UnexpectedEdmType); - } - } - - /// - /// A string like "The navigation property binding path is not valid." - /// - internal static string NavigationPropertyBinding_PathIsNotValid - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.NavigationPropertyBinding_PathIsNotValid); - } - } - - /// - /// A string like "More than one properties match the name '{0}' were found in type '{1}'." - /// - internal static string MultipleMatchingPropertiesFound(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.MultipleMatchingPropertiesFound, p0, p1); - } - - /// - /// A string like "First segment must be IEdmEntityContainer." - /// - internal static string TargetPath_FirstSegmentMustBeIEdmEntityContainer - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TargetPath_FirstSegmentMustBeIEdmEntityContainer); - } - } - - /// - /// A string like "Second segment must be IEdmEntityContainerElement." - /// - internal static string TargetPath_SecondSegmentMustBeIEdmEntityContainerElement - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement); - } - } - - /// - /// A string like "Target path segments must not contain a null segment." - /// - internal static string TargetPath_SegmentsMustNotContainNullSegment - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TargetPath_SegmentsMustNotContainNullSegment); - } - } - - /// - /// A string like "Encountered invalid type cast. '{0}' is not assignable from '{1}'." - /// - internal static string TypeCast_HierarchyNotFollowed(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TypeCast_HierarchyNotFollowed, p0, p1); - } - - /// - /// A string like "Type '{0}' must have a single type annotation with term type '{1}'." - /// - internal static string Edm_Evaluator_NoTermTypeAnnotationOnType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_NoTermTypeAnnotationOnType, p0, p1); - } - - /// - /// A string like "Type '{0}' must have a single annotation with term '{1}'." - /// - internal static string Edm_Evaluator_NoValueAnnotationOnType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_NoValueAnnotationOnType, p0, p1); - } - - /// - /// A string like "Element must have a single annotation with term '{0}'." - /// - internal static string Edm_Evaluator_NoValueAnnotationOnElement(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_NoValueAnnotationOnElement, p0); - } - - /// - /// A string like "Expression with kind '{0}' cannot be evaluated." - /// - internal static string Edm_Evaluator_UnrecognizedExpressionKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_UnrecognizedExpressionKind, p0); - } - - /// - /// A string like "Function '{0}' is not present in the execution environment." - /// - internal static string Edm_Evaluator_UnboundFunction(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_UnboundFunction, p0); - } - - /// - /// A string like "Path segment '{0}' has no binding in the execution environment." - /// - internal static string Edm_Evaluator_UnboundPath(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_UnboundPath, p0); - } - - /// - /// A string like "A containing object cannot be null when getting value of an annotation with Path in the execution environment." - /// - internal static string Edm_Evaluator_NoContextPath - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_NoContextPath); - } - } - - /// - /// A string like "Value fails to match type '{0}'." - /// - internal static string Edm_Evaluator_FailedTypeAssertion(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_FailedTypeAssertion, p0); - } - - /// - /// A string like "An edm model must be provided for type cast." - /// - internal static string Edm_Evaluator_TypeCastNeedsEdmModel - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Edm_Evaluator_TypeCastNeedsEdmModel); - } - } - - /// - /// A string like "The namespace '{0}' is a system namespace and cannot be used by non-system types. Please choose a different namespace." - /// - internal static string EdmModel_Validator_Semantic_SystemNamespaceEncountered(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_SystemNamespaceEncountered, p0); - } - - /// - /// A string like "The entity set or singleton '{0}' is based on type '{1}' that has no keys defined." - /// - internal static string EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys, p0, p1); - } - - /// - /// A string like "An end with the name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_DuplicateEndName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateEndName, p0); - } - - /// - /// A string like "The key specified in entity type '{0}' is not valid. Property '{1}' is referenced more than once in the key element." - /// - internal static string EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey, p0, p1); - } - - /// - /// A string like "The complex type '{0}' is marked as abstract. Abstract complex types are only supported in version 1.1 EDM models." - /// - internal static string EdmModel_Validator_Semantic_InvalidComplexTypeAbstract(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidComplexTypeAbstract, p0); - } - - /// - /// A string like "The complex type '{0}' has a base type specified. Complex type inheritance is only supported in version 1.1 EDM models." - /// - internal static string EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic, p0); - } - - /// - /// A string like "The key part '{0}' for type '{1}' is not valid. All parts of the key must be non nullable." - /// - internal static string EdmModel_Validator_Semantic_InvalidKeyNullablePart(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidKeyNullablePart, p0, p1); - } - - /// - /// A string like "The property '{0}' in entity type '{1}' is not valid. All properties that are part of the entity key must be of primitive type." - /// - internal static string EdmModel_Validator_Semantic_EntityKeyMustBeScalar(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntityKeyMustBeScalar, p0, p1); - } - - /// - /// A string like "The entity type '{0}' has more than one composable escape functions '{1}' defined." - /// - internal static string EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne, p0, p1); - } - - /// - /// A string like "The entity type '{0}' has more than one non-composable escape functions '{1}' defined." - /// - internal static string EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne, p0, p1); - } - - /// - /// A string like "The key usage is not valid. '{0}' cannot define keys because one of its base classes '{1}' defines keys." - /// - internal static string EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass, p0, p1); - } - - /// - /// A string like "The entity type '{0}' has no key defined. Define the key for this entity type." - /// - internal static string EdmModel_Validator_Semantic_KeyMissingOnEntityType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_KeyMissingOnEntityType, p0); - } - - /// - /// A string like "The navigation property '{0}' is not valid. The role '{1}' is not defined in relationship '{2}'." - /// - internal static string EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole, p0, p1, p2); - } - - /// - /// A string like "The navigation property '{0}'is not valid. The from role and to role are the same." - /// - internal static string EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame, p0); - } - - /// - /// A string like "The navigation property type could not be determined from the role '{0}'." - /// - internal static string EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType, p0); - } - - /// - /// A string like "An on delete action can only be specified on one end of an association." - /// - internal static string EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation); - } - } - - /// - /// A string like "The navigation property '{0}' cannot have 'OnDelete' specified since its multiplicity is '*'." - /// - internal static string EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified, p0); - } - - /// - /// A string like "Each name and plural name in a relationship must be unique. '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate, p0); - } - - /// - /// A string like "In relationship '{0}', the principal and dependent role of the referential constraint refers to the same role in the relationship type." - /// - internal static string EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint, p0); - } - - /// - /// A string like "The principal navigation property '{0}' has an invalid multiplicity. Valid values for the multiplicity of a principal end are '0..1' or '1'." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne, p0); - } - - /// - /// A string like "Because all dependent properties of the navigation '{0}' are non-nullable, the multiplicity of the principal end must be '1'." - /// - internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable, p0); - } - - /// - /// A string like "Because all dependent properties of the navigation '{0}' are nullable, the multiplicity of the principal end must be '0..1'." - /// - internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable, p0); - } - - /// - /// A string like "The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties represent the dependent end key, the multiplicity of the dependent end must be '0..1' or '1'." - /// - internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne, p0); - } - - /// - /// A string like "The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties don't represent the dependent end key, the the multiplicity of the dependent end must be '*'." - /// - internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany, p0); - } - - /// - /// A string like "The number of properties in the dependent and principal role in a relationship constraint must be exactly identical." - /// - internal static string EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint); - } - } - - /// - /// A string like "The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint." - /// - internal static string EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint, p0, p1, p2, p3); - } - - /// - /// A string like "There is no property with name '{0}' defined in the type referred to by role '{1}'." - /// - internal static string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd, p0, p1); - } - - /// - /// A string like "The principal end properties in the referential constraint of the association '{0}' do not match the key of the type referred to by role '{1}'." - /// - internal static string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd, p0, p1); - } - - /// - /// A string like "A property cannot be of type '{0}'. The property type must be a complex, a primitive, an enum, a type definition or an untyped type, or a collection of complex, primitive, enum types, or type definition." - /// - internal static string EdmModel_Validator_Semantic_InvalidPropertyType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidPropertyType, p0); - } - - /// - /// A string like "The Bound operation '{0}' must have at least one parameter." - /// - internal static string EdmModel_Validator_Semantic_BoundOperationMustHaveParameters(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters, p0); - } - - /// - /// A string like "Required Parameter '{0}' must not follow an optional parameter." - /// - internal static string EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional, p0); - } - - /// - /// A string like "The return type is not valid in operation '{0}'. The operation has an unsupported type." - /// - internal static string EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType, p0); - } - - /// - /// A string like "The operation import '{0}' returns entities of type '{1}' that cannot exist in the entity set '{2}' specified for the operation import." - /// - internal static string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet, p0, p1, p2); - } - - /// - /// A string like "The operation import '{0}' returns entities of type '{1}' that cannot be returned by the entity set path specified for the operation import." - /// - internal static string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2, p0, p1); - } - - /// - /// A string like "The operation import '{0}' specifies an entity set of kind '{1}' which is not supported in this context. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties." - /// - internal static string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid, p0, p1); - } - - /// - /// A string like "The operation import '{0}' specifies an entity set expression which is not valid. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties." - /// - internal static string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, p0); - } - - /// - /// A string like "The operation import '{0}' specifies an entity set but does not return entities." - /// - internal static string EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType, p0); - } - - /// - /// A string like "The operation import '{0}' imports operation '{1}' that is bound. Only an unbound operation can be imported using an operation import." - /// - internal static string EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation, p0, p1); - } - - /// - /// A string like "The function import '{0}' should not be included in service document because it has parameter." - /// - internal static string EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument, p0); - } - - /// - /// A string like "The function '{0}' must specify a return type." - /// - internal static string EdmModel_Validator_Semantic_FunctionMustHaveReturnType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_FunctionMustHaveReturnType, p0); - } - - /// - /// A string like "The UrlEscape function '{0}' must be a bound function." - /// - internal static string EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction, p0); - } - - /// - /// A string like "The UrlEscape function '{0}' must have and only have one 'Edm.String' parameter." - /// - internal static string EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter, p0); - } - - /// - /// A string like "Each parameter name in a operation must be unique. The parameter name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate, p0); - } - - /// - /// A string like "Each member name in an EntityContainer must be unique. A member with name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, p0); - } - - /// - /// A string like "The function '{0}' has a different return type than other function overloads with the same name. Functions with the same name must have the same return type." - /// - internal static string EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType, p0); - } - - /// - /// A string like "The unbound operation '{0}' has an entity set path defined. Entity set path can only be defined on bound operations." - /// - internal static string EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation, p0); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path doesn't contain the binding parameter name." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName, p0); - } - - /// - /// A string like "The attribute '{0}' is invalid. The first item of the path '{2}' is '{3}' which does not match the first parameter name {3}. The first segment of the entity set path is required to be the name of the first parameter." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName, p0, p1, p2, p3); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that is not an entity type." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType, p0, p1, p2); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path '{1}' has a navigation property segment '{2}' that is unknown." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty, p0, p1, p2); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment that doesn't derive from the entity type '{2}' for type segment '{3}'." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment, p0, p1, p2, p3); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path '{1}' has a binding parameter that references a type '{2}' that is not an entity type." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter, p0, p1, p2); - } - - /// - /// A string like "The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that cannot be found in the model." - /// - internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment, p0, p1, p2); - } - - /// - /// A string like "The operation '{0}' has an entity set path and with an invalid return type. The return type is required to be an entity type or a collection of entity type." - /// - internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid, p0); - } - - /// - /// A string like "The operation '{0}' entity set path determined entity type '{1}' is not assignable to the return type '{2}'." - /// - internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, p0, p1, p2); - } - - /// - /// A string like "The operation '{0}' entity set path was determined to be a reference property but the return type is a collection." - /// - internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, p0); - } - - /// - /// A string like "An element with the name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined, p0); - } - - /// - /// A string like "The member name '{0}' cannot be used in a type with the same name. Member names cannot be the same as their enclosing type." - /// - internal static string EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName, p0); - } - - /// - /// A string like "Each property name in a type must be unique. Property name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_PropertyNameAlreadyDefined(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PropertyNameAlreadyDefined, p0); - } - - /// - /// A string like "The base type kind of a structured type must be the same as its derived type." - /// - internal static string EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind); - } - } - - /// - /// A string like "The base type of open type '{0}' is not open type." - /// - internal static string EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen, p0); - } - - /// - /// A string like "The key property '{0}' must belong to the entity '{1}'." - /// - internal static string EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity, p0, p1); - } - - /// - /// A string like "The 'Edm.PrimitiveType' cannot be used as the type of a key property '{0}' of an entity type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey, p0, p1); - } - - /// - /// A string like "The 'Edm.PrimitiveType' cannot be used as the underlying type of '{0}' type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType, p0, p1); - } - - /// - /// A string like "The dependent property '{0}' must belong to the dependent entity '{1}'." - /// - internal static string EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity, p0, p1); - } - - /// - /// A string like "The property '{0}' cannot belong to a type other than its declaring type." - /// - internal static string EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect, p0); - } - - /// - /// A string like "The named type '{0}' could not be found from the model being validated." - /// - internal static string EdmModel_Validator_Semantic_InaccessibleType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InaccessibleType, p0); - } - - /// - /// A string like "The named type '{0}' is ambiguous from the model being validated." - /// - internal static string EdmModel_Validator_Semantic_AmbiguousType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_AmbiguousType, p0); - } - - /// - /// A string like "The type of the navigation property '{0}' is invalid. The navigation target type must be an entity type or a collection of entity type. The navigation target entity type must match the declaring type of the partner property." - /// - internal static string EdmModel_Validator_Semantic_InvalidNavigationPropertyType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidNavigationPropertyType, p0); - } - - /// - /// A string like "The target multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and it must have an optional target represented by a collection or a nullable entity type." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional, p0); - } - - /// - /// A string like "The nullability of the property '{0}' is invalid. If a complex typed property is of the same type (or base type) as its declaring type, then the property represents a recursive containment and the given property must be optional." - /// - internal static string EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, p0); - } - - /// - /// A string like "The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and the multiplicity of the navigation source must be zero or one." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne, p0); - } - - /// - /// A string like "The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is not the same as the target entity type, then the property represents a non-recursive containment and the multiplicity of the navigation source must be exactly one." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne, p0); - } - - /// - /// A string like "The complex type '{0}' is invalid. A complex type must contain at least one property." - /// - internal static string EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties, p0); - } - - /// - /// A string like "The dependent property '{0}' of navigation property '{1}' is a duplicate." - /// - internal static string EdmModel_Validator_Semantic_DuplicateDependentProperty(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateDependentProperty, p0, p1); - } - - /// - /// A string like "The scale value can range from 0 through the specified precision value." - /// - internal static string EdmModel_Validator_Semantic_ScaleOutOfRange - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ScaleOutOfRange); - } - } - - /// - /// A string like "Precision cannot be negative." - /// - internal static string EdmModel_Validator_Semantic_PrecisionOutOfRange - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PrecisionOutOfRange); - } - } - - /// - /// A string like "The max length facet specifies the maximum length of an instance of the string type. For unicode equal to 'true', the max length can range from 1 to 2^30, or if 'false', 1 to 2^31." - /// - internal static string EdmModel_Validator_Semantic_StringMaxLengthOutOfRange - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_StringMaxLengthOutOfRange); - } - } - - /// - /// A string like "Max length can range from 1 to 2^31." - /// - internal static string EdmModel_Validator_Semantic_MaxLengthOutOfRange - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_MaxLengthOutOfRange); - } - } - - /// - /// A string like "The value of enum member '{0}' exceeds the range of its underlying type." - /// - internal static string EdmModel_Validator_Semantic_EnumMemberValueOutOfRange(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EnumMemberValueOutOfRange, p0); - } - - /// - /// A string like "Each member name of an enum type must be unique. Enum member name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined, p0); - } - - /// - /// A string like "Only entity types can be open types." - /// - internal static string EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly); - } - } - - /// - /// A string like "The string reference is invalid because if 'IsUnbounded' is true 'MaxLength' must be null." - /// - internal static string EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); - } - } - - /// - /// A string like "The declared name and namespace of the annotation must match the name and namespace of its xml value." - /// - internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm); - } - } - - /// - /// A string like "The value of an annotation marked to be serialized as an xml element must have a well-formed xml value." - /// - internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml); - } - } - - /// - /// A string like "The value of an annotation marked to be serialized as an xml element must be IEdmStringValue." - /// - internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue); - } - } - - /// - /// A string like "The value of an annotation marked to be serialized as an xml element must be a string representing an xml element with non-empty name and namespace." - /// - internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName); - } - } - - /// - /// A string like "Cannot assert the nullable type '{0}' as a non-nullable type." - /// - internal static string EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType, p0); - } - - /// - /// A string like "Cannot promote the primitive type '{0}' to the specified primitive type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType, p0, p1); - } - - /// - /// A string like "Null value cannot have a non-nullable type." - /// - internal static string EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType); - } - } - - /// - /// A string like "The type of the expression is incompatible with the asserted type." - /// - internal static string EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType); - } - } - - /// - /// A string like "A collection expression is incompatible with a non-collection type." - /// - internal static string EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType); - } - } - - /// - /// A string like "A primitive expression is incompatible with a non-primitive type." - /// - internal static string EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType); - } - } - - /// - /// A string like "A record expression is incompatible with a non-structured type." - /// - internal static string EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType); - } - } - - /// - /// A string like "The record expression does not have a constructor for a property named '{0}'." - /// - internal static string EdmModel_Validator_Semantic_RecordExpressionMissingProperty(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_RecordExpressionMissingProperty, p0); - } - - /// - /// A string like "The type of the record expression is not open and does not contain a property named '{0}'." - /// - internal static string EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties, p0); - } - - /// - /// A string like "The annotated element '{0}' has multiple annotations with the term '{1}' and the qualifier '{2}'." - /// - internal static string EdmModel_Validator_Semantic_DuplicateAnnotation(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateAnnotation, p0, p1, p2); - } - - /// - /// A string like "The function application provides '{0}' arguments, but the function '{1}' expects '{2}' arguments." - /// - internal static string EdmModel_Validator_Semantic_IncorrectNumberOfArguments(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_IncorrectNumberOfArguments, p0, p1, p2); - } - - /// - /// A string like "Each entity container name in a function must be unique. The name '{0}' is already defined." - /// - internal static string EdmModel_Validator_Semantic_DuplicateEntityContainerName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateEntityContainerName, p0); - } - - /// - /// A string like "The primitive expression is not compatible with the asserted type." - /// - internal static string EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType); - } - } - - /// - /// A string like "The enum expression is not compatible with the asserted type." - /// - internal static string EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType); - } - } - - /// - /// A string like "The value of the integer constant is out of range for the asserted type." - /// - internal static string EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange); - } - } - - /// - /// A string like "The value of the string constant is '{0}' characters long, but the max length of its type is '{1}'." - /// - internal static string EdmModel_Validator_Semantic_StringConstantLengthOutOfRange(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_StringConstantLengthOutOfRange, p0, p1); - } - - /// - /// A string like "The value of the binary constant is '{0}' characters long, but the max length of its type is '{1}'." - /// - internal static string EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange, p0, p1); - } - - /// - /// A string like "A type without other errors must not have kind of none." - /// - internal static string EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone); - } - } - - /// - /// A string like "A schema element without other errors must not have kind of none. The kind of schema element '{0}' is none." - /// - internal static string EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone, p0); - } - - /// - /// A string like "A property without other errors must not have kind of none. The kind of property '{0}' is none." - /// - internal static string EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone, p0); - } - - /// - /// A string like "A primitive type without other errors must not have kind of none. The kind of primitive type '{0}' is none." - /// - internal static string EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone, p0); - } - - /// - /// A string like "An entity container element without other errors must not have kind of none. The kind of entity container element '{0}' is none." - /// - internal static string EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone, p0); - } - - /// - /// A string like "The entity set '{0}' should have only a single mapping for the property '{1}'." - /// - internal static string EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping, p0, p1); - } - - /// - /// A string like "The binding of the entity set or singleton '{0}' on navigation property '{1}' is invalid, the binding of bidirectional navigation property must be bidirectional if specified." - /// - internal static string EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional, p0, p1); - } - - /// - /// A string like "The entity set '{0}' is invalid because it is contained by more than one navigation property." - /// - internal static string EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty, p0); - } - - /// - /// A string like "The type annotation is missing a binding for the property '{0}'." - /// - internal static string EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty, p0); - } - - /// - /// A string like "They type of the type annotation is not open, and does not contain a property named '{0}'." - /// - internal static string EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties, p0); - } - - /// - /// A string like "The underlying type of '{0}' is not valid. The underlying type of an enum type must be an integral type." - /// - internal static string EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType, p0); - } - - /// - /// A string like "The term '{0}' could not be found from the model being validated." - /// - internal static string EdmModel_Validator_Semantic_InaccessibleTerm(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InaccessibleTerm, p0); - } - - /// - /// A string like "The target '{0}' could not be found from the model being validated." - /// - internal static string EdmModel_Validator_Semantic_InaccessibleTarget(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_InaccessibleTarget, p0); - } - - /// - /// A string like "The target '{0}' of the annotation is not allowed in the AppliesTo '{1}' of the term '{2}'."." - /// - internal static string EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable, p0, p1, p2); - } - - /// - /// A string like "An element already has a direct annotation with the namespace '{0}' and name '{1}'." - /// - internal static string EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique, p0, p1); - } - - /// - /// A string like "The association set '{0}' cannot assume an entity set for the role '{2}' because there are no entity sets for the role type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_NoEntitySetsFoundForType(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NoEntitySetsFoundForType, p0, p1, p2); - } - - /// - /// A string like "The association set '{0}' must specify an entity set for the role '{2}' because there are multiple entity sets for the role type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType, p0, p1, p2); - } - - /// - /// A string like "Because the navigation property '{0}' is recursive, the mapping from the entity set '{1}' must point back to itself." - /// - internal static string EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet, p0, p1); - } - - /// - /// A string like "The navigation property '{0}' is invalid because it indirectly contains itself." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself, p0); - } - - /// - /// A string like "The path cannot be resolved in the given context. The segment '{0}' failed to resolve." - /// - internal static string EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext, p0); - } - - /// - /// A string like "The entity set or singleton '{1}' is not a valid destination for the navigation property '{0}' because it cannot hold an element of the target entity type." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty, p0, p1); - } - - /// - /// A string like "The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and unordered set of parameter names uniquely identifies a bound function." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames, p0); - } - - /// - /// A string like "The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and ordered set of parameter types uniquely identifies a bound function." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, p0); - } - - /// - /// A string like "The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and unordered set of parameter names uniquely identifies an unbound function." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames, p0); - } - - /// - /// A string like "The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and ordered set of parameter types uniquely identifies an unbound function." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes, p0); - } - - /// - /// A string like "The bound action '{0}' is a duplicate of other bound actions. For bound actions the combination of the namespace, name, and binding parameter type uniquely identifies an bound action." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundActions(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateBoundActions, p0); - } - - /// - /// A string like "The unbound action '{0}' is a duplicate of other unbound actions. For unbound actions the combination of the namespace, and name uniquely identifies an unbound action." - /// - internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions, p0); - } - - /// - /// A string like "The bound function overload '{0}' does not have the same return type as other function overloads. Expected type '{1}'." - /// - internal static string EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType, p0, p1); - } - - /// - /// A string like "The type '{0}' of the entity set '{1}' is not valid, it must be collection of entity type." - /// - internal static string EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType, p0, p1); - } - - /// - /// A string like "The type '{0}' of the singleton '{1}' is not valid, it must be entity type." - /// - internal static string EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType, p0, p1); - } - - /// - /// A string like "The navigation property mapping '{0}' is invalid because its type is collection but target to a singleton '{1}'." - /// - internal static string EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton, p0, p1); - } - - /// - /// A string like "The type '{0}' cannot be the base type of an '{1}' type '{2}'." - /// - internal static string EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType, p0, p1, p2); - } - - /// - /// A string like "The type '{0}' cannot be used as the type of a property '{1}'." - /// - internal static string EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType, p0, p1); - } - - /// - /// A string like "The type '{0}' cannot be used as the return type of a function '{1}'." - /// - internal static string EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType, p0, p1); - } - - /// - /// A string like "The type 'Edm.EntityType' cannot be used as the type of a singleton '{0}' in an entity container." - /// - internal static string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton, p0); - } - - /// - /// A string like "The type 'Edm.EntityType' cannot be used as the type of an entity set '{0}' in an entity container." - /// - internal static string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet, p0); - } - - /// - /// A string like "The declaring type '{0}' of {1} '{2}' cannot include path type property." - /// - internal static string EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, p0, p1, p2); - } - - /// - /// A string like "The type '{0}' of navigation property '{1}' on declaring type '{2}' cannot include path type property." - /// - internal static string EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty, p0, p1, p2); - } - - /// - /// A string like "The name is missing or not valid." - /// - internal static string EdmModel_Validator_Syntactic_MissingName - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_MissingName); - } - } - - /// - /// A string like "The specified name must not be longer than 480 characters: '{0}'." - /// - internal static string EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong, p0); - } - - /// - /// A string like "The specified name is not allowed: '{0}'." - /// - internal static string EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed, p0); - } - - /// - /// A string like "The namespace name is missing or not valid." - /// - internal static string EdmModel_Validator_Syntactic_MissingNamespaceName - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_MissingNamespaceName); - } - } - - /// - /// A string like "The specified name must not be longer than 480 characters: '{0}'." - /// - internal static string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong, p0); - } - - /// - /// A string like "The specified namespace name is not allowed: '{0}'." - /// - internal static string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed, p0); - } - - /// - /// A string like "The value of the property '{0}.{1}' must not be null." - /// - internal static string EdmModel_Validator_Syntactic_PropertyMustNotBeNull(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_PropertyMustNotBeNull, p0, p1); - } - - /// - /// A string like "The property '{0}.{1}' of type '{2}' has value '{3}' that is not a valid enum member." - /// - internal static string EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange, p0, p1, p2, p3); - } - - /// - /// A string like "An object with the value '{0}' of the '{1}.{2}' property must implement '{3}' interface." - /// - internal static string EdmModel_Validator_Syntactic_InterfaceKindValueMismatch(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_InterfaceKindValueMismatch, p0, p1, p2, p3); - } - - /// - /// A string like "An object implementing '{0}' interface has type definition of kind '{1}'. The type reference interface must match to the kind of the definition." - /// - internal static string EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch, p0, p1); - } - - /// - /// A string like "The value '{0}' of the property '{1}.{2}' is not semantically valid. A semantically valid model must not contain elements of kind '{0}'." - /// - internal static string EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected, p0, p1, p2); - } - - /// - /// A string like "The value of the enumeration the property '{0}.{1}' contains a null element. Enumeration properties must not contain null elements." - /// - internal static string EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements, p0, p1); - } - - /// - /// A string like "The partner of the navigation property '{0}' must not be the same property, and must point back to the navigation property." - /// - internal static string EdmModel_Validator_Syntactic_NavigationPartnerInvalid(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_NavigationPartnerInvalid, p0); - } - - /// - /// A string like "The chain of base types of type '{0}' is cyclic." - /// - internal static string EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy, p0); - } - - /// - /// A string like "Single file provided but model cannot be serialized into single file." - /// - internal static string Serializer_SingleFileExpected - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_SingleFileExpected); - } - } - - /// - /// A string like "Unknown Edm version '{0}'." - /// - internal static string Serializer_UnknownEdmVersion(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_UnknownEdmVersion, p0); - } - - /// - /// A string like "Unknown Edmx version '{0}'." - /// - internal static string Serializer_UnknownEdmxVersion(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_UnknownEdmxVersion, p0); - } - - /// - /// A string like "The operation import '{0}' could not be serialized because its return type cannot be represented inline." - /// - internal static string Serializer_NonInlineOperationImportReturnType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_NonInlineOperationImportReturnType, p0); - } - - /// - /// A string like "A referenced type can not be serialized with an invalid name. The name '{0}' is invalid." - /// - internal static string Serializer_ReferencedTypeMustHaveValidName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_ReferencedTypeMustHaveValidName, p0); - } - - /// - /// A string like "The annotation can not be serialized with an invalid target name. The name '{0}' is invalid." - /// - internal static string Serializer_OutOfLineAnnotationTargetMustHaveValidName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_OutOfLineAnnotationTargetMustHaveValidName, p0); - } - - /// - /// A string like "No CSDL is written because no schema elements could be produced. This is likely because the model is empty." - /// - internal static string Serializer_NoSchemasProduced - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Serializer_NoSchemasProduced); - } - } - - /// - /// A string like "{0} does not contain a schema definition, or the XmlReader provided started at the end of the file." - /// - internal static string XmlParser_EmptyFile(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_EmptyFile, p0); - } - - /// - /// A string like "The source XmlReader does not contain a schema definition or started at the end of the file." - /// - internal static string XmlParser_EmptySchemaTextReader - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_EmptySchemaTextReader); - } - } - - /// - /// A string like "Required schema attribute '{0}' is not present on element '{1}'." - /// - internal static string XmlParser_MissingAttribute(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_MissingAttribute, p0, p1); - } - - /// - /// A string like "The current schema element does not support text '{0}'." - /// - internal static string XmlParser_TextNotAllowed(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_TextNotAllowed, p0); - } - - /// - /// A string like "The attribute '{0}' was not expected in the given context." - /// - internal static string XmlParser_UnexpectedAttribute(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedAttribute, p0); - } - - /// - /// A string like "The schema element '{0}' was not expected in the given context." - /// - internal static string XmlParser_UnexpectedElement(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedElement, p0); - } - - /// - /// A string like "Unused schema element: '{0}'." - /// - internal static string XmlParser_UnusedElement(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnusedElement, p0); - } - - /// - /// A string like "Unexpected XML node type: {0}." - /// - internal static string XmlParser_UnexpectedNodeType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedNodeType, p0); - } - - /// - /// A string like "The element '{0}' was unexpected for the root element. The root element should be {1}." - /// - internal static string XmlParser_UnexpectedRootElement(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedRootElement, p0, p1); - } - - /// - /// A string like "The namespace '{0}' is invalid. The root element is expected to belong to one of the following namespaces: '{1}'." - /// - internal static string XmlParser_UnexpectedRootElementWrongNamespace(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedRootElementWrongNamespace, p0, p1); - } - - /// - /// A string like "The root element has no namespace. The root element is expected to belong to one of the following namespaces: '{0}'." - /// - internal static string XmlParser_UnexpectedRootElementNoNamespace(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.XmlParser_UnexpectedRootElementNoNamespace, p0); - } - - /// - /// A string like "The {0} '{1}' is invalid. The entitySetPath value is not allowed when IsBound attribute is false." - /// - internal static string CsdlParser_InvalidEntitySetPathWithUnboundAction(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidEntitySetPathWithUnboundAction, p0, p1); - } - - /// - /// A string like "The alias '{0}' is not a valid simple name." - /// - internal static string CsdlParser_InvalidAlias(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidAlias, p0); - } - - /// - /// A string like "The delete action '{0}' is not valid. Action must be: 'None', 'Cascade', or 'Restrict'." - /// - internal static string CsdlParser_InvalidDeleteAction(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidDeleteAction, p0); - } - - /// - /// A string like "An XML attribute or sub-element representing an EDM type is missing." - /// - internal static string CsdlParser_MissingTypeAttributeOrElement - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_MissingTypeAttributeOrElement); - } - } - - /// - /// A string like "There is no Role with name '{0}' defined in relationship '{1}'." - /// - internal static string CsdlParser_InvalidEndRoleInRelationshipConstraint(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidEndRoleInRelationshipConstraint, p0, p1); - } - - /// - /// A string like "The multiplicity '{0}' is not valid. Multiplicity must be: '*', '0..1', or '1'." - /// - internal static string CsdlParser_InvalidMultiplicity(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidMultiplicity, p0); - } - - /// - /// A string like "Referential constraints requires one dependent role. Multiple dependent roles were specified for this referential constraint." - /// - internal static string CsdlParser_ReferentialConstraintRequiresOneDependent - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_ReferentialConstraintRequiresOneDependent); - } - } - - /// - /// A string like "Referential constraints requires one principal role. Multiple principal roles were specified for this referential constraint." - /// - internal static string CsdlParser_ReferentialConstraintRequiresOnePrincipal - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_ReferentialConstraintRequiresOnePrincipal); - } - } - - /// - /// A string like "If expression must contain 3 operands, the first being a boolean test, the second being being evaluated if the first is true, and the third being evaluated if the first is false." - /// - internal static string CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands); - } - } - - /// - /// A string like "The IsOf expression must contain 1 operand." - /// - internal static string CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands); - } - } - - /// - /// A string like "The Cast expression must contain 1 operand." - /// - internal static string CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands); - } - } - - /// - /// A string like "The LabeledElement expression must contain 1 operand." - /// - internal static string CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands); - } - } - - /// - /// A string like "The type name '{0}' is invalid. The type name must be that of a primitive type, a fully qualified name or an inline 'Collection' or 'Ref' type." - /// - internal static string CsdlParser_InvalidTypeName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidTypeName, p0); - } - - /// - /// A string like "The qualified name '{0}' is invalid. A qualified name must have a valid namespace or alias, and a valid name." - /// - internal static string CsdlParser_InvalidQualifiedName(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidQualifiedName, p0); - } - - /// - /// A string like "A model could not be produced because no XML readers were provided." - /// - internal static string CsdlParser_NoReadersProvided - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_NoReadersProvided); - } - } - - /// - /// A string like "A model could not be produced because one of the XML readers was null." - /// - internal static string CsdlParser_NullXmlReader - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_NullXmlReader); - } - } - - /// - /// A string like "'{0}' is not a valid entity set path." - /// - internal static string CsdlParser_InvalidEntitySetPath(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidEntitySetPath, p0); - } - - /// - /// A string like "'{0}' is not a valid enum member path." - /// - internal static string CsdlParser_InvalidEnumMemberPath(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_InvalidEnumMemberPath, p0); - } - - /// - /// A string like "The 'Nullable' attribute cannot be specified for a navigation property with collection type." - /// - internal static string CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType); - } - } - - /// - /// A string like "Metadata document cannot have more than one entity container." - /// - internal static string CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer); - } - } - - /// - /// A string like " There was a mismatch in the principal and dependent ends of the referential constraint." - /// - internal static string CsdlSemantics_ReferentialConstraintMismatch - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlSemantics_ReferentialConstraintMismatch); - } - } - - /// - /// A string like "The enumeration member must have a value." - /// - internal static string CsdlSemantics_EnumMemberMustHaveValue - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlSemantics_EnumMemberMustHaveValue); - } - } - - /// - /// A string like "The annotation target '{0}' could not be resolved because it cannot refer to an annotatable element." - /// - internal static string CsdlSemantics_ImpossibleAnnotationsTarget(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlSemantics_ImpossibleAnnotationsTarget, p0); - } - - /// - /// A string like "The schema '{0}' contains the alias '{1}' more than once." - /// - internal static string CsdlSemantics_DuplicateAlias(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlSemantics_DuplicateAlias, p0, p1); - } - - /// - /// A string like "An unexpected '{0}' value kind was found when parsing the JSON path '{1}'. A '{2}' value kind was expected." - /// - internal static string CsdlJsonParser_UnexpectedJsonValueKind(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_UnexpectedJsonValueKind, p0, p1, p2); - } - - /// - /// A string like "A member '{0}' is missing when parsing the JSON path '{1}'." - /// - internal static string CsdlJsonParser_MissingMemberInObject(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_MissingMemberInObject, p0, p1); - } - - /// - /// A string like "A member '{0}' with value type '{1}' is unexpected." - /// - internal static string CsdlJsonParser_UnexpectedJsonMember(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_UnexpectedJsonMember, p0, p1); - } - - /// - /// A string like "Cannot read the value '{0}' at JSON path '{1}' as '{2}' numeric value." - /// - internal static string CsdlJsonParser_CannotReadValueAsType(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_CannotReadValueAsType, p0, p1, p2); - } - - /// - /// A string like "A schema '{0}' object MUST contain the member '$Kind' with a string value of '{1}'." - /// - internal static string CsdlJsonParser_MissingKindMember(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_MissingKindMember, p0, p1); - } - - /// - /// A string like "A property '{0}' is missing when parsing the JSON path '{1}'." - /// - internal static string CsdlJsonParser_MissingRequiredPropertyInObject(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_MissingRequiredPropertyInObject, p0, p1); - } - - /// - /// A string like "Found an unknown value kind '{0}' when parsing the JSON path '{1}'." - /// - internal static string CsdlJsonParser_UnknownJsonElementValueKind(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_UnknownJsonElementValueKind, p0, p1); - } - - /// - /// A string like "Cannot parse a JSON number '{0}' when parsing the JSON path '{1}'." - /// - internal static string CsdlJsonParser_InvalidJsonNumberType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_InvalidJsonNumberType, p0, p1); - } - - /// - /// A string like "A member at JSON path '{0}' is not supported." - /// - internal static string CsdlJsonParser_UnsupportedJsonMember(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_UnsupportedJsonMember, p0); - } - - /// - /// A string like "The version specified at '{0}' is not valid. It should be a string containing either '4.0' or '4.01'." - /// - internal static string CsdlJsonParser_InvalidCsdlVersion(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_InvalidCsdlVersion, p0); - } - - /// - /// A string like "The schema object at '{0}' cannot have more than one entity container." - /// - internal static string CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer, p0); - } - - /// - /// A string like "The EDMX version specified in the 'Version' attribute does not match the version corresponding to the namespace of the 'Edmx' element." - /// - internal static string EdmxParser_EdmxVersionMismatch - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmxParser_EdmxVersionMismatch); - } - } - - /// - /// A string like "Unexpected {0} element while parsing Edmx. Edmx is expected to have at most one of 'Runtime' or 'DataServices' elements." - /// - internal static string EdmxParser_BodyElement(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmxParser_BodyElement, p0); - } - - /// - /// A string like "edmx:Reference must contain at least one edmx:Includes or edmx:IncludeAnnotations." - /// - internal static string EdmxParser_InvalidReferenceIncorrectNumberOfIncludes - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmxParser_InvalidReferenceIncorrectNumberOfIncludes); - } - } - - /// - /// A string like "Unresolved Uri found in edmx:Reference, getReferencedModelReaderFunc should not return null when the URI is not a well-known schema." - /// - internal static string EdmxParser_UnresolvedReferenceUriInEdmxReference - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmxParser_UnresolvedReferenceUriInEdmxReference); - } - } - - /// - /// A string like "Encountered the following errors when parsing the CSDL document: \r\n{0}" - /// - internal static string EdmParseException_ErrorsEncounteredInEdmx(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmParseException_ErrorsEncounteredInEdmx, p0); - } - - /// - /// A string like "The value '{0}' is not a valid boolean. The value must be 'true' or 'false'." - /// - internal static string ValueParser_InvalidBoolean(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidBoolean, p0); - } - - /// - /// A string like "The value '{0}' is not a valid integer. The value must be a valid 32 bit integer." - /// - internal static string ValueParser_InvalidInteger(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidInteger, p0); - } - - /// - /// A string like "The value '{0}' is not a valid integer. The value must be a valid 64 bit integer." - /// - internal static string ValueParser_InvalidLong(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidLong, p0); - } - - /// - /// A string like "The value '{0}' is not a valid floating point value." - /// - internal static string ValueParser_InvalidFloatingPoint(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidFloatingPoint, p0); - } - - /// - /// A string like "The value '{0}' is not a valid integer. The value must be a valid 32 bit integer or 'Max'." - /// - internal static string ValueParser_InvalidMaxLength(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidMaxLength, p0); - } - - /// - /// A string like "The value '{0}' is not a valid SRID. The value must either be a 32 bit integer or 'Variable'." - /// - internal static string ValueParser_InvalidSrid(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidSrid, p0); - } - - /// - /// A string like "The value '{0}' is not a valid scale. The value must either be a 32 bit integer or 'Variable'." - /// - internal static string ValueParser_InvalidScale(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidScale, p0); - } - - /// - /// A string like "The value '{0}' is not a valid Guid." - /// - internal static string ValueParser_InvalidGuid(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidGuid, p0); - } - - /// - /// A string like "The value '{0}' is not a valid decimal." - /// - internal static string ValueParser_InvalidDecimal(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidDecimal, p0); - } - - /// - /// A string like "The value '{0}' is not a valid date time offset value." - /// - internal static string ValueParser_InvalidDateTimeOffset(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidDateTimeOffset, p0); - } - - /// - /// A string like "The value '{0}' is not a valid date time value." - /// - internal static string ValueParser_InvalidDateTime(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidDateTime, p0); - } - - /// - /// A string like "The value '{0}' is not a valid date value." - /// - internal static string ValueParser_InvalidDate(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidDate, p0); - } - - /// - /// A string like "The value '{0}' is not a valid duration value." - /// - internal static string ValueParser_InvalidDuration(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidDuration, p0); - } - - /// - /// A string like "The value '{0}' is not a valid binary value. The value must be a hexadecimal string and must not be prefixed by '0x'." - /// - internal static string ValueParser_InvalidBinary(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidBinary, p0); - } - - /// - /// A string like "The value '{0}' is not a valid TimeOfDay value." - /// - internal static string ValueParser_InvalidTimeOfDay(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.ValueParser_InvalidTimeOfDay, p0); - } - - /// - /// A string like "Invalid multiplicity: '{0}'" - /// - internal static string UnknownEnumVal_Multiplicity(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_Multiplicity, p0); - } - - /// - /// A string like "Invalid schema element kind: '{0}'" - /// - internal static string UnknownEnumVal_SchemaElementKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_SchemaElementKind, p0); - } - - /// - /// A string like "Invalid type kind: '{0}'" - /// - internal static string UnknownEnumVal_TypeKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_TypeKind, p0); - } - - /// - /// A string like "Invalid primitive kind: '{0}'" - /// - internal static string UnknownEnumVal_PrimitiveKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_PrimitiveKind, p0); - } - - /// - /// A string like "Invalid container element kind: '{0}'" - /// - internal static string UnknownEnumVal_ContainerElementKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_ContainerElementKind, p0); - } - - /// - /// A string like "Invalid CSDL target: '{0}'" - /// - internal static string UnknownEnumVal_CsdlTarget(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_CsdlTarget, p0); - } - - /// - /// A string like "Invalid property kind: '{0}'" - /// - internal static string UnknownEnumVal_PropertyKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_PropertyKind, p0); - } - - /// - /// A string like "Invalid expression kind: '{0}'" - /// - internal static string UnknownEnumVal_ExpressionKind(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.UnknownEnumVal_ExpressionKind, p0); - } - - /// - /// A string like "The name '{0}' is ambiguous." - /// - internal static string Bad_AmbiguousElementBinding(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_AmbiguousElementBinding, p0); - } - - /// - /// A string like "The type '{0}' could not be found." - /// - internal static string Bad_UnresolvedType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedType, p0); - } - - /// - /// A string like "The complex type '{0}' could not be found." - /// - internal static string Bad_UnresolvedComplexType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedComplexType, p0); - } - - /// - /// A string like "The entity type '{0}' could not be found." - /// - internal static string Bad_UnresolvedEntityType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedEntityType, p0); - } - - /// - /// A string like "The primitive type '{0}' could not be found." - /// - internal static string Bad_UnresolvedPrimitiveType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedPrimitiveType, p0); - } - - /// - /// A string like "The operation '{0}' could not be found." - /// - internal static string Bad_UnresolvedOperation(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedOperation, p0); - } - - /// - /// A string like "The operation '{0}' could not be resolved because more than one operation could be used for this application." - /// - internal static string Bad_AmbiguousOperation(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_AmbiguousOperation, p0); - } - - /// - /// A string like "The operation '{0}' could not be resolved because none of the operations with that name take the correct set of parameters." - /// - internal static string Bad_OperationParametersDontMatch(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_OperationParametersDontMatch, p0); - } - - /// - /// A string like "The entity set '{0}' could not be found." - /// - internal static string Bad_UnresolvedEntitySet(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedEntitySet, p0); - } - - /// - /// A string like "The entity container '{0}' could not be found." - /// - internal static string Bad_UnresolvedEntityContainer(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedEntityContainer, p0); - } - - /// - /// A string like "The enum type '{0}' could not be found." - /// - internal static string Bad_UnresolvedEnumType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedEnumType, p0); - } - - /// - /// A string like "The enum member '{0}' could not be found." - /// - internal static string Bad_UnresolvedEnumMember(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedEnumMember, p0); - } - - /// - /// A string like "The property '{0}' could not be found." - /// - internal static string Bad_UnresolvedProperty(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedProperty, p0); - } - - /// - /// A string like "The parameter '{0}' could not be found." - /// - internal static string Bad_UnresolvedParameter(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedParameter, p0); - } - - /// - /// A string like "The return of operation '{0}' could not be found." - /// - internal static string Bad_UnresolvedReturn(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedReturn, p0); - } - - /// - /// A string like "The labeled element '{0}' could not be found." - /// - internal static string Bad_UnresolvedLabeledElement(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedLabeledElement, p0); - } - - /// - /// A string like "The entity '{0}' is invalid because its base type is cyclic." - /// - internal static string Bad_CyclicEntity(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_CyclicEntity, p0); - } - - /// - /// A string like "The complex type '{0}' is invalid because its base type is cyclic." - /// - internal static string Bad_CyclicComplex(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_CyclicComplex, p0); - } - - /// - /// A string like "The entity container '{0}' is invalid because its extends hierarchy is cyclic." - /// - internal static string Bad_CyclicEntityContainer(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_CyclicEntityContainer, p0); - } - - /// - /// A string like "A navigation property could not be found for the path '{0}' starting from the type '{1}'." - /// - internal static string Bad_UnresolvedNavigationPropertyPath(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Bad_UnresolvedNavigationPropertyPath, p0, p1); - } - - /// - /// A string like "The same rule cannot be in the same rule set twice." - /// - internal static string RuleSet_DuplicateRulesExistInRuleSet - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.RuleSet_DuplicateRulesExistInRuleSet); - } - } - - /// - /// A string like "Conversion of EDM values to a CLR type with type {0} is not supported." - /// - internal static string EdmToClr_UnsupportedType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_UnsupportedType, p0); - } - - /// - /// A string like "Conversion of an EDM structured value is supported only to a CLR class." - /// - internal static string EdmToClr_StructuredValueMappedToNonClass - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_StructuredValueMappedToNonClass); - } - } - - /// - /// A string like "Cannot initialize a property '{0}' on an object of type '{1}'. The property already has a value." - /// - internal static string EdmToClr_IEnumerableOfTPropertyAlreadyHasValue(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_IEnumerableOfTPropertyAlreadyHasValue, p0, p1); - } - - /// - /// A string like "An EDM structured value contains multiple values for the property '{0}'. Conversion of an EDM structured value with duplicate property values is not supported." - /// - internal static string EdmToClr_StructuredPropertyDuplicateValue(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_StructuredPropertyDuplicateValue, p0); - } - - /// - /// A string like "Conversion of an EDM value of the type '{0}' to the CLR type '{1}' is not supported." - /// - internal static string EdmToClr_CannotConvertEdmValueToClrType(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_CannotConvertEdmValueToClrType, p0, p1); - } - - /// - /// A string like "Conversion of an edm collection value to the CLR type '{0}' is not supported. EDM collection values can be converted to System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T> or System.Collections.Generic.ICollection<T>." - /// - internal static string EdmToClr_CannotConvertEdmCollectionValueToClrType(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_CannotConvertEdmCollectionValueToClrType, p0); - } - - /// - /// A string like "The type '{0}' of the object returned by the TryCreateObjectInstance delegate is not assignable to the expected type '{1}'." - /// - internal static string EdmToClr_TryCreateObjectInstanceReturnedWrongObject(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmToClr_TryCreateObjectInstanceReturnedWrongObject, p0, p1); - } - - /// - /// A string like "The MIME type annotation must not have a null value." - /// - internal static string EdmUtil_NullValueForMimeTypeAnnotation - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmUtil_NullValueForMimeTypeAnnotation); - } - } - - /// - /// A string like "An annotation of type string was expected for the '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' annotation, but an annotation of type '{1}' was found." - /// - internal static string EdmUtil_InvalidAnnotationValue(object p0, object p1) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmUtil_InvalidAnnotationValue, p0, p1); - } - - /// - /// A string like "The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information." - /// - internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.PlatformHelper_DateTimeOffsetMustContainTimeZone, p0); - } - - /// - /// A string like "The added or subtracted value results in an un-representable Date." - /// - internal static string Date_InvalidAddedOrSubtractedResults - { - get - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Date_InvalidAddedOrSubtractedResults); - } - } - - /// - /// A string like "The Year '{0}', Month '{1}' and Day '{2}' parameters describe an un-representable Date." - /// - internal static string Date_InvalidDateParameters(object p0, object p1, object p2) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Date_InvalidDateParameters, p0, p1, p2); - } - - /// - /// A string like "String '{0}' was not recognized as a valid Date." - /// - internal static string Date_InvalidParsingString(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Date_InvalidParsingString, p0); - } - - /// - /// A string like "Target object '{0}' is not an instance with type of Date." - /// - internal static string Date_InvalidCompareToTarget(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.Date_InvalidCompareToTarget, p0); - } - - /// - /// A string like "The Hour '{0}', Minute '{1}', Second '{2}' and Millisecond '{3}' parameters describe an un-representable TimeOfDay." - /// - internal static string TimeOfDay_InvalidTimeOfDayParameters(object p0, object p1, object p2, object p3) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TimeOfDay_InvalidTimeOfDayParameters, p0, p1, p2, p3); - } - - /// - /// A string like "The ticks value '{0}' is out of representable TimeOfDay range." - /// - internal static string TimeOfDay_TicksOutOfRange(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TimeOfDay_TicksOutOfRange, p0); - } - - /// - /// A string like "The TimeSpan value '{0}' is out of representable TimeOfDay range." - /// - internal static string TimeOfDay_ConvertErrorFromTimeSpan(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TimeOfDay_ConvertErrorFromTimeSpan, p0); - } - - /// - /// A string like "String '{0}' was not recognized as a valid TimeOfDay." - /// - internal static string TimeOfDay_InvalidParsingString(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TimeOfDay_InvalidParsingString, p0); - } - - /// - /// A string like "Target object '{0}' is not an instance with type of TimeOfDay." - /// - internal static string TimeOfDay_InvalidCompareToTarget(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.TimeOfDay_InvalidCompareToTarget, p0); - } - - /// - /// A string like "Annotation expressions must specify a value or use a term with a specified default value. Cannot find a default value for the given annotation term, '{0}'." - /// - internal static string EdmVocabularyAnnotations_DidNotFindDefaultValue(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmVocabularyAnnotations_DidNotFindDefaultValue, p0); - } - - /// - /// A string like "Term type '{0}' is not supported for value retrieval." - /// - internal static string EdmVocabularyAnnotations_TermTypeNotSupported(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmVocabularyAnnotations_TermTypeNotSupported, p0); - } - - /// - /// A string like "Invalid to set inline location for a path target '{0}'." - /// - internal static string EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation(object p0) - { - return Microsoft.OData.Edm.EdmRes.GetString(Microsoft.OData.Edm.EdmRes.EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation, p0); - } - - } - - /// - /// Strongly-typed and parameterized exception factory. - /// - internal static partial class Error { - - /// - /// The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. - /// - internal static Exception ArgumentNull(string paramName) { - return new ArgumentNullException(paramName); - } - - /// - /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. - /// - internal static Exception ArgumentOutOfRange(string paramName) { - return new ArgumentOutOfRangeException(paramName); - } - - /// - /// The exception that is thrown when the author has not yet implemented the logic at this point in the program. This can act as an exception based TODO tag. - /// - internal static Exception NotImplemented() { - return new NotImplementedException(); - } - - /// - /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. - /// - internal static Exception NotSupported() { - return new NotSupportedException(); - } - } -} diff --git a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.tt b/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.tt deleted file mode 100644 index 6f8d96e371..0000000000 --- a/src/Microsoft.OData.Edm/Parameterized.Microsoft.OData.Edm.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\StringsClassGenerator.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.OData.Edm"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.OData.Edm"; - - // The name of the generated resource class. - public const string ResourceClassName = "EdmRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.OData.Edm.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.OData.Edm/RegistrationHelper.cs b/src/Microsoft.OData.Edm/RegistrationHelper.cs index f3297e2d52..e77e8e614c 100644 --- a/src/Microsoft.OData.Edm/RegistrationHelper.cs +++ b/src/Microsoft.OData.Edm/RegistrationHelper.cs @@ -31,7 +31,7 @@ internal static void RegisterSchemaElement(IEdmSchemaElement element, Dictionary // Only one entity container can be added. if (containerDictionary.Count > 0) { - throw new InvalidOperationException(Edm.Strings.EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel); + throw new InvalidOperationException(SRResources.EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel); } IEdmEntityContainer container = (IEdmEntityContainer)element; @@ -40,9 +40,9 @@ internal static void RegisterSchemaElement(IEdmSchemaElement element, Dictionary break; case EdmSchemaElementKind.None: - throw new InvalidOperationException(Edm.Strings.EdmModel_CannotUseElementWithTypeNone); + throw new InvalidOperationException(SRResources.EdmModel_CannotUseElementWithTypeNone); default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_SchemaElementKind(element.SchemaElementKind)); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_SchemaElementKind, element.SchemaElementKind)); } } diff --git a/src/Microsoft.OData.Edm/SRResources.Designer.cs b/src/Microsoft.OData.Edm/SRResources.Designer.cs new file mode 100644 index 0000000000..9f3cd58cfd --- /dev/null +++ b/src/Microsoft.OData.Edm/SRResources.Designer.cs @@ -0,0 +1,2870 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.OData.Edm { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SRResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SRResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.OData.Edm.SRResources", typeof(SRResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Annotation of type '{0}' cannot be interpreted as '{1}'.. + /// + internal static string Annotations_TypeMismatch { + get { + return ResourceManager.GetString("Annotations_TypeMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name '{0}' is ambiguous.. + /// + internal static string Bad_AmbiguousElementBinding { + get { + return ResourceManager.GetString("Bad_AmbiguousElementBinding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' could not be resolved because more than one operation could be used for this application.. + /// + internal static string Bad_AmbiguousOperation { + get { + return ResourceManager.GetString("Bad_AmbiguousOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' is invalid because its base type is cyclic.. + /// + internal static string Bad_CyclicComplex { + get { + return ResourceManager.GetString("Bad_CyclicComplex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity '{0}' is invalid because its base type is cyclic.. + /// + internal static string Bad_CyclicEntity { + get { + return ResourceManager.GetString("Bad_CyclicEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity container '{0}' is invalid because its extends hierarchy is cyclic.. + /// + internal static string Bad_CyclicEntityContainer { + get { + return ResourceManager.GetString("Bad_CyclicEntityContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' could not be resolved because none of the operations with that name take the correct set of parameters.. + /// + internal static string Bad_OperationParametersDontMatch { + get { + return ResourceManager.GetString("Bad_OperationParametersDontMatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' could not be found.. + /// + internal static string Bad_UnresolvedComplexType { + get { + return ResourceManager.GetString("Bad_UnresolvedComplexType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity container '{0}' could not be found.. + /// + internal static string Bad_UnresolvedEntityContainer { + get { + return ResourceManager.GetString("Bad_UnresolvedEntityContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' could not be found.. + /// + internal static string Bad_UnresolvedEntitySet { + get { + return ResourceManager.GetString("Bad_UnresolvedEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' could not be found.. + /// + internal static string Bad_UnresolvedEntityType { + get { + return ResourceManager.GetString("Bad_UnresolvedEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enum member '{0}' could not be found.. + /// + internal static string Bad_UnresolvedEnumMember { + get { + return ResourceManager.GetString("Bad_UnresolvedEnumMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enum type '{0}' could not be found.. + /// + internal static string Bad_UnresolvedEnumType { + get { + return ResourceManager.GetString("Bad_UnresolvedEnumType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The labeled element '{0}' could not be found.. + /// + internal static string Bad_UnresolvedLabeledElement { + get { + return ResourceManager.GetString("Bad_UnresolvedLabeledElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A navigation property could not be found for the path '{0}' starting from the type '{1}'.. + /// + internal static string Bad_UnresolvedNavigationPropertyPath { + get { + return ResourceManager.GetString("Bad_UnresolvedNavigationPropertyPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' could not be found.. + /// + internal static string Bad_UnresolvedOperation { + get { + return ResourceManager.GetString("Bad_UnresolvedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter '{0}' could not be found.. + /// + internal static string Bad_UnresolvedParameter { + get { + return ResourceManager.GetString("Bad_UnresolvedParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The primitive type '{0}' could not be found.. + /// + internal static string Bad_UnresolvedPrimitiveType { + get { + return ResourceManager.GetString("Bad_UnresolvedPrimitiveType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' could not be found.. + /// + internal static string Bad_UnresolvedProperty { + get { + return ResourceManager.GetString("Bad_UnresolvedProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The return of operation '{0}' could not be found.. + /// + internal static string Bad_UnresolvedReturn { + get { + return ResourceManager.GetString("Bad_UnresolvedReturn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' could not be found.. + /// + internal static string Bad_UnresolvedType { + get { + return ResourceManager.GetString("Bad_UnresolvedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The number of dependent properties must match the number of key properties on the principal entity type. '{0}' principal properties were provided, but {1} dependent properties were provided.. + /// + internal static string Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType { + get { + return ResourceManager.GetString("Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity type or a collection of an entity type is expected.. + /// + internal static string Constructable_EntityTypeOrCollectionOfEntityTypeExpected { + get { + return ResourceManager.GetString("Constructable_EntityTypeOrCollectionOfEntityTypeExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Navigation target entity type must be '{0}'.. + /// + internal static string Constructable_TargetMustBeStock { + get { + return ResourceManager.GetString("Constructable_TargetMustBeStock", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation must have non-null target.. + /// + internal static string Constructable_VocabularyAnnotationMustHaveTarget { + get { + return ResourceManager.GetString("Constructable_VocabularyAnnotationMustHaveTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' at JSON path '{1}' as '{2}' numeric value.. + /// + internal static string CsdlJsonParser_CannotReadValueAsType { + get { + return ResourceManager.GetString("CsdlJsonParser_CannotReadValueAsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The version specified at '{0}' is not valid. It should be a string containing either '4.0' or '4.01'.. + /// + internal static string CsdlJsonParser_InvalidCsdlVersion { + get { + return ResourceManager.GetString("CsdlJsonParser_InvalidCsdlVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot parse a JSON number '{0}' when parsing the JSON path '{1}'.. + /// + internal static string CsdlJsonParser_InvalidJsonNumberType { + get { + return ResourceManager.GetString("CsdlJsonParser_InvalidJsonNumberType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A schema '{0}' object MUST contain the member '$Kind' with a string value of '{1}'.. + /// + internal static string CsdlJsonParser_MissingKindMember { + get { + return ResourceManager.GetString("CsdlJsonParser_MissingKindMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A member '{0}' is missing when parsing the JSON path '{1}'.. + /// + internal static string CsdlJsonParser_MissingMemberInObject { + get { + return ResourceManager.GetString("CsdlJsonParser_MissingMemberInObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property '{0}' is missing when parsing the JSON path '{1}'.. + /// + internal static string CsdlJsonParser_MissingRequiredPropertyInObject { + get { + return ResourceManager.GetString("CsdlJsonParser_MissingRequiredPropertyInObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The schema object at '{0}' cannot have more than one entity container.. + /// + internal static string CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer { + get { + return ResourceManager.GetString("CsdlJsonParser_SchemaCannotHaveMoreThanOneEntityContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A member '{0}' with value type '{1}' is unexpected.. + /// + internal static string CsdlJsonParser_UnexpectedJsonMember { + get { + return ResourceManager.GetString("CsdlJsonParser_UnexpectedJsonMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected '{0}' value kind was found when parsing the JSON path '{1}'. A '{2}' value kind was expected.. + /// + internal static string CsdlJsonParser_UnexpectedJsonValueKind { + get { + return ResourceManager.GetString("CsdlJsonParser_UnexpectedJsonValueKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found an unknown value kind '{0}' when parsing the JSON path '{1}'.. + /// + internal static string CsdlJsonParser_UnknownJsonElementValueKind { + get { + return ResourceManager.GetString("CsdlJsonParser_UnknownJsonElementValueKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A member at JSON path '{0}' is not supported.. + /// + internal static string CsdlJsonParser_UnsupportedJsonMember { + get { + return ResourceManager.GetString("CsdlJsonParser_UnsupportedJsonMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Nullable' attribute cannot be specified for a navigation property with collection type.. + /// + internal static string CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType { + get { + return ResourceManager.GetString("CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The alias '{0}' is not a valid simple name.. + /// + internal static string CsdlParser_InvalidAlias { + get { + return ResourceManager.GetString("CsdlParser_InvalidAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Cast expression must contain 1 operand.. + /// + internal static string CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands { + get { + return ResourceManager.GetString("CsdlParser_InvalidCastExpressionIncorrectNumberOfOperands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The delete action '{0}' is not valid. Action must be: 'None', 'Cascade', or 'Restrict'.. + /// + internal static string CsdlParser_InvalidDeleteAction { + get { + return ResourceManager.GetString("CsdlParser_InvalidDeleteAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no Role with name '{0}' defined in relationship '{1}'.. + /// + internal static string CsdlParser_InvalidEndRoleInRelationshipConstraint { + get { + return ResourceManager.GetString("CsdlParser_InvalidEndRoleInRelationshipConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is not a valid entity set path.. + /// + internal static string CsdlParser_InvalidEntitySetPath { + get { + return ResourceManager.GetString("CsdlParser_InvalidEntitySetPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} '{1}' is invalid. The entitySetPath value is not allowed when IsBound attribute is false.. + /// + internal static string CsdlParser_InvalidEntitySetPathWithUnboundAction { + get { + return ResourceManager.GetString("CsdlParser_InvalidEntitySetPathWithUnboundAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is not a valid enum member path.. + /// + internal static string CsdlParser_InvalidEnumMemberPath { + get { + return ResourceManager.GetString("CsdlParser_InvalidEnumMemberPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If expression must contain 3 operands, the first being a boolean test, the second being being evaluated if the first is true, and the third being evaluated if the first is false.. + /// + internal static string CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands { + get { + return ResourceManager.GetString("CsdlParser_InvalidIfExpressionIncorrectNumberOfOperands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The IsOf expression must contain 1 operand.. + /// + internal static string CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands { + get { + return ResourceManager.GetString("CsdlParser_InvalidIsOfExpressionIncorrectNumberOfOperands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LabeledElement expression must contain 1 operand.. + /// + internal static string CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands { + get { + return ResourceManager.GetString("CsdlParser_InvalidLabeledElementExpressionIncorrectNumberOfOperands", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The multiplicity '{0}' is not valid. Multiplicity must be: '*', '0..1', or '1'.. + /// + internal static string CsdlParser_InvalidMultiplicity { + get { + return ResourceManager.GetString("CsdlParser_InvalidMultiplicity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The qualified name '{0}' is invalid. A qualified name must have a valid namespace or alias, and a valid name.. + /// + internal static string CsdlParser_InvalidQualifiedName { + get { + return ResourceManager.GetString("CsdlParser_InvalidQualifiedName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type name '{0}' is invalid. The type name must be that of a primitive type, a fully qualified name or an inline 'Collection' or 'Ref' type.. + /// + internal static string CsdlParser_InvalidTypeName { + get { + return ResourceManager.GetString("CsdlParser_InvalidTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Metadata document cannot have more than one entity container.. + /// + internal static string CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer { + get { + return ResourceManager.GetString("CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An XML attribute or sub-element representing an EDM type is missing.. + /// + internal static string CsdlParser_MissingTypeAttributeOrElement { + get { + return ResourceManager.GetString("CsdlParser_MissingTypeAttributeOrElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A model could not be produced because no XML readers were provided.. + /// + internal static string CsdlParser_NoReadersProvided { + get { + return ResourceManager.GetString("CsdlParser_NoReadersProvided", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A model could not be produced because one of the XML readers was null.. + /// + internal static string CsdlParser_NullXmlReader { + get { + return ResourceManager.GetString("CsdlParser_NullXmlReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Referential constraints requires one dependent role. Multiple dependent roles were specified for this referential constraint.. + /// + internal static string CsdlParser_ReferentialConstraintRequiresOneDependent { + get { + return ResourceManager.GetString("CsdlParser_ReferentialConstraintRequiresOneDependent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Referential constraints requires one principal role. Multiple principal roles were specified for this referential constraint.. + /// + internal static string CsdlParser_ReferentialConstraintRequiresOnePrincipal { + get { + return ResourceManager.GetString("CsdlParser_ReferentialConstraintRequiresOnePrincipal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The schema '{0}' contains the alias '{1}' more than once.. + /// + internal static string CsdlSemantics_DuplicateAlias { + get { + return ResourceManager.GetString("CsdlSemantics_DuplicateAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enumeration member must have a value.. + /// + internal static string CsdlSemantics_EnumMemberMustHaveValue { + get { + return ResourceManager.GetString("CsdlSemantics_EnumMemberMustHaveValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation target '{0}' could not be resolved because it cannot refer to an annotatable element.. + /// + internal static string CsdlSemantics_ImpossibleAnnotationsTarget { + get { + return ResourceManager.GetString("CsdlSemantics_ImpossibleAnnotationsTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was a mismatch in the principal and dependent ends of the referential constraint.. + /// + internal static string CsdlSemantics_ReferentialConstraintMismatch { + get { + return ResourceManager.GetString("CsdlSemantics_ReferentialConstraintMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The added or subtracted value results in an un-representable Date.. + /// + internal static string Date_InvalidAddedOrSubtractedResults { + get { + return ResourceManager.GetString("Date_InvalidAddedOrSubtractedResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target object '{0}' is not an instance with type of Date.. + /// + internal static string Date_InvalidCompareToTarget { + get { + return ResourceManager.GetString("Date_InvalidCompareToTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Year '{0}', Month '{1}' and Day '{2}' parameters describe an un-representable Date.. + /// + internal static string Date_InvalidDateParameters { + get { + return ResourceManager.GetString("Date_InvalidDateParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to String '{0}' was not recognized as a valid Date.. + /// + internal static string Date_InvalidParsingString { + get { + return ResourceManager.GetString("Date_InvalidParsingString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value fails to match type '{0}'.. + /// + internal static string Edm_Evaluator_FailedTypeAssertion { + get { + return ResourceManager.GetString("Edm_Evaluator_FailedTypeAssertion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A containing object cannot be null when getting value of an annotation with Path in the execution environment.. + /// + internal static string Edm_Evaluator_NoContextPath { + get { + return ResourceManager.GetString("Edm_Evaluator_NoContextPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' must have a single type annotation with term type '{1}'.. + /// + internal static string Edm_Evaluator_NoTermTypeAnnotationOnType { + get { + return ResourceManager.GetString("Edm_Evaluator_NoTermTypeAnnotationOnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Element must have a single annotation with term '{0}'.. + /// + internal static string Edm_Evaluator_NoValueAnnotationOnElement { + get { + return ResourceManager.GetString("Edm_Evaluator_NoValueAnnotationOnElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' must have a single annotation with term '{1}'.. + /// + internal static string Edm_Evaluator_NoValueAnnotationOnType { + get { + return ResourceManager.GetString("Edm_Evaluator_NoValueAnnotationOnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An edm model must be provided for type cast.. + /// + internal static string Edm_Evaluator_TypeCastNeedsEdmModel { + get { + return ResourceManager.GetString("Edm_Evaluator_TypeCastNeedsEdmModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Function '{0}' is not present in the execution environment.. + /// + internal static string Edm_Evaluator_UnboundFunction { + get { + return ResourceManager.GetString("Edm_Evaluator_UnboundFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path segment '{0}' has no binding in the execution environment.. + /// + internal static string Edm_Evaluator_UnboundPath { + get { + return ResourceManager.GetString("Edm_Evaluator_UnboundPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expression with kind '{0}' cannot be evaluated.. + /// + internal static string Edm_Evaluator_UnrecognizedExpressionKind { + get { + return ResourceManager.GetString("Edm_Evaluator_UnrecognizedExpressionKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An element with type 'None' cannot be used in an entity container.. + /// + internal static string EdmEntityContainer_CannotUseElementWithTypeNone { + get { + return ResourceManager.GetString("EdmEntityContainer_CannotUseElementWithTypeNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot add more than one entity container to an edm model.. + /// + internal static string EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel { + get { + return ResourceManager.GetString("EdmModel_CannotAddMoreThanOneEntityContainerToOneEdmModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An element with type 'None' cannot be used in a model.. + /// + internal static string EdmModel_CannotUseElementWithTypeNone { + get { + return ResourceManager.GetString("EdmModel_CannotUseElementWithTypeNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The named type '{0}' is ambiguous from the model being validated.. + /// + internal static string EdmModel_Validator_Semantic_AmbiguousType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_AmbiguousType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property type could not be determined from the role '{0}'.. + /// + internal static string EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BadNavigationPropertyCouldNotDetermineType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}'is not valid. The from role and to role are the same.. + /// + internal static string EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BadNavigationPropertyRolesCannotBeTheSame", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' is not valid. The role '{1}' is not defined in relationship '{2}'.. + /// + internal static string EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BadNavigationPropertyUndefinedRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base type kind of a structured type must be the same as its derived type.. + /// + internal static string EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base type of open type '{0}' is not open type.. + /// + internal static string EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the binary constant is '{0}' characters long, but the max length of its type is '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bound function overload '{0}' does not have the same return type as other function overloads. Expected type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Bound operation '{0}' must have at least one parameter.. + /// + internal static string EdmModel_Validator_Semantic_BoundOperationMustHaveParameters { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_BoundOperationMustHaveParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot assert the nullable type '{0}' as a non-nullable type.. + /// + internal static string EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The association set '{0}' must specify an entity set for the role '{2}' because there are multiple entity sets for the role type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_CannotInferEntitySetWithMultipleSetsPerType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A collection expression is incompatible with a non-collection type.. + /// + internal static string EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' is invalid. A complex type must contain at least one property.. + /// + internal static string EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ComplexTypeMustHaveProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot belong to a type other than its declaring type. . + /// + internal static string EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The declaring type '{0}' of {1} '{2}' cannot include path type property.. + /// + internal static string EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty" + + "", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependent property '{0}' must belong to the dependent entity '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotated element '{0}' has multiple annotations with the term '{1}' and the qualifier '{2}'.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateAnnotation { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependent property '{0}' of navigation property '{1}' is a duplicate.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateDependentProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateDependentProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An end with the name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateEndName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateEndName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each member name in an EntityContainer must be unique. A member with name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each entity container name in a function must be unique. The name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateEntityContainerName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateEntityContainerName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' should have only a single mapping for the property '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key specified in entity type '{0}' is not valid. Property '{1}' is referenced more than once in the key element.. + /// + internal static string EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type 'Edm.EntityType' cannot be used as the type of an entity set '{0}' in an entity container.. + /// + internal static string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type 'Edm.EntityType' cannot be used as the type of a singleton '{0}' in an entity container.. + /// + internal static string EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Edm.PrimitiveType' cannot be used as the type of a key property '{0}' of an entity type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Edm.PrimitiveType' cannot be used as the underlying type of '{0}' type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An element already has a direct annotation with the namespace '{0}' and name '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each name and plural name in a relationship must be unique. '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EndNameAlreadyDefinedDuplicate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' cannot have 'OnDelete' specified since its multiplicity is '*'.. + /// + internal static string EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' has more than one composable escape functions '{1}' defined.. + /// + internal static string EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An entity container element without other errors must not have kind of none. The kind of entity container element '{0}' is none.. + /// + internal static string EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' in entity type '{1}' is not valid. All properties that are part of the entity key must be of primitive type.. + /// + internal static string EdmModel_Validator_Semantic_EntityKeyMustBeScalar { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntityKeyMustBeScalar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' has more than one non-composable escape functions '{1}' defined.. + /// + internal static string EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' is invalid because it is contained by more than one navigation property.. + /// + internal static string EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationPropert" + + "y", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Because the navigation property '{0}' is recursive, the mapping from the entity set '{1}' must point back to itself.. + /// + internal static string EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPoint" + + "BackToSourceEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the entity set '{1}' is not valid, it must be collection of entity type.. + /// + internal static string EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each member name of an enum type must be unique. Enum member name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of enum member '{0}' exceeds the range of its underlying type.. + /// + internal static string EdmModel_Validator_Semantic_EnumMemberValueOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EnumMemberValueOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The underlying type of '{0}' is not valid. The underlying type of an enum type must be an integral type. . + /// + internal static string EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enum expression is not compatible with the asserted type.. + /// + internal static string EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the expression is incompatible with the asserted type.. + /// + internal static string EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot promote the primitive type '{0}' to the specified primitive type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The primitive expression is not compatible with the asserted type.. + /// + internal static string EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function import '{0}' should not be included in service document because it has parameter.. + /// + internal static string EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServi" + + "ceDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function '{0}' must specify a return type.. + /// + internal static string EdmModel_Validator_Semantic_FunctionMustHaveReturnType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_FunctionMustHaveReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target '{0}' could not be found from the model being validated.. + /// + internal static string EdmModel_Validator_Semantic_InaccessibleTarget { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InaccessibleTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The term '{0}' could not be found from the model being validated.. + /// + internal static string EdmModel_Validator_Semantic_InaccessibleTerm { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InaccessibleTerm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The named type '{0}' could not be found from the model being validated.. + /// + internal static string EdmModel_Validator_Semantic_InaccessibleType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InaccessibleType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function application provides '{0}' arguments, but the function '{1}' expects '{2}' arguments.. + /// + internal static string EdmModel_Validator_Semantic_IncorrectNumberOfArguments { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_IncorrectNumberOfArguments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the integer constant is out of range for the asserted type.. + /// + internal static string EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' is marked as abstract. Abstract complex types are only supported in version 1.1 EDM models.. + /// + internal static string EdmModel_Validator_Semantic_InvalidComplexTypeAbstract { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidComplexTypeAbstract", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The complex type '{0}' has a base type specified. Complex type inheritance is only supported in version 1.1 EDM models.. + /// + internal static string EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidComplexTypePolymorphic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The declared name and namespace of the annotation must match the name and namespace of its xml value.. + /// + internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of an annotation marked to be serialized as an xml element must be IEdmStringValue.. + /// + internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of an annotation marked to be serialized as an xml element must be a string representing an xml element with non-empty name and namespace.. + /// + internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of an annotation marked to be serialized as an xml element must have a well-formed xml value.. + /// + internal static string EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment that doesn't derive from the entity type '{2}' for type segment '{3}'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path doesn't contain the binding parameter name.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that is not an entity type.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path '{1}' has a navigation property segment '{2}' that is unknown.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that cannot be found in the model.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' is invalid. The first item of the path '{2}' is '{3}' which does not match the first parameter name {3}. The first segment of the entity set path is required to be the name of the first parameter.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatching" + + "FirstParameterName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' has an invalid value. The path '{1}' has a binding parameter that references a type '{2}' that is not an entity type.. + /// + internal static string EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key usage is not valid. '{0}' cannot define keys because one of its base classes '{1}' defines keys.. + /// + internal static string EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key part '{0}' for type '{1}' is not valid. All parts of the key must be non nullable.. + /// + internal static string EdmModel_Validator_Semantic_InvalidKeyNullablePart { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidKeyNullablePart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The member name '{0}' cannot be used in a type with the same name. Member names cannot be the same as their enclosing type.. + /// + internal static string EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties don't represent the dependent end key, the the multiplicity of the dependent end must be '*'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties represent the dependent end key, the multiplicity of the dependent end must be '0..1' or '1'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Because all dependent properties of the navigation '{0}' are non-nullable, the multiplicity of the principal end must be '1'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesA" + + "llNonnullable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Because all dependent properties of the navigation '{0}' are nullable, the multiplicity of the principal end must be '0..1'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesA" + + "llNullable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the navigation property '{0}' is invalid. The navigation target type must be an entity type or a collection of entity type. The navigation target entity type must match the declaring type of the partner property.. + /// + internal static string EdmModel_Validator_Semantic_InvalidNavigationPropertyType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidNavigationPropertyType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An on delete action can only be specified on one end of an association.. + /// + internal static string EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no property with name '{0}' defined in the type referred to by role '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintDependentEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The principal end properties in the referential constraint of the association '{0}' do not match the key of the type referred to by role '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidPropertyInRelationshipConstraintPrimaryEnd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property cannot be of type '{0}'. The property type must be a complex, a primitive, an enum, a type definition or an untyped type, or a collection of complex, primitive, enum types, or type definition.. + /// + internal static string EdmModel_Validator_Semantic_InvalidPropertyType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_InvalidPropertyType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The string reference is invalid because if 'IsUnbounded' is true 'MaxLength' must be null.. + /// + internal static string EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' has no key defined. Define the key for this entity type.. + /// + internal static string EdmModel_Validator_Semantic_KeyMissingOnEntityType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_KeyMissingOnEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key property '{0}' must belong to the entity '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Max length can range from 1 to 2^31.. + /// + internal static string EdmModel_Validator_Semantic_MaxLengthOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_MaxLengthOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The number of properties in the dependent and principal role in a relationship constraint must be exactly identical.. + /// + internal static string EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_MismatchNumberOfPropertiesinRelationshipConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bound action '{0}' is a duplicate of other bound actions. For bound actions the combination of the namespace, name, and binding parameter type uniquely identifies an bound action.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundActions { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateBoundActions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and unordered set of parameter names uniquely identifies a bound function.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and ordered set of parameter types uniquely identifies a bound function.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The unbound action '{0}' is a duplicate of other unbound actions. For unbound actions the combination of the namespace, and name uniquely identifies an unbound action.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and unordered set of parameter names uniquely identifies an unbound function.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and ordered set of parameter types uniquely identifies an unbound function.. + /// + internal static string EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The binding of the entity set or singleton '{0}' on navigation property '{1}' is invalid, the binding of bidirectional navigation property must be bidirectional if specified. . + /// + internal static string EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property '{0}' is invalid because it indirectly contains itself.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItsel" + + "f", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set or singleton '{1}' is not a valid destination for the navigation property '{0}' because it cannot hold an element of the target entity type.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForPro" + + "perty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property mapping '{0}' is invalid because its type is collection but target to a singleton '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSing" + + "leton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The principal navigation property '{0}' has an invalid multiplicity. Valid values for the multiplicity of a principal end are '0..1' or '1'.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundM" + + "ustBeOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is not the same as the target entity type, then the property represents a non-recursive containment and the multiplicity of the navigation source must be exactly one.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMu" + + "stBeFromOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and the multiplicity of the navigation source must be zero or one.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustB" + + "eFromZeroOrOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and it must have an optional target represented by a collection or a nullable entity type.. + /// + internal static string EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustB" + + "eOptional", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set or singleton '{0}' is based on type '{1}' that has no keys defined.. + /// + internal static string EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The association set '{0}' cannot assume an entity set for the role '{2}' because there are no entity sets for the role type '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_NoEntitySetsFoundForType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NoEntitySetsFoundForType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Null value cannot have a non-nullable type.. + /// + internal static string EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only entity types can be open types.. + /// + internal static string EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OpenTypesSupportedForEntityTypesOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The unbound operation '{0}' has an entity set path defined. Entity set path can only be defined on bound operations.. + /// + internal static string EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' imports operation '{1}' that is bound. Only an unbound operation can be imported using an operation import.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' specifies an entity set expression which is not valid. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' specifies an entity set of kind '{1}' which is not supported in this context. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' returns entities of type '{1}' that cannot exist in the entity set '{2}' specified for the operation import.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' returns entities of type '{1}' that cannot be returned by the entity set path specified for the operation import.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2 { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' specifies an entity set but does not return entities.. + /// + internal static string EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be used as the return type of a function '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' entity set path determined entity type '{1}' is not assignable to the return type '{2}'.. + /// + internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssigna" + + "ble", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' entity set path was determined to be a reference property but the return type is a collection.. + /// + internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityT" + + "ypeMismatchesEntityTypeReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation '{0}' has an entity set path and with an invalid return type. The return type is required to be an entity type or a collection of entity type.. + /// + internal static string EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The return type is not valid in operation '{0}'. The operation has an unsupported type.. + /// + internal static string EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each parameter name in a operation must be unique. The parameter name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The path cannot be resolved in the given context. The segment '{0}' failed to resolve.. + /// + internal static string EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Precision cannot be negative.. + /// + internal static string EdmModel_Validator_Semantic_PrecisionOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PrecisionOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A primitive expression is incompatible with a non-primitive type.. + /// + internal static string EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveTyp" + + "e", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A primitive type without other errors must not have kind of none. The kind of primitive type '{0}' is none.. + /// + internal static string EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A property without other errors must not have kind of none. The kind of property '{0}' is none.. + /// + internal static string EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Each property name in a type must be unique. Property name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_PropertyNameAlreadyDefined { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PropertyNameAlreadyDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be used as the type of a property '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the record expression is not open and does not contain a property named '{0}'.. + /// + internal static string EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The record expression does not have a constructor for a property named '{0}'.. + /// + internal static string EdmModel_Validator_Semantic_RecordExpressionMissingProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_RecordExpressionMissingProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A record expression is incompatible with a non-structured type.. + /// + internal static string EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The nullability of the property '{0}' is invalid. If a complex typed property is of the same type (or base type) as its declaring type, then the property represents a recursive containment and the given property must be optional.. + /// + internal static string EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Required Parameter '{0}' must not follow an optional parameter.. + /// + internal static string EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In relationship '{0}', the principal and dependent role of the referential constraint refers to the same role in the relationship type.. + /// + internal static string EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_SameRoleReferredInReferentialConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The scale value can range from 0 through the specified precision value.. + /// + internal static string EdmModel_Validator_Semantic_ScaleOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_ScaleOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A schema element without other errors must not have kind of none. The kind of schema element '{0}' is none.. + /// + internal static string EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An element with the name '{0}' is already defined.. + /// + internal static string EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the singleton '{1}' is not valid, it must be entity type.. + /// + internal static string EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the string constant is '{0}' characters long, but the max length of its type is '{1}'.. + /// + internal static string EdmModel_Validator_Semantic_StringConstantLengthOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_StringConstantLengthOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The max length facet specifies the maximum length of an instance of the string type. For unicode equal to 'true', the max length can range from 1 to 2^30, or if 'false', 1 to 2^31.. + /// + internal static string EdmModel_Validator_Semantic_StringMaxLengthOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_StringMaxLengthOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be the base type of an '{1}' type '{2}'.. + /// + internal static string EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The namespace '{0}' is a system namespace and cannot be used by non-system types. Please choose a different namespace.. + /// + internal static string EdmModel_Validator_Semantic_SystemNamespaceEncountered { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_SystemNamespaceEncountered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to They type of the type annotation is not open, and does not contain a property named '{0}'.. + /// + internal static string EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_TypeAnnotationHasExtraProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type annotation is missing a binding for the property '{0}'.. + /// + internal static string EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_TypeAnnotationMissingRequiredProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint.. + /// + internal static string EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A type without other errors must not have kind of none.. + /// + internal static string EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of navigation property '{1}' on declaring type '{2}' cannot include path type property.. + /// + internal static string EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function '{0}' has a different return type than other function overloads with the same name. Functions with the same name must have the same return type.. + /// + internal static string EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The UrlEscape function '{0}' must be a bound function.. + /// + internal static string EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The UrlEscape function '{0}' must have and only have one 'Edm.String' parameter.. + /// + internal static string EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The target '{0}' of the annotation is not allowed in the AppliesTo '{1}' of the term '{2}'.".. + /// + internal static string EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable { + get { + return ResourceManager.GetString("EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified name is not allowed: '{0}'.. + /// + internal static string EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified name must not be longer than 480 characters: '{0}'.. + /// + internal static string EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified namespace name is not allowed: '{0}'.. + /// + internal static string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified name must not be longer than 480 characters: '{0}'.. + /// + internal static string EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the enumeration the property '{0}.{1}' contains a null element. Enumeration properties must not contain null elements.. + /// + internal static string EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}.{1}' of type '{2}' has value '{3}' that is not a valid enum member.. + /// + internal static string EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The chain of base types of type '{0}' is cyclic.. + /// + internal static string EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_InterfaceCriticalCycleInTypeHierarchy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An object with the value '{0}' of the '{1}.{2}' property must implement '{3}' interface.. + /// + internal static string EdmModel_Validator_Syntactic_InterfaceKindValueMismatch { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_InterfaceKindValueMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' of the property '{1}.{2}' is not semantically valid. A semantically valid model must not contain elements of kind '{0}'.. + /// + internal static string EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name is missing or not valid.. + /// + internal static string EdmModel_Validator_Syntactic_MissingName { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_MissingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The namespace name is missing or not valid.. + /// + internal static string EdmModel_Validator_Syntactic_MissingNamespaceName { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_MissingNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The partner of the navigation property '{0}' must not be the same property, and must point back to the navigation property.. + /// + internal static string EdmModel_Validator_Syntactic_NavigationPartnerInvalid { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_NavigationPartnerInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the property '{0}.{1}' must not be null.. + /// + internal static string EdmModel_Validator_Syntactic_PropertyMustNotBeNull { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_PropertyMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An object implementing '{0}' interface has type definition of kind '{1}'. The type reference interface must match to the kind of the definition.. + /// + internal static string EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch { + get { + return ResourceManager.GetString("EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered the following errors when parsing the CSDL document: \r\n{0}. + /// + internal static string EdmParseException_ErrorsEncounteredInEdmx { + get { + return ResourceManager.GetString("EdmParseException_ErrorsEncounteredInEdmx", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected path type kind.. + /// + internal static string EdmPath_UnexpectedKind { + get { + return ResourceManager.GetString("EdmPath_UnexpectedKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected primitive type kind.. + /// + internal static string EdmPrimitive_UnexpectedKind { + get { + return ResourceManager.GetString("EdmPrimitive_UnexpectedKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Conversion of an edm collection value to the CLR type '{0}' is not supported. EDM collection values can be converted to System.Collections.Generic.IEnumerable{T}, System.Collections.Generic.IList{T} or System.Collections.Generic.ICollection{T}.. + /// + internal static string EdmToClr_CannotConvertEdmCollectionValueToClrType { + get { + return ResourceManager.GetString("EdmToClr_CannotConvertEdmCollectionValueToClrType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Conversion of an EDM value of the type '{0}' to the CLR type '{1}' is not supported.. + /// + internal static string EdmToClr_CannotConvertEdmValueToClrType { + get { + return ResourceManager.GetString("EdmToClr_CannotConvertEdmValueToClrType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot initialize a property '{0}' on an object of type '{1}'. The property already has a value.. + /// + internal static string EdmToClr_IEnumerableOfTPropertyAlreadyHasValue { + get { + return ResourceManager.GetString("EdmToClr_IEnumerableOfTPropertyAlreadyHasValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An EDM structured value contains multiple values for the property '{0}'. Conversion of an EDM structured value with duplicate property values is not supported.. + /// + internal static string EdmToClr_StructuredPropertyDuplicateValue { + get { + return ResourceManager.GetString("EdmToClr_StructuredPropertyDuplicateValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Conversion of an EDM structured value is supported only to a CLR class.. + /// + internal static string EdmToClr_StructuredValueMappedToNonClass { + get { + return ResourceManager.GetString("EdmToClr_StructuredValueMappedToNonClass", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the object returned by the TryCreateObjectInstance delegate is not assignable to the expected type '{1}'.. + /// + internal static string EdmToClr_TryCreateObjectInstanceReturnedWrongObject { + get { + return ResourceManager.GetString("EdmToClr_TryCreateObjectInstanceReturnedWrongObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Conversion of EDM values to a CLR type with type {0} is not supported.. + /// + internal static string EdmToClr_UnsupportedType { + get { + return ResourceManager.GetString("EdmToClr_UnsupportedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected Edm type.. + /// + internal static string EdmType_UnexpectedEdmType { + get { + return ResourceManager.GetString("EdmType_UnexpectedEdmType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An annotation of type string was expected for the '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' annotation, but an annotation of type '{1}' was found.. + /// + internal static string EdmUtil_InvalidAnnotationValue { + get { + return ResourceManager.GetString("EdmUtil_InvalidAnnotationValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The MIME type annotation must not have a null value.. + /// + internal static string EdmUtil_NullValueForMimeTypeAnnotation { + get { + return ResourceManager.GetString("EdmUtil_NullValueForMimeTypeAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Annotation expressions must specify a value or use a term with a specified default value. Cannot find a default value for the given annotation term, '{0}'.. + /// + internal static string EdmVocabularyAnnotations_DidNotFindDefaultValue { + get { + return ResourceManager.GetString("EdmVocabularyAnnotations_DidNotFindDefaultValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid to set inline location for a path target '{0}'.. + /// + internal static string EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation { + get { + return ResourceManager.GetString("EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Term type '{0}' is not supported for value retrieval.. + /// + internal static string EdmVocabularyAnnotations_TermTypeNotSupported { + get { + return ResourceManager.GetString("EdmVocabularyAnnotations_TermTypeNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected {0} element while parsing Edmx. Edmx is expected to have at most one of 'Runtime' or 'DataServices' elements.. + /// + internal static string EdmxParser_BodyElement { + get { + return ResourceManager.GetString("EdmxParser_BodyElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDMX version specified in the 'Version' attribute does not match the version corresponding to the namespace of the 'Edmx' element.. + /// + internal static string EdmxParser_EdmxVersionMismatch { + get { + return ResourceManager.GetString("EdmxParser_EdmxVersionMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to edmx:Reference must contain at least one edmx:Includes or edmx:IncludeAnnotations.. + /// + internal static string EdmxParser_InvalidReferenceIncorrectNumberOfIncludes { + get { + return ResourceManager.GetString("EdmxParser_InvalidReferenceIncorrectNumberOfIncludes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unresolved Uri found in edmx:Reference, getReferencedModelReaderFunc should not return null when the URI is not a well-known schema.. + /// + internal static string EdmxParser_UnresolvedReferenceUriInEdmxReference { + get { + return ResourceManager.GetString("EdmxParser_UnresolvedReferenceUriInEdmxReference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one properties match the name '{0}' were found in type '{1}'.. + /// + internal static string MultipleMatchingPropertiesFound { + get { + return ResourceManager.GetString("MultipleMatchingPropertiesFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property binding path is not valid.. + /// + internal static string NavigationPropertyBinding_PathIsNotValid { + get { + return ResourceManager.GetString("NavigationPropertyBinding_PathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path segments must not contain '/' character.. + /// + internal static string PathSegmentMustNotContainSlash { + get { + return ResourceManager.GetString("PathSegmentMustNotContainSlash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information.. + /// + internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone { + get { + return ResourceManager.GetString("PlatformHelper_DateTimeOffsetMustContainTimeZone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The same rule cannot be in the same rule set twice.. + /// + internal static string RuleSet_DuplicateRulesExistInRuleSet { + get { + return ResourceManager.GetString("RuleSet_DuplicateRulesExistInRuleSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import '{0}' could not be serialized because its return type cannot be represented inline.. + /// + internal static string Serializer_NonInlineOperationImportReturnType { + get { + return ResourceManager.GetString("Serializer_NonInlineOperationImportReturnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No CSDL is written because no schema elements could be produced. This is likely because the model is empty.. + /// + internal static string Serializer_NoSchemasProduced { + get { + return ResourceManager.GetString("Serializer_NoSchemasProduced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The annotation can not be serialized with an invalid target name. The name '{0}' is invalid.. + /// + internal static string Serializer_OutOfLineAnnotationTargetMustHaveValidName { + get { + return ResourceManager.GetString("Serializer_OutOfLineAnnotationTargetMustHaveValidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A referenced type can not be serialized with an invalid name. The name '{0}' is invalid.. + /// + internal static string Serializer_ReferencedTypeMustHaveValidName { + get { + return ResourceManager.GetString("Serializer_ReferencedTypeMustHaveValidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Single file provided but model cannot be serialized into single file.. + /// + internal static string Serializer_SingleFileExpected { + get { + return ResourceManager.GetString("Serializer_SingleFileExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown Edm version '{0}'.. + /// + internal static string Serializer_UnknownEdmVersion { + get { + return ResourceManager.GetString("Serializer_UnknownEdmVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown Edmx version '{0}'.. + /// + internal static string Serializer_UnknownEdmxVersion { + get { + return ResourceManager.GetString("Serializer_UnknownEdmxVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to First segment must be IEdmEntityContainer.. + /// + internal static string TargetPath_FirstSegmentMustBeIEdmEntityContainer { + get { + return ResourceManager.GetString("TargetPath_FirstSegmentMustBeIEdmEntityContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Second segment must be IEdmEntityContainerElement.. + /// + internal static string TargetPath_SecondSegmentMustBeIEdmEntityContainerElement { + get { + return ResourceManager.GetString("TargetPath_SecondSegmentMustBeIEdmEntityContainerElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target path segments must not contain a null segment.. + /// + internal static string TargetPath_SegmentsMustNotContainNullSegment { + get { + return ResourceManager.GetString("TargetPath_SegmentsMustNotContainNullSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The TimeSpan value '{0}' is out of representable TimeOfDay range.. + /// + internal static string TimeOfDay_ConvertErrorFromTimeSpan { + get { + return ResourceManager.GetString("TimeOfDay_ConvertErrorFromTimeSpan", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Target object '{0}' is not an instance with type of TimeOfDay.. + /// + internal static string TimeOfDay_InvalidCompareToTarget { + get { + return ResourceManager.GetString("TimeOfDay_InvalidCompareToTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to String '{0}' was not recognized as a valid TimeOfDay.. + /// + internal static string TimeOfDay_InvalidParsingString { + get { + return ResourceManager.GetString("TimeOfDay_InvalidParsingString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Hour '{0}', Minute '{1}', Second '{2}' and Millisecond '{3}' parameters describe an un-representable TimeOfDay.. + /// + internal static string TimeOfDay_InvalidTimeOfDayParameters { + get { + return ResourceManager.GetString("TimeOfDay_InvalidTimeOfDayParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ticks value '{0}' is out of representable TimeOfDay range.. + /// + internal static string TimeOfDay_TicksOutOfRange { + get { + return ResourceManager.GetString("TimeOfDay_TicksOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encountered invalid type cast. '{0}' is not assignable from '{1}'.. + /// + internal static string TypeCast_HierarchyNotFollowed { + get { + return ResourceManager.GetString("TypeCast_HierarchyNotFollowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' could not be converted to be a '{1}' type.. + /// + internal static string TypeSemantics_CouldNotConvertTypeReference { + get { + return ResourceManager.GetString("TypeSemantics_CouldNotConvertTypeReference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid container element kind: '{0}'. + /// + internal static string UnknownEnumVal_ContainerElementKind { + get { + return ResourceManager.GetString("UnknownEnumVal_ContainerElementKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid CSDL target: '{0}'. + /// + internal static string UnknownEnumVal_CsdlTarget { + get { + return ResourceManager.GetString("UnknownEnumVal_CsdlTarget", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid expression kind: '{0}'. + /// + internal static string UnknownEnumVal_ExpressionKind { + get { + return ResourceManager.GetString("UnknownEnumVal_ExpressionKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid multiplicity: '{0}'. + /// + internal static string UnknownEnumVal_Multiplicity { + get { + return ResourceManager.GetString("UnknownEnumVal_Multiplicity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid primitive kind: '{0}'. + /// + internal static string UnknownEnumVal_PrimitiveKind { + get { + return ResourceManager.GetString("UnknownEnumVal_PrimitiveKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid property kind: '{0}'. + /// + internal static string UnknownEnumVal_PropertyKind { + get { + return ResourceManager.GetString("UnknownEnumVal_PropertyKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid schema element kind: '{0}'. + /// + internal static string UnknownEnumVal_SchemaElementKind { + get { + return ResourceManager.GetString("UnknownEnumVal_SchemaElementKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid type kind: '{0}'. + /// + internal static string UnknownEnumVal_TypeKind { + get { + return ResourceManager.GetString("UnknownEnumVal_TypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value has already been set.. + /// + internal static string ValueHasAlreadyBeenSet { + get { + return ResourceManager.GetString("ValueHasAlreadyBeenSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid binary value. The value must be a hexadecimal string and must not be prefixed by '0x'.. + /// + internal static string ValueParser_InvalidBinary { + get { + return ResourceManager.GetString("ValueParser_InvalidBinary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid boolean. The value must be 'true' or 'false'.. + /// + internal static string ValueParser_InvalidBoolean { + get { + return ResourceManager.GetString("ValueParser_InvalidBoolean", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid date value.. + /// + internal static string ValueParser_InvalidDate { + get { + return ResourceManager.GetString("ValueParser_InvalidDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid date time value.. + /// + internal static string ValueParser_InvalidDateTime { + get { + return ResourceManager.GetString("ValueParser_InvalidDateTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid date time offset value.. + /// + internal static string ValueParser_InvalidDateTimeOffset { + get { + return ResourceManager.GetString("ValueParser_InvalidDateTimeOffset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid decimal.. + /// + internal static string ValueParser_InvalidDecimal { + get { + return ResourceManager.GetString("ValueParser_InvalidDecimal", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid duration value.. + /// + internal static string ValueParser_InvalidDuration { + get { + return ResourceManager.GetString("ValueParser_InvalidDuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid floating point value.. + /// + internal static string ValueParser_InvalidFloatingPoint { + get { + return ResourceManager.GetString("ValueParser_InvalidFloatingPoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid Guid.. + /// + internal static string ValueParser_InvalidGuid { + get { + return ResourceManager.GetString("ValueParser_InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid integer. The value must be a valid 32 bit integer.. + /// + internal static string ValueParser_InvalidInteger { + get { + return ResourceManager.GetString("ValueParser_InvalidInteger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid integer. The value must be a valid 64 bit integer.. + /// + internal static string ValueParser_InvalidLong { + get { + return ResourceManager.GetString("ValueParser_InvalidLong", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid integer. The value must be a valid 32 bit integer or 'Max'.. + /// + internal static string ValueParser_InvalidMaxLength { + get { + return ResourceManager.GetString("ValueParser_InvalidMaxLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid scale. The value must either be a 32 bit integer or 'Variable'.. + /// + internal static string ValueParser_InvalidScale { + get { + return ResourceManager.GetString("ValueParser_InvalidScale", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid SRID. The value must either be a 32 bit integer or 'Variable'.. + /// + internal static string ValueParser_InvalidSrid { + get { + return ResourceManager.GetString("ValueParser_InvalidSrid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not a valid TimeOfDay value.. + /// + internal static string ValueParser_InvalidTimeOfDay { + get { + return ResourceManager.GetString("ValueParser_InvalidTimeOfDay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value writer cannot write a value of kind '{0}'.. + /// + internal static string ValueWriter_NonSerializableValue { + get { + return ResourceManager.GetString("ValueWriter_NonSerializableValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not contain a schema definition, or the XmlReader provided started at the end of the file.. + /// + internal static string XmlParser_EmptyFile { + get { + return ResourceManager.GetString("XmlParser_EmptyFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The source XmlReader does not contain a schema definition or started at the end of the file.. + /// + internal static string XmlParser_EmptySchemaTextReader { + get { + return ResourceManager.GetString("XmlParser_EmptySchemaTextReader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Required schema attribute '{0}' is not present on element '{1}'.. + /// + internal static string XmlParser_MissingAttribute { + get { + return ResourceManager.GetString("XmlParser_MissingAttribute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current schema element does not support text '{0}'.. + /// + internal static string XmlParser_TextNotAllowed { + get { + return ResourceManager.GetString("XmlParser_TextNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' was not expected in the given context.. + /// + internal static string XmlParser_UnexpectedAttribute { + get { + return ResourceManager.GetString("XmlParser_UnexpectedAttribute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The schema element '{0}' was not expected in the given context.. + /// + internal static string XmlParser_UnexpectedElement { + get { + return ResourceManager.GetString("XmlParser_UnexpectedElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected XML node type: {0}.. + /// + internal static string XmlParser_UnexpectedNodeType { + get { + return ResourceManager.GetString("XmlParser_UnexpectedNodeType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The element '{0}' was unexpected for the root element. The root element should be {1}.. + /// + internal static string XmlParser_UnexpectedRootElement { + get { + return ResourceManager.GetString("XmlParser_UnexpectedRootElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The root element has no namespace. The root element is expected to belong to one of the following namespaces: '{0}'.. + /// + internal static string XmlParser_UnexpectedRootElementNoNamespace { + get { + return ResourceManager.GetString("XmlParser_UnexpectedRootElementNoNamespace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The namespace '{0}' is invalid. The root element is expected to belong to one of the following namespaces: '{1}'.. + /// + internal static string XmlParser_UnexpectedRootElementWrongNamespace { + get { + return ResourceManager.GetString("XmlParser_UnexpectedRootElementWrongNamespace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unused schema element: '{0}'.. + /// + internal static string XmlParser_UnusedElement { + get { + return ResourceManager.GetString("XmlParser_UnusedElement", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.OData.Edm/SRResources.resx b/src/Microsoft.OData.Edm/SRResources.resx new file mode 100644 index 0000000000..89d1de7a7c --- /dev/null +++ b/src/Microsoft.OData.Edm/SRResources.resx @@ -0,0 +1,1050 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unexpected primitive type kind. + + + Unexpected path type kind. + + + Annotation of type '{0}' cannot be interpreted as '{1}'. + + + The annotation must have non-null target. + + + An entity type or a collection of an entity type is expected. + + + Navigation target entity type must be '{0}'. + + + The type '{0}' could not be converted to be a '{1}' type. + + + An element with type 'None' cannot be used in a model. + + + Cannot add more than one entity container to an edm model. + + + An element with type 'None' cannot be used in an entity container. + + + The value writer cannot write a value of kind '{0}'. + + + Value has already been set. + + + Path segments must not contain '/' character. + + + The number of dependent properties must match the number of key properties on the principal entity type. '{0}' principal properties were provided, but {1} dependent properties were provided. + + + Unexpected Edm type. + + + The navigation property binding path is not valid. + + + More than one properties match the name '{0}' were found in type '{1}'. + + + First segment must be IEdmEntityContainer. + + + Second segment must be IEdmEntityContainerElement. + + + Target path segments must not contain a null segment. + + + Encountered invalid type cast. '{0}' is not assignable from '{1}'. + + + Type '{0}' must have a single type annotation with term type '{1}'. + + + Type '{0}' must have a single annotation with term '{1}'. + + + Element must have a single annotation with term '{0}'. + + + Expression with kind '{0}' cannot be evaluated. + + + Function '{0}' is not present in the execution environment. + + + Path segment '{0}' has no binding in the execution environment. + + + A containing object cannot be null when getting value of an annotation with Path in the execution environment. + + + Value fails to match type '{0}'. + + + An edm model must be provided for type cast. + + + The namespace '{0}' is a system namespace and cannot be used by non-system types. Please choose a different namespace. + + + The entity set or singleton '{0}' is based on type '{1}' that has no keys defined. + + + An end with the name '{0}' is already defined. + + + The key specified in entity type '{0}' is not valid. Property '{1}' is referenced more than once in the key element. + + + The complex type '{0}' is marked as abstract. Abstract complex types are only supported in version 1.1 EDM models. + + + The complex type '{0}' has a base type specified. Complex type inheritance is only supported in version 1.1 EDM models. + + + The key part '{0}' for type '{1}' is not valid. All parts of the key must be non nullable. + + + The property '{0}' in entity type '{1}' is not valid. All properties that are part of the entity key must be of primitive type. + + + The entity type '{0}' has more than one composable escape functions '{1}' defined. + + + The entity type '{0}' has more than one non-composable escape functions '{1}' defined. + + + The key usage is not valid. '{0}' cannot define keys because one of its base classes '{1}' defines keys. + + + The entity type '{0}' has no key defined. Define the key for this entity type. + + + The navigation property '{0}' is not valid. The role '{1}' is not defined in relationship '{2}'. + + + The navigation property '{0}'is not valid. The from role and to role are the same. + + + The navigation property type could not be determined from the role '{0}'. + + + An on delete action can only be specified on one end of an association. + + + The navigation property '{0}' cannot have 'OnDelete' specified since its multiplicity is '*'. + + + Each name and plural name in a relationship must be unique. '{0}' is already defined. + + + In relationship '{0}', the principal and dependent role of the referential constraint refers to the same role in the relationship type. + + + The principal navigation property '{0}' has an invalid multiplicity. Valid values for the multiplicity of a principal end are '0..1' or '1'. + + + Because all dependent properties of the navigation '{0}' are non-nullable, the multiplicity of the principal end must be '1'. + + + Because all dependent properties of the navigation '{0}' are nullable, the multiplicity of the principal end must be '0..1'. + + + The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties represent the dependent end key, the multiplicity of the dependent end must be '0..1' or '1'. + + + The multiplicity of the dependent end '{0}' is not valid. Because the dependent properties don't represent the dependent end key, the the multiplicity of the dependent end must be '*'. + + + The number of properties in the dependent and principal role in a relationship constraint must be exactly identical. + + + The types of all properties in the dependent role of a referential constraint must be the same as the corresponding property types in the principal role. The type of property '{0}' on entity '{1}' does not match the type of property '{2}' on entity '{3}' in the referential constraint. + + + There is no property with name '{0}' defined in the type referred to by role '{1}'. + + + The principal end properties in the referential constraint of the association '{0}' do not match the key of the type referred to by role '{1}'. + + + A property cannot be of type '{0}'. The property type must be a complex, a primitive, an enum, a type definition or an untyped type, or a collection of complex, primitive, enum types, or type definition. + + + The Bound operation '{0}' must have at least one parameter. + + + Required Parameter '{0}' must not follow an optional parameter. + + + The return type is not valid in operation '{0}'. The operation has an unsupported type. + + + The operation import '{0}' returns entities of type '{1}' that cannot exist in the entity set '{2}' specified for the operation import. + + + The operation import '{0}' returns entities of type '{1}' that cannot be returned by the entity set path specified for the operation import. + + + The operation import '{0}' specifies an entity set of kind '{1}' which is not supported in this context. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties. + + + The operation import '{0}' specifies an entity set expression which is not valid. Operation import entity set expression can be either an entity set reference or a path starting with a operation import parameter and traversing navigation properties. + + + The operation import '{0}' specifies an entity set but does not return entities. + + + The operation import '{0}' imports operation '{1}' that is bound. Only an unbound operation can be imported using an operation import. + + + The function import '{0}' should not be included in service document because it has parameter. + + + The function '{0}' must specify a return type. + + + The UrlEscape function '{0}' must be a bound function. + + + The UrlEscape function '{0}' must have and only have one 'Edm.String' parameter. + + + Each parameter name in a operation must be unique. The parameter name '{0}' is already defined. + + + Each member name in an EntityContainer must be unique. A member with name '{0}' is already defined. + + + The function '{0}' has a different return type than other function overloads with the same name. Functions with the same name must have the same return type. + + + The unbound operation '{0}' has an entity set path defined. Entity set path can only be defined on bound operations. + + + The attribute '{0}' has an invalid value. The path doesn't contain the binding parameter name. + + + The attribute '{0}' is invalid. The first item of the path '{2}' is '{3}' which does not match the first parameter name {3}. The first segment of the entity set path is required to be the name of the first parameter. + + + The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that is not an entity type. + + + The attribute '{0}' has an invalid value. The path '{1}' has a navigation property segment '{2}' that is unknown. + + + The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment that doesn't derive from the entity type '{2}' for type segment '{3}'. + + + The attribute '{0}' has an invalid value. The path '{1}' has a binding parameter that references a type '{2}' that is not an entity type. + + + The attribute '{0}' has an invalid value. The path '{1}' has a type cast segment '{2}' that cannot be found in the model. + + + The operation '{0}' has an entity set path and with an invalid return type. The return type is required to be an entity type or a collection of entity type. + + + The operation '{0}' entity set path determined entity type '{1}' is not assignable to the return type '{2}'. + + + The operation '{0}' entity set path was determined to be a reference property but the return type is a collection. + + + An element with the name '{0}' is already defined. + + + The member name '{0}' cannot be used in a type with the same name. Member names cannot be the same as their enclosing type. + + + Each property name in a type must be unique. Property name '{0}' is already defined. + + + The base type kind of a structured type must be the same as its derived type. + + + The base type of open type '{0}' is not open type. + + + The key property '{0}' must belong to the entity '{1}'. + + + The 'Edm.PrimitiveType' cannot be used as the type of a key property '{0}' of an entity type '{1}'. + + + The 'Edm.PrimitiveType' cannot be used as the underlying type of '{0}' type '{1}'. + + + The dependent property '{0}' must belong to the dependent entity '{1}'. + + + The property '{0}' cannot belong to a type other than its declaring type. + + + The named type '{0}' could not be found from the model being validated. + + + The named type '{0}' is ambiguous from the model being validated. + + + The type of the navigation property '{0}' is invalid. The navigation target type must be an entity type or a collection of entity type. The navigation target entity type must match the declaring type of the partner property. + + + The target multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and it must have an optional target represented by a collection or a nullable entity type. + + + The nullability of the property '{0}' is invalid. If a complex typed property is of the same type (or base type) as its declaring type, then the property represents a recursive containment and the given property must be optional. + + + The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is the same or inherits from the target entity type, then the property represents a recursive containment and the multiplicity of the navigation source must be zero or one. + + + The source multiplicity of the navigation property '{0}' is invalid. If a navigation property has 'ContainsTarget' set to true and declaring entity type of the property is not the same as the target entity type, then the property represents a non-recursive containment and the multiplicity of the navigation source must be exactly one. + + + The complex type '{0}' is invalid. A complex type must contain at least one property. + + + The dependent property '{0}' of navigation property '{1}' is a duplicate. + + + The scale value can range from 0 through the specified precision value. + + + Precision cannot be negative. + + + The max length facet specifies the maximum length of an instance of the string type. For unicode equal to 'true', the max length can range from 1 to 2^30, or if 'false', 1 to 2^31. + + + Max length can range from 1 to 2^31. + + + The value of enum member '{0}' exceeds the range of its underlying type. + + + Each member name of an enum type must be unique. Enum member name '{0}' is already defined. + + + Only entity types can be open types. + + + The string reference is invalid because if 'IsUnbounded' is true 'MaxLength' must be null. + + + The declared name and namespace of the annotation must match the name and namespace of its xml value. + + + The value of an annotation marked to be serialized as an xml element must have a well-formed xml value. + + + The value of an annotation marked to be serialized as an xml element must be IEdmStringValue. + + + The value of an annotation marked to be serialized as an xml element must be a string representing an xml element with non-empty name and namespace. + + + Cannot assert the nullable type '{0}' as a non-nullable type. + + + Cannot promote the primitive type '{0}' to the specified primitive type '{1}'. + + + Null value cannot have a non-nullable type. + + + The type of the expression is incompatible with the asserted type. + + + A collection expression is incompatible with a non-collection type. + + + A primitive expression is incompatible with a non-primitive type. + + + A record expression is incompatible with a non-structured type. + + + The record expression does not have a constructor for a property named '{0}'. + + + The type of the record expression is not open and does not contain a property named '{0}'. + + + The annotated element '{0}' has multiple annotations with the term '{1}' and the qualifier '{2}'. + + + The function application provides '{0}' arguments, but the function '{1}' expects '{2}' arguments. + + + Each entity container name in a function must be unique. The name '{0}' is already defined. + + + The primitive expression is not compatible with the asserted type. + + + The enum expression is not compatible with the asserted type. + + + The value of the integer constant is out of range for the asserted type. + + + The value of the string constant is '{0}' characters long, but the max length of its type is '{1}'. + + + The value of the binary constant is '{0}' characters long, but the max length of its type is '{1}'. + + + A type without other errors must not have kind of none. + + + A schema element without other errors must not have kind of none. The kind of schema element '{0}' is none. + + + A property without other errors must not have kind of none. The kind of property '{0}' is none. + + + A primitive type without other errors must not have kind of none. The kind of primitive type '{0}' is none. + + + An entity container element without other errors must not have kind of none. The kind of entity container element '{0}' is none. + + + The entity set '{0}' should have only a single mapping for the property '{1}'. + + + The binding of the entity set or singleton '{0}' on navigation property '{1}' is invalid, the binding of bidirectional navigation property must be bidirectional if specified. + + + The entity set '{0}' is invalid because it is contained by more than one navigation property. + + + The type annotation is missing a binding for the property '{0}'. + + + They type of the type annotation is not open, and does not contain a property named '{0}'. + + + The underlying type of '{0}' is not valid. The underlying type of an enum type must be an integral type. + + + The term '{0}' could not be found from the model being validated. + + + The target '{0}' could not be found from the model being validated. + + + The target '{0}' of the annotation is not allowed in the AppliesTo '{1}' of the term '{2}'.". + + + An element already has a direct annotation with the namespace '{0}' and name '{1}'. + + + The association set '{0}' cannot assume an entity set for the role '{2}' because there are no entity sets for the role type '{1}'. + + + The association set '{0}' must specify an entity set for the role '{2}' because there are multiple entity sets for the role type '{1}'. + + + Because the navigation property '{0}' is recursive, the mapping from the entity set '{1}' must point back to itself. + + + The navigation property '{0}' is invalid because it indirectly contains itself. + + + The path cannot be resolved in the given context. The segment '{0}' failed to resolve. + + + The entity set or singleton '{1}' is not a valid destination for the navigation property '{0}' because it cannot hold an element of the target entity type. + + + The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and unordered set of parameter names uniquely identifies a bound function. + + + The bound function '{0}' is a duplicate of other bound functions. For bound functions the combination of the namespace, name, binding parameter type and ordered set of parameter types uniquely identifies a bound function. + + + The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and unordered set of parameter names uniquely identifies an unbound function. + + + The unbound function '{0}' is a duplicate of other unbound functions. For unbound functions the combination of the namespace, name and ordered set of parameter types uniquely identifies an unbound function. + + + The bound action '{0}' is a duplicate of other bound actions. For bound actions the combination of the namespace, name, and binding parameter type uniquely identifies an bound action. + + + The unbound action '{0}' is a duplicate of other unbound actions. For unbound actions the combination of the namespace, and name uniquely identifies an unbound action. + + + The bound function overload '{0}' does not have the same return type as other function overloads. Expected type '{1}'. + + + The type '{0}' of the entity set '{1}' is not valid, it must be collection of entity type. + + + The type '{0}' of the singleton '{1}' is not valid, it must be entity type. + + + The navigation property mapping '{0}' is invalid because its type is collection but target to a singleton '{1}'. + + + The type '{0}' cannot be the base type of an '{1}' type '{2}'. + + + The type '{0}' cannot be used as the type of a property '{1}'. + + + The type '{0}' cannot be used as the return type of a function '{1}'. + + + The type 'Edm.EntityType' cannot be used as the type of a singleton '{0}' in an entity container. + + + The type 'Edm.EntityType' cannot be used as the type of an entity set '{0}' in an entity container. + + + The declaring type '{0}' of {1} '{2}' cannot include path type property. + + + The type '{0}' of navigation property '{1}' on declaring type '{2}' cannot include path type property. + + + The name is missing or not valid. + + + The specified name must not be longer than 480 characters: '{0}'. + + + The specified name is not allowed: '{0}'. + + + The namespace name is missing or not valid. + + + The specified name must not be longer than 480 characters: '{0}'. + + + The specified namespace name is not allowed: '{0}'. + + + The value of the property '{0}.{1}' must not be null. + + + The property '{0}.{1}' of type '{2}' has value '{3}' that is not a valid enum member. + + + An object with the value '{0}' of the '{1}.{2}' property must implement '{3}' interface. + + + An object implementing '{0}' interface has type definition of kind '{1}'. The type reference interface must match to the kind of the definition. + + + The value '{0}' of the property '{1}.{2}' is not semantically valid. A semantically valid model must not contain elements of kind '{0}'. + + + The value of the enumeration the property '{0}.{1}' contains a null element. Enumeration properties must not contain null elements. + + + The partner of the navigation property '{0}' must not be the same property, and must point back to the navigation property. + + + The chain of base types of type '{0}' is cyclic. + + + Single file provided but model cannot be serialized into single file. + + + Unknown Edm version '{0}'. + + + Unknown Edmx version '{0}'. + + + The operation import '{0}' could not be serialized because its return type cannot be represented inline. + + + A referenced type can not be serialized with an invalid name. The name '{0}' is invalid. + + + The annotation can not be serialized with an invalid target name. The name '{0}' is invalid. + + + No CSDL is written because no schema elements could be produced. This is likely because the model is empty. + + + {0} does not contain a schema definition, or the XmlReader provided started at the end of the file. + + + The source XmlReader does not contain a schema definition or started at the end of the file. + + + Required schema attribute '{0}' is not present on element '{1}'. + + + The current schema element does not support text '{0}'. + + + The attribute '{0}' was not expected in the given context. + + + The schema element '{0}' was not expected in the given context. + + + Unused schema element: '{0}'. + + + Unexpected XML node type: {0}. + + + The element '{0}' was unexpected for the root element. The root element should be {1}. + + + The namespace '{0}' is invalid. The root element is expected to belong to one of the following namespaces: '{1}'. + + + The root element has no namespace. The root element is expected to belong to one of the following namespaces: '{0}'. + + + The {0} '{1}' is invalid. The entitySetPath value is not allowed when IsBound attribute is false. + + + The alias '{0}' is not a valid simple name. + + + The delete action '{0}' is not valid. Action must be: 'None', 'Cascade', or 'Restrict'. + + + An XML attribute or sub-element representing an EDM type is missing. + + + There is no Role with name '{0}' defined in relationship '{1}'. + + + The multiplicity '{0}' is not valid. Multiplicity must be: '*', '0..1', or '1'. + + + Referential constraints requires one dependent role. Multiple dependent roles were specified for this referential constraint. + + + Referential constraints requires one principal role. Multiple principal roles were specified for this referential constraint. + + + If expression must contain 3 operands, the first being a boolean test, the second being being evaluated if the first is true, and the third being evaluated if the first is false. + + + The IsOf expression must contain 1 operand. + + + The Cast expression must contain 1 operand. + + + The LabeledElement expression must contain 1 operand. + + + The type name '{0}' is invalid. The type name must be that of a primitive type, a fully qualified name or an inline 'Collection' or 'Ref' type. + + + The qualified name '{0}' is invalid. A qualified name must have a valid namespace or alias, and a valid name. + + + A model could not be produced because no XML readers were provided. + + + A model could not be produced because one of the XML readers was null. + + + '{0}' is not a valid entity set path. + + + '{0}' is not a valid enum member path. + + + The 'Nullable' attribute cannot be specified for a navigation property with collection type. + + + Metadata document cannot have more than one entity container. + + + There was a mismatch in the principal and dependent ends of the referential constraint. + + + The enumeration member must have a value. + + + The annotation target '{0}' could not be resolved because it cannot refer to an annotatable element. + + + The schema '{0}' contains the alias '{1}' more than once. + + + An unexpected '{0}' value kind was found when parsing the JSON path '{1}'. A '{2}' value kind was expected. + + + A member '{0}' is missing when parsing the JSON path '{1}'. + + + A member '{0}' with value type '{1}' is unexpected. + + + Cannot read the value '{0}' at JSON path '{1}' as '{2}' numeric value. + + + A schema '{0}' object MUST contain the member '$Kind' with a string value of '{1}'. + + + A property '{0}' is missing when parsing the JSON path '{1}'. + + + Found an unknown value kind '{0}' when parsing the JSON path '{1}'. + + + Cannot parse a JSON number '{0}' when parsing the JSON path '{1}'. + + + A member at JSON path '{0}' is not supported. + + + The version specified at '{0}' is not valid. It should be a string containing either '4.0' or '4.01'. + + + The schema object at '{0}' cannot have more than one entity container. + + + The EDMX version specified in the 'Version' attribute does not match the version corresponding to the namespace of the 'Edmx' element. + + + Unexpected {0} element while parsing Edmx. Edmx is expected to have at most one of 'Runtime' or 'DataServices' elements. + + + edmx:Reference must contain at least one edmx:Includes or edmx:IncludeAnnotations. + + + Unresolved Uri found in edmx:Reference, getReferencedModelReaderFunc should not return null when the URI is not a well-known schema. + + + Encountered the following errors when parsing the CSDL document: \r\n{0} + + + The value '{0}' is not a valid boolean. The value must be 'true' or 'false'. + + + The value '{0}' is not a valid integer. The value must be a valid 32 bit integer. + + + The value '{0}' is not a valid integer. The value must be a valid 64 bit integer. + + + The value '{0}' is not a valid floating point value. + + + The value '{0}' is not a valid integer. The value must be a valid 32 bit integer or 'Max'. + + + The value '{0}' is not a valid SRID. The value must either be a 32 bit integer or 'Variable'. + + + The value '{0}' is not a valid scale. The value must either be a 32 bit integer or 'Variable'. + + + The value '{0}' is not a valid Guid. + + + The value '{0}' is not a valid decimal. + + + The value '{0}' is not a valid date time offset value. + + + The value '{0}' is not a valid date time value. + + + The value '{0}' is not a valid date value. + + + The value '{0}' is not a valid duration value. + + + The value '{0}' is not a valid binary value. The value must be a hexadecimal string and must not be prefixed by '0x'. + + + The value '{0}' is not a valid TimeOfDay value. + + + Invalid multiplicity: '{0}' + + + Invalid schema element kind: '{0}' + + + Invalid type kind: '{0}' + + + Invalid primitive kind: '{0}' + + + Invalid container element kind: '{0}' + + + Invalid CSDL target: '{0}' + + + Invalid property kind: '{0}' + + + Invalid expression kind: '{0}' + + + The name '{0}' is ambiguous. + + + The type '{0}' could not be found. + + + The complex type '{0}' could not be found. + + + The entity type '{0}' could not be found. + + + The primitive type '{0}' could not be found. + + + The operation '{0}' could not be found. + + + The operation '{0}' could not be resolved because more than one operation could be used for this application. + + + The operation '{0}' could not be resolved because none of the operations with that name take the correct set of parameters. + + + The entity set '{0}' could not be found. + + + The entity container '{0}' could not be found. + + + The enum type '{0}' could not be found. + + + The enum member '{0}' could not be found. + + + The property '{0}' could not be found. + + + The parameter '{0}' could not be found. + + + The return of operation '{0}' could not be found. + + + The labeled element '{0}' could not be found. + + + The entity '{0}' is invalid because its base type is cyclic. + + + The complex type '{0}' is invalid because its base type is cyclic. + + + The entity container '{0}' is invalid because its extends hierarchy is cyclic. + + + A navigation property could not be found for the path '{0}' starting from the type '{1}'. + + + The same rule cannot be in the same rule set twice. + + + Conversion of EDM values to a CLR type with type {0} is not supported. + + + Conversion of an EDM structured value is supported only to a CLR class. + + + Cannot initialize a property '{0}' on an object of type '{1}'. The property already has a value. + + + An EDM structured value contains multiple values for the property '{0}'. Conversion of an EDM structured value with duplicate property values is not supported. + + + Conversion of an EDM value of the type '{0}' to the CLR type '{1}' is not supported. + + + Conversion of an edm collection value to the CLR type '{0}' is not supported. EDM collection values can be converted to System.Collections.Generic.IEnumerable{T}, System.Collections.Generic.IList{T} or System.Collections.Generic.ICollection{T}. + + + The type '{0}' of the object returned by the TryCreateObjectInstance delegate is not assignable to the expected type '{1}'. + + + The MIME type annotation must not have a null value. + + + An annotation of type string was expected for the '{{http://docs.oasis-open.org/odata/ns/metadata}}:{0}' annotation, but an annotation of type '{1}' was found. + + + The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. + + + The added or subtracted value results in an un-representable Date. + + + The Year '{0}', Month '{1}' and Day '{2}' parameters describe an un-representable Date. + + + String '{0}' was not recognized as a valid Date. + + + Target object '{0}' is not an instance with type of Date. + + + The Hour '{0}', Minute '{1}', Second '{2}' and Millisecond '{3}' parameters describe an un-representable TimeOfDay. + + + The ticks value '{0}' is out of representable TimeOfDay range. + + + The TimeSpan value '{0}' is out of representable TimeOfDay range. + + + String '{0}' was not recognized as a valid TimeOfDay. + + + Target object '{0}' is not an instance with type of TimeOfDay. + + + Annotation expressions must specify a value or use a term with a specified default value. Cannot find a default value for the given annotation term, '{0}'. + + + Term type '{0}' is not supported for value retrieval. + + + Invalid to set inline location for a path target '{0}'. + + \ No newline at end of file diff --git a/src/Microsoft.OData.Edm/Schema/AmbiguousBinding.cs b/src/Microsoft.OData.Edm/Schema/AmbiguousBinding.cs index eac4228b43..86299a92d7 100644 --- a/src/Microsoft.OData.Edm/Schema/AmbiguousBinding.cs +++ b/src/Microsoft.OData.Edm/Schema/AmbiguousBinding.cs @@ -20,7 +20,7 @@ internal class AmbiguousBinding : BadElement private readonly List bindings = new List(); public AmbiguousBinding(TElement first, TElement second) - : base(new EdmError[] { new EdmError(null, EdmErrorCode.BadAmbiguousElementBinding, Edm.Strings.Bad_AmbiguousElementBinding(first.Name)) }) + : base(new EdmError[] { new EdmError(null, EdmErrorCode.BadAmbiguousElementBinding, Error.Format(SRResources.Bad_AmbiguousElementBinding, first.Name)) }) { this.AddBinding(first); this.AddBinding(second); diff --git a/src/Microsoft.OData.Edm/Schema/CoreModel/EdmCoreModel.cs b/src/Microsoft.OData.Edm/Schema/CoreModel/EdmCoreModel.cs index 310d6e7c45..0e4d8fb97e 100644 --- a/src/Microsoft.OData.Edm/Schema/CoreModel/EdmCoreModel.cs +++ b/src/Microsoft.OData.Edm/Schema/CoreModel/EdmCoreModel.cs @@ -342,7 +342,7 @@ public IEdmPrimitiveTypeReference GetPrimitive(EdmPrimitiveTypeKind kind, bool i } else { - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } @@ -372,7 +372,7 @@ public IEdmPathTypeReference GetPathType(EdmPathTypeKind kind, bool isNullable) } else { - throw new InvalidOperationException(Edm.Strings.EdmPath_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPath_UnexpectedKind); } } @@ -622,7 +622,7 @@ public IEdmTemporalTypeReference GetTemporal(EdmPrimitiveTypeKind kind, int? pre case EdmPrimitiveTypeKind.TimeOfDay: return new EdmTemporalTypeReference(this.GetCoreModelPrimitiveType(kind), isNullable, precision); default: - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } @@ -641,7 +641,7 @@ public IEdmTemporalTypeReference GetTemporal(EdmPrimitiveTypeKind kind, bool isN case EdmPrimitiveTypeKind.TimeOfDay: return new EdmTemporalTypeReference(this.GetCoreModelPrimitiveType(kind), isNullable); default: - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } @@ -696,7 +696,7 @@ public IEdmSpatialTypeReference GetSpatial(EdmPrimitiveTypeKind kind, int? spati case EdmPrimitiveTypeKind.GeometryMultiPoint: return new EdmSpatialTypeReference(this.GetCoreModelPrimitiveType(kind), isNullable, spatialReferenceIdentifier); default: - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } @@ -728,7 +728,7 @@ public IEdmSpatialTypeReference GetSpatial(EdmPrimitiveTypeKind kind, bool isNul case EdmPrimitiveTypeKind.GeometryMultiPoint: return new EdmSpatialTypeReference(this.GetCoreModelPrimitiveType(kind), isNullable); default: - throw new InvalidOperationException(Edm.Strings.EdmPrimitive_UnexpectedKind); + throw new InvalidOperationException(SRResources.EdmPrimitive_UnexpectedKind); } } diff --git a/src/Microsoft.OData.Edm/Schema/CyclicComplexType.cs b/src/Microsoft.OData.Edm/Schema/CyclicComplexType.cs index 685a7c7a48..52e444e72a 100644 --- a/src/Microsoft.OData.Edm/Schema/CyclicComplexType.cs +++ b/src/Microsoft.OData.Edm/Schema/CyclicComplexType.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Edm internal class CyclicComplexType : BadComplexType { public CyclicComplexType(string qualifiedName, EdmLocation location) - : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicComplex, Edm.Strings.Bad_CyclicComplex(qualifiedName)) }) + : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicComplex, Error.Format(SRResources.Bad_CyclicComplex, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Schema/CyclicEntityContainer.cs b/src/Microsoft.OData.Edm/Schema/CyclicEntityContainer.cs index ae174e227b..dab0375eca 100644 --- a/src/Microsoft.OData.Edm/Schema/CyclicEntityContainer.cs +++ b/src/Microsoft.OData.Edm/Schema/CyclicEntityContainer.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Edm internal class CyclicEntityContainer : BadEntityContainer { public CyclicEntityContainer(string name, EdmLocation location) - : base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicEntityContainer, Edm.Strings.Bad_CyclicEntityContainer(name)) }) + : base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicEntityContainer, Error.Format(SRResources.Bad_CyclicEntityContainer, name)) }) { } } diff --git a/src/Microsoft.OData.Edm/Schema/CyclicEntityType.cs b/src/Microsoft.OData.Edm/Schema/CyclicEntityType.cs index 8c3c4ff9fa..86097e6321 100644 --- a/src/Microsoft.OData.Edm/Schema/CyclicEntityType.cs +++ b/src/Microsoft.OData.Edm/Schema/CyclicEntityType.cs @@ -14,7 +14,7 @@ namespace Microsoft.OData.Edm internal class CyclicEntityType : BadEntityType { public CyclicEntityType(string qualifiedName, EdmLocation location) - : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicEntity, Edm.Strings.Bad_CyclicEntity(qualifiedName)) }) + : base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicEntity, Error.Format(SRResources.Bad_CyclicEntity, qualifiedName)) }) { } } diff --git a/src/Microsoft.OData.Edm/Schema/Date.cs b/src/Microsoft.OData.Edm/Schema/Date.cs index 6239fa3396..002956b737 100644 --- a/src/Microsoft.OData.Edm/Schema/Date.cs +++ b/src/Microsoft.OData.Edm/Schema/Date.cs @@ -44,7 +44,7 @@ public Date(int year, int month, int day) } catch (System.ArgumentOutOfRangeException) { - throw new FormatException(Strings.Date_InvalidDateParameters(year, month, day)); + throw new FormatException(Error.Format(SRResources.Date_InvalidDateParameters, year, month, day)); } } @@ -172,7 +172,7 @@ public Date AddYears(int value) } catch (System.ArgumentOutOfRangeException) { - throw new ArgumentOutOfRangeException(nameof(value), Strings.Date_InvalidAddedOrSubtractedResults); + throw new ArgumentOutOfRangeException(nameof(value), SRResources.Date_InvalidAddedOrSubtractedResults); } } @@ -189,7 +189,7 @@ public Date AddMonths(int value) } catch (System.ArgumentOutOfRangeException) { - throw new ArgumentOutOfRangeException(nameof(value), Strings.Date_InvalidAddedOrSubtractedResults); + throw new ArgumentOutOfRangeException(nameof(value), SRResources.Date_InvalidAddedOrSubtractedResults); } } @@ -206,7 +206,7 @@ public Date AddDays(int value) } catch (System.ArgumentOutOfRangeException) { - throw new ArgumentOutOfRangeException(nameof(value), Strings.Date_InvalidAddedOrSubtractedResults); + throw new ArgumentOutOfRangeException(nameof(value), SRResources.Date_InvalidAddedOrSubtractedResults); } } @@ -277,7 +277,7 @@ public int CompareTo(object obj) } else { - throw new ArgumentException(Strings.Date_InvalidCompareToTarget(obj)); + throw new ArgumentException(Error.Format(SRResources.Date_InvalidCompareToTarget, obj)); } } @@ -357,7 +357,7 @@ public static Date Parse(string text, IFormatProvider provider) } else { - throw new FormatException(Strings.Date_InvalidParsingString(text)); + throw new FormatException(Error.Format(SRResources.Date_InvalidParsingString, text)); } } diff --git a/src/Microsoft.OData.Edm/Schema/EdmBinaryTypeReference.cs b/src/Microsoft.OData.Edm/Schema/EdmBinaryTypeReference.cs index 32c133fd77..1b7aa0c253 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmBinaryTypeReference.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmBinaryTypeReference.cs @@ -38,7 +38,7 @@ public EdmBinaryTypeReference(IEdmPrimitiveType definition, bool isNullable, boo { if (isUnbounded && maxLength != null) { - throw new InvalidOperationException(Edm.Strings.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); + throw new InvalidOperationException(SRResources.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); } this.isUnbounded = isUnbounded; diff --git a/src/Microsoft.OData.Edm/Schema/EdmEntityContainer.cs b/src/Microsoft.OData.Edm/Schema/EdmEntityContainer.cs index 672aead4c3..cb3f7cdf56 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmEntityContainer.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmEntityContainer.cs @@ -101,9 +101,9 @@ public void AddElement(IEdmEntityContainerElement element) RegistrationHelper.AddOperationImport((IEdmOperationImport)element, element.Name, this.operationImportDictionary); break; case EdmContainerElementKind.None: - throw new InvalidOperationException(Edm.Strings.EdmEntityContainer_CannotUseElementWithTypeNone); + throw new InvalidOperationException(SRResources.EdmEntityContainer_CannotUseElementWithTypeNone); default: - throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_ContainerElementKind(element.ContainerElementKind)); + throw new InvalidOperationException(Error.Format(SRResources.UnknownEnumVal_ContainerElementKind, element.ContainerElementKind)); } } diff --git a/src/Microsoft.OData.Edm/Schema/EdmEntityType.cs b/src/Microsoft.OData.Edm/Schema/EdmEntityType.cs index 56b36300b3..80b0ad4dd1 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmEntityType.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmEntityType.cs @@ -175,7 +175,7 @@ public EdmNavigationProperty AddBidirectionalNavigation(EdmNavigationPropertyInf EdmEntityType targetType = propertyInfo.Target as EdmEntityType; if (targetType == null) { - throw new ArgumentException(Strings.Constructable_TargetMustBeStock(typeof(EdmEntityType).FullName), "propertyInfo.Target"); + throw new ArgumentException(Error.Format(SRResources.Constructable_TargetMustBeStock, typeof(EdmEntityType).FullName), "propertyInfo.Target"); } EdmNavigationProperty property = EdmNavigationProperty.CreateNavigationPropertyWithPartner(propertyInfo, this.FixUpDefaultPartnerInfo(propertyInfo, partnerInfo)); diff --git a/src/Microsoft.OData.Edm/Schema/EdmModel.cs b/src/Microsoft.OData.Edm/Schema/EdmModel.cs index c0c97e5a89..d7984d51dc 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmModel.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmModel.cs @@ -124,7 +124,7 @@ public void AddVocabularyAnnotation(IEdmVocabularyAnnotation annotation) EdmUtil.CheckArgumentNull(annotation, "annotation"); if (annotation.Target == null) { - throw new InvalidOperationException(Strings.Constructable_VocabularyAnnotationMustHaveTarget); + throw new InvalidOperationException(SRResources.Constructable_VocabularyAnnotationMustHaveTarget); } List elementAnnotations; @@ -173,7 +173,7 @@ public void SetVocabularyAnnotation(IEdmVocabularyAnnotation annotation) EdmUtil.CheckArgumentNull(annotation, "annotation"); if (annotation.Target == null) { - throw new InvalidOperationException(Strings.Constructable_VocabularyAnnotationMustHaveTarget); + throw new InvalidOperationException(SRResources.Constructable_VocabularyAnnotationMustHaveTarget); } List elementAnnotations; diff --git a/src/Microsoft.OData.Edm/Schema/EdmNavigationProperty.cs b/src/Microsoft.OData.Edm/Schema/EdmNavigationProperty.cs index 1061518b13..c11521407b 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmNavigationProperty.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmNavigationProperty.cs @@ -187,7 +187,7 @@ public static EdmNavigationProperty CreateNavigationPropertyWithPartner( declaringType = GetEntityType(partnerPropertyType) as IEdmEntityType; if (declaringType == null) { - throw new ArgumentException(Strings.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); + throw new ArgumentException(SRResources.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); } } else if (partnerPropertyType.Definition.TypeKind == EdmTypeKind.Complex) @@ -195,18 +195,18 @@ public static EdmNavigationProperty CreateNavigationPropertyWithPartner( declaringType = GetComplexType(partnerPropertyType) as IEdmComplexType; if (declaringType == null) { - throw new ArgumentException(Strings.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); + throw new ArgumentException(SRResources.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); } } else { - throw new ArgumentException(Strings.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); + throw new ArgumentException(SRResources.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(partnerPropertyType)); } IEdmEntityType partnerDeclaringType = GetEntityType(propertyType); if (partnerDeclaringType == null) { - throw new ArgumentException(Strings.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(propertyType)); + throw new ArgumentException(SRResources.Constructable_EntityTypeOrCollectionOfEntityTypeExpected, nameof(propertyType)); } EdmNavigationProperty end1 = new EdmNavigationProperty( @@ -297,7 +297,7 @@ private static IEdmTypeReference CreateNavigationPropertyType(IEdmEntityType ent return EdmCoreModel.GetCollection(new EdmEntityTypeReference(entityType, false)); default: - throw new ArgumentOutOfRangeException(multiplicityParameterName, Strings.UnknownEnumVal_Multiplicity(multiplicity)); + throw new ArgumentOutOfRangeException(multiplicityParameterName, Error.Format(SRResources.UnknownEnumVal_Multiplicity, multiplicity)); } } } diff --git a/src/Microsoft.OData.Edm/Schema/EdmNavigationSource.cs b/src/Microsoft.OData.Edm/Schema/EdmNavigationSource.cs index a6d45ec53b..86c6210843 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmNavigationSource.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmNavigationSource.cs @@ -128,13 +128,13 @@ public void AddNavigationTarget(IEdmNavigationProperty navigationProperty, IEdmN if (lastSegment == null) { - throw new ArgumentException(Strings.NavigationPropertyBinding_PathIsNotValid); + throw new ArgumentException(SRResources.NavigationPropertyBinding_PathIsNotValid); } if (navigationProperty.Name != lastSegment && (lastSegment.IndexOf('.', StringComparison.Ordinal) < 0 || navigationProperty.Name != penultimateSegment)) { - throw new ArgumentException(Strings.NavigationPropertyBinding_PathIsNotValid); + throw new ArgumentException(SRResources.NavigationPropertyBinding_PathIsNotValid); } AddNavigationPropertyBinding(navigationProperty, target, bindingPath); diff --git a/src/Microsoft.OData.Edm/Schema/EdmPathExpression.cs b/src/Microsoft.OData.Edm/Schema/EdmPathExpression.cs index 6d65746c7e..2a7be427b7 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmPathExpression.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmPathExpression.cs @@ -47,7 +47,7 @@ public EdmPathExpression(IEnumerable pathSegments) if (pathSegments.Any(segment => segment.Contains("/", StringComparison.Ordinal))) { - throw new ArgumentException(Strings.PathSegmentMustNotContainSlash); + throw new ArgumentException(SRResources.PathSegmentMustNotContainSlash); } this.pathSegments = pathSegments.ToList(); diff --git a/src/Microsoft.OData.Edm/Schema/EdmReferentialConstraint.cs b/src/Microsoft.OData.Edm/Schema/EdmReferentialConstraint.cs index 52faf6ebdb..67d3baa4b3 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmReferentialConstraint.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmReferentialConstraint.cs @@ -51,7 +51,7 @@ public static EdmReferentialConstraint Create(IEnumerable(principalProperties); if (dependentPropertyList.Count != principalPropertyList.Count) { - throw new ArgumentException(Strings.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType(principalPropertyList.Count, dependentPropertyList.Count)); + throw new ArgumentException(Error.Format(SRResources.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType, principalPropertyList.Count, dependentPropertyList.Count)); } return new EdmReferentialConstraint(dependentPropertyList.Select((d, i) => new EdmReferentialConstraintPropertyPair(d, principalPropertyList[i]))); diff --git a/src/Microsoft.OData.Edm/Schema/EdmStringTypeReference.cs b/src/Microsoft.OData.Edm/Schema/EdmStringTypeReference.cs index 192a71b4d4..b376360ae5 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmStringTypeReference.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmStringTypeReference.cs @@ -40,7 +40,7 @@ public EdmStringTypeReference(IEdmPrimitiveType definition, bool isNullable, boo { if (isUnbounded && maxLength != null) { - throw new InvalidOperationException(Edm.Strings.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); + throw new InvalidOperationException(SRResources.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); } this.isUnbounded = isUnbounded; diff --git a/src/Microsoft.OData.Edm/Schema/EdmStructuredType.cs b/src/Microsoft.OData.Edm/Schema/EdmStructuredType.cs index 307ff61ab2..1eac77b06e 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmStructuredType.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmStructuredType.cs @@ -87,7 +87,7 @@ public void AddProperty(IEdmProperty property) if (!Object.ReferenceEquals(this, property.DeclaringType)) { - throw new InvalidOperationException(Edm.Strings.EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect(property.Name)); + throw new InvalidOperationException(Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect, property.Name)); } this.declaredProperties.Add(property); diff --git a/src/Microsoft.OData.Edm/Schema/EdmTargetPath.cs b/src/Microsoft.OData.Edm/Schema/EdmTargetPath.cs index d446685998..e1b1583545 100644 --- a/src/Microsoft.OData.Edm/Schema/EdmTargetPath.cs +++ b/src/Microsoft.OData.Edm/Schema/EdmTargetPath.cs @@ -101,20 +101,20 @@ private void ValidateSegments() // Validate no segment is null if (this.segments.Contains(null)) { - throw new ArgumentException(Strings.TargetPath_SegmentsMustNotContainNullSegment); + throw new ArgumentException(SRResources.TargetPath_SegmentsMustNotContainNullSegment); } // Validate that the first element is Container. if (this.segments.Count > 0 && !(this.segments[0] is IEdmEntityContainer)) { - throw new InvalidOperationException(Strings.TargetPath_FirstSegmentMustBeIEdmEntityContainer); + throw new InvalidOperationException(SRResources.TargetPath_FirstSegmentMustBeIEdmEntityContainer); } // Validate the second element is a Container element. if (this.segments.Count > 1 && !(this.segments[1] is IEdmEntityContainerElement)) { - throw new InvalidOperationException(Strings.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement); + throw new InvalidOperationException(SRResources.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement); } } } diff --git a/src/Microsoft.OData.Edm/Schema/TimeOfDay.cs b/src/Microsoft.OData.Edm/Schema/TimeOfDay.cs index ac749c2861..974b677bf4 100644 --- a/src/Microsoft.OData.Edm/Schema/TimeOfDay.cs +++ b/src/Microsoft.OData.Edm/Schema/TimeOfDay.cs @@ -66,7 +66,7 @@ public TimeOfDay(int hour, int minute, int second, int millisecond) { if (hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 59 || millisecond < 0 || millisecond > 999) { - throw new FormatException(Strings.TimeOfDay_InvalidTimeOfDayParameters(hour, minute, second, millisecond)); + throw new FormatException(Error.Format(SRResources.TimeOfDay_InvalidTimeOfDayParameters, hour, minute, second, millisecond)); } else { @@ -83,7 +83,7 @@ public TimeOfDay(long ticks) { if (ticks < MinTickValue || ticks > MaxTickValue) { - throw new FormatException(Strings.TimeOfDay_TicksOutOfRange(ticks)); + throw new FormatException(Error.Format(SRResources.TimeOfDay_TicksOutOfRange, ticks)); } else { @@ -245,7 +245,7 @@ public static implicit operator TimeOfDay(TimeSpan timeSpan) || timeSpan.Minutes < 0 || timeSpan.Milliseconds < 0 || timeSpan.Ticks < MinTickValue || timeSpan.Ticks > MaxTickValue) { - throw new FormatException(Strings.TimeOfDay_ConvertErrorFromTimeSpan(timeSpan)); + throw new FormatException(Error.Format(SRResources.TimeOfDay_ConvertErrorFromTimeSpan, timeSpan)); } else { @@ -337,7 +337,7 @@ public int CompareTo(object obj) } else { - throw new ArgumentException(Strings.TimeOfDay_InvalidCompareToTarget(obj)); + throw new ArgumentException(Error.Format(SRResources.TimeOfDay_InvalidCompareToTarget, obj)); } } @@ -380,7 +380,7 @@ public static TimeOfDay Parse(string text, IFormatProvider provider) } else { - throw new FormatException(Strings.TimeOfDay_InvalidParsingString(text)); + throw new FormatException(Error.Format(SRResources.TimeOfDay_InvalidParsingString, text)); } } diff --git a/src/Microsoft.OData.Edm/Validation/DuplicateOperationValidator.cs b/src/Microsoft.OData.Edm/Validation/DuplicateOperationValidator.cs index 0a288d795c..6e96bdfb9d 100644 --- a/src/Microsoft.OData.Edm/Validation/DuplicateOperationValidator.cs +++ b/src/Microsoft.OData.Edm/Validation/DuplicateOperationValidator.cs @@ -51,7 +51,7 @@ public bool ValidateNotDuplicate(IEdmOperation operation, bool skipError) this.context.AddError( function.Location(), EdmErrorCode.DuplicateFunctions, - function.IsBound ? Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames(fullName) : Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames(fullName)); + function.IsBound ? Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames, fullName) : Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames, fullName)); } } else @@ -68,7 +68,7 @@ public bool ValidateNotDuplicate(IEdmOperation operation, bool skipError) this.context.AddError( function.Location(), EdmErrorCode.DuplicateFunctions, - function.IsBound ? Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes(fullName) : Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes(fullName)); + function.IsBound ? Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, fullName) : Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes, fullName)); } } else @@ -89,7 +89,7 @@ public bool ValidateNotDuplicate(IEdmOperation operation, bool skipError) this.context.AddError( action.Location(), EdmErrorCode.DuplicateActions, - action.IsBound ? Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundActions(fullName) : Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions(fullName)); + action.IsBound ? Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundActions, fullName) : Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions, fullName)); } } else diff --git a/src/Microsoft.OData.Edm/Validation/ExpressionTypeChecker.cs b/src/Microsoft.OData.Edm/Validation/ExpressionTypeChecker.cs index 1323c725b9..7d6fec71c9 100644 --- a/src/Microsoft.OData.Edm/Validation/ExpressionTypeChecker.cs +++ b/src/Microsoft.OData.Edm/Validation/ExpressionTypeChecker.cs @@ -127,7 +127,7 @@ public static bool TryCast(this IEdmExpression expression, IEdmTypeReference typ case EdmExpressionKind.EnumMember: return TryCastEnumConstantAsType((IEdmEnumMemberExpression)expression, type, matchExactly, out discoveredErrors); default: - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionNotValidForTheAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionNotValidForTheAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; return false; } } @@ -136,7 +136,7 @@ internal static bool TryCastPrimitiveAsType(this IEdmPrimitiveValue expression, { if (!type.IsPrimitive()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.PrimitiveConstantExpressionNotValidForNonPrimitiveType, Edm.Strings.EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.PrimitiveConstantExpressionNotValidForNonPrimitiveType, SRResources.EdmModel_Validator_Semantic_PrimitiveConstantExpressionNotValidForNonPrimitiveType) }; return false; } @@ -165,7 +165,7 @@ internal static bool TryCastPrimitiveAsType(this IEdmPrimitiveValue expression, case EdmValueKind.TimeOfDay: return TryCastTimeOfDayConstantAsType((IEdmTimeOfDayConstantExpression)expression, type, out discoveredErrors); default: - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } } @@ -174,7 +174,7 @@ internal static bool TryCastNullAsType(this IEdmNullExpression expression, IEdmT { if (!type.IsNullable) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.NullCannotBeAssertedToBeANonNullableType, Edm.Strings.EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.NullCannotBeAssertedToBeANonNullableType, SRResources.EdmModel_Validator_Semantic_NullCannotBeAssertedToBeANonNullableType) }; return false; } @@ -195,7 +195,7 @@ internal static bool TryCastPathAsType(this IEdmPathExpression expression, IEdmT IEdmStructuredType structuredResult = result as IEdmStructuredType; if (structuredResult == null) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.PathIsNotValidForTheGivenContext, Edm.Strings.EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext(segment)) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.PathIsNotValidForTheGivenContext, Error.Format(SRResources.EdmModel_Validator_Semantic_PathIsNotValidForTheGivenContext, segment)) }; return false; } @@ -244,7 +244,7 @@ internal static bool TryCastRecordAsType(this IEdmRecordExpression expression, I if (!type.IsStructured()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.RecordExpressionNotValidForNonStructuredType, Edm.Strings.EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.RecordExpressionNotValidForNonStructuredType, SRResources.EdmModel_Validator_Semantic_RecordExpressionNotValidForNonStructuredType) }; return false; } @@ -257,7 +257,7 @@ internal static bool TryCastRecordAsType(this IEdmRecordExpression expression, I IEdmPropertyConstructor expressionProperty = expression.Properties.FirstOrDefault(p => p.Name == typeProperty.Name); if (expressionProperty == null) { - errors.Add(new EdmError(expression.Location(), EdmErrorCode.RecordExpressionMissingRequiredProperty, Edm.Strings.EdmModel_Validator_Semantic_RecordExpressionMissingProperty(typeProperty.Name))); + errors.Add(new EdmError(expression.Location(), EdmErrorCode.RecordExpressionMissingRequiredProperty, Error.Format(SRResources.EdmModel_Validator_Semantic_RecordExpressionMissingProperty, typeProperty.Name))); } else { @@ -280,7 +280,7 @@ internal static bool TryCastRecordAsType(this IEdmRecordExpression expression, I { if (!foundProperties.Contains(property.Name)) { - errors.Add(new EdmError(expression.Location(), EdmErrorCode.RecordExpressionHasExtraProperties, Edm.Strings.EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties(property.Name))); + errors.Add(new EdmError(expression.Location(), EdmErrorCode.RecordExpressionHasExtraProperties, Error.Format(SRResources.EdmModel_Validator_Semantic_RecordExpressionHasExtraProperties, property.Name))); } } } @@ -299,7 +299,7 @@ internal static bool TryCastCollectionAsType(this IEdmCollectionExpression expre { if (!type.IsCollection()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.CollectionExpressionNotValidForNonCollectionType, Edm.Strings.EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.CollectionExpressionNotValidForNonCollectionType, SRResources.EdmModel_Validator_Semantic_CollectionExpressionNotValidForNonCollectionType) }; return false; } @@ -321,7 +321,7 @@ private static bool TryCastGuidConstantAsType(IEdmGuidConstantExpression express { if (!type.IsGuid()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -333,7 +333,7 @@ private static bool TryCastFloatingConstantAsType(IEdmFloatingConstantExpression { if (!type.IsFloating()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -345,7 +345,7 @@ private static bool TryCastDecimalConstantAsType(IEdmDecimalConstantExpression e { if (!type.IsDecimal()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -357,7 +357,7 @@ private static bool TryCastDateTimeOffsetConstantAsType(IEdmDateTimeOffsetConsta { if (!type.IsDateTimeOffset()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -369,7 +369,7 @@ private static bool TryCastDurationConstantAsType(IEdmDurationConstantExpression { if (!type.IsDuration()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -381,7 +381,7 @@ private static bool TryCastDateConstantAsType(IEdmDateConstantExpression express { if (!type.IsDate()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -393,7 +393,7 @@ private static bool TryCastTimeOfDayConstantAsType(IEdmTimeOfDayConstantExpressi { if (!type.IsTimeOfDay()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -405,7 +405,7 @@ private static bool TryCastBooleanConstantAsType(IEdmBooleanConstantExpression e { if (!type.IsBoolean()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -417,14 +417,14 @@ private static bool TryCastStringConstantAsType(IEdmStringConstantExpression exp { if (!type.IsString()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } IEdmStringTypeReference stringType = type.AsString(); if (stringType.MaxLength.HasValue && expression.Value.Length > stringType.MaxLength.Value) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.StringConstantLengthOutOfRange, Edm.Strings.EdmModel_Validator_Semantic_StringConstantLengthOutOfRange(expression.Value.Length, stringType.MaxLength.Value)) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.StringConstantLengthOutOfRange, Error.Format(SRResources.EdmModel_Validator_Semantic_StringConstantLengthOutOfRange, expression.Value.Length, stringType.MaxLength.Value)) }; return false; } @@ -436,7 +436,7 @@ private static bool TryCastIntegerConstantAsType(IEdmIntegerConstantExpression e { if (!type.IsIntegral()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } @@ -453,7 +453,7 @@ private static bool TryCastIntegerConstantAsType(IEdmIntegerConstantExpression e case EdmPrimitiveTypeKind.SByte: return TryCastIntegerConstantInRange(expression, SByte.MinValue, SByte.MaxValue, out discoveredErrors); default: - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } } @@ -462,7 +462,7 @@ private static bool TryCastIntegerConstantInRange(IEdmIntegerConstantExpression { if (expression.Value < min || expression.Value > max) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.IntegerConstantValueOutOfRange, Edm.Strings.EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.IntegerConstantValueOutOfRange, SRResources.EdmModel_Validator_Semantic_IntegerConstantValueOutOfRange) }; return false; } @@ -474,14 +474,14 @@ private static bool TryCastBinaryConstantAsType(IEdmBinaryConstantExpression exp { if (!type.IsBinary()) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindNotValidForAssertedType) }; return false; } IEdmBinaryTypeReference binaryType = type.AsBinary(); if (binaryType.MaxLength.HasValue && expression.Value.Length > binaryType.MaxLength.Value) { - discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.BinaryConstantLengthOutOfRange, Edm.Strings.EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange(expression.Value.Length, binaryType.MaxLength.Value)) }; + discoveredErrors = new EdmError[] { new EdmError(expression.Location(), EdmErrorCode.BinaryConstantLengthOutOfRange, Error.Format(SRResources.EdmModel_Validator_Semantic_BinaryConstantLengthOutOfRange, expression.Value.Length, binaryType.MaxLength.Value)) }; return false; } @@ -498,7 +498,7 @@ private static bool TryCastEnumConstantAsType(IEdmEnumMemberExpression expressio new EdmError( expression.Location(), EdmErrorCode.ExpressionEnumKindNotValidForAssertedType, - Edm.Strings.EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType) + SRResources.EdmModel_Validator_Semantic_ExpressionEnumKindNotValidForAssertedType) }; return false; } @@ -538,7 +538,7 @@ private static bool TestTypeMatch(this IEdmType expressionType, IEdmType asserte { if (!expressionType.IsEquivalentTo(assertedType)) { - discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionNotValidForTheAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionNotValidForTheAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; return false; } } @@ -557,7 +557,7 @@ private static bool TestTypeMatch(this IEdmType expressionType, IEdmType asserte IEdmPrimitiveType primitiveAssertedType = assertedType as IEdmPrimitiveType; if (!primitiveExpressionType.PrimitiveKind.PromotesTo(primitiveAssertedType.PrimitiveKind)) { - discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType(expressionType.ToTraceString(), assertedType.ToTraceString())) }; + discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Error.Format(SRResources.EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType, expressionType.ToTraceString(), assertedType.ToTraceString())) }; return false; } } @@ -565,7 +565,7 @@ private static bool TestTypeMatch(this IEdmType expressionType, IEdmType asserte { if (!expressionType.IsOrInheritsFrom(assertedType)) { - discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionNotValidForTheAssertedType, Edm.Strings.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; + discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.ExpressionNotValidForTheAssertedType, SRResources.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType) }; return false; } } @@ -579,7 +579,7 @@ private static bool TestNullabilityMatch(this IEdmTypeReference expressionType, { if (!assertedType.IsNullable && expressionType.IsNullable) { - discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.CannotAssertNullableTypeAsNonNullableType, Edm.Strings.EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType(expressionType.FullName())) }; + discoveredErrors = new EdmError[] { new EdmError(location, EdmErrorCode.CannotAssertNullableTypeAsNonNullableType, Error.Format(SRResources.EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType, expressionType.FullName())) }; return false; } diff --git a/src/Microsoft.OData.Edm/Validation/InterfaceValidator.cs b/src/Microsoft.OData.Edm/Validation/InterfaceValidator.cs index ed1be55c78..c43ce2bc1b 100644 --- a/src/Microsoft.OData.Edm/Validation/InterfaceValidator.cs +++ b/src/Microsoft.OData.Edm/Validation/InterfaceValidator.cs @@ -130,7 +130,7 @@ private static EdmError CreatePropertyMustNotBeNullError(T item, string prope return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalPropertyValueMustNotBeNull, - Strings.EdmModel_Validator_Syntactic_PropertyMustNotBeNull(typeof(T).Name, propertyName)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_PropertyMustNotBeNull, typeof(T).Name, propertyName)); } private static EdmError CreateEnumPropertyOutOfRangeError(T item, E enumValue, string propertyName) @@ -138,7 +138,7 @@ private static EdmError CreateEnumPropertyOutOfRangeError(T item, E enumVa return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalEnumPropertyValueOutOfRange, - Strings.EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange(typeof(T).Name, propertyName, typeof(E).Name, enumValue)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_EnumPropertyValueOutOfRange, typeof(T).Name, propertyName, typeof(E).Name, enumValue)); } private static EdmError CheckForInterfaceKindValueMismatchError(T item, K kind, string propertyName) @@ -152,7 +152,7 @@ private static EdmError CheckForInterfaceKindValueMismatchError(T item, return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalKindValueMismatch, - Strings.EdmModel_Validator_Syntactic_InterfaceKindValueMismatch(kind, typeof(T).Name, propertyName, typeof(I).Name)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_InterfaceKindValueMismatch, kind, typeof(T).Name, propertyName, typeof(I).Name)); } private static EdmError CreateInterfaceKindValueUnexpectedError(T item, K kind, string propertyName) @@ -160,7 +160,7 @@ private static EdmError CreateInterfaceKindValueUnexpectedError(T item, K return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalKindValueUnexpected, - Strings.EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected(kind, typeof(T).Name, propertyName)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_InterfaceKindValueUnexpected, kind, typeof(T).Name, propertyName)); } private static EdmError CreateTypeRefInterfaceTypeKindValueMismatchError(T item) where T : IEdmTypeReference @@ -169,7 +169,7 @@ private static EdmError CreateTypeRefInterfaceTypeKindValueMismatchError(T it return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalKindValueMismatch, - Strings.EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch(typeof(T).Name, item.Definition.TypeKind)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch, typeof(T).Name, item.Definition.TypeKind)); } private static EdmError CreatePrimitiveTypeRefInterfaceTypeKindValueMismatchError(T item) where T : IEdmPrimitiveTypeReference @@ -178,7 +178,7 @@ private static EdmError CreatePrimitiveTypeRefInterfaceTypeKindValueMismatchErro return new EdmError( GetLocation(item), EdmErrorCode.InterfaceCriticalKindValueMismatch, - Strings.EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch(typeof(T).Name, ((IEdmPrimitiveType)item.Definition).PrimitiveKind)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_TypeRefInterfaceTypeKindValueMismatch, typeof(T).Name, ((IEdmPrimitiveType)item.Definition).PrimitiveKind)); } private static void ProcessEnumerable(T item, IEnumerable enumerable, string propertyName, IList targetList, ref List errors) @@ -198,7 +198,7 @@ private static void ProcessEnumerable(T item, IEnumerable enumerable, s else { CollectErrors( - new EdmError(GetLocation(item), EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements, Strings.EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements(typeof(T).Name, propertyName)), + new EdmError(GetLocation(item), EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements, Error.Format(SRResources.EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements, typeof(T).Name, propertyName)), ref errors); break; } @@ -708,7 +708,7 @@ protected override IEnumerable VisitT(IEdmStructuredType type, List VisitT(IEdmNavigationProperty property, if ((property.Partner.Partner != null && property.Partner.Partner != property) || (property.Partner == property && (ValidationHelper.ComputeNavigationPropertyTarget(property) != property.DeclaringType))) { - CollectErrors(new EdmError(GetLocation(property), EdmErrorCode.InterfaceCriticalNavigationPartnerInvalid, Strings.EdmModel_Validator_Syntactic_NavigationPartnerInvalid(property.Name)), ref errors); + CollectErrors(new EdmError(GetLocation(property), EdmErrorCode.InterfaceCriticalNavigationPartnerInvalid, Error.Format(SRResources.EdmModel_Validator_Syntactic_NavigationPartnerInvalid, property.Name)), ref errors); } } } @@ -952,7 +952,7 @@ protected override IEnumerable VisitT(IEdmReferentialConstraint member { if (pair == null) { - CollectErrors(new EdmError(GetLocation(member), EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements, Strings.EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements(typeof(IEdmReferentialConstraint).Name, "PropertyPairs")), ref errors); + CollectErrors(new EdmError(GetLocation(member), EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements, Error.Format(SRResources.EdmModel_Validator_Syntactic_EnumerableMustNotHaveNullElements, typeof(IEdmReferentialConstraint).Name, "PropertyPairs")), ref errors); break; } diff --git a/src/Microsoft.OData.Edm/Validation/ValidationHelper.cs b/src/Microsoft.OData.Edm/Validation/ValidationHelper.cs index 473845b82d..082ce35dab 100644 --- a/src/Microsoft.OData.Edm/Validation/ValidationHelper.cs +++ b/src/Microsoft.OData.Edm/Validation/ValidationHelper.cs @@ -79,7 +79,7 @@ internal static bool ValidateValueCanBeWrittenAsXmlElementAnnotation(IEdmValue v IEdmStringValue edmStringValue = value as IEdmStringValue; if (edmStringValue == null) { - error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, Edm.Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue); + error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationNotIEdmStringValue); return false; } @@ -100,7 +100,7 @@ internal static bool ValidateValueCanBeWrittenAsXmlElementAnnotation(IEdmValue v // The annotation must be an element. if (reader.EOF) { - error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, Edm.Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml); + error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml); return false; } @@ -110,13 +110,13 @@ internal static bool ValidateValueCanBeWrittenAsXmlElementAnnotation(IEdmValue v if (EdmUtil.IsNullOrWhiteSpaceInternal(elementNamespace) || EdmUtil.IsNullOrWhiteSpaceInternal(elementName)) { - error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, Edm.Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName); + error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationNullNamespaceOrName); return false; } if (!((annotationNamespace == null || elementNamespace == annotationNamespace) && (annotationName == null || elementName == annotationName))) { - error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, Edm.Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm); + error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm); return false; } @@ -130,7 +130,7 @@ internal static bool ValidateValueCanBeWrittenAsXmlElementAnnotation(IEdmValue v } catch (XmlException) { - error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, Edm.Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml); + error = new EdmError(value.Location(), EdmErrorCode.InvalidElementAnnotation, SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationValueInvalidXml); return false; } } diff --git a/src/Microsoft.OData.Edm/Validation/ValidationRuleSet.cs b/src/Microsoft.OData.Edm/Validation/ValidationRuleSet.cs index 0bd8106a28..8a1e2c534d 100644 --- a/src/Microsoft.OData.Edm/Validation/ValidationRuleSet.cs +++ b/src/Microsoft.OData.Edm/Validation/ValidationRuleSet.cs @@ -167,7 +167,7 @@ public static ValidationRuleSet GetEdmModelRuleSet(Version version) } else { - throw new InvalidOperationException(Edm.Strings.Serializer_UnknownEdmVersion(version.ToString())); + throw new InvalidOperationException(Error.Format(SRResources.Serializer_UnknownEdmVersion, version.ToString())); } } @@ -212,7 +212,7 @@ private void AddRule(ValidationRule rule) if (typeRules.Contains(rule)) { - throw new InvalidOperationException(Edm.Strings.RuleSet_DuplicateRulesExistInRuleSet); + throw new InvalidOperationException(SRResources.RuleSet_DuplicateRulesExistInRuleSet); } typeRules.Add(rule); diff --git a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs index 00ca2cae9c..1c41b2e29e 100644 --- a/src/Microsoft.OData.Edm/Validation/ValidationRules.cs +++ b/src/Microsoft.OData.Edm/Validation/ValidationRules.cs @@ -37,7 +37,7 @@ public static class ValidationRules context.AddError( annotation.Location(), EdmErrorCode.DuplicateDirectValueAnnotationFullName, - Strings.EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique(annotation.NamespaceUri, annotation.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_ElementDirectValueAnnotationFullNameMustBeUnique, annotation.NamespaceUri, annotation.Name)); } } }); @@ -58,7 +58,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.InvalidName, - Strings.EdmModel_Validator_Syntactic_MissingName); + SRResources.EdmModel_Validator_Syntactic_MissingName); } }); @@ -74,7 +74,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.NameTooLong, - Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong(item.Name)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong, item.Name)); } }); @@ -99,7 +99,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.InvalidName, - Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed(item.Name)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed, item.Name)); } } }); @@ -120,7 +120,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.InvalidNamespaceName, - Strings.EdmModel_Validator_Syntactic_MissingNamespaceName); + SRResources.EdmModel_Validator_Syntactic_MissingNamespaceName); } }); @@ -136,7 +136,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.InvalidNamespaceName, - Strings.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong(item.Namespace)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsTooLong, item.Namespace)); } }); @@ -155,7 +155,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.InvalidNamespaceName, - Strings.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed(item.Namespace)); + Error.Format(SRResources.EdmModel_Validator_Syntactic_EdmModel_NamespaceNameIsNotAllowed, item.Namespace)); } } }); @@ -172,7 +172,7 @@ public static class ValidationRules context.AddError( element.Location(), EdmErrorCode.SystemNamespaceEncountered, - Strings.EdmModel_Validator_Semantic_SystemNamespaceEncountered(element.Namespace)); + Error.Format(SRResources.EdmModel_Validator_Semantic_SystemNamespaceEncountered, element.Namespace)); } }); @@ -188,7 +188,7 @@ public static class ValidationRules context.AddError( element.Location(), EdmErrorCode.SchemaElementMustNotHaveKindOfNone, - Strings.EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone(element.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_SchemaElementMustNotHaveKindOfNone, element.FullName())); } }); @@ -208,7 +208,7 @@ public static class ValidationRules context.AddError( element.Location(), EdmErrorCode.EntityContainerElementMustNotHaveKindOfNone, - Strings.EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone(element.Container.FullName() + '/' + element.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityContainerElementMustNotHaveKindOfNone, element.Container.FullName() + '/' + element.Name)); } }); @@ -276,7 +276,7 @@ public static class ValidationRules context.AddError( item.Location(), EdmErrorCode.DuplicateEntityContainerMemberName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName(item.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, item.Name)); } } }); @@ -308,7 +308,7 @@ public static class ValidationRules if ((entityType.Key() == null || !entityType.Key().Any()) && !context.IsBad(entityType)) { - string errorMessage = Strings.EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys( + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationSourceTypeHasNoKeys, navigationSource.Name, entityType.Name); @@ -338,8 +338,8 @@ public static class ValidationRules { string name = navigationSource is IEdmSingleton ? "singleton" : "entity set"; - string errorMessage = Strings - .EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty(entityType.FullName(), name, navigationSource.Name); + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, + entityType.FullName(), name, navigationSource.Name); context.AddError( navigationSource.Location(), @@ -378,7 +378,7 @@ public static class ValidationRules context.AddError( navigationSource.Location(), EdmErrorCode.DuplicateNavigationPropertyMapping, - Strings.EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping(navigationSource.Name, mapping.NavigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateNavigationPropertyMapping, navigationSource.Name, mapping.NavigationProperty.Name)); } } }); @@ -403,7 +403,7 @@ public static class ValidationRules context.AddError( navigationSource.Location(), EdmErrorCode.NavigationPropertyMappingMustPointToValidTargetForProperty, - Strings.EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty(mapping.NavigationProperty.Name, mapping.Target.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyMappingMustPointToValidTargetForProperty, mapping.NavigationProperty.Name, mapping.Target.Name)); } if (mapping.Target is IEdmSingleton && mapping.NavigationProperty.Type.Definition.TypeKind == EdmTypeKind.Collection) @@ -411,7 +411,7 @@ public static class ValidationRules context.AddError( navigationSource.Location(), EdmErrorCode.NavigationPropertyOfCollectionTypeMustNotTargetToSingleton, - Strings.EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton(mapping.NavigationProperty.Name, mapping.Target.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyOfCollectionTypeMustNotTargetToSingleton, mapping.NavigationProperty.Name, mapping.Target.Name)); } } }); @@ -472,7 +472,7 @@ public static class ValidationRules context.AddError( set.Location(), EdmErrorCode.EntitySetCanOnlyBeContainedByASingleNavigationProperty, - Strings.EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty(set.Container.FullName() + "." + set.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetCanOnlyBeContainedByASingleNavigationProperty, set.Container.FullName() + "." + set.Name)); } containmentFound = true; @@ -508,7 +508,7 @@ public static class ValidationRules context.AddError( navigationSource.Location(), EdmErrorCode.NavigationMappingMustBeBidirectional, - Strings.EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional(navigationSource.Name, property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationMappingMustBeBidirectional, navigationSource.Name, property.Name)); } } }); @@ -529,7 +529,7 @@ public static class ValidationRules context.AddError( set.Location(), EdmErrorCode.EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet, - Strings.EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet(mapping.NavigationProperty, set.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetRecursiveNavigationPropertyMappingsMustPointBackToSourceEntitySet, mapping.NavigationProperty, set.Name)); } } }); @@ -551,7 +551,7 @@ public static class ValidationRules if (!isCollectionOfEntityType) { - string errorMessage = Strings.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType(entitySet.Type.FullTypeName(), entitySet.Name); + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType, entitySet.Type.FullTypeName(), entitySet.Name); context.AddError( entitySet.Location(), @@ -572,7 +572,7 @@ public static class ValidationRules context.AddError( entitySet.Location(), EdmErrorCode.EntityTypeOfEntitySetCannotBeEdmEntityType, - Strings.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet(entitySet.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet, entitySet.Name)); } }); #endregion @@ -589,7 +589,7 @@ public static class ValidationRules if (!(singleton.Type is IEdmEntityType)) { string errorMessage = - Strings.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType( + Error.Format(SRResources.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType, singleton.Type.FullTypeName(), singleton.Name); context.AddError( @@ -611,7 +611,7 @@ public static class ValidationRules context.AddError( singleton.Location(), EdmErrorCode.EntityTypeOfSingletonCannotBeEdmEntityType, - Strings.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton(singleton.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton, singleton.Name)); } }); #endregion @@ -637,7 +637,7 @@ public static class ValidationRules context.AddError( property.Location(), EdmErrorCode.BadProperty, - Strings.EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMemberNameMatchesTypeName, property.Name)); } } } @@ -662,7 +662,7 @@ public static class ValidationRules propertyNames, context, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_PropertyNameAlreadyDefined(property.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_PropertyNameAlreadyDefined, property.Name), /*supressError*/ !structuredType.DeclaredProperties.Contains(property)); } } @@ -683,7 +683,7 @@ public static class ValidationRules context.AddError( structuredType.Location(), (structuredType.TypeKind == EdmTypeKind.Entity) ? EdmErrorCode.EntityMustHaveEntityBaseType : EdmErrorCode.ComplexTypeMustHaveComplexBaseType, - Strings.EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind); + SRResources.EdmModel_Validator_Semantic_BaseTypeMustHaveSameTypeKind); } } }); @@ -705,7 +705,7 @@ public static class ValidationRules (structuredType.TypeKind == EdmTypeKind.Entity) ? EdmErrorCode.EntityTypeBaseTypeCannotBeEdmEntityType : EdmErrorCode.ComplexTypeBaseTypeCannotBeEdmComplexType, - Strings.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType( + Error.Format(SRResources.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType, structuredType.BaseType.FullTypeName(), typeKind, structuredType.FullTypeName())); } }); @@ -740,7 +740,7 @@ public static class ValidationRules context.AddError( property.Location(), EdmErrorCode.DeclaringTypeMustBeCorrect, - Strings.EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeMustBeCorrect, property.Name)); } } } @@ -768,7 +768,7 @@ public static class ValidationRules memberNames, context, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined(member.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_EnumMemberNameAlreadyDefined, member.Name), /*supressError*/ false); } } @@ -786,7 +786,7 @@ public static class ValidationRules context.AddError( enumType.Location(), EdmErrorCode.EnumMustHaveIntegerUnderlyingType, - Strings.EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType(enumType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_EnumMustHaveIntegralUnderlyingType, enumType.FullName())); } }); @@ -802,7 +802,7 @@ public static class ValidationRules context.AddError( enumType.Location(), EdmErrorCode.TypeDefinitionUnderlyingTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType("enumeration", enumType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType, "enumeration", enumType.FullName())); } }); #endregion @@ -827,7 +827,7 @@ public static class ValidationRules context.AddError( enumMember.Location(), EdmErrorCode.EnumMemberValueOutOfRange, - Strings.EdmModel_Validator_Semantic_EnumMemberValueOutOfRange(enumMember.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EnumMemberValueOutOfRange, enumMember.Name)); } } }); @@ -848,7 +848,7 @@ public static class ValidationRules context.AddError( typeDefinition.Location(), EdmErrorCode.TypeDefinitionUnderlyingTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType("type definition", typeDefinition.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType, "type definition", typeDefinition.FullName())); } }); #endregion @@ -872,7 +872,7 @@ public static class ValidationRules keyPropertyNameList, context, EdmErrorCode.DuplicatePropertySpecifiedInEntityKey, - Strings.EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey(entityType.Name, item.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicatePropertyNameSpecifiedInEntityKey, entityType.Name, item.Name), /*supressError*/ false); } } @@ -896,7 +896,7 @@ public static class ValidationRules context.AddError( key.Location(), EdmErrorCode.InvalidKey, - Strings.EdmModel_Validator_Semantic_InvalidKeyNullablePart(key.Name, entityType.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidKeyNullablePart, key.Name, entityType.Name)); } } } @@ -919,7 +919,7 @@ public static class ValidationRules context.AddError( key.Location(), EdmErrorCode.EntityKeyMustBeScalar, - Strings.EdmModel_Validator_Semantic_EntityKeyMustBeScalar(key.Name, entityType.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityKeyMustBeScalar, key.Name, entityType.Name)); } } } @@ -938,12 +938,12 @@ public static class ValidationRules { if (baseType.DeclaredKey != null) { - if(foundKey) + if (foundKey) { context.AddError( entityType.Location(), EdmErrorCode.InvalidKey, - Strings.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass(entityType.Name, baseType.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass, entityType.Name, baseType.Name)); break; } @@ -969,7 +969,7 @@ public static class ValidationRules context.AddError( entityType.Location(), EdmErrorCode.KeyPropertyMustBelongToEntity, - Strings.EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity(key.Name, entityType.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_KeyPropertyMustBelongToEntity, key.Name, entityType.Name)); } } } @@ -991,7 +991,7 @@ public static class ValidationRules context.AddError( entityType.Location(), EdmErrorCode.KeyPropertyTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey( + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey, key.Name, entityType.FullName())); } } @@ -1030,7 +1030,7 @@ public static class ValidationRules context.AddError( entityType.Location(), EdmErrorCode.EntityComposableBoundEscapeFunctionMustBeLessOne, - Strings.EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne(entityType.FullName(), escapeFunctionString)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne, entityType.FullName(), escapeFunctionString)); } if (nonComposableEscapeFunctions.Count > 1) @@ -1039,7 +1039,7 @@ public static class ValidationRules context.AddError( entityType.Location(), EdmErrorCode.EntityNoncomposableBoundEscapeFunctionMustBeLessOne, - Strings.EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne(entityType.FullName(), escapeFunctionString)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne, entityType.FullName(), escapeFunctionString)); } }); #endregion @@ -1075,7 +1075,7 @@ public static class ValidationRules context.AddError( type.Location(), EdmErrorCode.TypeMustNotHaveKindOfNone, - Strings.EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone); + SRResources.EdmModel_Validator_Semantic_TypeMustNotHaveKindOfNone); } }); #endregion @@ -1094,7 +1094,7 @@ public static class ValidationRules context.AddError( type.Location(), EdmErrorCode.PrimitiveTypeMustNotHaveKindOfNone, - Strings.EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone(type.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_PrimitiveTypeMustNotHaveKindOfNone, type.FullName())); } }); @@ -1114,7 +1114,7 @@ public static class ValidationRules context.AddError( complexType.Location(), EdmErrorCode.InvalidAbstractComplexType, - Strings.EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen(complexType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_BaseTypeOfOpenTypeMustBeOpen, complexType.FullName())); } }); @@ -1145,7 +1145,7 @@ public static class ValidationRules && validatedType.TypeKind != EdmTypeKind.TypeDefinition && !context.IsBad(validatedType)) { - context.AddError(property.Location(), EdmErrorCode.InvalidPropertyType, Strings.EdmModel_Validator_Semantic_InvalidPropertyType(property.Type.TypeKind().ToString())); + context.AddError(property.Location(), EdmErrorCode.InvalidPropertyType, Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidPropertyType, property.Type.TypeKind().ToString())); } }); @@ -1175,7 +1175,7 @@ public static class ValidationRules context.AddError( property.Location(), EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, - Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, property.Name)); } } }); @@ -1196,7 +1196,7 @@ public static class ValidationRules context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidAction, - Strings.EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation); + SRResources.EdmModel_Validator_Semantic_InvalidOperationMultipleEndsInAssociation); } }); @@ -1213,7 +1213,7 @@ public static class ValidationRules context.AddError( property.Location(), EdmErrorCode.InvalidNavigationPropertyType, - Strings.EdmModel_Validator_Semantic_InvalidNavigationPropertyType(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidNavigationPropertyType, property.Name)); return; } @@ -1229,7 +1229,7 @@ public static class ValidationRules context.AddError( property.Location(), EdmErrorCode.InvalidNavigationPropertyType, - Strings.EdmModel_Validator_Semantic_InvalidNavigationPropertyType(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidNavigationPropertyType, property.Name)); } }); @@ -1253,7 +1253,7 @@ public static class ValidationRules propertyNames, context, EdmErrorCode.DuplicateDependentProperty, - Strings.EdmModel_Validator_Semantic_DuplicateDependentProperty(property.Name, navigationProperty.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateDependentProperty, property.Name, navigationProperty.Name), /*supressError*/ false); } } @@ -1292,7 +1292,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidMultiplicityOfPrincipalEnd, - Strings.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable(navigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNullable, navigationProperty.Name)); } } else if (!ValidationHelper.HasNullableProperty(dependentProperties)) @@ -1302,7 +1302,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidMultiplicityOfPrincipalEnd, - Strings.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable(navigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMultiplicityOfPrincipalEndDependentPropertiesAllNonnullable, navigationProperty.Name)); } } else @@ -1313,7 +1313,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidMultiplicityOfPrincipalEnd, - Strings.EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne(navigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyPrincipalEndMultiplicityUpperBoundMustBeOne, navigationProperty.Name)); } } } @@ -1345,7 +1345,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidMultiplicityOfDependentEnd, - Strings.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne(navigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeZeroOneOrOne, navigationProperty.Name)); } } else if (!navigationProperty.Partner.Type.IsCollection()) @@ -1353,7 +1353,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.InvalidMultiplicityOfDependentEnd, - Strings.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany(navigationProperty.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany, navigationProperty.Name)); } } }); @@ -1381,7 +1381,7 @@ Dependent properties | | | | context.AddError( navigationProperty.Location(), EdmErrorCode.DependentPropertiesMustBelongToDependentEntity, - Strings.EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity(dependantProperty.Name, dependentEntity.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_DependentPropertiesMustBelongToDependentEntity, dependantProperty.Name, dependentEntity.Name)); } } } @@ -1401,7 +1401,7 @@ Dependent properties | | | | end.Partner.Type.IsCollection() && end.OnDelete != EdmOnDeleteAction.None) { - string errorMessage = Strings.EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified(end.Name); + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_EndWithManyMultiplicityCannotHaveOperationsSpecified, end.Name); context.AddError( end.Location(), @@ -1450,7 +1450,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.NavigationPropertyWithRecursiveContainmentTargetMustBeOptional, - Strings.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentTargetMustBeOptional, property.Name)); } }); @@ -1471,7 +1471,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne, - Strings.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyWithRecursiveContainmentSourceMustBeFromZeroOrOne, property.Name)); } }); @@ -1491,7 +1491,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne, - Strings.EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyWithNonRecursiveContainmentSourceMustBeFromOne, property.Name)); } }); @@ -1510,7 +1510,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.NavigationPropertyEntityMustNotIndirectlyContainItself, - Strings.EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_NavigationPropertyEntityMustNotIndirectlyContainItself, property.Name)); } } }); @@ -1537,8 +1537,8 @@ Dependent properties | | | | IList visited = new List(); if (HasPathTypeProperty(structuredType, visited)) { - string errorMessage = Strings - .EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty(property.Type.FullName(), property.Name, property.DeclaringType.FullTypeName()); + string errorMessage = Error.Format(SRResources + .EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty, property.Type.FullName(), property.Name, property.DeclaringType.FullTypeName()); context.AddError( property.Location(), @@ -1568,7 +1568,7 @@ Dependent properties | | | | var principalType = principalProperties.ElementAtOrDefault(i).Type.Definition; if (!(dependentType is BadType) && !(principalType is BadType) && !dependentType.IsEquivalentTo(principalType)) { - string errorMessage = Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint(navigationProperty.DependentProperties().ToList()[i].Name, navigationProperty.DeclaringEntityType().FullName(), principalProperties.ToList()[i].Name, principalEntityType.Name); + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint, navigationProperty.DependentProperties().ToList()[i].Name, navigationProperty.DeclaringEntityType().FullName(), principalProperties.ToList()[i].Name, principalEntityType.Name); context.AddError(navigationProperty.Location(), EdmErrorCode.TypeMismatchRelationshipConstraint, errorMessage); } @@ -1593,7 +1593,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.PropertyMustNotHaveKindOfNone, - Strings.EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone(property.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_PropertyMustNotHaveKindOfNone, property.Name)); } }); @@ -1613,7 +1613,7 @@ Dependent properties | | | | context.AddError( property.Location(), EdmErrorCode.PropertyTypeCannotBeCollectionOfAbstractType, - Strings.EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType( + Error.Format(SRResources.EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType, property.Type.FullName(), property.Name)); } } @@ -1635,7 +1635,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportCannotImportBoundOperation, - Strings.EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation(operationImport.Name, operationImport.Operation.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation, operationImport.Name, operationImport.Operation.Name)); } }); @@ -1653,7 +1653,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid(operationImport.Name, operationImport.EntitySet.ExpressionKind)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionKindIsInvalid, operationImport.Name, operationImport.EntitySet.ExpressionKind)); } else { @@ -1664,7 +1664,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } else { @@ -1678,7 +1678,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(operationImport.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, operationImport.Name)); } } } @@ -1709,7 +1709,7 @@ Dependent properties | | | | IEdmEntityType entitySetElementType = entitySet.EntityType; if (!returnedEntityType.IsOrInheritsFrom(entitySetElementType) && !context.IsBad(returnedEntityType) && !context.IsBad(entitySet) && !context.IsBad(entitySetElementType)) { - string errorMessage = Strings.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet( + string errorMessage = Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet, operationImport.Name, returnedEntityType.FullName(), entitySet.Name); @@ -1730,7 +1730,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportEntityTypeDoesNotMatchEntitySet, - Strings.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2(operationImport.Name, elementType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntityTypeDoesNotMatchEntitySet2, operationImport.Name, elementType.FullName())); } } @@ -1741,7 +1741,7 @@ Dependent properties | | | | context.AddError( operationImport.Location(), EdmErrorCode.OperationImportSpecifiesEntitySetButDoesNotReturnEntityType, - Strings.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType(operationImport.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType, operationImport.Name)); } } }); @@ -1763,7 +1763,7 @@ Dependent properties | | | | context.AddError( functionImport.Location(), EdmErrorCode.FunctionImportWithParameterShouldNotBeIncludedInServiceDocument, - Strings.EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument(functionImport.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument, functionImport.Name)); } }); @@ -1783,7 +1783,7 @@ Dependent properties | | | | context.AddError( function.Location(), EdmErrorCode.FunctionMustHaveReturnType, - Strings.EdmModel_Validator_Semantic_FunctionMustHaveReturnType(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_FunctionMustHaveReturnType, function.Name)); } }); @@ -1805,7 +1805,7 @@ Dependent properties | | | | context.AddError( function.Location(), EdmErrorCode.UrlEscapeFunctionMustBeBoundFunction, - Strings.EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction, function.Name)); } }); @@ -1829,7 +1829,7 @@ Dependent properties | | | | context.AddError( function.Location(), EdmErrorCode.UrlEscapeFunctionMustHaveOnlyOneEdmStringParameter, - Strings.EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter, function.Name)); } }); #endregion @@ -1852,7 +1852,7 @@ Dependent properties | | | | context.AddError( operation.Location(), EdmErrorCode.OperationImportUnsupportedReturnType, - Strings.EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType(operation.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithUnsupportedReturnType, operation.Name)); } } }); @@ -1874,7 +1874,7 @@ Dependent properties | | | | parameterList, context, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate(parameter.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate, parameter.Name), /*supressError*/ false); } } @@ -1892,7 +1892,7 @@ Dependent properties | | | | context.AddError( operation.Location(), EdmErrorCode.BoundOperationMustHaveParameters, - Strings.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters(operation.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters, operation.Name)); } }); @@ -1915,7 +1915,7 @@ Dependent properties | | | | context.AddError( operation.Location(), EdmErrorCode.RequiredParametersMustPrecedeOptional, - Strings.EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional(parameter.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional, parameter.Name)); } } }); @@ -1973,7 +1973,7 @@ Dependent properties | | | | if (!isEntity || context.IsBad(elementType)) { - context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathReturnTypeInvalid, Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid(operation.Name)); + context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathReturnTypeInvalid, Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid, operation.Name)); } IEdmNavigationProperty navProp = null; @@ -1986,13 +1986,13 @@ Dependent properties | | | | { if (returnCollectionType != null) { - context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType(operation.Name)); + context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, operation.Name)); } } if (lastEntityType != null && elementType != null && !elementType.IsOrInheritsFrom(lastEntityType)) { - context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable(operation.Name, elementType.FullName(), lastEntityType.FullName())); + context.AddError(operation.Location(), EdmErrorCode.OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, operation.Name, elementType.FullName(), lastEntityType.FullName())); } } }); @@ -2013,7 +2013,7 @@ Dependent properties | | | | context.AddError( operation.Location(), EdmErrorCode.OperationWithCollectionOfAbstractReturnTypeInvalid, - Strings.EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType(operation.ReturnType.FullName(), operation.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType, operation.ReturnType.FullName(), operation.FullName())); } } }); @@ -2052,7 +2052,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.ScaleOutOfRange, - Strings.EdmModel_Validator_Semantic_ScaleOutOfRange); + SRResources.EdmModel_Validator_Semantic_ScaleOutOfRange); } }); @@ -2068,7 +2068,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.PrecisionOutOfRange, - Strings.EdmModel_Validator_Semantic_PrecisionOutOfRange); + SRResources.EdmModel_Validator_Semantic_PrecisionOutOfRange); } }); @@ -2088,7 +2088,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.MaxLengthOutOfRange, - Strings.EdmModel_Validator_Semantic_StringMaxLengthOutOfRange); + SRResources.EdmModel_Validator_Semantic_StringMaxLengthOutOfRange); } }); @@ -2104,7 +2104,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull, - Strings.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); + SRResources.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); } }); @@ -2124,7 +2124,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.MaxLengthOutOfRange, - Strings.EdmModel_Validator_Semantic_MaxLengthOutOfRange); + SRResources.EdmModel_Validator_Semantic_MaxLengthOutOfRange); } }); @@ -2140,7 +2140,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull, - Strings.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); + SRResources.EdmModel_Validator_Semantic_IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull); } }); @@ -2160,7 +2160,7 @@ Dependent properties | | | | context.AddError( type.Location(), EdmErrorCode.PrecisionOutOfRange, - Strings.EdmModel_Validator_Semantic_PrecisionOutOfRange); + SRResources.EdmModel_Validator_Semantic_PrecisionOutOfRange); } }); @@ -2227,7 +2227,7 @@ Dependent properties | | | | context.AddError( item.Location(), EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined(fullName)); + Error.Format(SRResources.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined, fullName)); } } }); @@ -2248,7 +2248,7 @@ Dependent properties | | | | entityContainerNameList, context, EdmErrorCode.DuplicateEntityContainerName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerName(container.Name), + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerName, container.Name), /*supressError*/ false); } }); @@ -2284,7 +2284,7 @@ Dependent properties | | | | context.AddError( function.Location(), EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, - Strings.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType(function.Name, expectedReturnType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType, function.Name, expectedReturnType.FullName())); } } } @@ -2311,7 +2311,7 @@ Dependent properties | | | | context.AddError( function.Location(), EdmErrorCode.UnboundFunctionOverloadHasIncorrectReturnType, - Strings.EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType, function.Name)); } } } @@ -2338,7 +2338,7 @@ Dependent properties | | | | context.AddError( annotation.Location(), EdmErrorCode.InvalidElementAnnotation, - Strings.EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm); + SRResources.EdmModel_Validator_Semantic_InvalidElementAnnotationMismatchedTerm); } } } @@ -2386,7 +2386,7 @@ Dependent properties | | | | { IEdmValue value = annotation.Value as IEdmValue; EdmLocation errorLocation = value == null ? null : value.Location(); - context.AddError(new EdmError(errorLocation, EdmErrorCode.InvalidName, Edm.Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed(annotation.Name))); + context.AddError(new EdmError(errorLocation, EdmErrorCode.InvalidName, Error.Format(SRResources.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed, annotation.Name))); } } }); @@ -2494,7 +2494,7 @@ Dependent properties | | | | context.AddError( annotation.Location(), EdmErrorCode.BadUnresolvedTarget, - Strings.EdmModel_Validator_Semantic_InaccessibleTarget(EdmUtil.FullyQualifiedName(target))); + Error.Format(SRResources.EdmModel_Validator_Semantic_InaccessibleTarget, EdmUtil.FullyQualifiedName(target))); } }); @@ -2533,7 +2533,7 @@ Dependent properties | | | | context.AddError( annotation.Location(), EdmErrorCode.BadUnresolvedTerm, - Strings.EdmModel_Validator_Semantic_InaccessibleTerm(annotation.Term.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_InaccessibleTerm, annotation.Term.FullName())); } }); @@ -2561,7 +2561,7 @@ Dependent properties | | | | context.AddError( annotation.Location(), EdmErrorCode.AnnotationApplyToNotAllowedAnnotatable, - Strings.EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable(EdmUtil.FullyQualifiedName(annotation.Target), term.AppliesTo, term.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable, EdmUtil.FullyQualifiedName(annotation.Target), term.AppliesTo, term.FullName())); }); #endregion @@ -2670,7 +2670,7 @@ Dependent properties | | | | context.AddError(new EdmError( expression.Location(), EdmErrorCode.IncorrectNumberOfArguments, - Edm.Strings.EdmModel_Validator_Semantic_IncorrectNumberOfArguments(expression.Arguments.Count(), appliedFunction.FullName(), appliedFunction.Parameters.Count()))); + Error.Format(SRResources.EdmModel_Validator_Semantic_IncorrectNumberOfArguments, expression.Arguments.Count(), appliedFunction.FullName(), appliedFunction.Parameters.Count()))); } IEnumerator parameterExpressionEnumerator = expression.Arguments.GetEnumerator(); @@ -2708,7 +2708,7 @@ Dependent properties | | | | context.AddError(new EdmError( annotation.Location(), EdmErrorCode.DuplicateAnnotation, - Edm.Strings.EdmModel_Validator_Semantic_DuplicateAnnotation(EdmUtil.FullyQualifiedName(annotatable), annotation.Term.FullName(), annotation.Qualifier))); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateAnnotation, EdmUtil.FullyQualifiedName(annotatable), annotation.Term.FullName(), annotation.Qualifier))); } } }); @@ -2745,14 +2745,14 @@ private static void CheckForUnreacheableTypeError(ValidationContext context, IEd context.AddError( location, EdmErrorCode.BadAmbiguousElementBinding, - Strings.EdmModel_Validator_Semantic_AmbiguousType(type.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_AmbiguousType, type.FullName())); } else if (!foundType.IsEquivalentTo(type)) { context.AddError( location, EdmErrorCode.BadUnresolvedType, - Strings.EdmModel_Validator_Semantic_InaccessibleType(type.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_InaccessibleType, type.FullName())); } } diff --git a/src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmTermExtensions.cs b/src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmTermExtensions.cs index b8d0d985dd..c3ce924552 100644 --- a/src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmTermExtensions.cs +++ b/src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmTermExtensions.cs @@ -40,7 +40,7 @@ public static IEdmVocabularyAnnotation CreateVocabularyAnnotation(this IEdmTerm IEdmExpression value = term.GetDefaultValueExpression(); if (value == null) { - throw new InvalidOperationException(Strings.EdmVocabularyAnnotations_DidNotFindDefaultValue(term.Type)); + throw new InvalidOperationException(Error.Format(SRResources.EdmVocabularyAnnotations_DidNotFindDefaultValue, term.Type)); } return new EdmVocabularyAnnotation(target, term, qualifier, value) @@ -119,7 +119,7 @@ internal static IEdmExpression BuildEdmExpression(IEdmType edmType, string value case EdmTypeKind.EntityReference: case EdmTypeKind.Untyped: default: - throw new NotSupportedException(Strings.EdmVocabularyAnnotations_TermTypeNotSupported(edmType.FullTypeName())); + throw new NotSupportedException(Error.Format(SRResources.EdmVocabularyAnnotations_TermTypeNotSupported, edmType.FullTypeName())); } } @@ -142,7 +142,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmBinaryConstant(binary); } - throw new FormatException(Strings.ValueParser_InvalidBinary(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidBinary, value)); case EdmPrimitiveTypeKind.Boolean: if (EdmValueParser.TryParseBool(value, out bool? bl)) @@ -150,7 +150,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmBooleanConstant(bl.Value); } - throw new FormatException(Strings.ValueParser_InvalidBoolean(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidBoolean, value)); case EdmPrimitiveTypeKind.Date: if (EdmValueParser.TryParseDate(value, out Date? dt)) @@ -158,7 +158,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmDateConstant(dt.Value); } - throw new FormatException(Strings.ValueParser_InvalidDate(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidDate, value)); case EdmPrimitiveTypeKind.DateTimeOffset: if (EdmValueParser.TryParseDateTimeOffset(value, out DateTimeOffset? dto)) @@ -166,7 +166,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmDateTimeOffsetConstant(dto.Value); } - throw new FormatException(Strings.ValueParser_InvalidDateTimeOffset(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidDateTimeOffset, value)); case EdmPrimitiveTypeKind.Decimal: if (EdmValueParser.TryParseDecimal(value, out decimal? dec)) @@ -174,7 +174,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmDecimalConstant(dec.Value); } - throw new FormatException(Strings.ValueParser_InvalidDecimal(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidDecimal, value)); case EdmPrimitiveTypeKind.Duration: if (EdmValueParser.TryParseDuration(value, out TimeSpan? ts)) @@ -182,7 +182,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmDurationConstant(ts.Value); } - throw new FormatException(Strings.ValueParser_InvalidDuration(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidDuration, value)); case EdmPrimitiveTypeKind.Single: case EdmPrimitiveTypeKind.Double: @@ -191,7 +191,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmFloatingConstant(dbl.Value); } - throw new FormatException(Strings.ValueParser_InvalidFloatingPoint(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidFloatingPoint, value)); case EdmPrimitiveTypeKind.Guid: if (EdmValueParser.TryParseGuid(value, out Guid? gd)) @@ -199,7 +199,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmGuidConstant(gd.Value); } - throw new FormatException(Strings.ValueParser_InvalidGuid(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidGuid, value)); case EdmPrimitiveTypeKind.Int16: case EdmPrimitiveTypeKind.Int32: @@ -208,7 +208,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmIntegerConstant(intNum.Value); } - throw new FormatException(Strings.ValueParser_InvalidInteger(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidInteger, value)); case EdmPrimitiveTypeKind.Int64: if (EdmValueParser.TryParseLong(value, out long? longNum)) @@ -216,7 +216,7 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmIntegerConstant(longNum.Value); } - throw new FormatException(Strings.ValueParser_InvalidLong(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidLong, value)); case EdmPrimitiveTypeKind.String: return new EdmStringConstant(value); @@ -227,10 +227,10 @@ private static IEdmExpression BuildEdmPrimitiveValueExp(IEdmPrimitiveType typeRe return new EdmTimeOfDayConstant(tod.Value); } - throw new FormatException(Strings.ValueParser_InvalidTimeOfDay(value)); + throw new FormatException(Error.Format(SRResources.ValueParser_InvalidTimeOfDay, value)); } - throw new NotSupportedException(Strings.EdmVocabularyAnnotations_TermTypeNotSupported(typeReference.FullName())); + throw new NotSupportedException(Error.Format(SRResources.EdmVocabularyAnnotations_TermTypeNotSupported, typeReference.FullName())); } /// diff --git a/src/Microsoft.OData.Edm/Vocabularies/EdmExpressionEvaluator.cs b/src/Microsoft.OData.Edm/Vocabularies/EdmExpressionEvaluator.cs index fcb545ce12..e28bd4af76 100644 --- a/src/Microsoft.OData.Edm/Vocabularies/EdmExpressionEvaluator.cs +++ b/src/Microsoft.OData.Edm/Vocabularies/EdmExpressionEvaluator.cs @@ -292,7 +292,7 @@ private static IEdmValue Cast(IEdmTypeReference targetType, IEdmValue operand) if (!matches) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_FailedTypeAssertion(targetType.ToTraceString())); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_FailedTypeAssertion, targetType.ToTraceString())); } return operand; @@ -405,7 +405,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) { if (context == null) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_NoContextPath); + throw new InvalidOperationException(SRResources.Edm_Evaluator_NoContextPath); } IEdmPathExpression pathExpression = (IEdmPathExpression)expression; @@ -465,7 +465,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) { if (this.edmModel == null) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_TypeCastNeedsEdmModel); + throw new InvalidOperationException(SRResources.Edm_Evaluator_TypeCastNeedsEdmModel); } IEdmType typeSegmentClientType = this.resolveTypeFromName(hop, this.edmModel); @@ -507,7 +507,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) result = FindProperty(hop, result); if (result == null) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_UnboundPath(hop)); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_UnboundPath, hop)); } } } @@ -530,7 +530,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) if (result == null) { - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_UnboundPath(hop)); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_UnboundPath, hop)); } } @@ -569,7 +569,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) } } - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_UnboundFunction(target != null ? target.ToTraceString() : string.Empty)); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_UnboundFunction, target != null ? target.ToTraceString() : string.Empty)); } case EdmExpressionKind.If: @@ -676,7 +676,7 @@ private IEdmValue Eval(IEdmExpression expression, IEdmStructuredValue context) } default: - throw new InvalidOperationException(Edm.Strings.Edm_Evaluator_UnrecognizedExpressionKind(((int)expression.ExpressionKind).ToString(System.Globalization.CultureInfo.InvariantCulture))); + throw new InvalidOperationException(Error.Format(SRResources.Edm_Evaluator_UnrecognizedExpressionKind, ((int)expression.ExpressionKind).ToString(System.Globalization.CultureInfo.InvariantCulture))); } } diff --git a/src/Microsoft.OData.Edm/Vocabularies/EdmToClrConverter.cs b/src/Microsoft.OData.Edm/Vocabularies/EdmToClrConverter.cs index a69e327815..30df0765ce 100644 --- a/src/Microsoft.OData.Edm/Vocabularies/EdmToClrConverter.cs +++ b/src/Microsoft.OData.Edm/Vocabularies/EdmToClrConverter.cs @@ -628,12 +628,12 @@ private object AsClrValue(IEdmValue edmValue, Type clrType, bool convertEnumValu if (memberValue != null && !TryConvertEnumType(underlyingType, memberValue.Value, out clrValue)) { - throw new InvalidCastException(Strings.EdmToClr_UnsupportedType(underlyingType)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_UnsupportedType, underlyingType)); } } else if (!TryConvertAsNonGuidPrimitiveType(underlyingType, edmValue, out clrValue)) { - throw new InvalidCastException(Strings.EdmToClr_UnsupportedType(underlyingType)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_UnsupportedType, underlyingType)); } // In case of enums, because the converter returns a primitive type value we want to convert it to the CLR enum type. @@ -643,7 +643,7 @@ private object AsClrValue(IEdmValue edmValue, Type clrType, bool convertEnumValu object nonEnumclrValue = null; if (!TryConvertAsNonGuidPrimitiveType(clrType, edmValue, out nonEnumclrValue)) { - throw new InvalidCastException(Strings.EdmToClr_UnsupportedType(clrType)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_UnsupportedType, clrType)); } return nonEnumclrValue; @@ -778,11 +778,11 @@ private object AsClrObject(IEdmValue edmValue, Type clrObjectType) { if (edmValue is IEdmCollectionValue) { - throw new InvalidCastException(Strings.EdmToClr_CannotConvertEdmCollectionValueToClrType(clrObjectType.FullName)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_CannotConvertEdmCollectionValueToClrType, clrObjectType.FullName)); } else { - throw new InvalidCastException(Strings.EdmToClr_CannotConvertEdmValueToClrType(GetEdmValueInterfaceName(edmValue), clrObjectType.FullName)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_CannotConvertEdmValueToClrType, GetEdmValueInterfaceName(edmValue), clrObjectType.FullName)); } } @@ -796,7 +796,7 @@ private object AsClrObject(IEdmValue edmValue, Type clrObjectType) // By convention we only support mapping structured values to a CLR class. if (!clrObjectType.IsClass()) { - throw new InvalidCastException(Strings.EdmToClr_StructuredValueMappedToNonClass); + throw new InvalidCastException(SRResources.EdmToClr_StructuredValueMappedToNonClass); } // Try user-defined logic before the default logic. @@ -809,7 +809,7 @@ private object AsClrObject(IEdmValue edmValue, Type clrObjectType) Type newClrObjectType = clrObject.GetType(); if (!clrObjectType.IsAssignableFrom(newClrObjectType)) { - throw new InvalidCastException(Strings.EdmToClr_TryCreateObjectInstanceReturnedWrongObject(newClrObjectType.FullName, clrObjectType.FullName)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_TryCreateObjectInstanceReturnedWrongObject, newClrObjectType.FullName, clrObjectType.FullName)); } clrObjectType = newClrObjectType; @@ -848,7 +848,7 @@ private void PopulateObjectProperties(IEdmStructuredValue edmValue, object clrOb { if (populatedProperties.Contains(propertyValue.Name)) { - throw new InvalidCastException(Strings.EdmToClr_StructuredPropertyDuplicateValue(propertyValue.Name)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_StructuredPropertyDuplicateValue, propertyValue.Name)); } if (!this.TrySetCollectionProperty(clrProperty, clrObject, propertyValue)) @@ -910,7 +910,7 @@ private bool TrySetCollectionProperty(PropertyInfo clrProperty, object clrObject if (genericTypeDefinitionIsIEnumerableOfT) { // Cannot add elements to an existing value of type IEnumerable. - throw new InvalidCastException(Strings.EdmToClr_IEnumerableOfTPropertyAlreadyHasValue(clrProperty.Name, clrProperty.DeclaringType.FullName)); + throw new InvalidCastException(Error.Format(SRResources.EdmToClr_IEnumerableOfTPropertyAlreadyHasValue, clrProperty.Name, clrProperty.DeclaringType.FullName)); } clrPropertyValueType = clrPropertyValue.GetType(); diff --git a/src/Microsoft.OData.Edm/Vocabularies/Expressions/EdmLabeledExpressionReferenceExpression.cs b/src/Microsoft.OData.Edm/Vocabularies/Expressions/EdmLabeledExpressionReferenceExpression.cs index 90a503dd82..a1cb43e658 100644 --- a/src/Microsoft.OData.Edm/Vocabularies/Expressions/EdmLabeledExpressionReferenceExpression.cs +++ b/src/Microsoft.OData.Edm/Vocabularies/Expressions/EdmLabeledExpressionReferenceExpression.cs @@ -50,7 +50,7 @@ public IEdmLabeledExpression ReferencedLabeledExpression if (this.referencedLabeledExpression != null) { - throw new InvalidOperationException(Strings.ValueHasAlreadyBeenSet); + throw new InvalidOperationException(SRResources.ValueHasAlreadyBeenSet); } this.referencedLabeledExpression = value; diff --git a/src/Microsoft.OData.Edm/Vocabularies/Values/EdmPropertyValue.cs b/src/Microsoft.OData.Edm/Vocabularies/Values/EdmPropertyValue.cs index e575571a3c..b41dc4fa5e 100644 --- a/src/Microsoft.OData.Edm/Vocabularies/Values/EdmPropertyValue.cs +++ b/src/Microsoft.OData.Edm/Vocabularies/Values/EdmPropertyValue.cs @@ -67,7 +67,7 @@ public IEdmValue Value if (this.value != null) { - throw new InvalidOperationException(Strings.ValueHasAlreadyBeenSet); + throw new InvalidOperationException(SRResources.ValueHasAlreadyBeenSet); } this.value = value; diff --git a/src/Microsoft.Spatial/Geography/GeoJsonObjectReader.cs b/src/Microsoft.Spatial/Geography/GeoJsonObjectReader.cs index 4685413b6b..fa3d76cab8 100644 --- a/src/Microsoft.Spatial/Geography/GeoJsonObjectReader.cs +++ b/src/Microsoft.Spatial/Geography/GeoJsonObjectReader.cs @@ -138,13 +138,13 @@ private static double ValueAsDouble(object value) { if (value == null) { - throw new FormatException(Strings.GeoJsonReader_InvalidNullElement); + throw new FormatException(SRResources.GeoJsonReader_InvalidNullElement); } // At this point we are expecting them to only be numeric, so verify that. if (value is String || value is IDictionary || value is IEnumerable || value is bool) { - throw new FormatException(Strings.GeoJsonReader_ExpectedNumeric); + throw new FormatException(SRResources.GeoJsonReader_ExpectedNumeric); } // value is already a numeric value at this point, so can safely convert it using InvariantCulture. @@ -166,14 +166,14 @@ private static IEnumerable ValueAsJsonArray(object value) // need to be sure it isn't a string because string is also enumerable); if (value is string) { - throw new FormatException(Strings.GeoJsonReader_ExpectedArray); + throw new FormatException(SRResources.GeoJsonReader_ExpectedArray); } if (value is IDictionary || value is IDictionary) { // These are typically signatures of json objects though they can be looked at as IEnumerable, // but that would be a mistake, becuase we wouldn't know how to interpret the KeyValuePair - throw new FormatException(Strings.GeoJsonReader_ExpectedArray); + throw new FormatException(SRResources.GeoJsonReader_ExpectedArray); } IEnumerable array = value as IEnumerable; @@ -182,7 +182,7 @@ private static IEnumerable ValueAsJsonArray(object value) return array; } - throw new FormatException(Strings.GeoJsonReader_ExpectedArray); + throw new FormatException(SRResources.GeoJsonReader_ExpectedArray); } /// @@ -203,7 +203,7 @@ private static IDictionary ValueAsJsonObject(object value) return castValue; } - throw new FormatException(Strings.JsonReaderExtensions_CannotReadValueAsJsonObject(value)); + throw new FormatException(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsJsonObject, value)); } /// @@ -225,7 +225,7 @@ private static string ValueAsString(string propertyName, object value) return castValue; } - throw new FormatException(Strings.JsonReaderExtensions_CannotReadPropertyValueAsString(value, propertyName)); + throw new FormatException(Error.Format(SRResources.JsonReaderExtensions_CannotReadPropertyValueAsString, value, propertyName)); } /// @@ -242,7 +242,7 @@ private static SpatialType GetSpatialType(IDictionary geoJsonObj } else { - throw new FormatException(Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.TypeMemberName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.TypeMemberName)); } } @@ -277,7 +277,7 @@ private static int GetCoordinateSystemIdFromCrs(IDictionary crsJ object typeValue; if (!crsJsonObject.TryGetValue(GeoJsonConstants.TypeMemberName, out typeValue)) { - throw new FormatException(Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.TypeMemberName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.TypeMemberName)); } // we previously validated that the value was a string, so this cast is safe @@ -286,14 +286,14 @@ private static int GetCoordinateSystemIdFromCrs(IDictionary crsJ // validate the type is supported if (!string.Equals(typeString, GeoJsonConstants.CrsTypeMemberValue, StringComparison.Ordinal)) { - throw new FormatException(Strings.GeoJsonReader_InvalidCrsType(typeString)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_InvalidCrsType, typeString)); } // get the value of the 'properties' property object propertiesValue; if (!crsJsonObject.TryGetValue(GeoJsonConstants.CrsPropertiesMemberName, out propertiesValue)) { - throw new FormatException(Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.CrsPropertiesMemberName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.CrsPropertiesMemberName)); } var properties = ValueAsJsonObject(propertiesValue); @@ -302,7 +302,7 @@ private static int GetCoordinateSystemIdFromCrs(IDictionary crsJ object nameValue; if (!properties.TryGetValue(GeoJsonConstants.CrsNameMemberName, out nameValue)) { - throw new FormatException(Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.CrsNameMemberName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.CrsNameMemberName)); } // we previously validated that the value was a string @@ -317,7 +317,7 @@ private static int GetCoordinateSystemIdFromCrs(IDictionary crsJ || nameString[offset] != ':' || !int.TryParse(nameString.Substring(offset + 1), out epsgId)) { - throw new FormatException(Strings.GeoJsonReader_InvalidCrsName(nameString)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_InvalidCrsName, nameString)); } return epsgId; @@ -338,7 +338,7 @@ private static IEnumerable GetMemberValueAsJsonArray(IDictionary } else { - throw new FormatException(Strings.GeoJsonReader_MissingRequiredMember(memberName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, memberName)); } } @@ -377,7 +377,7 @@ private static SpatialType ReadTypeName(string typeName) case GeoJsonConstants.TypeMemberValueGeometryCollection: return SpatialType.Collection; default: - throw new FormatException(Strings.GeoJsonReader_InvalidTypeName(typeName)); + throw new FormatException(Error.Format(SRResources.GeoJsonReader_InvalidTypeName, typeName)); } } @@ -543,7 +543,7 @@ private void SendPosition(IEnumerable positionElements, bool first) if (count < 2 || count > 4) { - throw new FormatException(Strings.GeoJsonReader_InvalidPosition); + throw new FormatException(SRResources.GeoJsonReader_InvalidPosition); } if (first) diff --git a/src/Microsoft.Spatial/Geography/GeographyPointImplementation.cs b/src/Microsoft.Spatial/Geography/GeographyPointImplementation.cs index 719aa9d578..6f18fba18c 100644 --- a/src/Microsoft.Spatial/Geography/GeographyPointImplementation.cs +++ b/src/Microsoft.Spatial/Geography/GeographyPointImplementation.cs @@ -50,12 +50,12 @@ internal GeographyPointImplementation(CoordinateSystem coordinateSystem, Spatial { if (double.IsNaN(latitude) || double.IsInfinity(latitude)) { - throw new ArgumentException(Strings.InvalidPointCoordinate(latitude, "latitude")); + throw new ArgumentException(Error.Format(SRResources.InvalidPointCoordinate, latitude, "latitude")); } if (double.IsNaN(longitude) || double.IsInfinity(longitude)) { - throw new ArgumentException(Strings.InvalidPointCoordinate(longitude, "longitude")); + throw new ArgumentException(Error.Format(SRResources.InvalidPointCoordinate, longitude, "longitude")); } this.latitude = latitude; @@ -87,7 +87,7 @@ public override double Latitude { if (this.IsEmpty) { - throw new NotSupportedException(Strings.Point_AccessCoordinateWhenEmpty); + throw new NotSupportedException(SRResources.Point_AccessCoordinateWhenEmpty); } return this.latitude; @@ -103,7 +103,7 @@ public override double Longitude { if (this.IsEmpty) { - throw new NotSupportedException(Strings.Point_AccessCoordinateWhenEmpty); + throw new NotSupportedException(SRResources.Point_AccessCoordinateWhenEmpty); } return this.longitude; diff --git a/src/Microsoft.Spatial/Geometry/GeometryPointImplementation.cs b/src/Microsoft.Spatial/Geometry/GeometryPointImplementation.cs index 15074b1d45..460514d5fe 100644 --- a/src/Microsoft.Spatial/Geometry/GeometryPointImplementation.cs +++ b/src/Microsoft.Spatial/Geometry/GeometryPointImplementation.cs @@ -60,12 +60,12 @@ internal GeometryPointImplementation(CoordinateSystem coordinateSystem, SpatialI { if (double.IsNaN(x) || double.IsInfinity(x)) { - throw new ArgumentException(Strings.InvalidPointCoordinate(x, "x")); + throw new ArgumentException(Error.Format(SRResources.InvalidPointCoordinate, x, "x")); } if (double.IsNaN(y) || double.IsInfinity(y)) { - throw new ArgumentException(Strings.InvalidPointCoordinate(y, "y")); + throw new ArgumentException(Error.Format(SRResources.InvalidPointCoordinate, y, "y")); } this.x = x; @@ -84,7 +84,7 @@ public override double X { if (this.IsEmpty) { - throw new NotSupportedException(Strings.Point_AccessCoordinateWhenEmpty); + throw new NotSupportedException(SRResources.Point_AccessCoordinateWhenEmpty); } return this.x; @@ -101,7 +101,7 @@ public override double Y { if (this.IsEmpty) { - throw new NotSupportedException(Strings.Point_AccessCoordinateWhenEmpty); + throw new NotSupportedException(SRResources.Point_AccessCoordinateWhenEmpty); } return this.y; diff --git a/src/Microsoft.Spatial/Gml/GmlReader.cs b/src/Microsoft.Spatial/Gml/GmlReader.cs index 4c60158a68..7d7a493eaf 100644 --- a/src/Microsoft.Spatial/Gml/GmlReader.cs +++ b/src/Microsoft.Spatial/Gml/GmlReader.cs @@ -126,7 +126,7 @@ private void ParseGmlGeometry(bool readCoordinateSystem) { if (!this.reader.IsStartElement()) { - throw new FormatException(Strings.GmlReader_ExpectReaderAtElement); + throw new FormatException(SRResources.GmlReader_ExpectReaderAtElement); } // handle SRID here @@ -158,7 +158,7 @@ private void ParseGmlGeometry(bool readCoordinateSystem) this.ParseGmlMultiGeometryShape(); break; default: - throw new FormatException(Strings.GmlReader_InvalidSpatialType(this.reader.LocalName)); + throw new FormatException(Error.Format(SRResources.GmlReader_InvalidSpatialType, this.reader.LocalName)); } } else if (object.ReferenceEquals(this.reader.NamespaceURI, this.fullGlobeNamespace) && this.reader.LocalName.Equals(GmlConstants.FullGlobe, StringComparison.Ordinal)) @@ -168,7 +168,7 @@ private void ParseGmlGeometry(bool readCoordinateSystem) } else { - throw new FormatException(Strings.GmlReader_ExpectReaderAtElement); + throw new FormatException(SRResources.GmlReader_ExpectReaderAtElement); } } @@ -204,7 +204,7 @@ private void ReadAttributes(bool expectSrsName) if (!expectSrsName) { this.reader.MoveToElement(); - throw new FormatException(Strings.GmlReader_InvalidAttribute(attributeName, this.reader.Name)); + throw new FormatException(Error.Format(SRResources.GmlReader_InvalidAttribute, attributeName, this.reader.Name)); } // srsName="http://www.opengis.net/def/crs/EPSG/0/SRID" @@ -217,13 +217,13 @@ private void ReadAttributes(bool expectSrsName) } else { - throw new FormatException(Strings.GmlReader_InvalidSrsName(GmlConstants.SrsPrefix)); + throw new FormatException(Error.Format(SRResources.GmlReader_InvalidSrsName, GmlConstants.SrsPrefix)); } break; default: this.reader.MoveToElement(); - throw new FormatException(Strings.GmlReader_InvalidAttribute(attributeName, this.reader.Name)); + throw new FormatException(Error.Format(SRResources.GmlReader_InvalidAttribute, attributeName, this.reader.Name)); } } while (this.reader.MoveToNextAttribute()); @@ -448,7 +448,7 @@ private void ParseGmlLinearRingElement() if (this.IsEndElement(GmlConstants.LinearRing)) { // Empty rings are not allowed - throw new FormatException(Strings.GmlReader_EmptyRingsNotAllowed); + throw new FormatException(SRResources.GmlReader_EmptyRingsNotAllowed); } else { @@ -552,14 +552,14 @@ private void ParseGmlPosElement(bool allowEmpty) if (doubleList.Length < 2) { // When parsing a pos, we need at least two coordinates. - throw new FormatException(Strings.GmlReader_PosNeedTwoNumbers); + throw new FormatException(SRResources.GmlReader_PosNeedTwoNumbers); } this.AddPoint(doubleList[0], doubleList[1], doubleList.Length > 2 ? doubleList[2] : default(double?), doubleList.Length > 3 ? doubleList[3] : default(double?)); } else if (!allowEmpty) { - throw new FormatException(Strings.GmlReader_PosNeedTwoNumbers); + throw new FormatException(SRResources.GmlReader_PosNeedTwoNumbers); } this.ReadEndElement(); @@ -567,7 +567,7 @@ private void ParseGmlPosElement(bool allowEmpty) else if (!allowEmpty) { // Read an empty "pos", and allowEmpty is false. - throw new FormatException(Strings.GmlReader_PosNeedTwoNumbers); + throw new FormatException(SRResources.GmlReader_PosNeedTwoNumbers); } } @@ -633,7 +633,7 @@ private void ParseGmlPosListElement(bool allowEmpty) if (doubleList.Length % dimension != 0) { // Odd number of doubles - throw new FormatException(Strings.GmlReader_PosListNeedsEvenCount); + throw new FormatException(SRResources.GmlReader_PosListNeedsEvenCount); } // posList supports only 2D points @@ -652,13 +652,13 @@ private void ParseGmlPosListElement(bool allowEmpty) else { // Read a ParseGmlPosListElement with 0 elements. - throw new FormatException(Strings.GmlReader_PosListNeedsEvenCount); + throw new FormatException(SRResources.GmlReader_PosListNeedsEvenCount); } } else if (!allowEmpty) { // Read a posList with no contents. - throw new FormatException(Strings.GmlReader_PosListNeedsEvenCount); + throw new FormatException(SRResources.GmlReader_PosListNeedsEvenCount); } this.ReadEndElement(); @@ -666,7 +666,7 @@ private void ParseGmlPosListElement(bool allowEmpty) else if (!allowEmpty) { // Read an empty posList. - throw new FormatException(Strings.GmlReader_PosListNeedsEvenCount); + throw new FormatException(SRResources.GmlReader_PosListNeedsEvenCount); } } @@ -685,7 +685,7 @@ private int ReadSrsDimension() if (dimension != 2 && dimension != 3) { - throw new FormatException(Strings.GmlReader_InvalidSrsDimension); + throw new FormatException(SRResources.GmlReader_InvalidSrsDimension); } return dimension; @@ -768,7 +768,7 @@ private void ReadEndElement() this.reader.MoveToContent(); if (this.reader.NodeType != XmlNodeType.EndElement) { - throw new FormatException(Strings.GmlReader_UnexpectedElement(this.reader.Name)); + throw new FormatException(Error.Format(SRResources.GmlReader_UnexpectedElement, this.reader.Name)); } this.reader.ReadEndElement(); diff --git a/src/Microsoft.Spatial/Gml/GmlWriter.cs b/src/Microsoft.Spatial/Gml/GmlWriter.cs index c41006ddee..f4745fb60a 100644 --- a/src/Microsoft.Spatial/Gml/GmlWriter.cs +++ b/src/Microsoft.Spatial/Gml/GmlWriter.cs @@ -261,7 +261,7 @@ private void BeginGeo(SpatialType type) this.writer.WriteStartElement(GmlConstants.FullGlobe, GmlConstants.FullGlobeNamespace); break; default: - throw new NotSupportedException(Strings.Validator_InvalidType(type)); + throw new NotSupportedException(Error.Format(SRResources.Validator_InvalidType, type)); } this.WriteCoordinateSystem(); diff --git a/src/Microsoft.Spatial/Microsoft.Spatial.cs b/src/Microsoft.Spatial/Microsoft.Spatial.cs deleted file mode 100644 index 21fff89277..0000000000 --- a/src/Microsoft.Spatial/Microsoft.Spatial.cs +++ /dev/null @@ -1,147 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -using System; -using System.Globalization; -using System.Reflection; -using System.Resources; -using System.Threading; - -namespace Microsoft.Spatial -{ - /// - /// AutoGenerated resource class. Usage: - /// - /// string s = TextRes.GetString(TextRes.MyIdentifier); - /// - internal sealed class TextRes { - internal const string SpatialImplementation_NoRegisteredOperations = "SpatialImplementation_NoRegisteredOperations"; - internal const string InvalidPointCoordinate = "InvalidPointCoordinate"; - internal const string Point_AccessCoordinateWhenEmpty = "Point_AccessCoordinateWhenEmpty"; - internal const string SpatialBuilder_CannotCreateBeforeDrawn = "SpatialBuilder_CannotCreateBeforeDrawn"; - internal const string GmlReader_UnexpectedElement = "GmlReader_UnexpectedElement"; - internal const string GmlReader_ExpectReaderAtElement = "GmlReader_ExpectReaderAtElement"; - internal const string GmlReader_InvalidSpatialType = "GmlReader_InvalidSpatialType"; - internal const string GmlReader_EmptyRingsNotAllowed = "GmlReader_EmptyRingsNotAllowed"; - internal const string GmlReader_PosNeedTwoNumbers = "GmlReader_PosNeedTwoNumbers"; - internal const string GmlReader_PosListNeedsEvenCount = "GmlReader_PosListNeedsEvenCount"; - internal const string GmlReader_InvalidSrsName = "GmlReader_InvalidSrsName"; - internal const string GmlReader_InvalidAttribute = "GmlReader_InvalidAttribute"; - internal const string GmlReader_InvalidSrsDimension = "GmlReader_InvalidSrsDimension"; - internal const string WellKnownText_UnexpectedToken = "WellKnownText_UnexpectedToken"; - internal const string WellKnownText_UnexpectedCharacter = "WellKnownText_UnexpectedCharacter"; - internal const string WellKnownText_UnknownTaggedText = "WellKnownText_UnknownTaggedText"; - internal const string WellKnownText_TooManyDimensions = "WellKnownText_TooManyDimensions"; - internal const string Validator_SridMismatch = "Validator_SridMismatch"; - internal const string Validator_InvalidType = "Validator_InvalidType"; - internal const string Validator_FullGlobeInCollection = "Validator_FullGlobeInCollection"; - internal const string Validator_LineStringNeedsTwoPoints = "Validator_LineStringNeedsTwoPoints"; - internal const string Validator_FullGlobeCannotHaveElements = "Validator_FullGlobeCannotHaveElements"; - internal const string Validator_NestingOverflow = "Validator_NestingOverflow"; - internal const string Validator_InvalidPointCoordinate = "Validator_InvalidPointCoordinate"; - internal const string Validator_UnexpectedCall = "Validator_UnexpectedCall"; - internal const string Validator_UnexpectedCall2 = "Validator_UnexpectedCall2"; - internal const string Validator_InvalidPolygonPoints = "Validator_InvalidPolygonPoints"; - internal const string Validator_InvalidLatitudeCoordinate = "Validator_InvalidLatitudeCoordinate"; - internal const string Validator_InvalidLongitudeCoordinate = "Validator_InvalidLongitudeCoordinate"; - internal const string Validator_UnexpectedGeography = "Validator_UnexpectedGeography"; - internal const string Validator_UnexpectedGeometry = "Validator_UnexpectedGeometry"; - internal const string GeoJsonReader_MissingRequiredMember = "GeoJsonReader_MissingRequiredMember"; - internal const string GeoJsonReader_InvalidPosition = "GeoJsonReader_InvalidPosition"; - internal const string GeoJsonReader_InvalidTypeName = "GeoJsonReader_InvalidTypeName"; - internal const string GeoJsonReader_InvalidNullElement = "GeoJsonReader_InvalidNullElement"; - internal const string GeoJsonReader_ExpectedNumeric = "GeoJsonReader_ExpectedNumeric"; - internal const string GeoJsonReader_ExpectedArray = "GeoJsonReader_ExpectedArray"; - internal const string GeoJsonReader_InvalidCrsType = "GeoJsonReader_InvalidCrsType"; - internal const string GeoJsonReader_InvalidCrsName = "GeoJsonReader_InvalidCrsName"; - internal const string JsonReaderExtensions_CannotReadPropertyValueAsString = "JsonReaderExtensions_CannotReadPropertyValueAsString"; - internal const string JsonReaderExtensions_CannotReadValueAsJsonObject = "JsonReaderExtensions_CannotReadValueAsJsonObject"; - internal const string PlatformHelper_DateTimeOffsetMustContainTimeZone = "PlatformHelper_DateTimeOffsetMustContainTimeZone"; - - static TextRes loader = null; - ResourceManager resources; - - internal TextRes() - { - resources = new System.Resources.ResourceManager("Microsoft.Spatial", this.GetType().GetTypeInfo().Assembly); - } - - private static TextRes GetLoader() - { - if (loader == null) - { - TextRes sr = new TextRes(); - Interlocked.CompareExchange(ref loader, sr, null); - } - - return loader; - } - - private static CultureInfo Culture - { - get { return null/*use ResourceManager default, CultureInfo.CurrentUICulture*/; } - } - - public static ResourceManager Resources - { - get - { - return GetLoader().resources; - } - } - - public static string GetString(string name, params object[] args) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - string res = sys.resources.GetString(name, TextRes.Culture); - - if (args != null && args.Length > 0) - { - for (int i = 0; i < args.Length; i ++) - { - String value = args[i] as String; - if (value != null && value.Length > 1024) - { - args[i] = value.Substring(0, 1024 - 3) + "..."; - } - } - return String.Format(CultureInfo.CurrentCulture, res, args); - } - else - { - return res; - } - } - - public static string GetString(string name) - { - TextRes sys = GetLoader(); - if (sys == null) - { - return null; - } - - return sys.resources.GetString(name, TextRes.Culture); - } - - public static string GetString(string name, out bool usedFallback) - { - // always false for this version of gensr - usedFallback = false; - return GetString(name); - } - } -} diff --git a/src/Microsoft.Spatial/Microsoft.Spatial.csproj b/src/Microsoft.Spatial/Microsoft.Spatial.csproj index 73d937cbea..c3c581a53c 100644 --- a/src/Microsoft.Spatial/Microsoft.Spatial.csproj +++ b/src/Microsoft.Spatial/Microsoft.Spatial.csproj @@ -21,9 +21,7 @@ - - @@ -56,39 +54,17 @@ - - Microsoft.Spatial - true - true - internal - true - Microsoft.Spatial.TextRes - false - true - - - - - - TextTemplatingFileGenerator - Microsoft.Spatial.cs - - - TextTemplatingFileGenerator - Parameterized.Microsoft.Spatial.cs - - - - - + True True - Microsoft.Spatial.tt - - - True - True - Parameterized.Microsoft.Spatial.tt + SRResources.resx + + + + ResXFileCodeGenerator + SRResources.Designer.cs + + diff --git a/src/Microsoft.Spatial/Microsoft.Spatial.tt b/src/Microsoft.Spatial/Microsoft.Spatial.tt deleted file mode 100644 index 62cfd2884d..0000000000 --- a/src/Microsoft.Spatial/Microsoft.Spatial.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\ResourceClassGenerator2.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.Spatial"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.Spatial"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.Spatial.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.Spatial/Microsoft.Spatial.txt b/src/Microsoft.Spatial/Microsoft.Spatial.txt deleted file mode 100644 index e77bd4e36f..0000000000 --- a/src/Microsoft.Spatial/Microsoft.Spatial.txt +++ /dev/null @@ -1,59 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Note: During the build, this file is merged with the DataWeb\OData\Microsoft.Data.Json.Common.txt file to generate the System.Data.Spatial.txt file. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; Error Messages - -SpatialImplementation_NoRegisteredOperations=No operations are registered. Please provide operations using SpatialImplementation.CurrentImplementation.Operations property. - -InvalidPointCoordinate=The value '{0}' is not valid for the coordinate '{1}'. -Point_AccessCoordinateWhenEmpty=Access to the coordinate properties of an empty point is not supported. - -SpatialBuilder_CannotCreateBeforeDrawn=The builder cannot create an instance until all pipeline calls are completed. - -GmlReader_UnexpectedElement=Incorrect GML Format: The XmlReader instance encountered an unexpected element "{0}". -GmlReader_ExpectReaderAtElement=Incorrect GML Format: the XmlReader instance is expected to be at the start of a GML element. -GmlReader_InvalidSpatialType=Incorrect GML Format: unknown spatial type tag "{0}". -GmlReader_EmptyRingsNotAllowed=Incorrect GML Format: a LinearRing element must not be empty. -GmlReader_PosNeedTwoNumbers=Incorrect GML Format: a pos element must contain at least two coordinates. -GmlReader_PosListNeedsEvenCount=Incorrect GML Format: a posList element must contain an even number of coordinates. -GmlReader_InvalidSrsName=Incorrect GML Format: a srsName attribute must begin with the namespace "{0}". -GmlReader_InvalidAttribute=The attribute '{0}' on element '{1}' is not supported. -GmlReader_InvalidSrsDimension=Incorrect GML Format: a srsDimension attribute must be either "2" or "3". - -WellKnownText_UnexpectedToken=Expecting token type "{0}" with text "{1}" but found "{2}". -WellKnownText_UnexpectedCharacter=Unexpected character '{0}' found in text. -WellKnownText_UnknownTaggedText=Unknown Tagged Text "{0}". -WellKnownText_TooManyDimensions=The WellKnownTextReader is configured to allow only two dimensions, and a third dimension was encountered. - -Validator_SridMismatch=Invalid spatial data: An instance of spatial type can have only one unique CoordinateSystem for all of its coordinates. -Validator_InvalidType=Invalid spatial data: Invalid spatial type "{0}". -Validator_FullGlobeInCollection=Invalid spatial data: the spatial type "FullGlobe" cannot be part of a collection type. -Validator_LineStringNeedsTwoPoints=Invalid spatial data: the spatial type "LineString" must contain at least two points. -Validator_FullGlobeCannotHaveElements=Invalid spatial data: the spatial type "FullGlobe" cannot contain figures. -Validator_NestingOverflow=Invalid spatial data: only {0} levels of nesting are supported in collection types. -Validator_InvalidPointCoordinate=Invalid spatial data: the coordinates ({0} {1} {2} {3}) are not valid. -Validator_UnexpectedCall=Invalid spatial data: expected call to "{0}" but got call to "{1}". -Validator_UnexpectedCall2=Invalid spatial data: expected call to "{0}" or "{1}" but got call to "{2}". -Validator_InvalidPolygonPoints=Invalid spatial data: A polygon ring must contain at least four points, and the last point must be equal to the first point. -Validator_InvalidLatitudeCoordinate=Invalid latitude coordinate {0}. A latitude coordinate must be a value between -90.0 and +90.0 degrees. -Validator_InvalidLongitudeCoordinate=Invalid longitude coordinate {0}. A longitude coordinate must be a value between -15069.0 and +15069.0 degrees -Validator_UnexpectedGeography=A geography operation was called while processing a geometric shape. -Validator_UnexpectedGeometry=A geometry operation was called while processing a geographic shape. - -GeoJsonReader_MissingRequiredMember=Invalid GeoJSON. The '{0}' member is required, but was not found. -GeoJsonReader_InvalidPosition=Invalid GeoJSON. A position must contain at least two and no more than four elements. -GeoJsonReader_InvalidTypeName=Invalid GeoJSON. The value '{0}' is not a valid value for the 'type' member. -GeoJsonReader_InvalidNullElement=Invalid GeoJSON. A null value was found in an array element where nulls are not allowed. -GeoJsonReader_ExpectedNumeric=Invalid GeoJSON. A non-numeric value was found in an array element where a numeric value was expected. -GeoJsonReader_ExpectedArray=Invalid GeoJSON. A primitive value was found in an array element where an array was expected. -GeoJsonReader_InvalidCrsType=Invalid GeoJSON. The value '{0}' is not a recognized CRS type. -GeoJsonReader_InvalidCrsName=Invalid GeoJSON. The value '{0}' is not a recognized CRS name. - -; Note: The below list of error messages are common to both the OData and the Spatial project. - -JsonReaderExtensions_CannotReadPropertyValueAsString=Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value. -JsonReaderExtensions_CannotReadValueAsJsonObject=Cannot read the value '{0}' as a JSON object. - -; Note: The below list of error messages are common to the ODataLib, EdmLib, Spatial, Server and Client projects. -PlatformHelper_DateTimeOffsetMustContainTimeZone=The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. diff --git a/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.cs b/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.cs deleted file mode 100644 index 1ca947c16d..0000000000 --- a/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.cs +++ /dev/null @@ -1,451 +0,0 @@ -// - -//--------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. -// -// GENERATED FILE. DO NOT MODIFY. -// -// -//--------------------------------------------------------------------- - -namespace Microsoft.Spatial { - using System; - using System.Resources; - - /// - /// Strongly-typed and parameterized string resources. - /// - internal static class Strings { - /// - /// A string like "No operations are registered. Please provide operations using SpatialImplementation.CurrentImplementation.Operations property." - /// - internal static string SpatialImplementation_NoRegisteredOperations - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.SpatialImplementation_NoRegisteredOperations); - } - } - - /// - /// A string like "The value '{0}' is not valid for the coordinate '{1}'." - /// - internal static string InvalidPointCoordinate(object p0, object p1) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.InvalidPointCoordinate, p0, p1); - } - - /// - /// A string like "Access to the coordinate properties of an empty point is not supported." - /// - internal static string Point_AccessCoordinateWhenEmpty - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Point_AccessCoordinateWhenEmpty); - } - } - - /// - /// A string like "The builder cannot create an instance until all pipeline calls are completed." - /// - internal static string SpatialBuilder_CannotCreateBeforeDrawn - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.SpatialBuilder_CannotCreateBeforeDrawn); - } - } - - /// - /// A string like "Incorrect GML Format: The XmlReader instance encountered an unexpected element "{0}"." - /// - internal static string GmlReader_UnexpectedElement(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_UnexpectedElement, p0); - } - - /// - /// A string like "Incorrect GML Format: the XmlReader instance is expected to be at the start of a GML element." - /// - internal static string GmlReader_ExpectReaderAtElement - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_ExpectReaderAtElement); - } - } - - /// - /// A string like "Incorrect GML Format: unknown spatial type tag "{0}"." - /// - internal static string GmlReader_InvalidSpatialType(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_InvalidSpatialType, p0); - } - - /// - /// A string like "Incorrect GML Format: a LinearRing element must not be empty." - /// - internal static string GmlReader_EmptyRingsNotAllowed - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_EmptyRingsNotAllowed); - } - } - - /// - /// A string like "Incorrect GML Format: a pos element must contain at least two coordinates." - /// - internal static string GmlReader_PosNeedTwoNumbers - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_PosNeedTwoNumbers); - } - } - - /// - /// A string like "Incorrect GML Format: a posList element must contain an even number of coordinates." - /// - internal static string GmlReader_PosListNeedsEvenCount - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_PosListNeedsEvenCount); - } - } - - /// - /// A string like "Incorrect GML Format: a srsName attribute must begin with the namespace "{0}"." - /// - internal static string GmlReader_InvalidSrsName(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_InvalidSrsName, p0); - } - - /// - /// A string like "The attribute '{0}' on element '{1}' is not supported." - /// - internal static string GmlReader_InvalidAttribute(object p0, object p1) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_InvalidAttribute, p0, p1); - } - - /// - /// A string like "Incorrect GML Format: a srsDimension attribute must be either "2" or "3"." - /// - internal static string GmlReader_InvalidSrsDimension - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GmlReader_InvalidSrsDimension); - } - } - - /// - /// A string like "Expecting token type "{0}" with text "{1}" but found "{2}"." - /// - internal static string WellKnownText_UnexpectedToken(object p0, object p1, object p2) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.WellKnownText_UnexpectedToken, p0, p1, p2); - } - - /// - /// A string like "Unexpected character '{0}' found in text." - /// - internal static string WellKnownText_UnexpectedCharacter(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.WellKnownText_UnexpectedCharacter, p0); - } - - /// - /// A string like "Unknown Tagged Text "{0}"." - /// - internal static string WellKnownText_UnknownTaggedText(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.WellKnownText_UnknownTaggedText, p0); - } - - /// - /// A string like "The WellKnownTextReader is configured to allow only two dimensions, and a third dimension was encountered." - /// - internal static string WellKnownText_TooManyDimensions - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.WellKnownText_TooManyDimensions); - } - } - - /// - /// A string like "Invalid spatial data: An instance of spatial type can have only one unique CoordinateSystem for all of its coordinates." - /// - internal static string Validator_SridMismatch - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_SridMismatch); - } - } - - /// - /// A string like "Invalid spatial data: Invalid spatial type "{0}"." - /// - internal static string Validator_InvalidType(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_InvalidType, p0); - } - - /// - /// A string like "Invalid spatial data: the spatial type "FullGlobe" cannot be part of a collection type." - /// - internal static string Validator_FullGlobeInCollection - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_FullGlobeInCollection); - } - } - - /// - /// A string like "Invalid spatial data: the spatial type "LineString" must contain at least two points." - /// - internal static string Validator_LineStringNeedsTwoPoints - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_LineStringNeedsTwoPoints); - } - } - - /// - /// A string like "Invalid spatial data: the spatial type "FullGlobe" cannot contain figures." - /// - internal static string Validator_FullGlobeCannotHaveElements - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_FullGlobeCannotHaveElements); - } - } - - /// - /// A string like "Invalid spatial data: only {0} levels of nesting are supported in collection types." - /// - internal static string Validator_NestingOverflow(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_NestingOverflow, p0); - } - - /// - /// A string like "Invalid spatial data: the coordinates ({0} {1} {2} {3}) are not valid." - /// - internal static string Validator_InvalidPointCoordinate(object p0, object p1, object p2, object p3) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_InvalidPointCoordinate, p0, p1, p2, p3); - } - - /// - /// A string like "Invalid spatial data: expected call to "{0}" but got call to "{1}"." - /// - internal static string Validator_UnexpectedCall(object p0, object p1) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_UnexpectedCall, p0, p1); - } - - /// - /// A string like "Invalid spatial data: expected call to "{0}" or "{1}" but got call to "{2}"." - /// - internal static string Validator_UnexpectedCall2(object p0, object p1, object p2) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_UnexpectedCall2, p0, p1, p2); - } - - /// - /// A string like "Invalid spatial data: A polygon ring must contain at least four points, and the last point must be equal to the first point." - /// - internal static string Validator_InvalidPolygonPoints - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_InvalidPolygonPoints); - } - } - - /// - /// A string like "Invalid latitude coordinate {0}. A latitude coordinate must be a value between -90.0 and +90.0 degrees." - /// - internal static string Validator_InvalidLatitudeCoordinate(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_InvalidLatitudeCoordinate, p0); - } - - /// - /// A string like "Invalid longitude coordinate {0}. A longitude coordinate must be a value between -15069.0 and +15069.0 degrees" - /// - internal static string Validator_InvalidLongitudeCoordinate(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_InvalidLongitudeCoordinate, p0); - } - - /// - /// A string like "A geography operation was called while processing a geometric shape." - /// - internal static string Validator_UnexpectedGeography - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_UnexpectedGeography); - } - } - - /// - /// A string like "A geometry operation was called while processing a geographic shape." - /// - internal static string Validator_UnexpectedGeometry - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.Validator_UnexpectedGeometry); - } - } - - /// - /// A string like "Invalid GeoJSON. The '{0}' member is required, but was not found." - /// - internal static string GeoJsonReader_MissingRequiredMember(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_MissingRequiredMember, p0); - } - - /// - /// A string like "Invalid GeoJSON. A position must contain at least two and no more than four elements." - /// - internal static string GeoJsonReader_InvalidPosition - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_InvalidPosition); - } - } - - /// - /// A string like "Invalid GeoJSON. The value '{0}' is not a valid value for the 'type' member." - /// - internal static string GeoJsonReader_InvalidTypeName(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_InvalidTypeName, p0); - } - - /// - /// A string like "Invalid GeoJSON. A null value was found in an array element where nulls are not allowed." - /// - internal static string GeoJsonReader_InvalidNullElement - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_InvalidNullElement); - } - } - - /// - /// A string like "Invalid GeoJSON. A non-numeric value was found in an array element where a numeric value was expected." - /// - internal static string GeoJsonReader_ExpectedNumeric - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_ExpectedNumeric); - } - } - - /// - /// A string like "Invalid GeoJSON. A primitive value was found in an array element where an array was expected." - /// - internal static string GeoJsonReader_ExpectedArray - { - get - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_ExpectedArray); - } - } - - /// - /// A string like "Invalid GeoJSON. The value '{0}' is not a recognized CRS type." - /// - internal static string GeoJsonReader_InvalidCrsType(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_InvalidCrsType, p0); - } - - /// - /// A string like "Invalid GeoJSON. The value '{0}' is not a recognized CRS name." - /// - internal static string GeoJsonReader_InvalidCrsName(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.GeoJsonReader_InvalidCrsName, p0); - } - - /// - /// A string like "Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value." - /// - internal static string JsonReaderExtensions_CannotReadPropertyValueAsString(object p0, object p1) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.JsonReaderExtensions_CannotReadPropertyValueAsString, p0, p1); - } - - /// - /// A string like "Cannot read the value '{0}' as a JSON object." - /// - internal static string JsonReaderExtensions_CannotReadValueAsJsonObject(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.JsonReaderExtensions_CannotReadValueAsJsonObject, p0); - } - - /// - /// A string like "The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information." - /// - internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone(object p0) - { - return Microsoft.Spatial.TextRes.GetString(Microsoft.Spatial.TextRes.PlatformHelper_DateTimeOffsetMustContainTimeZone, p0); - } - - } - - /// - /// Strongly-typed and parameterized exception factory. - /// - internal static partial class Error { - - /// - /// The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. - /// - internal static Exception ArgumentNull(string paramName) { - return new ArgumentNullException(paramName); - } - - /// - /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. - /// - internal static Exception ArgumentOutOfRange(string paramName) { - return new ArgumentOutOfRangeException(paramName); - } - - /// - /// The exception that is thrown when the author has not yet implemented the logic at this point in the program. This can act as an exception based TODO tag. - /// - internal static Exception NotImplemented() { - return new NotImplementedException(); - } - - /// - /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. - /// - internal static Exception NotSupported() { - return new NotSupportedException(); - } - } -} diff --git a/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.tt b/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.tt deleted file mode 100644 index 41911e6b69..0000000000 --- a/src/Microsoft.Spatial/Parameterized.Microsoft.Spatial.tt +++ /dev/null @@ -1,19 +0,0 @@ -<#@ include file="..\..\tools\StringResourceGenerator\StringsClassGenerator.ttinclude" #> -<#+ -public static class Configuration -{ - // The namespace where the generated resource classes reside. - public const string ResourceClassNamespace = "Microsoft.Spatial"; - - // The assembly name where the generated resource classes will be linked. - public const string AssemblyName = "Microsoft.Spatial"; - - // The name of the generated resource class. - public const string ResourceClassName = "TextRes"; - - // The list of text files containing all the string resources. - public static readonly string[] TextFiles = { - "Microsoft.Spatial.txt" - }; -} -#> \ No newline at end of file diff --git a/src/Microsoft.Spatial/SRResources.Designer.cs b/src/Microsoft.Spatial/SRResources.Designer.cs new file mode 100644 index 0000000000..9172bd5ec7 --- /dev/null +++ b/src/Microsoft.Spatial/SRResources.Designer.cs @@ -0,0 +1,441 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Spatial { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SRResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SRResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Spatial.SRResources", typeof(SRResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. A primitive value was found in an array element where an array was expected.. + /// + internal static string GeoJsonReader_ExpectedArray { + get { + return ResourceManager.GetString("GeoJsonReader_ExpectedArray", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. A non-numeric value was found in an array element where a numeric value was expected.. + /// + internal static string GeoJsonReader_ExpectedNumeric { + get { + return ResourceManager.GetString("GeoJsonReader_ExpectedNumeric", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. The value '{0}' is not a recognized CRS name.. + /// + internal static string GeoJsonReader_InvalidCrsName { + get { + return ResourceManager.GetString("GeoJsonReader_InvalidCrsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. The value '{0}' is not a recognized CRS type.. + /// + internal static string GeoJsonReader_InvalidCrsType { + get { + return ResourceManager.GetString("GeoJsonReader_InvalidCrsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. A null value was found in an array element where nulls are not allowed.. + /// + internal static string GeoJsonReader_InvalidNullElement { + get { + return ResourceManager.GetString("GeoJsonReader_InvalidNullElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. A position must contain at least two and no more than four elements.. + /// + internal static string GeoJsonReader_InvalidPosition { + get { + return ResourceManager.GetString("GeoJsonReader_InvalidPosition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. The value '{0}' is not a valid value for the 'type' member.. + /// + internal static string GeoJsonReader_InvalidTypeName { + get { + return ResourceManager.GetString("GeoJsonReader_InvalidTypeName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid GeoJSON. The '{0}' member is required, but was not found.. + /// + internal static string GeoJsonReader_MissingRequiredMember { + get { + return ResourceManager.GetString("GeoJsonReader_MissingRequiredMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: a LinearRing element must not be empty.. + /// + internal static string GmlReader_EmptyRingsNotAllowed { + get { + return ResourceManager.GetString("GmlReader_EmptyRingsNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: the XmlReader instance is expected to be at the start of a GML element.. + /// + internal static string GmlReader_ExpectReaderAtElement { + get { + return ResourceManager.GetString("GmlReader_ExpectReaderAtElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute '{0}' on element '{1}' is not supported.. + /// + internal static string GmlReader_InvalidAttribute { + get { + return ResourceManager.GetString("GmlReader_InvalidAttribute", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: unknown spatial type tag "{0}".. + /// + internal static string GmlReader_InvalidSpatialType { + get { + return ResourceManager.GetString("GmlReader_InvalidSpatialType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: a srsDimension attribute must be either "2" or "3".. + /// + internal static string GmlReader_InvalidSrsDimension { + get { + return ResourceManager.GetString("GmlReader_InvalidSrsDimension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: a srsName attribute must begin with the namespace "{0}".. + /// + internal static string GmlReader_InvalidSrsName { + get { + return ResourceManager.GetString("GmlReader_InvalidSrsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: a posList element must contain an even number of coordinates.. + /// + internal static string GmlReader_PosListNeedsEvenCount { + get { + return ResourceManager.GetString("GmlReader_PosListNeedsEvenCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: a pos element must contain at least two coordinates.. + /// + internal static string GmlReader_PosNeedTwoNumbers { + get { + return ResourceManager.GetString("GmlReader_PosNeedTwoNumbers", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect GML Format: The XmlReader instance encountered an unexpected element "{0}".. + /// + internal static string GmlReader_UnexpectedElement { + get { + return ResourceManager.GetString("GmlReader_UnexpectedElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is not valid for the coordinate '{1}'.. + /// + internal static string InvalidPointCoordinate { + get { + return ResourceManager.GetString("InvalidPointCoordinate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value.. + /// + internal static string JsonReaderExtensions_CannotReadPropertyValueAsString { + get { + return ResourceManager.GetString("JsonReaderExtensions_CannotReadPropertyValueAsString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot read the value '{0}' as a JSON object.. + /// + internal static string JsonReaderExtensions_CannotReadValueAsJsonObject { + get { + return ResourceManager.GetString("JsonReaderExtensions_CannotReadValueAsJsonObject", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information.. + /// + internal static string PlatformHelper_DateTimeOffsetMustContainTimeZone { + get { + return ResourceManager.GetString("PlatformHelper_DateTimeOffsetMustContainTimeZone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to the coordinate properties of an empty point is not supported.. + /// + internal static string Point_AccessCoordinateWhenEmpty { + get { + return ResourceManager.GetString("Point_AccessCoordinateWhenEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The builder cannot create an instance until all pipeline calls are completed.. + /// + internal static string SpatialBuilder_CannotCreateBeforeDrawn { + get { + return ResourceManager.GetString("SpatialBuilder_CannotCreateBeforeDrawn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No operations are registered. Please provide operations using SpatialImplementation.CurrentImplementation.Operations property.. + /// + internal static string SpatialImplementation_NoRegisteredOperations { + get { + return ResourceManager.GetString("SpatialImplementation_NoRegisteredOperations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: the spatial type "FullGlobe" cannot contain figures.. + /// + internal static string Validator_FullGlobeCannotHaveElements { + get { + return ResourceManager.GetString("Validator_FullGlobeCannotHaveElements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: the spatial type "FullGlobe" cannot be part of a collection type.. + /// + internal static string Validator_FullGlobeInCollection { + get { + return ResourceManager.GetString("Validator_FullGlobeInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid latitude coordinate {0}. A latitude coordinate must be a value between -90.0 and +90.0 degrees.. + /// + internal static string Validator_InvalidLatitudeCoordinate { + get { + return ResourceManager.GetString("Validator_InvalidLatitudeCoordinate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid longitude coordinate {0}. A longitude coordinate must be a value between -15069.0 and +15069.0 degrees. + /// + internal static string Validator_InvalidLongitudeCoordinate { + get { + return ResourceManager.GetString("Validator_InvalidLongitudeCoordinate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: the coordinates ({0} {1} {2} {3}) are not valid.. + /// + internal static string Validator_InvalidPointCoordinate { + get { + return ResourceManager.GetString("Validator_InvalidPointCoordinate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: A polygon ring must contain at least four points, and the last point must be equal to the first point.. + /// + internal static string Validator_InvalidPolygonPoints { + get { + return ResourceManager.GetString("Validator_InvalidPolygonPoints", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: Invalid spatial type "{0}".. + /// + internal static string Validator_InvalidType { + get { + return ResourceManager.GetString("Validator_InvalidType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: the spatial type "LineString" must contain at least two points.. + /// + internal static string Validator_LineStringNeedsTwoPoints { + get { + return ResourceManager.GetString("Validator_LineStringNeedsTwoPoints", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: only {0} levels of nesting are supported in collection types.. + /// + internal static string Validator_NestingOverflow { + get { + return ResourceManager.GetString("Validator_NestingOverflow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: An instance of spatial type can have only one unique CoordinateSystem for all of its coordinates.. + /// + internal static string Validator_SridMismatch { + get { + return ResourceManager.GetString("Validator_SridMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: expected call to "{0}" but got call to "{1}".. + /// + internal static string Validator_UnexpectedCall { + get { + return ResourceManager.GetString("Validator_UnexpectedCall", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid spatial data: expected call to "{0}" or "{1}" but got call to "{2}".. + /// + internal static string Validator_UnexpectedCall2 { + get { + return ResourceManager.GetString("Validator_UnexpectedCall2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A geography operation was called while processing a geometric shape.. + /// + internal static string Validator_UnexpectedGeography { + get { + return ResourceManager.GetString("Validator_UnexpectedGeography", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A geometry operation was called while processing a geographic shape.. + /// + internal static string Validator_UnexpectedGeometry { + get { + return ResourceManager.GetString("Validator_UnexpectedGeometry", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The WellKnownTextReader is configured to allow only two dimensions, and a third dimension was encountered.. + /// + internal static string WellKnownText_TooManyDimensions { + get { + return ResourceManager.GetString("WellKnownText_TooManyDimensions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unexpected character '{0}' found in text.. + /// + internal static string WellKnownText_UnexpectedCharacter { + get { + return ResourceManager.GetString("WellKnownText_UnexpectedCharacter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expecting token type "{0}" with text "{1}" but found "{2}".. + /// + internal static string WellKnownText_UnexpectedToken { + get { + return ResourceManager.GetString("WellKnownText_UnexpectedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown Tagged Text "{0}".. + /// + internal static string WellKnownText_UnknownTaggedText { + get { + return ResourceManager.GetString("WellKnownText_UnknownTaggedText", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.Spatial/SRResources.resx b/src/Microsoft.Spatial/SRResources.resx new file mode 100644 index 0000000000..e3834447f2 --- /dev/null +++ b/src/Microsoft.Spatial/SRResources.resx @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + No operations are registered. Please provide operations using SpatialImplementation.CurrentImplementation.Operations property. + + + The value '{0}' is not valid for the coordinate '{1}'. + + + Access to the coordinate properties of an empty point is not supported. + + + The builder cannot create an instance until all pipeline calls are completed. + + + Incorrect GML Format: The XmlReader instance encountered an unexpected element "{0}". + + + Incorrect GML Format: the XmlReader instance is expected to be at the start of a GML element. + + + Incorrect GML Format: unknown spatial type tag "{0}". + + + Incorrect GML Format: a LinearRing element must not be empty. + + + Incorrect GML Format: a pos element must contain at least two coordinates. + + + Incorrect GML Format: a posList element must contain an even number of coordinates. + + + Incorrect GML Format: a srsName attribute must begin with the namespace "{0}". + + + The attribute '{0}' on element '{1}' is not supported. + + + Incorrect GML Format: a srsDimension attribute must be either "2" or "3". + + + Expecting token type "{0}" with text "{1}" but found "{2}". + + + Unexpected character '{0}' found in text. + + + Unknown Tagged Text "{0}". + + + The WellKnownTextReader is configured to allow only two dimensions, and a third dimension was encountered. + + + Invalid spatial data: An instance of spatial type can have only one unique CoordinateSystem for all of its coordinates. + + + Invalid spatial data: Invalid spatial type "{0}". + + + Invalid spatial data: the spatial type "FullGlobe" cannot be part of a collection type. + + + Invalid spatial data: the spatial type "LineString" must contain at least two points. + + + Invalid spatial data: the spatial type "FullGlobe" cannot contain figures. + + + Invalid spatial data: only {0} levels of nesting are supported in collection types. + + + Invalid spatial data: the coordinates ({0} {1} {2} {3}) are not valid. + + + Invalid spatial data: expected call to "{0}" but got call to "{1}". + + + Invalid spatial data: expected call to "{0}" or "{1}" but got call to "{2}". + + + Invalid spatial data: A polygon ring must contain at least four points, and the last point must be equal to the first point. + + + Invalid latitude coordinate {0}. A latitude coordinate must be a value between -90.0 and +90.0 degrees. + + + Invalid longitude coordinate {0}. A longitude coordinate must be a value between -15069.0 and +15069.0 degrees + + + A geography operation was called while processing a geometric shape. + + + A geometry operation was called while processing a geographic shape. + + + Invalid GeoJSON. The '{0}' member is required, but was not found. + + + Invalid GeoJSON. A position must contain at least two and no more than four elements. + + + Invalid GeoJSON. The value '{0}' is not a valid value for the 'type' member. + + + Invalid GeoJSON. A null value was found in an array element where nulls are not allowed. + + + Invalid GeoJSON. A non-numeric value was found in an array element where a numeric value was expected. + + + Invalid GeoJSON. A primitive value was found in an array element where an array was expected. + + + Invalid GeoJSON. The value '{0}' is not a recognized CRS type. + + + Invalid GeoJSON. The value '{0}' is not a recognized CRS name. + + + Cannot read the value '{0}' for the property '{1}' as a quoted JSON string value. + + + Cannot read the value '{0}' as a JSON object. + + + The time zone information is missing on the DateTimeOffset value '{0}'. A DateTimeOffset value must contain the time zone information. + + \ No newline at end of file diff --git a/src/Microsoft.Spatial/Spatial/SpatialImplementation.cs b/src/Microsoft.Spatial/Spatial/SpatialImplementation.cs index db61da45ab..de2cda246e 100644 --- a/src/Microsoft.Spatial/Spatial/SpatialImplementation.cs +++ b/src/Microsoft.Spatial/Spatial/SpatialImplementation.cs @@ -74,7 +74,7 @@ internal SpatialOperations VerifyAndGetNonNullOperations() var operations = this.Operations; if (operations == null) { - throw new NotImplementedException(Strings.SpatialImplementation_NoRegisteredOperations); + throw new NotImplementedException(SRResources.SpatialImplementation_NoRegisteredOperations); } return operations; diff --git a/src/Microsoft.Spatial/Spatial/SpatialTreeBuilder.cs b/src/Microsoft.Spatial/Spatial/SpatialTreeBuilder.cs index 0d5284aab0..6d05d9642e 100644 --- a/src/Microsoft.Spatial/Spatial/SpatialTreeBuilder.cs +++ b/src/Microsoft.Spatial/Spatial/SpatialTreeBuilder.cs @@ -48,7 +48,7 @@ public T ConstructedInstance { if (this.lastConstructedNode == null || this.lastConstructedNode.Instance == null || this.lastConstructedNode.Parent != null) { - throw new InvalidOperationException(Strings.SpatialBuilder_CannotCreateBeforeDrawn); + throw new InvalidOperationException(SRResources.SpatialBuilder_CannotCreateBeforeDrawn); } return this.lastConstructedNode.Instance; diff --git a/src/Microsoft.Spatial/Spatial/SpatialValidatorImplementation.cs b/src/Microsoft.Spatial/Spatial/SpatialValidatorImplementation.cs index c984011b98..3a4ea774c7 100644 --- a/src/Microsoft.Spatial/Spatial/SpatialValidatorImplementation.cs +++ b/src/Microsoft.Spatial/Spatial/SpatialValidatorImplementation.cs @@ -338,7 +338,7 @@ protected override CoordinateSystem OnSetCoordinateSystem(CoordinateSystem coord } else if (this.validationCoordinateSystem != coordinateSystem) { - throw new FormatException(Strings.Validator_SridMismatch); + throw new FormatException(SRResources.Validator_SridMismatch); } return coordinateSystem; @@ -353,7 +353,7 @@ protected override SpatialType OnBeginGeography(SpatialType shape) { if (this.depth > 0 && !this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeometry); + throw new FormatException(SRResources.Validator_UnexpectedGeometry); } this.processingGeography = true; @@ -370,7 +370,7 @@ protected override void OnEndGeography() Execute(PipelineCall.End); if (!this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeometry); + throw new FormatException(SRResources.Validator_UnexpectedGeometry); } this.depth -= 1; @@ -385,7 +385,7 @@ protected override SpatialType OnBeginGeometry(SpatialType shape) { if (this.depth > 0 && this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeography); + throw new FormatException(SRResources.Validator_UnexpectedGeography); } this.processingGeography = false; @@ -401,7 +401,7 @@ protected override void OnEndGeometry() Execute(PipelineCall.End); if (this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeography); + throw new FormatException(SRResources.Validator_UnexpectedGeography); } this.depth -= 1; @@ -461,7 +461,7 @@ protected override GeographyPosition OnLineTo(GeographyPosition position) if (!this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeometry); + throw new FormatException(SRResources.Validator_UnexpectedGeometry); } return position; @@ -483,7 +483,7 @@ protected override GeometryPosition OnLineTo(GeometryPosition position) if (this.processingGeography) { - throw new FormatException(Strings.Validator_UnexpectedGeography); + throw new FormatException(SRResources.Validator_UnexpectedGeography); } return position; @@ -525,7 +525,7 @@ private static void ValidateOnePosition(double first, double second, double? z, { if (!IsPointValid(first, second, z, m)) { - throw new FormatException(Strings.Validator_InvalidPointCoordinate(first, second, z, m)); + throw new FormatException(Error.Format(SRResources.Validator_InvalidPointCoordinate, first, second, z, m)); } } @@ -541,12 +541,12 @@ private static void ValidateGeographyPosition(double latitude, double longitude, ValidateOnePosition(latitude, longitude, z, m); if (!IsLatitudeValid(latitude)) { - throw new FormatException(Strings.Validator_InvalidLatitudeCoordinate(latitude)); + throw new FormatException(Error.Format(SRResources.Validator_InvalidLatitudeCoordinate, latitude)); } if (!IsLongitudeValid(longitude)) { - throw new FormatException(Strings.Validator_InvalidLongitudeCoordinate(longitude)); + throw new FormatException(Error.Format(SRResources.Validator_InvalidLongitudeCoordinate, longitude)); } } @@ -600,7 +600,7 @@ private static void ValidateGeographyPolygon( if (numOfPoints < 4 || initialFirstCoordinate != mostRecentFirstCoordinate || !AreLongitudesEqual(initialSecondCoordinate, mostRecentSecondCoordinate)) { - throw new FormatException(Strings.Validator_InvalidPolygonPoints); + throw new FormatException(SRResources.Validator_InvalidPolygonPoints); } } @@ -622,7 +622,7 @@ private static void ValidateGeometryPolygon( if (numOfPoints < 4 || initialFirstCoordinate != mostRecentFirstCoordinate || initialSecondCoordinate != mostRecentSecondCoordinate) { - throw new FormatException(Strings.Validator_InvalidPolygonPoints); + throw new FormatException(SRResources.Validator_InvalidPolygonPoints); } } @@ -687,7 +687,7 @@ private void BeginShape(SpatialType type) case SpatialType.FullGlobe: if (!this.processingGeography) { - throw new FormatException(Strings.Validator_InvalidType(type)); + throw new FormatException(Error.Format(SRResources.Validator_InvalidType, type)); } Execute(PipelineCall.BeginFullGlobe); @@ -706,7 +706,7 @@ private void BeginShape(SpatialType type) break; #endif default: - throw new FormatException(Strings.Validator_InvalidType(type)); + throw new FormatException(Error.Format(SRResources.Validator_InvalidType, type)); } } @@ -779,7 +779,7 @@ private void Call(ValidatorState state) { if (this.stack.Count > MaxGeometryCollectionDepth) { - throw new FormatException(Strings.Validator_NestingOverflow(MaxGeometryCollectionDepth)); + throw new FormatException(Error.Format(SRResources.Validator_NestingOverflow, MaxGeometryCollectionDepth)); } this.stack.Push(state); @@ -828,7 +828,7 @@ internal abstract void ValidateTransition( /// The actual state protected static void ThrowExpected(PipelineCall transition, PipelineCall actual) { - throw new FormatException(Strings.Validator_UnexpectedCall(transition, actual)); + throw new FormatException(Error.Format(SRResources.Validator_UnexpectedCall, transition, actual)); } /// @@ -842,7 +842,7 @@ protected static void ThrowExpected( PipelineCall transition2, PipelineCall actual) { - throw new FormatException(Strings.Validator_UnexpectedCall2(transition1, transition2, actual)); + throw new FormatException(Error.Format(SRResources.Validator_UnexpectedCall2, transition1, transition2, actual)); } /// @@ -858,7 +858,7 @@ protected static void ThrowExpected( PipelineCall transition3, PipelineCall actual) { - throw new FormatException(Strings.Validator_UnexpectedCall2(transition1 + ", " + transition2, transition3, actual)); + throw new FormatException(Error.Format(SRResources.Validator_UnexpectedCall2, transition1 + ", " + transition2, transition3, actual)); } } @@ -930,7 +930,7 @@ internal override void ValidateTransition( case PipelineCall.BeginFullGlobe: if (validator.depth != 1) { - throw new FormatException(Strings.Validator_FullGlobeInCollection); + throw new FormatException(SRResources.Validator_FullGlobeInCollection); } validator.Jump(FullGlobe); @@ -1094,7 +1094,7 @@ internal override void ValidateTransition(PipelineCall transition, NestedValidat case PipelineCall.EndFigure: if (validator.pointCount < 2) { - throw new FormatException(Strings.Validator_LineStringNeedsTwoPoints); + throw new FormatException(SRResources.Validator_LineStringNeedsTwoPoints); } validator.Jump(LineStringEnd); @@ -1340,7 +1340,7 @@ internal override void ValidateTransition(PipelineCall transition, NestedValidat validator.Return(); return; case PipelineCall.BeginFullGlobe: - throw new FormatException(Strings.Validator_FullGlobeInCollection); + throw new FormatException(SRResources.Validator_FullGlobeInCollection); #if CURVE_SUPPORT case Transition.Begin_CircularString: Call(CircularString); @@ -1380,7 +1380,7 @@ internal override void ValidateTransition(PipelineCall transition, NestedValidat validator.Return(); return; default: - throw new FormatException(Strings.Validator_FullGlobeCannotHaveElements); + throw new FormatException(SRResources.Validator_FullGlobeCannotHaveElements); } } } diff --git a/src/Microsoft.Spatial/WellKnown/WellKnownTextLexer.cs b/src/Microsoft.Spatial/WellKnown/WellKnownTextLexer.cs index 933c423133..0bca1e9a74 100644 --- a/src/Microsoft.Spatial/WellKnown/WellKnownTextLexer.cs +++ b/src/Microsoft.Spatial/WellKnown/WellKnownTextLexer.cs @@ -93,7 +93,7 @@ protected override bool MatchTokenType(char nextChar, int? activeTokenType, out return false; } - throw new FormatException(Strings.WellKnownText_UnexpectedCharacter(nextChar)); + throw new FormatException(Error.Format(SRResources.WellKnownText_UnexpectedCharacter, nextChar)); } } } diff --git a/src/Microsoft.Spatial/WellKnown/WellKnownTextSqlReader.cs b/src/Microsoft.Spatial/WellKnown/WellKnownTextSqlReader.cs index d0caa4170d..8eb8ac08d3 100644 --- a/src/Microsoft.Spatial/WellKnown/WellKnownTextSqlReader.cs +++ b/src/Microsoft.Spatial/WellKnown/WellKnownTextSqlReader.cs @@ -214,12 +214,12 @@ private void ParsePoint(bool firstFigure) if (this.TryReadOptionalNullableDouble(out z) && allowOnlyTwoDimensions) { - throw new FormatException(Strings.WellKnownText_TooManyDimensions); + throw new FormatException(SRResources.WellKnownText_TooManyDimensions); } if (this.TryReadOptionalNullableDouble(out m) && allowOnlyTwoDimensions) { - throw new FormatException(Strings.WellKnownText_TooManyDimensions); + throw new FormatException(SRResources.WellKnownText_TooManyDimensions); } if (firstFigure) @@ -305,7 +305,7 @@ private void ParseTaggedText() // ::= geometrycollection if (!this.NextToken()) { - throw new FormatException(Strings.WellKnownText_UnknownTaggedText(String.Empty)); + throw new FormatException(Error.Format(SRResources.WellKnownText_UnknownTaggedText, string.Empty)); } switch (this.lexer.CurrentToken.Text.ToUpperInvariant()) @@ -350,7 +350,7 @@ private void ParseTaggedText() this.pipeline.EndGeo(); break; default: - throw new FormatException(Strings.WellKnownText_UnknownTaggedText(this.lexer.CurrentToken.Text)); + throw new FormatException(Error.Format(SRResources.WellKnownText_UnknownTaggedText, this.lexer.CurrentToken.Text)); } } @@ -460,7 +460,7 @@ private void ReadToken(WellKnownTextTokenType type, String text) { if (!(this.NextToken() && this.IsTokenMatch(type, text))) { - throw new FormatException(Strings.WellKnownText_UnexpectedToken(type, text, this.lexer.CurrentToken)); + throw new FormatException(Error.Format(SRResources.WellKnownText_UnexpectedToken, type, text, this.lexer.CurrentToken)); } } } diff --git a/src/PlatformHelper.cs b/src/PlatformHelper.cs index ed34078bd2..f2d5cd89dd 100644 --- a/src/PlatformHelper.cs +++ b/src/PlatformHelper.cs @@ -21,7 +21,7 @@ namespace Microsoft.OData.Client namespace Microsoft.Spatial #else #if ODATA_CORE -namespace Microsoft.OData +namespace Microsoft.OData.Core #else namespace Microsoft.OData.Edm #endif @@ -328,35 +328,35 @@ internal static DateTimeOffset ConvertStringToDateTimeOffset(ReadOnlySpan } #if ODATA_CLIENT - /// - /// Converts a string to a DateTime. This is only built in client library - /// - /// A DateTime value to be converted. - /// See documentation for method being accessed in the body of the method. - internal static DateTime ConvertStringToDateTime(string text) - { - var offset = ConvertStringToDateTimeOffset(text); - return offset.UtcDateTime; - } + /// + /// Converts a string to a DateTime. This is only built in client library + /// + /// A DateTime value to be converted. + /// See documentation for method being accessed in the body of the method. + internal static DateTime ConvertStringToDateTime(string text) + { + var offset = ConvertStringToDateTimeOffset(text); + return offset.UtcDateTime; + } - /// - /// Convert the given DateTime instance to corresponding DateTimeOffset instance. - /// The conversion rules for a DateTime kind to DateTimeOffset are: - /// a) Unspecified -> UTC - /// b) Local -> Local - /// c) UTC -> UTC - /// - /// Given DateTime value. - /// DateTimeOffset corresponding to given DateTime value. - internal static DateTimeOffset ConvertDateTimeToDateTimeOffset(DateTime dt) + /// + /// Convert the given DateTime instance to corresponding DateTimeOffset instance. + /// The conversion rules for a DateTime kind to DateTimeOffset are: + /// a) Unspecified -> UTC + /// b) Local -> Local + /// c) UTC -> UTC + /// + /// Given DateTime value. + /// DateTimeOffset corresponding to given DateTime value. + internal static DateTimeOffset ConvertDateTimeToDateTimeOffset(DateTime dt) + { + if (dt.Kind == DateTimeKind.Unspecified) { - if (dt.Kind == DateTimeKind.Unspecified) - { - return new DateTimeOffset(new DateTime(dt.Ticks, DateTimeKind.Utc)); - } - - return new DateTimeOffset(dt); + return new DateTimeOffset(new DateTime(dt.Ticks, DateTimeKind.Utc)); } + + return new DateTimeOffset(dt); + } #endif /// @@ -384,7 +384,7 @@ private static void ValidateTimeZoneInformationInDateTimeOffsetString(ReadOnlySp } // No timezone specified, for example: "2012-12-21T15:01:23.1234567" - throw new FormatException(Strings.PlatformHelper_DateTimeOffsetMustContainTimeZone(text.ToString())); + throw new FormatException(Error.Format(SRResources.PlatformHelper_DateTimeOffsetMustContainTimeZone, text.ToString())); } /// @@ -1005,4 +1005,51 @@ public static Regex CreateCompiled(string pattern, RegexOptions options) return new Regex(pattern, options); } } + + [ExcludeFromCodeCoverage] + internal static partial class Error + { + /// + /// Formats the specified resource string. + /// + /// A composite format string. + /// An object array that contains zero or more objects to format. + /// The formatted string. + internal static string Format(string format, params object[] args) + { + return string.Format(SRResources.Culture, format, args); + } + + /// + /// The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. + /// + internal static Exception ArgumentNull(string paramName) + { + return new ArgumentNullException(paramName); + } + + /// + /// The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. + /// + internal static Exception ArgumentOutOfRange(string paramName) + { + return new ArgumentOutOfRangeException(paramName); + } + + /// + /// The exception that is thrown when the author has not yet implemented the logic at this point in the program. This can act as an exception based TODO tag. + /// + internal static Exception NotImplemented() + { + return new NotImplementedException(); + } + + /// + /// The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. + /// + internal static Exception NotSupported() + { + return new NotSupportedException(); + } + } } diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/AddNewEndingTokenVisitorTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/AddNewEndingTokenVisitorTests.cs index baece8d147..9cfda56bc0 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/AddNewEndingTokenVisitorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/AddNewEndingTokenVisitorTests.cs @@ -6,7 +6,6 @@ using System; using Microsoft.OData.Client.ALinq.UriParser; -using Microsoft.OData; using Xunit; namespace Microsoft.OData.Client.Tests.ALinq @@ -24,7 +23,7 @@ public void SystemTokensThrowNotSupportedError() Action visitSystemToken = () => token.Accept(visitor); NotSupportedException exception = Assert.Throws(visitSystemToken); - Assert.Equal(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It), exception.Message); + Assert.Equal(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, ExpressionConstants.It), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/DollarApplyGroupByTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/DollarApplyGroupByTests.cs index c43e7ac424..d3b0e2e550 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/DollarApplyGroupByTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/DollarApplyGroupByTests.cs @@ -1341,7 +1341,7 @@ public void GroupByResultSelector_ConstructorInitializationInKeySelectorNotPermi }); Assert.Equal( - "Error translating Linq expression to URI: " + Strings.ALinq_InvalidGroupByKeySelector("new SalesGroupingKey02(d1.Product.Color, d1.Customer.Country)"), + "Error translating Linq expression to URI: " + Error.Format(SRResources.ALinq_InvalidGroupByKeySelector, "new SalesGroupingKey02(d1.Product.Color, d1.Customer.Country)"), aggregateQuery.ToString()); } diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/RemoveWildcardVisitorTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/RemoveWildcardVisitorTests.cs index 3db8910299..4d02667044 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/RemoveWildcardVisitorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/RemoveWildcardVisitorTests.cs @@ -22,7 +22,7 @@ public void SystemTokenThrows() SystemToken token = new SystemToken(ExpressionConstants.It, null); Action visitSystemToken = () => token.Accept(visitor); NotSupportedException exception = Assert.Throws(visitSystemToken); - Assert.Equal(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It), exception.Message); + Assert.Equal(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, ExpressionConstants.It), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/SelectExpandPathToStringVisitorTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/SelectExpandPathToStringVisitorTests.cs index a61bfedcc0..d024dcbf36 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/SelectExpandPathToStringVisitorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/ALinq/SelectExpandPathToStringVisitorTests.cs @@ -23,7 +23,7 @@ public void SystemTokenThrows() SystemToken systemToken = new SystemToken(ExpressionConstants.It, null); Action visitSystemToken = () => systemToken.Accept(visitor); NotSupportedException exception = Assert.Throws(visitSystemToken); - Assert.Equal(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It), exception.Message); + Assert.Equal(Error.Format(SRResources.ALinq_IllegalSystemQueryOption, ExpressionConstants.It), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/DataServiceQueryProviderTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/DataServiceQueryProviderTests.cs index a8c3a3b1eb..a2d2eb86ef 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/DataServiceQueryProviderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/DataServiceQueryProviderTests.cs @@ -89,7 +89,7 @@ public void ThrowsForEnumerableContainsWithEmptyCollection() var exception = Assert.ThrowsAny(() => sut.Translate(products.Expression)); // Assert - Assert.Equal(Strings.ALinq_ContainsNotValidOnEmptyCollection, exception.Message); + Assert.Equal(SRResources.ALinq_ContainsNotValidOnEmptyCollection, exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Client.Tests/Metadata/ClientTypeUtilTests.cs b/test/FunctionalTests/Microsoft.OData.Client.Tests/Metadata/ClientTypeUtilTests.cs index f3b97e282d..2b120f8b50 100644 --- a/test/FunctionalTests/Microsoft.OData.Client.Tests/Metadata/ClientTypeUtilTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Client.Tests/Metadata/ClientTypeUtilTests.cs @@ -148,7 +148,7 @@ public void IFTypeProperty_HasNullableGenericTypeKey_OfTypeStruct_GetKeyProperti PropertyInfo empTypeStructKey = employee.GetProperty("EmpTypeStruct"); - InvalidOperationException expectedException = Error.InvalidOperation(Strings.ClientType_KeysMustBeSimpleTypes(empTypeStructKey.Name, employee.ToString(), empTypeStructKey.PropertyType.FullName)); + InvalidOperationException expectedException = Error.InvalidOperation(Error.Format(SRResources.ClientType_KeysMustBeSimpleTypes, empTypeStructKey.Name, employee.ToString(), empTypeStructKey.PropertyType.FullName)); //Act InvalidOperationException actualException = Assert.Throws(() => ClientTypeUtil.GetKeyPropertiesOnType(employee)); diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/AnnotationFilterPatternTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/AnnotationFilterPatternTests.cs index 6ddce1910e..dbd044950e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/AnnotationFilterPatternTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/AnnotationFilterPatternTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -67,7 +68,7 @@ public void ExcludeAllPatternShouldMatchArbitraryInstanceAnnotation() public void InvalidPatternMissingDotShouldThrow(string pattern) { Action test = () => AnnotationFilterPattern.Create(pattern); - test.Throws(Strings.AnnotationFilterPattern_InvalidPatternMissingDot(pattern)); + test.Throws(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternMissingDot, pattern)); } [Theory] @@ -80,7 +81,7 @@ public void InvalidPatternMissingDotShouldThrow(string pattern) public void InvalidPatternEmptySegmentShouldThrow(string pattern) { Action test = () => AnnotationFilterPattern.Create(pattern); - test.Throws(Strings.AnnotationFilterPattern_InvalidPatternEmptySegment(pattern)); + test.Throws(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternEmptySegment, pattern)); } [Theory] @@ -93,7 +94,7 @@ public void InvalidPatternEmptySegmentShouldThrow(string pattern) public void InvalidPatternWildCardInSegmentShouldThrow(string pattern) { Action test = () => AnnotationFilterPattern.Create(pattern); - test.Throws(Strings.AnnotationFilterPattern_InvalidPatternWildCardInSegment(pattern)); + test.Throws(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternWildCardInSegment, pattern)); } [Theory] @@ -106,7 +107,7 @@ public void InvalidPatternWildCardInSegmentShouldThrow(string pattern) public void InvalidPatternWildCardNotInLastSegmentShouldThrow(string pattern) { Action test = () => AnnotationFilterPattern.Create(pattern); - test.Throws(Strings.AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment(pattern)); + test.Throws(Error.Format(SRResources.AnnotationFilterPattern_InvalidPatternWildCardMustBeInLastSegment, pattern)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/BufferUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/BufferUtilsTests.cs index b734cbd70c..941e7c5812 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/BufferUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/BufferUtilsTests.cs @@ -6,6 +6,7 @@ using System; using Microsoft.OData.Buffers; +using Microsoft.OData.Core; using Xunit; namespace Microsoft.OData.Tests @@ -43,7 +44,7 @@ public void RentFromBufferShouldThrowsIfNullBufferReturns() // Act & Assert var exception = Assert.Throws(test); - Assert.Equal(Strings.BufferUtils_InvalidBufferOrSize(1024), exception.Message); + Assert.Equal(Error.Format(SRResources.BufferUtils_InvalidBufferOrSize, 1024), exception.Message); } public class BadCharArrayPool : ICharArrayPool @@ -66,7 +67,7 @@ public void RentFromBufferShouldThrowsIfStringyBufferReturns() // Act & Assert var exception = Assert.Throws(test); - Assert.Equal(Strings.BufferUtils_InvalidBufferOrSize(1024), exception.Message); + Assert.Equal(Error.Format(SRResources.BufferUtils_InvalidBufferOrSize, 1024), exception.Message); } public class StingyCharArrayPool : ICharArrayPool diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/DuplicatePropertyNamesCheckerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/DuplicatePropertyNamesCheckerTests.cs index 24f94d5fd0..ae8ff62503 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/DuplicatePropertyNamesCheckerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/DuplicatePropertyNamesCheckerTests.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -20,7 +20,7 @@ public void DuplicateInstanceODataAnnotationShouldFail() PropertyAndAnnotationCollector duplicateChecker = new PropertyAndAnnotationCollector(true); Action action = () => duplicateChecker.MarkPropertyAsProcessed(ODataJsonConstants.ODataAnnotationNamespacePrefix + "name"); action.DoesNotThrow(); - action.Throws(ErrorStrings.DuplicateAnnotationNotAllowed(ODataJsonConstants.ODataAnnotationNamespacePrefix + "name")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationNotAllowed, ODataJsonConstants.ODataAnnotationNamespacePrefix + "name")); } [Fact] @@ -29,7 +29,7 @@ public void DuplicatePropertyODataAnnotationShouldFail() PropertyAndAnnotationCollector duplicateChecker = new PropertyAndAnnotationCollector(true); Action action = () => duplicateChecker.AddODataPropertyAnnotation("property", ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "SomeValue"); action.DoesNotThrow(); - action.Throws(ErrorStrings.DuplicateAnnotationForPropertyNotAllowed(ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationForPropertyNotAllowed, ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); } [Fact] @@ -84,9 +84,9 @@ public void MarkPropertyAsProcessedWithNoPropertyShouldWork() PropertyAndAnnotationCollector duplicateChecker = new PropertyAndAnnotationCollector(true); duplicateChecker.MarkPropertyAsProcessed("property"); Action odataAction = () => duplicateChecker.AddODataPropertyAnnotation("property", ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "value"); - odataAction.Throws(ErrorStrings.PropertyAnnotationAfterTheProperty(ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); + odataAction.Throws(Error.Format(SRResources.PropertyAnnotationAfterTheProperty, ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); Action customAction = () => duplicateChecker.AddCustomPropertyAnnotation("property", "custom.name", "value"); - customAction.Throws(ErrorStrings.PropertyAnnotationAfterTheProperty("custom.name", "property")); + customAction.Throws(Error.Format(SRResources.PropertyAnnotationAfterTheProperty, "custom.name", "property")); } [Fact] @@ -96,9 +96,9 @@ public void MarkPropertyAsProcessedWithSomeAnnotationsShouldWork() duplicateChecker.AddODataPropertyAnnotation("property", ODataJsonConstants.ODataAnnotationNamespacePrefix + "first", 42); duplicateChecker.MarkPropertyAsProcessed("property"); Action odataAction = () => duplicateChecker.AddODataPropertyAnnotation("property", ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "value"); - odataAction.Throws(ErrorStrings.PropertyAnnotationAfterTheProperty(ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); + odataAction.Throws(Error.Format(SRResources.PropertyAnnotationAfterTheProperty, ODataJsonConstants.ODataAnnotationNamespacePrefix + "name", "property")); Action customAction = () => duplicateChecker.AddCustomPropertyAnnotation("property", "custom.name", "value"); - customAction.Throws(ErrorStrings.PropertyAnnotationAfterTheProperty("custom.name", "property")); + customAction.Throws(Error.Format(SRResources.PropertyAnnotationAfterTheProperty, "custom.name", "property")); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataConventionalUriBuilderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataConventionalUriBuilderTests.cs index e468cfc44d..353e3787c4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataConventionalUriBuilderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataConventionalUriBuilderTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Evaluation; @@ -121,14 +122,14 @@ public void BuildEntityInstanceUriShouldWorkWithMultipleKeys() public void BuildEntityInstanceUriShouldFailOnTypeWithNoKeyProperties() { Action action = () => this.builder.BuildEntityInstanceUri(new Uri("http://odata.org/base/MultipleKeys"), new Collection>(), "TestModel.EntityTypeWithNoKeys"); - action.Throws(Strings.ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties("TestModel.EntityTypeWithNoKeys")); + action.Throws(Error.Format(SRResources.ODataConventionalUriBuilder_EntityTypeWithNoKeyProperties, "TestModel.EntityTypeWithNoKeys")); } [Fact] public void BuildEntityInstanceUriShouldFailWithNullKeyValueKind() { Action action = () => this.builder.BuildEntityInstanceUri(new Uri("http://odata.org/base/Products"), new Collection> { new KeyValuePair("Id", null) }, "TestModel.Product"); - action.Throws(Strings.ODataConventionalUriBuilder_NullKeyValue("Id", "TestModel.Product")); + action.Throws(Error.Format(SRResources.ODataConventionalUriBuilder_NullKeyValue, "Id", "TestModel.Product")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataEntryMetadataContextTest.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataEntryMetadataContextTest.cs index 90a0fc9669..f03b182914 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataEntryMetadataContextTest.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataEntryMetadataContextTest.cs @@ -9,6 +9,7 @@ using Microsoft.OData.Evaluation; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.Evaluation { @@ -117,7 +118,7 @@ public void ActualEntityTypeNmeShouldThrowForContextWithoutModelIfEntryTypeNameI { this.entry.TypeName = null; Action test = () => Assert.Null(this.entryMetadataContextWithoutModel.ActualResourceTypeName); - test.Throws(Strings.ODataResourceTypeContext_ODataResourceTypeNameMissing); + test.Throws(SRResources.ODataResourceTypeContext_ODataResourceTypeNameMissing); } #endregion ActualEntityTypeName @@ -126,14 +127,14 @@ public void ActualEntityTypeNmeShouldThrowForContextWithoutModelIfEntryTypeNameI public void KeyPropertiesShouldThrowWhenEntryHasNoKeyPropertiesWithSerializationInfo() { Action test = () => Assert.NotNull(this.entryMetadataContextWithoutModel.KeyProperties); - test.Throws(Strings.ODataResourceMetadataContext_EntityTypeWithNoKeyProperties(ActualEntityType.FullName())); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_EntityTypeWithNoKeyProperties, ActualEntityType.FullName())); } [Fact] public void KeyPropertiesShouldThrowWhenEntryHasNoKeyPropertiesAsSpecifiedInTheMetadata() { Action test = () => Assert.NotNull(this.entryMetadataContextWithModel.KeyProperties); - test.Throws(Strings.EdmValueUtils_PropertyDoesntExist(ActualEntityType.FullName(), "ID2")); + test.Throws(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, ActualEntityType.FullName(), "ID2")); } [Fact] @@ -141,7 +142,7 @@ public void KeyPropertiesShouldThrowWhenSerializationInfoIsSetAndPropertyValueIs { this.entry.Properties = new[] { new ODataProperty { Name = "ID", Value = new ODataCollectionValue(), SerializationInfo = new ODataPropertySerializationInfo { PropertyKind = ODataPropertyKind.Key } } }; Action test = () => Assert.NotNull(this.entryMetadataContextWithoutModel.KeyProperties); - test.Throws(Strings.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues("ID", "ns.TypeName")); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues, "ID", "ns.TypeName")); } [Fact] @@ -149,7 +150,7 @@ public void KeyPropertiesShouldThrowWhenSerializationInfoIsSetAndPropertyValueIs { this.entry.Properties = new[] {new ODataProperty {Name = "ID", Value = null, SerializationInfo = new ODataPropertySerializationInfo {PropertyKind = ODataPropertyKind.Key}}}; Action test = () => Assert.NotNull(this.entryMetadataContextWithoutModel.KeyProperties); - test.Throws(Strings.ODataResourceMetadataContext_NullKeyValue("ID", "ns.TypeName")); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_NullKeyValue, "ID", "ns.TypeName")); } [Fact] @@ -157,7 +158,7 @@ public void KeyPropertiesShouldThrowWhenMetadataIsPresentAndPropertyValueIsNonPr { this.entry.Properties = new[] {new ODataProperty {Name = "ID2", Value = new ODataCollectionValue()}}; Action test = () => Assert.NotNull(this.entryMetadataContextWithModel.KeyProperties); - test.Throws(Strings.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues("ID2", "ns.TypeName")); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues, "ID2", "ns.TypeName")); } [Fact] @@ -165,14 +166,14 @@ public void KeyPropertiesShouldThrowWhenMetadataIsPresentAndPropertyValueIsNull( { this.entry.Properties = new[] {new ODataProperty {Name = "ID2", Value = null}}; Action test = () => Assert.NotNull(this.entryMetadataContextWithModel.KeyProperties); - test.Throws(Strings.ODataResourceMetadataContext_NullKeyValue("ID2", "ns.TypeName")); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_NullKeyValue, "ID2", "ns.TypeName")); } [Fact] public void KeyPropertiesShouldThrowWhenKeyPropertyInMetadataIsNotInEntry() { Action test = () => Assert.NotNull(this.entryMetadataContextWithModel.KeyProperties); - test.Throws(Strings.EdmValueUtils_PropertyDoesntExist("ns.TypeName", "ID2")); + test.Throws(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, "ns.TypeName", "ID2")); } [Fact] @@ -221,7 +222,7 @@ public void ETagPropertiesShouldThrowWhenSerializationInfoIsSetAndPropertyValueI { this.entry.Properties = new[] { new ODataProperty { Name = "Name", Value = new ODataCollectionValue(), SerializationInfo = new ODataPropertySerializationInfo { PropertyKind = ODataPropertyKind.ETag } } }; Action test = () => Assert.NotNull(this.entryMetadataContextWithoutModel.ETagProperties); - test.Throws(Strings.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues("Name", "ns.TypeName")); + test.Throws(Error.Format(SRResources.ODataResourceMetadataContext_KeyOrETagValuesMustBePrimitiveValues, "Name", "ns.TypeName")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataMetadataContextTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataMetadataContextTests.cs index 62e07612b2..3f5e01ee86 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataMetadataContextTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Evaluation/ODataMetadataContextTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Evaluation; @@ -35,7 +36,7 @@ public void GetEntityMetadataBuilderShouldThrowWhenMetadataDocumentUriIsNull() IEdmEntitySet set = this.edmModel.EntityContainer.FindEntitySet("Products"); ODataResource entry = TestUtils.CreateODataEntry(set, new EdmStructuredValue(new EdmEntityTypeReference(set.EntityType, true), new IEdmPropertyValue[0]), set.EntityType); Action action = () => context.GetResourceMetadataBuilderForReader(new TestJsonReaderEntryState { Resource = entry, SelectedProperties = new SelectedPropertiesNode(SelectedPropertiesNode.SelectionType.EntireSubtree), NavigationSource = set }, false); - action.Throws(Strings.ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload("odata.context")); + action.Throws(Error.Format(SRResources.ODataJsonResourceMetadataContext_MetadataAnnotationMustBeInPayload, "odata.context")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpHeaderValueLexerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpHeaderValueLexerTests.cs index 4784f71978..db3286e2b3 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpHeaderValueLexerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpHeaderValueLexerTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Linq; @@ -35,28 +36,28 @@ public void CreateShouldReturnHttpHeaderStart() public void StartCannotTransitionToQuotedString() { Action test = () => HttpHeaderValueLexer.Create("headerName", "\"quoted-string\"").ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString("headerName", "\"quoted-string\"", 0)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString, "headerName", "\"quoted-string\"", 0)); } [Fact] public void StartCannotTrnasistionToElementSeparator() { Action test = () => HttpHeaderValueLexer.Create("headerName", ",").ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", ",", 0)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", ",", 0)); } [Fact] public void StartCannotTrnasistionToParameterSeparator() { Action test = () => HttpHeaderValueLexer.Create("headerName", ";").ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", ";", 0)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", ";", 0)); } [Fact] public void StartCannotTrnasistionToValueSeparator() { Action test = () => HttpHeaderValueLexer.Create("headerName", "=").ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", "=", 0)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", "=", 0)); } [Fact] @@ -99,7 +100,7 @@ public void TokenCanTransitionToEnd() public void TokenCannotNotTransitionToQuotedString() { Action test = () => HttpHeaderValueLexer.Create("headerName", "token\"quotes-string\"").ReadNext().ReadNext(); - test.Throws(Strings.HttpUtils_EscapeCharWithoutQuotes("headerName", "token\"quotes-string\"", 5, "\"")); + test.Throws(Error.Format(SRResources.HttpUtils_EscapeCharWithoutQuotes, "headerName", "token\"quotes-string\"", 5, "\"")); } [Fact] @@ -132,7 +133,7 @@ public void QuotedStringCannotTransitionToValueSeparator() var lexer = HttpHeaderValueLexer.Create("headerName", "token=\"quotes-string\"=").ReadNext().ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.QuotedString, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString("headerName", "token=\"quotes-string\"=", 21, "=")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString, "headerName", "token=\"quotes-string\"=", 21, "=")); } [Fact] @@ -141,7 +142,7 @@ public void QuotesStringCannotTransitionToToken() var lexer = HttpHeaderValueLexer.Create("headerName", "token=\"quotes-string\"token").ReadNext().ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.QuotedString, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_UnrecognizedSeparator("headerName", "token=\"quotes-string\"token", 21, "t")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_UnrecognizedSeparator, "headerName", "token=\"quotes-string\"token", 21, "t")); } [Fact] @@ -150,7 +151,7 @@ public void QuotedStringCannotTransitionToQuotedString() var lexer = HttpHeaderValueLexer.Create("headerName", "token=\"quotes-string\"\"quotes-string\"").ReadNext().ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.QuotedString, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_UnrecognizedSeparator("headerName", "token=\"quotes-string\"\"quotes-string\"", 21, "\"")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_UnrecognizedSeparator, "headerName", "token=\"quotes-string\"\"quotes-string\"", 21, "\"")); } [Fact] @@ -159,7 +160,7 @@ public void ElementSeparatorCannotTransitionToEnd() var lexer = HttpHeaderValueLexer.Create("headerName", "token,").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ElementSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_EndOfFileAfterSeparator("headerName", "token,", 6, ",")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_EndOfFileAfterSeparator, "headerName", "token,", 6, ",")); } [Fact] @@ -168,7 +169,7 @@ public void ParameterSeparatorCannotTransitionToEnd() var lexer = HttpHeaderValueLexer.Create("headerName", "token;").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ParameterSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_EndOfFileAfterSeparator("headerName", "token;", 6, ";")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_EndOfFileAfterSeparator, "headerName", "token;", 6, ";")); } [Fact] @@ -177,7 +178,7 @@ public void ValueSeparatorCannotTransitionToEnd() var lexer = HttpHeaderValueLexer.Create("headerName", "token=").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ValueSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_EndOfFileAfterSeparator("headerName", "token=", 6, "=")); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_EndOfFileAfterSeparator, "headerName", "token=", 6, "=")); } [Fact] @@ -202,7 +203,7 @@ public void ValueSeparatorCannotTransitionToSeparator() var lexer = HttpHeaderValueLexer.Create("headerName", "token= =").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ValueSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", "token= =", 7)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", "token= =", 7)); } [Fact] @@ -219,7 +220,7 @@ public void ElementSeparatorCannotTransitionToQuotedString() var lexer = HttpHeaderValueLexer.Create("headerName", "token,\"quoted-string\"").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ElementSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString("headerName", "token,\"quoted-string\"", 6)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString, "headerName", "token,\"quoted-string\"", 6)); } [Fact] @@ -228,7 +229,7 @@ public void ElementSeparatorCannotTransitionToSeparator() var lexer = HttpHeaderValueLexer.Create("headerName", "token,,").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ElementSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", "token,,", 6)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", "token,,", 6)); } [Fact] @@ -245,7 +246,7 @@ public void ParameterSeparatorCannotTransitionToQuotedString() var lexer = HttpHeaderValueLexer.Create("headerName", "token;\"quoted-string\"").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ParameterSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString("headerName", "token;\"quoted-string\"", 6)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_TokenExpectedButFoundQuotedString, "headerName", "token;\"quoted-string\"", 6)); } [Fact] @@ -254,7 +255,7 @@ public void ParameterSeparatorCannotTransitionToSeparator() var lexer = HttpHeaderValueLexer.Create("headerName", "token;;").ReadNext().ReadNext(); Assert.Equal(HttpHeaderValueLexer.HttpHeaderValueItemType.ParameterSeparator, lexer.Type); Action test = () => lexer.ReadNext(); - test.Throws(Strings.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString("headerName", "token;;", 6)); + test.Throws(Error.Format(SRResources.HttpHeaderValueLexer_FailedToReadTokenOrQuotedString, "headerName", "token;;", 6)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpUtilsTests.cs index ad42a0455b..8737a93ff5 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/HttpUtilsTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -62,7 +63,7 @@ public void ReadTokenOrQuotedStringValueShouldThrowForEscapeCharInUnquotedString Action test = () => HttpUtils.ReadTokenOrQuotedStringValue(headerName, headerValue, ref textIndex, out isQuotedString, (s) => new Exception(s)); Exception exception = Assert.Throws(test); - Assert.Equal(Strings.HttpUtils_EscapeCharWithoutQuotes(headerName, headerValue, 5, ch), exception.Message); + Assert.Equal(Error.Format(SRResources.HttpUtils_EscapeCharWithoutQuotes, headerName, headerValue, 5, ch), exception.Message); } [Theory] @@ -105,7 +106,7 @@ public void ReadTokenOrQuotedStringValueShouldThrowEscapeCharAtEnd() Action test = () => HttpUtils.ReadTokenOrQuotedStringValue(headerName, headerValue, ref textIndex, out _, (s) => new Exception(s)); Exception exception = Assert.Throws(test); - Assert.Equal(Strings.HttpUtils_EscapeCharAtEnd(headerName, headerValue, 7, '\\'), exception.Message); + Assert.Equal(Error.Format(SRResources.HttpUtils_EscapeCharAtEnd, headerName, headerValue, 7, '\\'), exception.Message); } [Fact] @@ -117,7 +118,7 @@ public void ReadTokenOrQuotedStringValueShouldThrowInvalidCharacterInQuoted() Action test = () => HttpUtils.ReadTokenOrQuotedStringValue(headerName, headerValue, ref textIndex, out _, (s) => new Exception(s)); Exception exception = Assert.Throws(test); - Assert.Equal(Strings.HttpUtils_InvalidCharacterInQuotedParameterValue(headerName, headerValue, 4, '\u001b'), exception.Message); + Assert.Equal(Error.Format(SRResources.HttpUtils_InvalidCharacterInQuotedParameterValue, headerName, headerValue, 4, '\u001b'), exception.Message); } [Fact] @@ -129,7 +130,7 @@ public void ReadTokenOrQuotedStringValueShouldThrowClosingQuoteNotFound() Action test = () => HttpUtils.ReadTokenOrQuotedStringValue(headerName, headerValue, ref textIndex, out _, (s) => new Exception(s)); Exception exception = Assert.Throws(test); - Assert.Equal(Strings.HttpUtils_ClosingQuoteNotFound(headerName, headerValue, 6), exception.Message); + Assert.Equal(Error.Format(SRResources.HttpUtils_ClosingQuoteNotFound, headerName, headerValue, 6), exception.Message); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputeETagInJsonIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputeETagInJsonIntegrationTests.cs index 872fff0e73..685fc96fd8 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputeETagInJsonIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputeETagInJsonIntegrationTests.cs @@ -6,11 +6,11 @@ using System; using System.IO; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Vocabularies; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.IntegrationTests.Evaluation { @@ -195,7 +195,7 @@ public void ExceptionThrowForInvalidPropertyPath() }; Action action = () => GetWriterOutputForContentTypeAndKnobValue(entry, model, peopleSet, personType); - action.Throws(ErrorStrings.EdmValueUtils_PropertyDoesntExist("MyNs.Person", "NameName")); + action.Throws(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, "MyNs.Person", "NameName")); } private string GetWriterOutputForContentTypeAndKnobValue(ODataResource entry, EdmModel model, IEdmEntitySetBase entitySet, EdmEntityType entityType) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputePayloadMetadataInJsonIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputePayloadMetadataInJsonIntegrationTests.cs index 575ccfcfd6..4eed306d04 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputePayloadMetadataInJsonIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Evaluation/AutoComputePayloadMetadataInJsonIntegrationTests.cs @@ -11,6 +11,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; @@ -1044,7 +1045,7 @@ public void WritingNestedCollectionEntityReferenceLinksInResponseWithoutNestedRe // Assert var exception = Assert.Throws(test); - Assert.Equal(Strings.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_MultipleItemsInNestedResourceInfoWithContent, exception.Message); } [Fact] @@ -2062,7 +2063,7 @@ public void WritingInFullMetadataModeWithExpandWithContainedElementShouldThrowEx const string expandClause = "ExpandedNavLink($select=ContainedNonCollectionNavProp;$expand=ExpandedNavLink($select=ContainedNonCollectionNavProp))"; Action test = () => this.GetWriterOutputForContentTypeAndKnobValue("application/json;odata.metadata=full", true, itemsToWrite, Model, EntitySet, EntityType, selectClause, expandClause); - test.Throws(Strings.ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement); + test.Throws(SRResources.ODataWriterCore_PathInODataUriMustBeSetWhenWritingContainedElement); } [Fact] @@ -2080,7 +2081,7 @@ public void WritingInFullMetadataModeWithExpandWithContainedElementShouldThrowEx const string expandClause = "ExpandedNavLink($select=ContainedNonCollectionNavProp;$expand=ExpandedNavLink($select=ContainedNonCollectionNavProp))"; Action test = () => this.GetWriterOutputForContentTypeAndKnobValue("application/json;odata.metadata=full", true, itemsToWrite, Model, EntitySet, EntityType, selectClause, expandClause); - test.Throws(Strings.EdmValueUtils_PropertyDoesntExist("Namespace.EntityType", "ID")); + test.Throws(Error.Format(SRResources.EdmValueUtils_PropertyDoesntExist, "Namespace.EntityType", "ID")); } [Fact] @@ -2986,11 +2987,11 @@ public void ShouldThrowToAccessContainedIdIfParentIdIsNotPresent() ODataResource entry = entryList[0]; Action getId = () => Assert.Equal(entry.Id, new Uri("")); - getId.Throws(Strings.ODataMetadataBuilder_MissingParentIdOrContextUrl); + getId.Throws(SRResources.ODataMetadataBuilder_MissingParentIdOrContextUrl); entry = entryList[1]; getId = () => Assert.Equal(entry.Id, new Uri("")); - getId.Throws(Strings.ODataMetadataBuilder_MissingParentIdOrContextUrl); + getId.Throws(SRResources.ODataMetadataBuilder_MissingParentIdOrContextUrl); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/FeedAnnotationIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/FeedAnnotationIntegrationTests.cs index 9ad31d9487..787649a673 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/FeedAnnotationIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/FeedAnnotationIntegrationTests.cs @@ -8,10 +8,10 @@ using System.IO; using System.Text; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.IntegrationTests.Reader.Json { @@ -169,7 +169,7 @@ public void NextLinkComesBeforeAndAfterTopLevelFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Equal(new Uri("http://nextLink"), (entryReader.Item as ODataResourceSet).NextPageLink); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.DuplicateAnnotationNotAllowed("odata.nextLink")); + read.Throws(Error.Format(SRResources.DuplicateAnnotationNotAllowed, "odata.nextLink")); } } @@ -188,7 +188,7 @@ public void DeltaLinkComesBeforeAndAfterTopLevelFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Equal(new Uri("http://deltaLink"), (entryReader.Item as ODataResourceSet).DeltaLink); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.DuplicateAnnotationNotAllowed("odata.deltaLink")); + read.Throws(Error.Format(SRResources.DuplicateAnnotationNotAllowed, "odata.deltaLink")); } } @@ -250,7 +250,7 @@ public void CountComesBeforeAndAfterInnerFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Equal(0, (entryReader.Item as ODataResourceSet).Count); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation("odata.count", "NavProp")); + read.Throws(Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, "odata.count", "NavProp")); } [Fact] @@ -359,7 +359,7 @@ public void NonZeroCountComesBeforeAndAfterInnerFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Equal(2, (entryReader.Item as ODataResourceSet).Count); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation("odata.count", "NavProp")); + read.Throws(Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, "odata.count", "NavProp")); } [Fact] @@ -385,7 +385,7 @@ public void DifferentPropertyInBetweenInnerFeedShouldThrow() entryReader.Read(); Assert.Equal(ODataReaderState.NestedResourceInfoEnd, entryReader.State); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.PropertyAnnotationAfterTheProperty("odata.count", "NavProp")); + read.Throws(Error.Format(SRResources.PropertyAnnotationAfterTheProperty, "odata.count", "NavProp")); } [Fact] @@ -414,7 +414,7 @@ public void NextLinkComesBeforeInnerFeedOnRequestShouldThrow() var entryReader = GetEntryReader(entryText, isResponse: false); Action test = () => entryReader.Read(); - test.Throws(ErrorStrings.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation("NavProp", "odata.nextLink", "odata.bind")); + test.Throws(Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedNavigationLinkInRequestPropertyAnnotation, "NavProp", "odata.nextLink", "odata.bind")); } [Fact] @@ -429,7 +429,7 @@ public void DeltaLinkComesBeforeInnerFeedShouldThrow() var entryReader = GetEntryReader(entryText, isResponse); Action test = () => entryReader.Read(); - test.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.deltaLink")); + test.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.deltaLink")); } } @@ -450,7 +450,7 @@ public void NextLinkComesBeforeAndAfterInnerFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Equal(new Uri("http://nextLink"), (entryReader.Item as ODataResourceSet).NextPageLink); Action read = () => entryReader.Read(); - read.Throws(ErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation("odata.nextLink", "NavProp")); + read.Throws(Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, "odata.nextLink", "NavProp")); } [Fact] @@ -489,7 +489,7 @@ public void NextLinkComesAfterInnerFeedOnRequestShouldFail() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Null((entryReader.Item as ODataResourceSet).NextPageLink); Action test = () => entryReader.Read(); - test.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation("NavProp", "odata.nextLink")); + test.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, "NavProp", "odata.nextLink")); } [Fact] @@ -510,7 +510,7 @@ public void DeltaLinkComesAfterInnerFeedShouldThrow() Assert.Equal(ODataReaderState.ResourceSetStart, entryReader.State); Assert.Null((entryReader.Item as ODataResourceSet).NextPageLink); Action test = () => entryReader.Read(); - string expectedErrorMsg = isResponse ? ErrorStrings.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet("odata.deltaLink", "NavProp") : ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation("NavProp", "odata.deltaLink"); + string expectedErrorMsg = isResponse ? Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet, "odata.deltaLink", "NavProp") : Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, "NavProp", "odata.deltaLink"); test.Throws(expectedErrorMsg); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderEnumIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderEnumIntegrationTests.cs index 99c32e2e41..9944e68211 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderEnumIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderEnumIntegrationTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -144,7 +145,7 @@ public void FlagsEnumAsComplexProperty_NullValue_MinimalMetadata_Error() Action action = () => this.ReadEntryPayloadAndVerify(payload, "application/json;odata.metadata=minimal", expectedEntry); string fullName = this.entityType.FindProperty("ColorFlags").Type.FullName(); - action.Throws(Strings.ReaderValidationUtils_NullNamedValueForNonNullableType("MyColorFlags", fullName)); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, "MyColorFlags", fullName)); } [Fact] @@ -200,7 +201,7 @@ public void FlagsEnumAsDerivedComplexProperty_NullValue_MinimalMetadata_Error() Action action = () => this.ReadEntryPayloadAndVerify(payload, "application/json;odata.metadata=minimal", expectedEntry); string fullName = this.entityType.FindProperty("ColorFlags").Type.FullName(); - action.Throws(Strings.ReaderValidationUtils_NullNamedValueForNonNullableType("MyColorFlags", fullName)); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, "MyColorFlags", fullName)); } [Fact] @@ -343,7 +344,7 @@ public void FlagsEnumAsEntityProperty_NullAsValue_NoNullable_MinimalMetadata_Err Action action = () => this.ReadEntryPayloadAndVerify(payload, "application/json;odata.metadata=minimal", expectedEntry); string fullName = this.entityType.FindProperty("ColorFlags").Type.FullName(); - action.Throws(Strings.ReaderValidationUtils_NullNamedValueForNonNullableType("ColorFlags", fullName)); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, "ColorFlags", fullName)); } [Fact] @@ -368,7 +369,7 @@ public void FlagsEnumAsEntityProperty_IntAsValue_NullAsTypeName_MinimalMetadata_ const string payload = "{\"@odata.context\":\"http://odata.org/test/$metadata#MySet/$entity\",\"FloatId\":12.3,\"ColorFlags\":2}"; ODataResource entry = null; Action parse = () => ReadRequestEntryPayload(this.userModel, payload, "application/json;odata.metadata=minimal", this.entitySet, this.entityType, reader => { entry = entry ?? reader.Item as ODataResource; }); - parse.Throws(Strings.JsonReaderExtensions_CannotReadValueAsString("2")); + parse.Throws(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsString, "2")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderIntegrationTests.cs index 823de58621..096206b96d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/ODataJsonReaderIntegrationTests.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.Test.OData.Utils.ODataLibTest; @@ -748,7 +749,7 @@ public void ReadingTopLevelComplexCollection_ItemType_TypeContextUri_Inconsisten "}"; List resources = null; List nestedResourceInfos = null; - ReadingTopLevelComplexCollectionProperty(payload, ref resources, ref nestedResourceInfos, false, false, Strings.ValidationUtils_IncompatibleType("NS.Address", "NS.AddressWithCity")); + ReadingTopLevelComplexCollectionProperty(payload, ref resources, ref nestedResourceInfos, false, false, Error.Format(SRResources.ValidationUtils_IncompatibleType, "NS.Address", "NS.AddressWithCity")); } [Fact] @@ -774,7 +775,7 @@ public void ReadingTopLevelComplexCollection_CollectionType_ItemType_Inconsisten "}"; List resources = null; List nestedResourceInfos = null; - ReadingTopLevelComplexCollectionProperty(payload, ref resources, ref nestedResourceInfos, true, true, Strings.ValidationUtils_IncompatibleType("NS.Address", "NS.AddressWithCity")); + ReadingTopLevelComplexCollectionProperty(payload, ref resources, ref nestedResourceInfos, true, true, Error.Format(SRResources.ValidationUtils_IncompatibleType, "NS.Address", "NS.AddressWithCity")); } [Fact] @@ -1058,7 +1059,7 @@ public void ReadUndeclaredPropertyInNonOpenType() Action readEntry = () => this.ReadEntryPayloadForUndeclared(payload, reader => { }, false, true); - readEntry.Throws(Strings.ValidationUtils_PropertyDoesNotExistOnType("OpenProperty", "NS.Person")); + readEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenProperty", "NS.Person")); payload = "{" + "\"@odata.context\":\"http://www.example.com/$metadata#EntityNs.MyContainer.People/$entity\"," + @@ -1069,7 +1070,7 @@ public void ReadUndeclaredPropertyInNonOpenType() readEntry = () => this.ReadEntryPayloadForUndeclared(payload, reader => { }, false, true); - readEntry.Throws(Strings.ValidationUtils_PropertyDoesNotExistOnType("OpenComplex", "NS.Person")); + readEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenComplex", "NS.Person")); payload = "{" + "\"@odata.context\":\"http://www.example.com/$metadata#EntityNs.MyContainer.People/$entity\"," + @@ -1080,7 +1081,7 @@ public void ReadUndeclaredPropertyInNonOpenType() readEntry = () => this.ReadEntryPayloadForUndeclared(payload, reader => { }, false, true); - readEntry.Throws(Strings.ValidationUtils_PropertyDoesNotExistOnType("OpenNavigationProperty", "NS.Person")); + readEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenNavigationProperty", "NS.Person")); } private static void VerifyProperty(IEnumerable properties, string propertyName, object propertyValue) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/PropertyAndValueJsonReaderIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/PropertyAndValueJsonReaderIntegrationTests.cs index cef27fd374..44e104049d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/PropertyAndValueJsonReaderIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Reader/Json/PropertyAndValueJsonReaderIntegrationTests.cs @@ -10,11 +10,11 @@ using System.Linq; using System.Text; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Tests.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.IntegrationTests.Reader.Json { @@ -279,7 +279,7 @@ public void ReadPayloadThrowExceptionWithConflictBetweenInputformatAndIeee754Com IEdmModel mainModel = TestUtils.WrapReferencedModelsToMainModel("EntityNs", "MyContainer", model); ODataResource entry = null; Action test = () => this.ReadEntryPayload(mainModel, payload, entitySet, entityType, reader => { entry = entry ?? reader.Item as ODataResource; }, false); - test.Throws(ODataErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter("Edm.Int64")); + test.Throws(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, "Edm.Int64")); } [Fact] @@ -305,7 +305,7 @@ public void ReadPayloadThrowExceptionWithConflictBetweenInputformatAndIeee754Com IEdmModel mainModel = TestUtils.WrapReferencedModelsToMainModel("EntityNs", "MyContainer", model); ODataResource entry = null; Action test = () => this.ReadEntryPayload(mainModel, payload, entitySet, entityType, reader => { entry = entry ?? reader.Item as ODataResource; }); - test.Throws(ODataErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter("Edm.Decimal")); + test.Throws(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, "Edm.Decimal")); } [Fact] @@ -634,7 +634,7 @@ public void ReadingTypeDefinitionPayloadWithIncompatibleTypeShouldFail() "}"; Action read = () => this.ReadEntryPayload(model, payload, entitySet, entityType, reader => { }); - read.Throws(Strings.ValidationUtils_IncompatibleType("Edm.String", "NS.Weight")); + read.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "Edm.String", "NS.Weight")); } [Fact] @@ -671,7 +671,7 @@ public void ReadingTypeDefinitionPayloadWithIncompatibleTypeDefinitionShouldFail "}"; Action read = () => this.ReadEntryPayload(model, payload, entitySet, entityType, reader => { }); - read.Throws(Strings.ValidationUtils_IncompatibleType("NS.Height", "NS.Weight")); + read.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "NS.Height", "NS.Weight")); } [Fact] @@ -702,7 +702,7 @@ public void ReadingTypeDefinitionPayloadWithIncompatibleEdmTypeShouldFail() "}"; Action read = () => this.ReadEntryPayload(model, payload, entitySet, entityType, reader => { }); - read.Throws(Strings.ValidationUtils_IncompatibleType("NS.Weight", "Edm.Int32")); + read.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "NS.Weight", "Edm.Int32")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/InstanceAnnotationWriterIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/InstanceAnnotationWriterIntegrationTests.cs index ec64ce70ea..ca5c3266b7 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/InstanceAnnotationWriterIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/InstanceAnnotationWriterIntegrationTests.cs @@ -7,6 +7,7 @@ using System; using System.IO; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Xunit; @@ -514,10 +515,10 @@ private void WriteAnnotationAtStartExpandedFeedShouldFail(ODataFormat format) }; Action testResponse = () => this.WriteAnnotationsAndValidatePayload(action, EntitySet, format, null, request: false, createFeedWriter: false); - testResponse.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testResponse.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); Action testRequest = () => this.WriteAnnotationsAndValidatePayload(action, EntitySet, format, null, request: true, createFeedWriter: false); - testRequest.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testRequest.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); } [Fact] @@ -544,16 +545,16 @@ private void WriteAnnotationAtEndExpandedFeedShouldFail(ODataFormat format) }; Action testResponse = () => this.WriteAnnotationsAndValidatePayload(action, EntitySet, format, null, request: false, createFeedWriter: false); - testResponse.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testResponse.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); Action testResponseOfSingleton = () => this.WriteAnnotationsAndValidatePayload(action, Singleton, format, null, request: false, createFeedWriter: false); - testResponseOfSingleton.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testResponseOfSingleton.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); Action testRequest = () => this.WriteAnnotationsAndValidatePayload(action, EntitySet, format, null, request: true, createFeedWriter: false); - testRequest.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testRequest.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); Action testRequestOfSingleton = () => this.WriteAnnotationsAndValidatePayload(action, Singleton, format, null, request: true, createFeedWriter: false); - testRequestOfSingleton.Throws(Strings.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); + testRequestOfSingleton.Throws(SRResources.ODataJsonWriter_InstanceAnnotationNotSupportedOnExpandedResourceSet); } #endregion Writing instance annotations on expanded feeds diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/DeltaLinkJsonWriterIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/DeltaLinkJsonWriterIntegrationTests.cs index d0b62280d0..b0688e8aae 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/DeltaLinkJsonWriterIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/DeltaLinkJsonWriterIntegrationTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -114,10 +115,10 @@ public void WriteStartOnExpandedFeedWithDeltaLinkShouldThrow() }; Action requestTest = () => WriteAnnotationsAndValidatePayload(deltaLinkAtWriteStart, ODataFormat.Json, string.Empty, request: true, createFeedWriter: false); - requestTest.Throws(Strings.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); + requestTest.Throws(SRResources.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); Action responseTest = () => WriteAnnotationsAndValidatePayload(deltaLinkAtWriteStart, ODataFormat.Json, string.Empty, request: false, createFeedWriter: false); - responseTest.Throws(Strings.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); + responseTest.Throws(SRResources.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); } [Fact] @@ -138,10 +139,10 @@ public void WriteEndOnExpandedFeedWithDeltaLinkShouldThrow() }; Action requestTest = () => WriteAnnotationsAndValidatePayload(deltaLinkAtWriteEnd, ODataFormat.Json, string.Empty, request: true, createFeedWriter: false); - requestTest.Throws(Strings.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); + requestTest.Throws(SRResources.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); Action responseTest = () => WriteAnnotationsAndValidatePayload(deltaLinkAtWriteEnd, ODataFormat.Json, string.Empty, request: false, createFeedWriter: false); - responseTest.Throws(Strings.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); + responseTest.Throws(SRResources.ODataWriterCore_DeltaLinkNotSupportedOnExpandedResourceSet); } #endregion Writing delta link on expanded feeds diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterEnumIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterEnumIntegrationTests.cs index 2267a7eccb..86cbf2c4e0 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterEnumIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterEnumIntegrationTests.cs @@ -13,6 +13,7 @@ using Microsoft.OData.Edm; using Xunit; using System.Threading.Tasks; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.IntegrationTests.Writer.Json { @@ -649,11 +650,11 @@ public void FlagsEnumAsEntityProperty_NullAsValue_NonNullable_WithModelMinimalMe // with model: write response Action action = () => { this.WriteResponseWithModelAndValidatePayload(mediaType, nestedItemToWrite, "no_expectedPayload", true); }; - action.Throws(Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue("ColorFlags", fullName)); + action.Throws(Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, "ColorFlags", fullName)); // with model: write request action = () => { this.WriteMinimalRequestWithModelAndValidatePayload(mediaType, nestedItemToWrite, "no_expectedPayload", true); }; - action.Throws(Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue("ColorFlags", fullName)); + action.Throws(Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, "ColorFlags", fullName)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterIntegrationTests.cs index 96c5ef31b7..b98f80c2da 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterIntegrationTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.IntegrationTests.Writer.Json { @@ -53,7 +53,7 @@ public void ShouldNotBeAbleToWriteEntryInResponseWithoutSpecifyingMetadataDocume IEdmEntityType entityType = GetEntityType(); IEdmEntitySet entitySet = GetEntitySet(entityType); Action writeEmptyEntry = () => WriteJsonEntry(false, null, true, new ODataResource(), entitySet, entityType); - writeEmptyEntry.Throws(ErrorStrings.ODataOutputContext_MetadataDocumentUriMissing); + writeEmptyEntry.Throws(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } [Fact] @@ -241,7 +241,7 @@ public void WriteContainedEntitySetWithoutODataUriShouldThrow() entitySet: containedEntitySet, resourceType: containedEntitySet.Type as IEdmEntityType, odataUri: null); - writeContainedEntry.Throws(ErrorStrings.ODataMetadataBuilder_MissingParentIdOrContextUrl); + writeContainedEntry.Throws(SRResources.ODataMetadataBuilder_MissingParentIdOrContextUrl); } [Fact] @@ -866,7 +866,7 @@ public void WriteNonOpenEntryWithUndeclaredProperty() }, throwOnUndeclaredProperty: true ); - writeEntry.Throws(ErrorStrings.ValidationUtils_PropertyDoesNotExistOnType("OpenProperty", "Fake.Type")); + writeEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenProperty", "Fake.Type")); // Should throw on undeclared complex value property res = new ODataResource() { Properties = new[] { new ODataProperty { Name = "Key", Value = "son" } } }; @@ -886,7 +886,7 @@ public void WriteNonOpenEntryWithUndeclaredProperty() }, throwOnUndeclaredProperty: true ); - writeEntry.Throws(ErrorStrings.ValidationUtils_PropertyDoesNotExistOnType("OpenComplex", "Fake.Type")); + writeEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenComplex", "Fake.Type")); // Should throw on undeclared navigation property res = new ODataResource() { Properties = new[] { new ODataProperty { Name = "Key", Value = "son" } } }; @@ -914,7 +914,7 @@ public void WriteNonOpenEntryWithUndeclaredProperty() }, throwOnUndeclaredProperty: true ); - writeEntry.Throws(ErrorStrings.ValidationUtils_PropertyDoesNotExistOnType("OpenNavigationProperty", "Fake.Type")); + writeEntry.Throws(Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "OpenNavigationProperty", "Fake.Type")); } private static string WriteJsonEntry(bool isRequest, Uri serviceDocumentUri, bool specifySet, ODataResource odataEntry, IEdmNavigationSource entitySet, IEdmEntityType entityType) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterShortSpanIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterShortSpanIntegrationTests.cs index 52f644620e..590a000f53 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterShortSpanIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/ODataJsonWriterShortSpanIntegrationTests.cs @@ -12,6 +12,7 @@ using Microsoft.OData.Edm; using Microsoft.Spatial; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.IntegrationTests.Writer.Json { @@ -98,7 +99,7 @@ public void ShouldThrowWhenCreatingResponseWriterWithoutMetadataDocumentUri() var stream = new MemoryStream(); ODataJsonOutputContext outputContext = CreateJsonOutputContext(stream, writingResponse: true, userModel: null, serviceDocumentUri: null); Action action = () => new ODataJsonWriter(outputContext, navigationSource: null, resourceType: null, writingResourceSet: true); - action.Throws(Strings.ODataOutputContext_MetadataDocumentUriMissing); + action.Throws(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } [Fact] @@ -289,7 +290,7 @@ public void ShouldWriteStreamPropertyForRequestEntryPayloadWithUserModel() { var entry = new ODataResource { TypeName = "NS.MyDerivedEntityType", Properties = new[] { new ODataProperty { Name = "StreamProperty", Value = new ODataStreamReferenceValue { ReadLink = new Uri("http://odata.org/test/Blob") } } } }; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySet: null, entityType: null, nestedItemToWrite: new[] { entry }, expectedPayload: "", writingResponse: false); - action.Throws(Strings.WriterValidationUtils_StreamPropertyInRequest("StreamProperty")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_StreamPropertyInRequest, "StreamProperty")); } [Fact] @@ -297,7 +298,7 @@ public void ShouldWriteStreamPropertyForRequestEntryPayloadWithoutUserModel() { var entry = new ODataResource { TypeName = "NS.MyDerivedEntityType", Properties = new[] { new ODataProperty { Name = "StreamProperty", Value = new ODataStreamReferenceValue { ReadLink = new Uri("http://odata.org/test/Blob") } } } }; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySetFullName: null, derivedEntityTypeFullName: null, nestedItemToWrite: new[] { entry }, expectedPayload: "", writingResponse: false); - action.Throws(Strings.WriterValidationUtils_StreamPropertyInRequest("StreamProperty")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_StreamPropertyInRequest, "StreamProperty")); } #endregion Stream Property tests @@ -882,7 +883,7 @@ public void ShouldWriteActionForRequestEntryPayloadWithoutUserModel() entry.AddAction(new ODataAction { Metadata = new Uri("#Action1", UriKind.Relative) }); const string expectedPayload = "{\"@odata.type\":\"#NS.MyDerivedEntityType\",\"#Action1\":{}}"; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySetFullName: null, derivedEntityTypeFullName: null, nestedItemToWrite: new[] { entry }, expectedPayload: expectedPayload, writingResponse: false); - action.Throws(Strings.WriterValidationUtils_OperationInRequest("#Action1")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "#Action1")); } [Fact] @@ -892,7 +893,7 @@ public void ShouldWriteActionForRequestEntryPayloadWithUserModel() entry.AddAction(new ODataAction { Metadata = new Uri("#Action1", UriKind.Relative) }); const string expectedPayload = "{\"@odata.type\":\"#NS.MyDerivedEntityType\",\"#Action1\":{}}"; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySet: null, entityType: null, nestedItemToWrite: new[] { entry }, expectedPayload: expectedPayload, writingResponse: false); - action.Throws(Strings.WriterValidationUtils_OperationInRequest("#Action1")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "#Action1")); } #endregion Actions tests @@ -922,7 +923,7 @@ public void ShouldWriteFunctionForRequestEntryPayloadWithoutUserModel() entry.AddFunction(new ODataFunction {Metadata = new Uri("#Function1", UriKind.Relative)}); const string expectedPayload = "{\"@odata.type\":\"#NS.MyDerivedEntityType\",\"#Function1\":{}}"; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySetFullName: null, derivedEntityTypeFullName: null, nestedItemToWrite: new[] { entry }, expectedPayload: expectedPayload, writingResponse: false); - action.Throws(Strings.WriterValidationUtils_OperationInRequest("#Function1")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "#Function1")); } [Fact] @@ -932,7 +933,7 @@ public void ShouldWriteFunctionForRequestEntryPayloadWithUserModel() entry.AddFunction(new ODataFunction {Metadata = new Uri("#Function1", UriKind.Relative)}); const string expectedPayload = "{\"@odata.type\":\"#NS.MyDerivedEntityType\",\"#Function1\":{}}"; Action action = () => this.WriteNestedItemsAndValidatePayload(entitySet: null, entityType: null, nestedItemToWrite: new[] { entry }, expectedPayload: expectedPayload, writingResponse: false); - action.Throws(Strings.WriterValidationUtils_OperationInRequest("#Function1")); + action.Throws(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "#Function1")); } #endregion Functions tests diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/PropertyAndValueJsonWriterIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/PropertyAndValueJsonWriterIntegrationTests.cs index 7cb5b5d692..38891cf61c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/PropertyAndValueJsonWriterIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/PropertyAndValueJsonWriterIntegrationTests.cs @@ -384,7 +384,7 @@ public void WriteTypeDefinitionPayloadWithIncompatibleTypeShouldFail() }; Action write = () => this.WriterEntry(model, entry, entitySet, entityType); - write.Throws(Strings.ValidationUtils_IncompatiblePrimitiveItemType("Edm.String", "True", "NS.Weight", "False")); + write.Throws(Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, "Edm.String", "True", "NS.Weight", "False")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/UriParameterWriterIntegrationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/UriParameterWriterIntegrationTests.cs index e655787fcf..2bee09d321 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/UriParameterWriterIntegrationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/IntegrationTests/Writer/Json/UriParameterWriterIntegrationTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -180,7 +181,7 @@ public void WriteComplexParameter_UnknownTypeName() var resource = CreateAddress(0); resource.Resource.TypeName = "Person"; Action action = () => WriteParameter(resource, true, null); - action.Throws(Strings.ValidationUtils_UnrecognizedTypeName("Person")); + action.Throws(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, "Person")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonFullMetadataLevelTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonFullMetadataLevelTests.cs index a849c33e41..bdb1da0415 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonFullMetadataLevelTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonFullMetadataLevelTests.cs @@ -5,12 +5,12 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Microsoft.OData.Json; using Microsoft.OData.Tests.Evaluation; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -59,7 +59,7 @@ public void FullMetadataLevelCreateMetadataBuilderWithoutMetadataDocumentUriShou /*requestUri*/ null, /*settings*/null); - test.Throws(ODataErrorStrings.ODataOutputContext_MetadataDocumentUriMissing); + test.Throws(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterAsyncTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterAsyncTests.cs index 7fefa405fb..1e3100131b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterAsyncTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterAsyncTests.cs @@ -9,10 +9,10 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -230,7 +230,7 @@ public async Task WriteInstanceAnnotationsAsync_ExceptionThrownForDuplicateInsta })); Assert.Equal( - ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("favorite.Coffee"), + Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "favorite.Coffee"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterTests.cs index d4609e7a1a..e5ad3a1fb5 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonInstanceAnnotationWriterTests.cs @@ -16,9 +16,9 @@ using Microsoft.OData.Edm.Vocabularies.V1; using Microsoft.Spatial; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; using Microsoft.Extensions.DependencyInjection; using Microsoft.OData.Core.Tests.DependencyInjection; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.Json { @@ -362,7 +362,7 @@ public void WriteInstanceAnnotationWithNullValueShouldThrowIfTheTermIsNotNullabl string term = "My.Namespace.NotNullable"; Action action = () => this.jsonInstanceAnnotationWriter.WriteInstanceAnnotation(new ODataInstanceAnnotation(term, new ODataNullValue())); - action.Throws(ODataErrorStrings.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation(term, "Edm.Int32")); + action.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_NullValueNotAllowedForInstanceAnnotation, term, "Edm.Int32")); } [Fact] @@ -450,7 +450,7 @@ public void WriteInstanceAnnotationsShouldThrowOnDuplicatedAnnotationNames() this.valueWriter.WritePrimitiveVerifier = (value, reference) => verifierCalls++; Action test = () => this.jsonInstanceAnnotationWriter.WriteInstanceAnnotations(annotations); - test.Throws(Strings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("term.one")); + test.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "term.one")); } [Fact] @@ -485,7 +485,7 @@ public void WriteInstanceAnnotationsWithTrackerShouldThrowOnDuplicatedAnnotation annotations.Add(new ODataInstanceAnnotation("term.one", new ODataPrimitiveValue(456))); Action test = () => this.jsonInstanceAnnotationWriter.WriteInstanceAnnotations(annotations, tracker); - test.Throws(Strings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("term.one")); + test.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "term.one")); } [Fact] @@ -649,7 +649,7 @@ public void WritingPrimitiveAnnotationWithTypeMismatchShouldThrow() new ODataInstanceAnnotation("custom.namespace.MyDateTimeOffsetTerm", new ODataPrimitiveValue(Guid.Empty)), TestUtils.WrapReferencedModelsToMainModel(edmModel)); - testSubject.Throws(ODataErrorStrings.ValidationUtils_IncompatiblePrimitiveItemType("Edm.Guid", /*nullability*/ "False", "Edm.DateTimeOffset", /*nullability*/ "True")); + testSubject.Throws(Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, "Edm.Guid", /*nullability*/ "False", "Edm.DateTimeOffset", /*nullability*/ "True")); } [Fact] @@ -719,7 +719,7 @@ public void WritingResourceAnnotationWithNotDefinedResourceTypeShouldThrow() new ODataInstanceAnnotation("custom.namespace.AddressTerm", new ODataResourceValue() { TypeName = "custom.namespace.Address", Properties = Enumerable.Empty() }), TestUtils.WrapReferencedModelsToMainModel(edmModel)); - testSubject.Throws(ODataErrorStrings.ValidationUtils_UnrecognizedTypeName("custom.namespace.Address")); + testSubject.Throws(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, "custom.namespace.Address")); } [Fact] @@ -732,7 +732,7 @@ public void WritingResourceAnnotationWithCollectionOfNotDefinedResourceTypeShoul new ODataInstanceAnnotation("custom.namespace.CollectionOfAddressTerm", new ODataCollectionValue { Items = Enumerable.Empty(), TypeName = "Collection(custom.namespace.Address)" }), TestUtils.WrapReferencedModelsToMainModel(edmModel)); - testSubject.Throws(ODataErrorStrings.ValidationUtils_UnrecognizedTypeName("Collection(custom.namespace.Address)")); + testSubject.Throws(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, "Collection(custom.namespace.Address)")); } private static string WriteInstanceAnnotation(ODataInstanceAnnotation instanceAnnotation, IEdmModel model) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonReaderTests.cs index a1928fd6ae..542e6281c4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/JsonReaderTests.cs @@ -11,6 +11,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.OData.Buffers; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; @@ -488,7 +489,7 @@ public async Task UnexpectedCommaAtRootThrowsException() using (var reader = new JsonReader(new StringReader(",{}"), isIeee754Compatible: false)) { var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Root"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Root"), exception.Message); } } @@ -499,7 +500,7 @@ public async Task UnexpectedCommaAtObjectStartThrowsException() { await reader.ReadAsync(); // Read start of object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Object"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Object"), exception.Message); } } @@ -512,7 +513,7 @@ public async Task UnexpectedCommaAtObjectEndThrowsException() await reader.ReadAsync(); // Read property name: Id await reader.ReadAsync(); // Read property value var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Object"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Object"), exception.Message); } } @@ -525,7 +526,7 @@ public async Task MissingCommaInObjectThrowsException() await reader.ReadAsync(); // Read property name: Id await reader.ReadAsync(); // Read property value var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_MissingComma("Object"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_MissingComma, "Object"), exception.Message); } } @@ -536,7 +537,7 @@ public async Task EmptyPropertyNameThrowsException() { await reader.ReadAsync(); // Read start of object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); // Try to read property name - Assert.Equal(Strings.JsonReader_InvalidPropertyNameOrUnexpectedComma(string.Empty), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_InvalidPropertyNameOrUnexpectedComma, string.Empty), exception.Message); } } @@ -547,7 +548,7 @@ public async Task MissingColonAfterPropertyNameThrowsException() { await reader.ReadAsync(); // Read start of object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_MissingColon("Id"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_MissingColon, "Id"), exception.Message); } } @@ -559,7 +560,7 @@ public async Task MissingValueAfterPropertyNameThrowsException() await reader.ReadAsync(); // Read start of object await reader.ReadAsync(); // Read property name: Id var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnrecognizedToken, exception.Message); + Assert.Equal(SRResources.JsonReader_UnrecognizedToken, exception.Message); } } @@ -571,7 +572,7 @@ public async Task UnexpectedCommaAfterPropertyNameThrowsException() await reader.ReadAsync(); // Read start of object await reader.ReadAsync(); // Read property name: Id var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Property"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Property"), exception.Message); } } @@ -585,7 +586,7 @@ public async Task MultipleTopLevelValuesThrowsException() await reader.ReadAsync(); // Read property value await reader.ReadAsync(); // Read end of object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_MultipleTopLevelValues, exception.Message); + Assert.Equal(SRResources.JsonReader_MultipleTopLevelValues, exception.Message); } } @@ -598,7 +599,7 @@ public async Task UnexpectedCommaInArrayThrowsException() await reader.ReadAsync(); // Read property name: Orders await reader.ReadAsync(); // Read start of array var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Array"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Array"), exception.Message); } } @@ -615,7 +616,7 @@ public async Task UnexpectedCommaBeforeArrayEndThrowsException2() await reader.ReadAsync(); // Read property value await reader.ReadAsync(); // Read end of 1st array object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedComma("Array"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedComma, "Array"), exception.Message); } } @@ -632,7 +633,7 @@ public async Task MissingCommaInArrayThrowsException() await reader.ReadAsync(); // Read property value await reader.ReadAsync(); // Read end of 1st array object var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_MissingComma("Array"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_MissingComma, "Array"), exception.Message); } } @@ -643,7 +644,7 @@ public async Task UnexpectedNullTokenThrowsException() { await reader.ReadAsync(); var exception = await Assert.ThrowsAsync(async () => await reader.GetValueAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedToken("nil"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedToken, "nil"), exception.Message); } } @@ -660,7 +661,7 @@ public async Task UnrecognizedEscapeSequenceThrowsException(string payload, stri await reader.ReadAsync(); // Read property name - Data await reader.ReadAsync(); // Position reader at the beginning of string value var exception = await Assert.ThrowsAsync(async () => await reader.GetValueAsync()); - Assert.Equal(Strings.JsonReader_UnrecognizedEscapeSequence(expected), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, expected), exception.Message); } } @@ -682,7 +683,7 @@ public async Task ReadStringValueWithUnrecognizedEscapeSequenceThrowsException(s var chars = new char[maxLength]; var exception = await Assert.ThrowsAsync(async () => await textReader.ReadAsync(chars, 0, maxLength)); - Assert.Equal(Strings.JsonReader_UnrecognizedEscapeSequence(expected), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnrecognizedEscapeSequence, expected), exception.Message); } } } @@ -696,7 +697,7 @@ public async Task CreateReadStreamAsyncThrowsExceptionForReaderNotInStreamState( await reader.ReadAsync(); // Read property name: Binary // await reader.ReadAsync(); // Position reader at the beginning of binary value var exception = await Assert.ThrowsAsync(async () => await reader.CreateReadStreamAsync()); - Assert.Equal(Strings.JsonReader_CannotCreateReadStream, exception.Message); + Assert.Equal(SRResources.JsonReader_CannotCreateReadStream, exception.Message); } } @@ -710,7 +711,7 @@ public async Task CreateTextReaderAsyncThrowsExceptionForReaderNotInStreamState( await reader.ReadAsync(); // Read property name: Text // await reader.ReadAsync(); // Position reader at the beginning of string value var exception = await Assert.ThrowsAsync(async () => await reader.CreateTextReaderAsync()); - Assert.Equal(Strings.JsonReader_CannotCreateTextReader, exception.Message); + Assert.Equal(SRResources.JsonReader_CannotCreateTextReader, exception.Message); } } @@ -730,7 +731,7 @@ public async Task ReadAsyncThrowsExceptionForReaderInStreamState() } }); - Assert.Equal(Strings.JsonReader_CannotCallReadInStreamState, exception.Message); + Assert.Equal(SRResources.JsonReader_CannotCallReadInStreamState, exception.Message); } } @@ -750,7 +751,7 @@ public async Task GetValueAsyncThrowsExceptionForReaderInStreamState() } }); - Assert.Equal(Strings.JsonReader_CannotAccessValueInStreamState, exception.Message); + Assert.Equal(SRResources.JsonReader_CannotAccessValueInStreamState, exception.Message); } } @@ -764,7 +765,7 @@ public async Task UnexpectedEndOfStringThrowsException() await reader.ReadAsync(); // Read property name: Text await reader.ReadAsync(); // Position reader at the beginning of string value var exception = await Assert.ThrowsAsync(async () => await reader.GetValueAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedEndOfString, exception.Message); + Assert.Equal(SRResources.JsonReader_UnexpectedEndOfString, exception.Message); } } @@ -777,7 +778,7 @@ public async Task InvalidBooleanPrimitiveValueThrowsException() await reader.ReadAsync(); // Read property name: Value // Try to read boolean value var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_UnexpectedToken("tRue"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_UnexpectedToken, "tRue"), exception.Message); } } @@ -790,7 +791,7 @@ public async Task InvalidNumericPrimitiveValueThrowsException() await reader.ReadAsync(); // Read property name: Value // Try to read numeric value var exception = await Assert.ThrowsAsync(async () => await reader.ReadAsync()); - Assert.Equal(Strings.JsonReader_InvalidNumberFormat("6.0221409-e23"), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReader_InvalidNumberFormat, "6.0221409-e23"), exception.Message); } } @@ -997,7 +998,7 @@ public async Task ReadStringValueAsyncThrowsExceptionForNonStringValue() { Assert.True(reader.IsOnValueNode()); var exception = await Assert.ThrowsAsync(() => reader.ReadStringValueAsync()); - Assert.Equal(Strings.JsonReaderExtensions_CannotReadValueAsString(13), exception.Message); + Assert.Equal(Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsString, 13), exception.Message); } } @@ -1009,7 +1010,7 @@ public async Task ReadStringPropertyValueAsyncThrowsExceptionForNonStringValue() Assert.True(reader.IsOnValueNode()); var exception = await Assert.ThrowsAsync(() => reader.ReadStringValueAsync("Data")); Assert.Equal( - Strings.JsonReaderExtensions_CannotReadPropertyValueAsString(13, "Data"), + Error.Format(SRResources.JsonReaderExtensions_CannotReadPropertyValueAsString, 13, "Data"), exception.Message); } } @@ -1022,7 +1023,7 @@ public async Task ReadDoubleValueAsyncThrowsExceptionForValueNotReadableAsDouble Assert.True(reader.IsOnValueNode()); var exception = await Assert.ThrowsAsync(() => reader.ReadDoubleValueAsync()); Assert.Equal( - Strings.JsonReaderExtensions_CannotReadValueAsDouble("Thirteen"), + Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsDouble, "Thirteen"), exception.Message); } } @@ -1033,7 +1034,7 @@ public async Task SkipValueAsyncThrowsExceptionForUnbalancedScopes() using (var reader = await CreateJsonReaderAsync($"{{\"Product\":{{\"Id\":1,\"Name\":\"Pencil\"")) { var exception = await Assert.ThrowsAsync(() => reader.SkipValueAsync()); - Assert.Equal(Strings.JsonReader_EndOfInputWithOpenScope, exception.Message); + Assert.Equal(SRResources.JsonReader_EndOfInputWithOpenScope, exception.Message); } } @@ -1043,7 +1044,7 @@ public async Task SkipValueAsyncWithStringBuilderThrowsExceptionForUnbalancedSco using (var reader = await CreateJsonReaderAsync($"{{\"Product\":{{\"Id\":1,\"Name\":\"Pencil\"")) { var exception = await Assert.ThrowsAsync(() => reader.SkipValueAsync(new StringBuilder())); - Assert.Equal(Strings.JsonReader_EndOfInputWithOpenScope, exception.Message); + Assert.Equal(SRResources.JsonReader_EndOfInputWithOpenScope, exception.Message); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataAnnotationNamesTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataAnnotationNamesTests.cs index 66735203f6..73c2f836e0 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataAnnotationNamesTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataAnnotationNamesTests.cs @@ -6,6 +6,7 @@ using System; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; @@ -89,7 +90,7 @@ public void ValidateCustomAnnotationNameShouldThrowOnReservedODataAnnotationName foreach(string annotationName in ReservedODataAnnotationNames) { Action test = () => ODataAnnotationNames.ValidateIsCustomAnnotationName(annotationName); - test.Throws(Strings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties(annotationName)); + test.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, annotationName)); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchReaderTests.cs index 9eabb2db9b..b4058d8a60 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchReaderTests.cs @@ -13,7 +13,6 @@ using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Core.Tests.Json { @@ -465,7 +464,7 @@ public void ReadBatchRequestWithDuplicateProperties() isResponse: false)); // Verify that the correct duplicate property has raised the ODataException - Assert.Equal(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch("ATOMICITYGROUP"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch, "ATOMICITYGROUP"), exception.Message); } [Fact] @@ -498,7 +497,7 @@ public async Task ReadBatchRequestWithDuplicatePropertiesAsync() isResponse: false)); // Verify that the correct duplicate property has raised the ODataException - Assert.Equal(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch("ATOMICITYGROUP"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicatePropertyForRequestInBatch, "ATOMICITYGROUP"), exception.Message); } [Fact] @@ -529,7 +528,7 @@ public void ReadBatchRequestWithDuplicateHeaders() isResponse: false)); // Verify that the correct duplicate header has raised the ODataException - Assert.Equal(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch("duplicate-header"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch, "duplicate-header"), exception.Message); } [Fact] @@ -560,7 +559,7 @@ public async Task ReadBatchRequestWithDuplicateHeadersAsync() isResponse: false)); // Verify that the correct duplicate header has raised the ODataException - Assert.Equal(Strings.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch("duplicate-header"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_DuplicateHeaderForRequestInBatch, "duplicate-header"), exception.Message); } [Fact] @@ -973,7 +972,7 @@ public async Task ReadBatchRequestAsync_ThrowsExceptionForUnknownPropertyForMess isResponse: false)); Assert.Equal( - ErrorStrings.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch("FORBIDDEN"), + Error.Format(SRResources.ODataJsonBatchPayloadItemPropertiesCache_UnknownPropertyForMessageInBatch, "FORBIDDEN"), exception.Message); } @@ -994,7 +993,7 @@ public async Task ReadBatchAsync_ThrowsExceptionForJsonBatchTopLevelPropertyMiss isResponse: false)); Assert.Equal( - ErrorStrings.ODataBatchReader_JsonBatchTopLevelPropertyMissing, + SRResources.ODataBatchReader_JsonBatchTopLevelPropertyMissing, exception.Message); } @@ -1021,7 +1020,7 @@ public async Task ReadBatchRequestAsync_ThrowsExceptionForRequestMessageNotCreat isResponse: false)); Assert.Equal( - ErrorStrings.ODataBatchReader_NoMessageWasCreatedForOperation, + SRResources.ODataBatchReader_NoMessageWasCreatedForOperation, exception.Message); } @@ -1068,7 +1067,7 @@ public async Task ReadBatchRequestAsync_ThrowsExceptionForRepeatedContentId() isResponse: false)); Assert.Equal( - ErrorStrings.ODataBatchReader_DuplicateContentIDsNotAllowed("1"), + Error.Format(SRResources.ODataBatchReader_DuplicateContentIDsNotAllowed, "1"), exception.Message); } @@ -1104,7 +1103,7 @@ public async Task ReadBatchRequestAsync_ThrowsExceptionForDependsOnIdNotFound() isResponse: false)); Assert.Equal( - ErrorStrings.ODataBatchReader_DependsOnIdNotFound("0", "1"), + Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "0", "1"), exception.Message); } @@ -1140,7 +1139,7 @@ public async Task ReadBatchRequestAsync_ThrowsExceptionForDependsOnIdSameAsConte isResponse: false)); Assert.Equal( - ErrorStrings.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed("1", "1"), + Error.Format(SRResources.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed, "1", "1"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchWriterTests.cs index 6bd1b4ba21..363ac017f1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonBatchWriterTests.cs @@ -613,7 +613,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForChangesetStartedWithi await jsonBatchWriter.WriteStartChangesetAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, exception.Message); } [Fact] @@ -628,7 +628,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForEndChangesetNotPreced await jsonBatchWriter.WriteEndChangesetAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, exception.Message); } [Fact] @@ -644,7 +644,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForEndBatchBeforeEndChan await jsonBatchWriter.WriteEndBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, exception.Message); } [Fact] @@ -658,7 +658,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForNoStartBatch() await jsonBatchWriter.WriteStartChangesetAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromStart, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromStart, exception.Message); } [Fact] @@ -673,7 +673,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForMultipleStartBatch() await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchStarted, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchStarted, exception.Message); } [Fact] @@ -689,7 +689,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForStateTransitionsAfter await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchCompleted, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchCompleted, exception.Message); } [Fact] @@ -704,7 +704,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForResponseOperationMess }, /*writingRequest*/ true)); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, exception.Message); } [Fact] @@ -720,7 +720,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( }, /*writingRequest*/ false)); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, exception.Message); } [Fact] @@ -737,7 +737,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForInvalidTransitionFrom await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, exception.Message); } [Fact] @@ -765,7 +765,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForInvalidTransitionFrom await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, exception.Message); } [Fact] @@ -789,7 +789,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForInvalidTransitionFrom } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, exception.Message); } [Fact] @@ -806,7 +806,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationCreated, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationCreated, exception.Message); } [Fact] @@ -822,7 +822,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForInvalidTransitionFrom await jsonBatchWriter.WriteStartBatchAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, exception.Message); } [Fact] @@ -834,7 +834,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForSynchronousOutputCont var exception = await Assert.ThrowsAsync( () => jsonBatchWriter.WriteStartBatchAsync()); - Assert.Equal(Strings.ODataBatchWriter_AsyncCallOnSyncWriter, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_AsyncCallOnSyncWriter, exception.Message); } [Fact] @@ -851,7 +851,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( "GET", new Uri($"{ServiceUri}/Customers(1)"), "1"); })); - Assert.Equal(Strings.ODataBatch_InvalidHttpMethodForChangeSetRequest("GET"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatch_InvalidHttpMethodForChangeSetRequest, "GET"), exception.Message); } [Fact] @@ -868,7 +868,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( "PUT", new Uri($"{ServiceUri}/Customers(1)"), /*contentId*/ null); })); - Assert.Equal(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(ODataConstants.ContentIdHeader), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, ODataConstants.ContentIdHeader), exception.Message); } [Fact] @@ -886,7 +886,7 @@ public async Task WriteBatchRequestAsync_ThrowsExceptionForMaxPartsPerBatchLimit await jsonBatchWriter.WriteStartChangesetAsync(); })); - Assert.Equal(Strings.ODataBatchWriter_MaxBatchSizeExceeded(1), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchWriter_MaxBatchSizeExceeded, 1), exception.Message); } [Fact] @@ -906,7 +906,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( "PUT", new Uri($"{ServiceUri}/Customers(1)"), "2"); })); - Assert.Equal(Strings.ODataBatchWriter_MaxChangeSetSizeExceeded(1), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchWriter_MaxChangeSetSizeExceeded, 1), exception.Message); } [Fact] @@ -924,7 +924,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( "PUT", new Uri($"{ServiceUri}/Customers(1)"), "1"); })); - Assert.Equal(Strings.ODataBatchWriter_DuplicateContentIDsNotAllowed("1"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchWriter_DuplicateContentIDsNotAllowed, "1"), exception.Message); } [Fact] @@ -949,7 +949,7 @@ await jsonBatchWriter.CreateOperationRequestMessageAsync( "POST", new Uri($"{ServiceUri}/Orders"), "2", BatchPayloadUriOption.AbsoluteUri, dependsOnIds); })); - Assert.Equal(Strings.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed("2", "fd04fc24"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed, "2", "fd04fc24"), exception.Message); } #endregion Exception Cases diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionDeserializerTests.cs index 76447c2b7f..7885f253c9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionDeserializerTests.cs @@ -8,10 +8,10 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -230,7 +230,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonCollectionDeserializer_InvalidCollectionTypeName("Edm.String"), + Error.Format(SRResources.ODataJsonCollectionDeserializer_InvalidCollectionTypeName, "Edm.String"), exception.Message); } @@ -262,7 +262,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.deltaLink"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.deltaLink"), exception.Message); } @@ -293,7 +293,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName("UnexpectedProp", "value"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, "UnexpectedProp", "value"), exception.Message); } @@ -323,7 +323,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound("value"), + Error.Format(SRResources.ODataJsonCollectionDeserializer_ExpectedCollectionPropertyNotFound, "value"), exception.Message); } @@ -354,7 +354,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart("PrimitiveValue"), + Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionContentStart, "PrimitiveValue"), exception.Message); } @@ -385,7 +385,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty("value"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, "value"), exception.Message); } @@ -417,7 +417,7 @@ await jsonCollectionDeserializer.ReadPayloadStartAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.Func"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.Func"), exception.Message); } @@ -463,7 +463,7 @@ await jsonCollectionDeserializer.ReadCollectionEndAsync( })); Assert.Equal( - ODataErrorStrings.ODataJsonCollectionDeserializer_CannotReadCollectionEnd(propertyName), + Error.Format(SRResources.ODataJsonCollectionDeserializer_CannotReadCollectionEnd, propertyName), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionWriterTests.cs index 49855ba426..f88d577190 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonCollectionWriterTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; @@ -375,7 +376,7 @@ public async Task WriteStartAsync_ThrowsExceptionForWriterInCompletedState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromCompleted("Completed", "Collection"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, "Completed", "Collection"), exception.Message); } @@ -395,7 +396,7 @@ public async Task WriteStartAsync_ThrowsExceptionForWriterInCollectionState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataCollectionWriterCore_InvalidTransitionFromCollection("Collection", "Collection"), + Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromCollection, "Collection", "Collection"), exception.Message); } @@ -416,7 +417,7 @@ public async Task WriteStartAsync_ThrowsExceptionForWriterInItemState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataCollectionWriterCore_InvalidTransitionFromItem("Item", "Collection"), + Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromItem, "Item", "Collection"), exception.Message); } @@ -437,7 +438,7 @@ public async Task WriteItemAsync_ThrowsExceptionForWriterInCompletedState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromCompleted("Completed", "Item"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, "Completed", "Item"), exception.Message); } @@ -456,7 +457,7 @@ public async Task WriteItemAsync_ThrowsExceptionForWriterInStartState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataCollectionWriterCore_InvalidTransitionFromStart("Start", "Item"), + Error.Format(SRResources.ODataCollectionWriterCore_InvalidTransitionFromStart, "Start", "Item"), exception.Message); } @@ -477,7 +478,7 @@ public async Task WriteEndAsync_ThrowsExceptionForWriterInCompletedState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataCollectionWriterCore_WriteEndCalledInInvalidState("Completed"), + Error.Format(SRResources.ODataCollectionWriterCore_WriteEndCalledInInvalidState, "Completed"), exception.Message); } @@ -496,7 +497,7 @@ public async Task WriteEndAsync_ThrowsExceptionForWriterInStartState() EdmCoreModel.Instance.GetString(true))); Assert.Equal( - Strings.ODataCollectionWriterCore_WriteEndCalledInInvalidState("Start"), + Error.Format(SRResources.ODataCollectionWriterCore_WriteEndCalledInInvalidState, "Start"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonContextUriParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonContextUriParserTests.cs index 8269491b2b..1ed5527778 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonContextUriParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonContextUriParserTests.cs @@ -8,7 +8,6 @@ using Microsoft.OData.Json; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaReaderTests.cs index a2ed8ca309..18c51bf4cf 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaReaderTests.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Json; @@ -1234,7 +1235,7 @@ public void ReadNestedDeltaResourceSetIn41CreateODataResourceResponseFails() while (reader.Read()) { } }; - readAction.Throws(Strings.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); + readAction.Throws(SRResources.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload); } [InlineData(/*isResponse*/true)] @@ -1420,7 +1421,7 @@ public void ReadNestedDeletedEntryFromDifferentSetShouldFail(bool isResponse) } }; - readAction.Throws(Strings.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet("http://host/service/$metadata#Customers/$deletedEntity", "Customers", "Customers.Orders")); + readAction.Throws(Error.Format(SRResources.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet, "http://host/service/$metadata#Customers/$deletedEntity", "Customers", "Customers.Orders")); } #endregion @@ -3966,7 +3967,7 @@ public async Task ReadV401TopLevelResourceWithNestedDeltaResourceSetWithNestedDe readingDelta: false)); Assert.Equal( - Strings.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload, + SRResources.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload, exception.Message); } @@ -3989,7 +3990,7 @@ public async Task ReadV401DeltaPayloadWithNestedDeletedEntryFromDifferentResourc (jsonReader) => DoReadAsync(jsonReader))); Assert.Equal( - Strings.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet( + Error.Format(SRResources.ReaderValidationUtils_ContextUriValidationInvalidExpectedEntitySet, "http://host/service/$metadata#Customers/$deletedEntity", "Customers", "Customers.Orders"), diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaWriterTests.cs index 226392e515..ac3d309d11 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeltaWriterTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.OData.UriParser; @@ -501,7 +502,7 @@ public void WriteDerivedEntityOfWrongTypeShouldFail(bool isResponse) writer.WriteStart(derivedEntity); }; - writeAction.Throws(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes("MyNS.PhysicalProduct", "MyNS.Customer")); + writeAction.Throws(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, "MyNS.PhysicalProduct", "MyNS.Customer")); } [InlineData(/*isResponse*/true)] @@ -529,7 +530,7 @@ public void WriteDerivedDeletedResourceOfWrongTypeShouldFail(bool isResponse) writer.WriteStart(derivedEntity); }; - writeAction.Throws(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes("MyNS.PhysicalProduct", "MyNS.Customer")); + writeAction.Throws(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, "MyNS.PhysicalProduct", "MyNS.Customer")); } [InlineData(/*isResponse*/true)] @@ -1154,7 +1155,7 @@ public void CannotWriteExpandedNavigationPropertyOutsideDeltaEntry(bool isRespon writer.WriteStart(ordersNavigationLink); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromResourceSet("DeltaResourceSet", "NestedResourceInfo")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, "DeltaResourceSet", "NestedResourceInfo")); } [InlineData(/*isResponse*/true)] @@ -1173,7 +1174,7 @@ public void CantWriteDeletedtemFromDifferentSetInNestedDelta(bool isResponse) writer.WriteDeltaDeletedEntry(orderDeletedEntry); }); - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } private static string V4_01DeltaResponse = @@ -1304,7 +1305,7 @@ public void CannotWriteDeltaItemOfDifferentTypeWhileWritingExpandedNavigationPro writer.WriteDeltaDeletedEntry(customerDeletedEntry); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -1322,7 +1323,7 @@ public void CannotWriteExpandedFeedOutsideNavigationLink(bool isResponse) writer.WriteStart(ordersFeed); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromResource("Resource", "ResourceSet")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, "Resource", "ResourceSet")); } [InlineData(/*isResponse*/true)] @@ -1339,7 +1340,7 @@ public void CannotWriteExpandedFeedOutsideDeltaEntry(bool isResponse) writer.WriteStart(ordersFeed); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromResourceSet("DeltaResourceSet", "ResourceSet")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, "DeltaResourceSet", "ResourceSet")); } [InlineData(/*isResponse*/true)] @@ -1457,7 +1458,7 @@ public void WriteDeletedEntryWithoutKeyOrIdShouldFailWhenWritingARequest() writer.WriteStart(new ODataDeletedResource()); }; - writeAction.Throws(Strings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); + writeAction.Throws(SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); } [InlineData(/*isResponse*/true)] @@ -1502,7 +1503,7 @@ public void WriteResourceInDeltaSetResponseWithoutKeyOrIdShouldFail(bool isRespo if (isResponse) { - writeAction.Throws(Strings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); + writeAction.Throws(SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties); } else { @@ -1536,7 +1537,7 @@ public void WriteContentIn40DeletedEntryShouldFail(bool isResponse) }); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFrom40DeletedResource("DeletedResource", "NestedResourceInfo")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFrom40DeletedResource, "DeletedResource", "NestedResourceInfo")); } [InlineData(/*isResponse*/true)] @@ -1671,7 +1672,7 @@ public void WriteNestedDeletedEntryFromWrongSetShouldFail(bool isResponse) }); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Order", "MyNS.Product")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Order", "MyNS.Product")); } [InlineData(/*isResponse*/true)] @@ -1714,7 +1715,7 @@ public void WriteNestedSingletonResourceFromWrongSetShouldFail(bool isResponse) }); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Order", "MyNS.Product")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Order", "MyNS.Product")); } [InlineData(/*isResponse*/true)] @@ -1807,7 +1808,7 @@ public void WriteNestedSingletonDeletedEntryFromWrongSetShouldFail(bool isRespon }); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Order", "MyNS.Product")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Order", "MyNS.Product")); } [InlineData(/*isResponse*/true)] @@ -1852,7 +1853,7 @@ public void WriteNestedResourceFromWrongSetShouldFail(bool isResponse) }); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Order", "MyNS.Product")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Order", "MyNS.Product")); } [InlineData(/*isResponse*/true)] @@ -2126,7 +2127,7 @@ public void WriteNestedDeltaResourceSetIn40ShouldFail(bool isResponse) writer.WriteStart(new ODataDeltaResourceSet()); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeltaResourceSet")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeltaResourceSet")); } [InlineData(/*isResponse*/true)] @@ -2149,7 +2150,7 @@ public void WriteNestedDeletedResourceIn40ShouldFail(bool isResponse) writer.WriteDeltaDeletedEntry(new ODataDeltaDeletedEntry("Products/1", DeltaDeletedEntryReason.Deleted)); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeletedResource")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeletedResource")); } [InlineData(/*isResponse*/true)] @@ -2532,7 +2533,7 @@ public void WriteEntityFromDifferentSetToEntitySetShouldFail(bool isResponse) writer.WriteStart(product); }; - writeAction.Throws(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes("MyNS.Product", "MyNS.Customer")); + writeAction.Throws(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, "MyNS.Product", "MyNS.Customer")); } [InlineData(/*isResponse*/true)] @@ -2558,7 +2559,7 @@ public void WriteEntityFromDifferentSetToNestedEntitySetShouldFail(bool isRespon writer.WriteStart(product); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Product", "MyNS.Order")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Product", "MyNS.Order")); } [InlineData(/*isResponse*/true)] @@ -2584,7 +2585,7 @@ public void WriteEntityFromDifferentSetToNestedDeltaSetShouldFail(bool isRespons writer.WriteStart(customerUpdated); }; - writeAction.Throws(Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("MyNS.Customer","MyNS.Order")); + writeAction.Throws(Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "MyNS.Customer", "MyNS.Order")); } [InlineData(/*isResponse*/true)] @@ -2630,7 +2631,7 @@ public void WriteDeletedEntityToEntitySetShouldFail(bool isResponse) writer.WriteStart(customerDeleted); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -2656,7 +2657,7 @@ public void WriteDeletedEntityToNestedEntitySetShouldFail(bool isResponse) writer.WriteStart(customerUpdated); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -2680,7 +2681,7 @@ public void WriteDeltaLinkToNestedDeltaSetShouldFail(bool isResponse) writer.Write(linkToOrder10645); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromResourceSet("DeltaResourceSet", "DeltaLink")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, "DeltaResourceSet", "DeltaLink")); } [InlineData(/*isResponse*/true)] @@ -2697,7 +2698,7 @@ public void WriteDeltaLinkToEntitySetShouldFail(bool isResponse) writer.Write(linkToOrder10645); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -2721,7 +2722,7 @@ public void WriteDeltaLinkToNestedEntitySetShouldFail(bool isResponse) writer.Write(linkToOrder10645); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -2745,7 +2746,7 @@ public void WriteDeltaDeletedLinkToNestedDeltaSetShouldFail(bool isResponse) writer.Write(linkToOrder10643); }; - writeAction.Throws(Strings.ODataWriterCore_InvalidTransitionFromResourceSet("DeltaResourceSet", "DeltaDeletedLink")); + writeAction.Throws(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResourceSet, "DeltaResourceSet", "DeltaDeletedLink")); } [InlineData(/*isResponse*/true)] @@ -2762,7 +2763,7 @@ public void WriteDeltaDeletedLinkToEntitySetShouldFail(bool isResponse) writer.Write(linkToOrder10643); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } [InlineData(/*isResponse*/true)] @@ -2786,7 +2787,7 @@ public void WriteDeltaDeletedLinkToNestedEntitySetShouldFail(bool isResponse) writer.Write(linkToOrder10643); }; - writeAction.Throws(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); + writeAction.Throws(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter); } #endregion 4.01 Tests diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeserializerTests.cs index d8a0b0b0c9..5b7e48c237 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonDeserializerTests.cs @@ -9,11 +9,11 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.Spatial; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; using PropertyParsingResult = Microsoft.OData.Json.ODataJsonDeserializer.PropertyParsingResult; namespace Microsoft.OData.Tests.Json @@ -206,7 +206,7 @@ public void ParsingDuplicateODataPropertyAnnotationShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"" + JsonUtils.GetPropertyAnnotationName("property", ODataAnnotationNames.ODataType) + "\":\"typename\",\"" + JsonUtils.GetPropertyAnnotationName("property", ODataAnnotationNames.ODataType) + "\":\"typename2\"}", PropertyParsingResult.EndOfObject, null, null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.DuplicateAnnotationForPropertyNotAllowed(ODataAnnotationNames.ODataType, "property")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationForPropertyNotAllowed, ODataAnnotationNames.ODataType, "property")); } [Fact] @@ -349,14 +349,14 @@ public void ParsingCustomInstanceAnnotationWithDifferentAnnotationTargetingAnnot public void ParsingODataTypeWithoutTheTargetingInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.deltaLink@odata.type\":\"#typename\"}", PropertyParsingResult.PropertyWithoutValue, "odata.deltaLink", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.deltaLink")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.deltaLink")); } [Fact] public void ParsingODataTypeWithoutTheTargetingCustomInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\"}", PropertyParsingResult.PropertyWithoutValue, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] @@ -398,98 +398,98 @@ public void ParsingWithoutOverridingDefaultAnnotationFilterShouldSkipOverAllCust public void ParsingODataAnnotationTargetingODataInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.deltaLink@odata.unknown\":42,\"@odata.deltaLink\":42}", PropertyParsingResult.ODataInstanceAnnotation, "odata.deltaLink"); - action.Throws(ErrorStrings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation("odata.unknown", "odata.deltaLink", "odata.type")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, "odata.unknown", "odata.deltaLink", "odata.type")); } [Fact] public void ParsingCustomAnnotationTargetingODataInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.deltaLink@custom.annotation\":42,\"@odata.deltaLink\":42}", PropertyParsingResult.ODataInstanceAnnotation, "odata.deltaLink"); - action.Throws(ErrorStrings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation("custom.annotation", "odata.deltaLink", "odata.type")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, "custom.annotation", "odata.deltaLink", "odata.type")); } [Fact] public void ParsingODataAnnotationTargetingCustomInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.unknown\":42,\"@custom.instance\":42}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance"); - action.Throws(ErrorStrings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation("odata.unknown", "custom.instance", "odata.type")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, "odata.unknown", "custom.instance", "odata.type")); } [Fact] public void ParsingCustomAnnotationTargetingCustomInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@custom.annotation\":42,\"@custom.instance\":42}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance"); - action.Throws(ErrorStrings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation("custom.annotation", "custom.instance", "odata.type")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, "custom.annotation", "custom.instance", "odata.type")); } [Fact] public void ParsingODataTypeTargetingODataInstanceAnnotationWithDifferentPropertyAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.deltaLink@odata.type\":\"#typename\",\"foo\":42}", PropertyParsingResult.ODataInstanceAnnotation, ODataAnnotationNames.ODataType, null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.deltaLink")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.deltaLink")); } [Fact] public void ParsingODataTypeTargetingCustomInstanceAnnotationWithDifferentPropertyAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\",\"foo\":42}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] public void ParsingODataTypeTargetingODataInstanceAnnotationWithDifferentPropertyAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.unknown@odata.type\":\"#typename\",\"foo@odata.type\":\"#typename\"}", PropertyParsingResult.ODataInstanceAnnotation, "odata.unknown", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.unknown")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.unknown")); } [Fact] public void ParsingODataTypeTargetingCustomInstanceAnnotationWithDifferentPropertyAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\",\"foo@odata.type\":\"#typename\"}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] public void ParsingODataTypeTargetingODataInstanceAnnotationWithDifferentInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.unknown@odata.type\":\"#typename\",\"@custom.instance\":42}", PropertyParsingResult.ODataInstanceAnnotation, "odata.unknown", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.unknown")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.unknown")); } [Fact] public void ParsingODataTypeTargetingCustomInstanceAnnotationWithDifferentInstanceAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\",\"@odata.unknown\":42}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] public void ParsingODataTypeTargetingODataInstanceAnnotationWithDifferentAnnotationTargetingAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.unknown@odata.type\":\"#typename\",\"custom.instance@odata.type\":\"#typename\"}", PropertyParsingResult.ODataInstanceAnnotation, "odata.unknown", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.unknown")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.unknown")); } [Fact] public void ParsingODataTypeTargetingCustomInstanceAnnotationWithDifferentAnnotationTargetingAnnotationAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\",\"odata.unknown@odata.type\":\"#typename\"}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] public void ParsingODataTypeTargetingODataInstanceAnnotationWithMetadataReferencePropertyAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"odata.unknown@odata.type\":\"#typename\",\"@namespace.name\":42}", PropertyParsingResult.ODataInstanceAnnotation, "odata.unknown", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "odata.unknown")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "odata.unknown")); } [Fact] public void ParsingODataTypeTargetingCustomInstanceAnnotationWithMetadataReferencePropertyAfterItShouldFail() { Action action = () => this.RunPropertyParsingTest("{\"custom.instance@odata.type\":\"#typename\",\"@namespace.name\":42}", PropertyParsingResult.CustomInstanceAnnotation, "custom.instance", null, this.ReadODataTypePropertyAnnotation); - action.Throws(ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", "custom.instance")); + action.Throws(Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", "custom.instance")); } [Fact] @@ -499,7 +499,7 @@ public void ParsingDuplicateODataInstanceAnnotationShouldFail() Action action = () => this.RunPropertyParsingTest("{\"@odata.deltaLink\":\"url\",\"@odata.deltaLink\":\"url\"}", PropertyParsingResult.ODataInstanceAnnotation, "odata.deltaLink", null, this.ReadODataTypePropertyAnnotation, propertyAndAnnotationCollector); action(); - action.Throws(ErrorStrings.DuplicateAnnotationNotAllowed("odata.deltaLink")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationNotAllowed, "odata.deltaLink")); } [Fact] @@ -528,7 +528,7 @@ public void ParsingDuplicateODataTypeAnnotationTargetingODataInstanceAnnotationS var propertyAndAnnotationCollector = new PropertyAndAnnotationCollector(true); Action action = () => this.RunPropertyParsingTest("{\"odata.annotation@odata.type\":\"#typename\",\"odata.annotation@odata.type\":\"#typename\"}", PropertyParsingResult.CustomInstanceAnnotation, "custom.type", null, this.ReadODataTypePropertyAnnotation, propertyAndAnnotationCollector); - action.Throws(ErrorStrings.DuplicateAnnotationForInstanceAnnotationNotAllowed("odata.type", "odata.annotation")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationForInstanceAnnotationNotAllowed, "odata.type", "odata.annotation")); } [Fact] @@ -537,7 +537,7 @@ public void ParsingDuplicateODataTypeAnnotationTargetingCustomInstanceAnnotation var propertyAndAnnotationCollector = new PropertyAndAnnotationCollector(true); Action action = () => this.RunPropertyParsingTest("{\"custom.annotation@odata.type\":\"#typename\",\"custom.annotation@odata.type\":\"#typename\"}", PropertyParsingResult.CustomInstanceAnnotation, "custom.type", null, this.ReadODataTypePropertyAnnotation, propertyAndAnnotationCollector); - action.Throws(ErrorStrings.DuplicateAnnotationForInstanceAnnotationNotAllowed("odata.type", "custom.annotation")); + action.Throws(Error.Format(SRResources.DuplicateAnnotationForInstanceAnnotationNotAllowed, "odata.type", "custom.annotation")); } #endregion Instance Annotation tests @@ -731,7 +731,7 @@ private void AssertDuplicateMetadataReferencePropertyFails(PropertyAndAnnotation (propertyName) => null, (propertyParsingResult, propertyName) => { }); - readDuplicateProperty.Throws(ErrorStrings.DuplicatePropertyNamesNotAllowed("#action")); + readDuplicateProperty.Throws(Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, "#action")); } } @@ -748,7 +748,7 @@ private void VerifyInvalidMetadataReferenceProperty(string propertyName) Action readEntryContentAction = () => deserializer.ReadResourceContent(new TestJsonReaderEntryState()); var exception = Assert.Throws(readEntryContentAction); - Assert.Equal(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty(propertyName), exception.Message); + Assert.Equal(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, propertyName), exception.Message); } } #endregion MetadataReferenceProperty tests @@ -769,7 +769,7 @@ public void ParsingTypeDefinitionValueOfIncompatibleTypeShouldFail() /*isTopLevelPropertyValue*/ true, /*insideResourceValue*/ false, /*propertyName*/ null); - action.Throws(ErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter("Edm.Int64")); + action.Throws(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, "Edm.Int64")); } [Fact] @@ -893,7 +893,7 @@ public void ParsingInstanceAnnotationInTopLevelPropertyShouldThrowOnReservedODat this.messageReaderSettings = new ODataMessageReaderSettings { ShouldIncludeAnnotation = ODataUtils.CreateAnnotationFilter("*") }; ODataJsonPropertyAndValueDeserializer deserializer = new ODataJsonPropertyAndValueDeserializer(this.CreateJsonInputContext("{\"@odata.context\":\"http://odata.org/test/$metadata#Customers(1)/Name\",\"@odata.count\":123,\"value\":\"Joe\"}", model)); Action action = () => deserializer.ReadTopLevelProperty(primitiveTypeRef); - action.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.count")); + action.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.count")); } [Fact] @@ -1047,7 +1047,7 @@ public void ParsingInstanceAnnotationInComplexValueShouldThrowOnReservedODataAnn while (odataReader.Read()) ; }; - action.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.count")); + action.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.count")); } [Fact] @@ -1155,7 +1155,7 @@ public void ParsingExpectedComplexPropertyActualNotShouldThrow() } }; - action.Throws(ErrorStrings.JsonReaderExtensions_UnexpectedNodeDetected("StartObject", "PrimitiveValue")); + action.Throws(Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetected, "StartObject", "PrimitiveValue")); } #region Async Tests @@ -1271,7 +1271,7 @@ await jsonDeserializer.ReadContextUriAnnotationAsync( })); Assert.Equal( - ErrorStrings.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty, + SRResources.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty, exception.Message); } @@ -1534,7 +1534,7 @@ public async Task ReadAndValidateAnnotationAsLongForIeee754CompatibleAsync_Throw isIeee754Compatible: isIeee754Compatible)); Assert.Equal( - ErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter("Edm.Int64"), + Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, "Edm.Int64"), exception.Message); } @@ -1552,7 +1552,7 @@ public async Task ProcessPropertyAsync_ThrowsExceptionForNonODataTypeAnnotationT () => SetupJsonPropertyAndValueDeserializerAndRunProcessPropertyTestAsync(payload)); Assert.Equal( - ErrorStrings.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation( + Error.Format(SRResources.ODataJsonDeserializer_OnlyODataTypeAnnotationCanTargetInstanceAnnotation, annotation, targetedAnnotation, "odata.type"), exception.Message); } @@ -1584,7 +1584,7 @@ public async Task ProcessPropertyAsync_ThrowsExceptionForAnnotationTargetingAnno () => SetupJsonPropertyAndValueDeserializerAndRunProcessPropertyTestAsync(payload)); Assert.Equal( - ErrorStrings.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue("odata.type", targetAnnotation), + Error.Format(SRResources.ODataJsonDeserializer_AnnotationTargetingInstanceAnnotationWithoutValue, "odata.type", targetAnnotation), exception.Message); } @@ -1629,7 +1629,7 @@ public async Task ProcessPropertyAsync_ThrowsExceptionForDuplicateUnknownODataAn var exception = await Assert.ThrowsAsync( () => SetupJsonPropertyAndValueDeserializerAndRunProcessPropertyTestAsync(payload)); - Assert.Equal(ErrorStrings.DuplicateAnnotationNotAllowed("odata.unknown"), + Assert.Equal(Error.Format(SRResources.DuplicateAnnotationNotAllowed, "odata.unknown"), exception.Message); } @@ -1657,7 +1657,7 @@ public async Task ProcessPropertyAsync_ThrowsExceptionForDuplicateODataTypeAnnot () => SetupJsonPropertyAndValueDeserializerAndRunProcessPropertyTestAsync(payload)); Assert.Equal( - ErrorStrings.DuplicateAnnotationForInstanceAnnotationNotAllowed("odata.type", annotationProperty), + Error.Format(SRResources.DuplicateAnnotationForInstanceAnnotationNotAllowed, "odata.type", annotationProperty), exception.Message); } @@ -1760,7 +1760,7 @@ public async Task ReadTopLevelPrimitivePropertyAsync_ThrowsExceptionForConflicti isIeee754Compatible: isIeee754Compatible)); Assert.Equal( - ErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter(edmProperty.Type.FullName()), + Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, edmProperty.Type.FullName()), exception.Message); } @@ -1781,7 +1781,7 @@ public async Task ReadTopLevelPrimitivePropertyAsync_ThrowsExceptionForValueAsJs (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName("PrimitiveValue", "StartObject", "value"), + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, "PrimitiveValue", "StartObject", "value"), exception.Message); } @@ -1791,15 +1791,15 @@ public static IEnumerable GetTopLevelPrimitivePropertyUnsupportedScena { new object[] { "\"@odata.id\":\"#1\",\"value\":13", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.id") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.id") }, new object[] { "\"#action\":\"Action\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#action") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#action") }, new object[] { "\"value@custom.annotation\":\"foobar\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty("value") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, "value") } }; } @@ -1989,25 +1989,25 @@ public static IEnumerable GetTopLevelResourcePropertyUnsupportedScenar yield return new object[] { "\"#action\":\"Action\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#action") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#action") }; yield return new object[] { "\"Street@custom.annotation\":\"foobar\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty("Street") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ResourceValuePropertyAnnotationWithoutProperty, "Street") }; yield return new object[] { "\"@odata.id\":\"#1\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.id") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.id") }; yield return new object[] { "\"Street\":\"S1\",\"@odata.type\":\"#Edm.Int32\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst + SRResources.ODataJsonPropertyAndValueDeserializer_ResourceTypeAnnotationNotFirst }; } @@ -2077,7 +2077,7 @@ public async Task ReadTopLevelResourcePropertyAsync_ThrowsExceptionForODataTypeP (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTypeName(null), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, new object[] { null }), exception.Message); } @@ -2099,7 +2099,7 @@ public async Task ReadTopLevelResourcePropertyAsync_ThrowsExceptionForUnexpected (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.etag"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.etag"), exception.Message); } @@ -2185,7 +2185,7 @@ public async Task ReadTopLevelEnumCollectionPropertyAsync_ThrowsExceptionForValu (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName("PrimitiveValue", "StartObject", "value"), + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, "PrimitiveValue", "StartObject", "value"), exception.Message); } @@ -2247,31 +2247,31 @@ public static IEnumerable GetTopLevel6xNullPropertyExceptionScenariosT yield return new object[] { "\"@odata.null\":true,\"value\":\"foobar\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload("value") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_NoPropertyAndAnnotationAllowedInNullPayload, "value") }; yield return new object[] { "\"@odata.null\":true,\"TempProperty@odata.type\":\"#Edm.String\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation("odata.type") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, "odata.type") }; yield return new object[] { "\"@odata.null\":true,\"TempProperty@custom.annotation\":\"foobar\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty("TempProperty") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TopLevelPropertyAnnotationWithoutProperty, "TempProperty") }; yield return new object[] { "\"@odata.null\":true,\"#action\":\"Action\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#action") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#action") }; yield return new object[] { "\"@odata.null\":true,\"@odata.type\":\"#Edm.String\"", - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.type") + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.type") }; } @@ -2313,7 +2313,7 @@ public async Task ReadTopLevel6xNullPropertyAsync_ThrowsExceptionForInvalidValue (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation("odata.null", "true"), + Error.Format(SRResources.ODataJsonReaderUtils_InvalidValueForODataNullAnnotation, "odata.null", "true"), exception.Message); } @@ -2334,7 +2334,7 @@ public async Task ReadTopLevelPropertyAsync_ThrowsExceptionForConflictingODataTy (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ValidationUtils_IncorrectTypeKind("Collection(Edm.Int32)", "Primitive", "Collection"), + Error.Format(SRResources.ValidationUtils_IncorrectTypeKind, "Collection(Edm.Int32)", "Primitive", "Collection"), exception.Message); } @@ -2356,7 +2356,7 @@ public async Task ReadTopLevelPropertyAsync_ThrowsExceptionForUnexpectedODataPro (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation("odata.type"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedODataPropertyAnnotation, "odata.type"), exception.Message); } @@ -2377,7 +2377,7 @@ public async Task ReadTopLevelPropertyAsync_ThrowsExceptionForODataTypeAnnotatio (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty("odata.type", "value"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_TypePropertyAfterValueProperty, "odata.type", "value"), exception.Message); } @@ -2396,7 +2396,7 @@ public async Task ReadTopLevelPropertyAsync_ThrowsExceptionForInvalidTopLevelPro (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload, + SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyPayload, exception.Message); } @@ -2416,7 +2416,7 @@ public async Task ReadTopLevelPropertyAsync_ThrowsExceptionForInvalidTopLevelPro (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName("foobar", "value"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTopLevelPropertyName, "foobar", "value"), exception.Message); } @@ -2439,7 +2439,7 @@ public async Task ReadTopLevelPrimitiveCollectionPropertyAsync_ThrowsExceptionFo (jsonDeserializer) => jsonDeserializer.ReadTopLevelPropertyAsync(edmProperty.Type))); Assert.Equal( - ErrorStrings.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName("StartArray", "StartObject", "value"), + Error.Format(SRResources.JsonReaderExtensions_UnexpectedNodeDetectedWithPropertyName, "StartArray", "StartObject", "value"), exception.Message); } @@ -2498,7 +2498,7 @@ await jsonDeserializer.ReadNonEntityValueAsync( })); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty("HomeAddress", "PrimitiveValue", "NS.Address"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataResourceExpectedForProperty, "HomeAddress", "PrimitiveValue", "NS.Address"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntityReferenceLinkSerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntityReferenceLinkSerializerTests.cs index fb7971a24e..23087b0a01 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntityReferenceLinkSerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntityReferenceLinkSerializerTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; @@ -141,7 +142,7 @@ public async Task WriteEntityReferenceLinksAsync_ExceptionThrownForNullEntityRef return jsonEntityReferenceLinkSerializer.WriteEntityReferenceLinksAsync(entityReferenceLinks); })); - Assert.Equal(Strings.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, exception.Message); + Assert.Equal(SRResources.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, exception.Message); } [Fact] @@ -159,7 +160,7 @@ public async Task WriteEntityReferenceLinkAsync_ExceptionThrownForNullUrlInEntit return jsonEntityReferenceLinkSerializer.WriteEntityReferenceLinkAsync(entityReferenceLink); })); - Assert.Equal(Strings.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, exception.Message); + Assert.Equal(SRResources.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, exception.Message); } private ODataJsonEntityReferenceLinkSerializer CreateODataJsonEntityReferenceLinkSerializer( diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerTests.cs index f897020cdc..119d60245d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerTests.cs @@ -12,7 +12,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.Json { @@ -160,7 +160,7 @@ public void ReadInstanceAnnotationValueShouldThrowIfWireTypeAndModelTypeConflict propertyAndAnnotationCollector.AddODataPropertyAnnotation("custom.DateTimeOffsetAnnotation", "odata.type", "Edm.String"); Action testSubject = () => deserializer.ReadCustomInstanceAnnotationValue(propertyAndAnnotationCollector, "custom.DateTimeOffsetAnnotation"); - testSubject.Throws(ErrorStrings.ValidationUtils_IncompatibleType("Edm.String", "Edm.DateTimeOffset")); + testSubject.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "Edm.String", "Edm.DateTimeOffset")); } //[Fact(Skip="Complex instance annotation is not supported")] @@ -290,7 +290,7 @@ public void ReadAndApplyResourceSetInstanceAnnotationValueWithConflictShouldThro AdvanceReaderToFirstPropertyValue(deserializer.JsonReader); ODataResourceSet feed = new ODataResourceSet(); Action test = () => deserializer.ReadAndApplyResourceSetInstanceAnnotationValue("odata.count", feed, null /*propertyAndAnnotationCollector*/); - test.Throws(ErrorStrings.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter("Edm.Int64")); + test.Throws(Error.Format(SRResources.ODataJsonReaderUtils_ConflictBetweenInputFormatAndParameter, "Edm.Int64")); } [Fact] @@ -341,7 +341,7 @@ public void ReadEntryInstanceAnnotationShouldThrowOnReservedODataAnnotationNames var deserializer = this.CreateJsonEntryAndFeedDeserializer("{\"@odata.count\":\"123\"}"); AdvanceReaderToFirstPropertyValue(deserializer.JsonReader); Action action = () => deserializer.ReadEntryInstanceAnnotation("odata.count", false /*anyPropertyFound*/, true /*typeAnnotationFound*/, null /*propertyAndAnnotationCollector*/); - action.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.count")); + action.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.count")); } [Fact] @@ -364,7 +364,7 @@ public void ApplyEntryInstanceAnnotationShouldThrowOnReservedODataAnnotationName var deserializer = this.CreateJsonEntryAndFeedDeserializer("{\"@odata.count\":\"123\"}"); AdvanceReaderToFirstPropertyValue(deserializer.JsonReader); Action action = () => deserializer.ApplyEntryInstanceAnnotation(new TestJsonReaderEntryState(), "odata.count", 123); - action.Throws(ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.count")); + action.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.count")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerUndeclaredTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerUndeclaredTests.cs index 212dfcce53..7b1645438f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerUndeclaredTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedDeserializerUndeclaredTests.cs @@ -11,10 +11,10 @@ using System.Text; using System.Threading.Tasks; using Microsoft.OData; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Tests; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.Test.OData.TDD.Tests.Reader.Json { @@ -2301,7 +2301,7 @@ public void ReadResourceWithUndeclaredCollectionTypeShouldFail() const string payload = @"{""@odata.context"":""http://www.sampletest.com/$metadata#serverOpenEntitySet/$entity"",""Id"":61880128, ""UndeclaredProperty"":{""@odata.type"":""#Collection(Server.NS.Undeclared)"", ""Id"":""123""}}"; Action test = () => this.ReadEntryPayload(payload, this.serverOpenEntitySet, this.serverOpenEntityType, reader => { }, true); - test.Throws(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected("Collection(Server.NS.Undeclared)")); + test.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_CollectionTypeNotExpected, "Collection(Server.NS.Undeclared)")); } [Fact] @@ -2343,7 +2343,7 @@ public void ReadCollectionWithUndeclaredSingleTypeShouldFail() const string payload = @"{""@odata.context"":""http://www.sampletest.com/$metadata#serverOpenEntitySet/$entity"",""Id"":61880128, ""UndeclaredProperty@odata.type"":""#Server.NS.Undeclared"",""UndeclaredProperty"":[{""Id"":""123""}]}"; Action test = () => this.ReadEntryPayload(payload, this.serverOpenEntitySet, this.serverOpenEntityType, reader => { }, true); - test.Throws(ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected("Server.NS.Undeclared")); + test.Throws(Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_CollectionTypeExpected, "Server.NS.Undeclared")); } [Fact] @@ -2352,7 +2352,7 @@ public void ReadResourceExpectingCollectionShouldFail() string contextUrl = @"http://www.sampletest.com/$metadata#Collection(Server.NS.Undefined)"; string payload = "{\"@odata.context\":\"" + contextUrl + "\",\"id\":1}"; Action test = () => this.ReadEntryPayload(payload, this.serverOpenEntitySet, this.serverOpenEntityType, reader => { }, true); - test.Throws(ODataErrorStrings.ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind(contextUrl, "Resource")); + test.Throws(Error.Format(SRResources.ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind, contextUrl, "Resource")); } [Fact] @@ -2361,7 +2361,7 @@ public void ReadCollectionExpectingResourceShouldFail() string contextUrl = @"http://www.sampletest.com/$metadata#Server.NS.Undefined"; string payload = "{\"@odata.context\":\"" + contextUrl + "\",\"value\":[{\"id\":1}]}"; Action test = () => this.ReadCollectionPayload(payload, reader => { }); - test.Throws(ODataErrorStrings.ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind(contextUrl, "ResourceSet")); + test.Throws(Error.Format(SRResources.ODataJsonContextUriParser_ContextUriDoesNotMatchExpectedPayloadKind, contextUrl, "ResourceSet")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerTests.cs index 54e428ba51..45777b0d96 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.Json; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.Json { @@ -59,7 +59,7 @@ public void WriteOperationsOnRequestsShouldThrow() var context = this.CreateJsonOutputContext(stream, writingResponse: false); var serializer = new ODataJsonResourceSerializer(context); Action test = () => serializer.WriteOperations(new ODataOperation[] { new ODataAction { Metadata = new Uri("#foo", UriKind.Relative) } }, /*isAction*/true); - test.Throws(ErrorStrings.WriterValidationUtils_OperationInRequest("#foo")); + test.Throws(Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "#foo")); } } @@ -68,7 +68,7 @@ public void ShouldThrowWhenWritingRelativeActionsTargetWhenMetadataDocumentUriIs { IEnumerable operations = new ODataOperation[] { new ODataAction { Metadata = new Uri("#foo", UriKind.Relative), Target = new Uri("foo", UriKind.Relative) } }; Action test = () => this.WriteOperationsAndValidatePayload(operations, null, true, false /*setMetadataDocumentUri*/); - test.Throws(ErrorStrings.ODataOutputContext_MetadataDocumentUriMissing); + test.Throws(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } [Fact] @@ -124,7 +124,7 @@ public void ShouldThrowWhenWritingTwoActionsWithSameMetadataAndOneNullTarget() { var operations = new ODataOperation[] { new ODataAction { Metadata = new Uri("#foo", UriKind.Relative) }, new ODataAction { Metadata = new Uri("#foo", UriKind.Relative), Target = new Uri("http://www.example.com/foo") } }; Action test = () => this.WriteOperationsAndValidatePayload(operations, null); - test.Throws(ErrorStrings.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget("#foo")); + test.Throws(Error.Format(SRResources.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget, "#foo")); } [Fact] @@ -132,7 +132,7 @@ public void ShouldThrowWhenWritingTwoActionsWithSameMetadataAndTwoNullTargets() { var operations = new ODataOperation[] { new ODataAction { Metadata = new Uri("#foo", UriKind.Relative) }, new ODataAction { Metadata = new Uri("#foo", UriKind.Relative) } }; Action test = () => this.WriteOperationsAndValidatePayload(operations, null); - test.Throws(ErrorStrings.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget("#foo")); + test.Throws(Error.Format(SRResources.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustSpecifyTarget, "#foo")); } [Fact] @@ -140,7 +140,7 @@ public void ShouldThrowWhenWritingTwoActionsWithSameMetadataAndSameTargets() { var operations = new ODataOperation[] { new ODataAction { Metadata = new Uri("#foo", UriKind.Relative), Target = new Uri("http://www.example.com/foo") }, new ODataAction { Metadata = new Uri("#foo", UriKind.Relative), Target = new Uri("http://www.example.com/foo") } }; Action test = () => this.WriteOperationsAndValidatePayload(operations, null); - test.Throws(ErrorStrings.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget("#foo", "http://www.example.com/foo")); + test.Throws(Error.Format(SRResources.ODataJsonResourceSerializer_ActionsAndFunctionsGroupMustNotHaveDuplicateTarget, "#foo", "http://www.example.com/foo")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerUndecalredTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerUndecalredTests.cs index e0743016e9..1c7a689dea 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerUndecalredTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonEntryAndFeedSerializerUndecalredTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.Tests; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.Test.OData.TDD.Tests.Writer.Json { @@ -172,7 +173,7 @@ public void WriteResourceDeclaredCollectionUntypedProperty_ThrowsForNonCollectio Action test = () => WriteDeclaredUntypedProperty(property); ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.ValidationUtils_NonPrimitiveTypeForPrimitiveValue("Collection(Edm.Untyped)"), exception.Message); + Assert.Equal(Error.Format(SRResources.ValidationUtils_NonPrimitiveTypeForPrimitiveValue, "Collection(Edm.Untyped)"), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonErrorDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonErrorDeserializerTests.cs index 0932e17fe2..53f040b6dc 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonErrorDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonErrorDeserializerTests.cs @@ -8,10 +8,10 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -307,7 +307,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForMultipleErrorProperti (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName("error"), + Error.Format(SRResources.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName, "error"), exception.Message); } @@ -322,7 +322,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForUnexpectedTopLevelPro (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty("UnexpectedProp"), + Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty, "UnexpectedProp"), exception.Message); } @@ -338,7 +338,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForODataAnnotationInErro (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload("odata.type"), + Error.Format(SRResources.ODataJsonErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload, "odata.type"), exception.Message); } @@ -354,7 +354,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForPropertyWithoutValueI (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError("target"), + Error.Format(SRResources.ODataJsonErrorDeserializer_PropertyAnnotationWithoutPropertyForError, "target"), exception.Message); } @@ -370,7 +370,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForUnexpectedMetadataRef (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.ResolveError"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.ResolveError"), exception.Message); } @@ -387,7 +387,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForUnexpectedODataProper (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload("odata.etag"), + Error.Format(SRResources.ODataJsonErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload, "odata.etag"), exception.Message); } @@ -404,7 +404,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForInvalidODataTypeInErr (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_InvalidTypeName("odata.type"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_InvalidTypeName, "odata.type"), exception.Message); } @@ -420,7 +420,7 @@ public async Task ReadTopLevelErrorAsync_ThrowsExceptionForUnexpectedPropertyInE (jsonErrorDeserializer) => jsonErrorDeserializer.ReadTopLevelErrorAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty("UnexpectedProp"), + Error.Format(SRResources.ODataJsonErrorDeserializer_TopLevelErrorValueWithInvalidProperty, "UnexpectedProp"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextApiTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextApiTests.cs index b6966f7de4..50873d0879 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextApiTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextApiTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text.RegularExpressions; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.OData.UriParser; @@ -2600,8 +2601,8 @@ public async Task WriteRequestPayload_APIsThrowExceptionForCountInResourceSet() } })); - Assert.Equal(Strings.ODataWriterCore_QueryCountInRequest, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_QueryCountInRequest, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryCountInRequest, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryCountInRequest, syncException.Message); } [Fact] @@ -2636,8 +2637,8 @@ public async Task WriteRequestPayload_APIsThrowExceptionForNextPageLinkInDeltaRe } })); - Assert.Equal(Strings.ODataWriterCore_QueryNextLinkInRequest, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_QueryNextLinkInRequest, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryNextLinkInRequest, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryNextLinkInRequest, syncException.Message); } [Fact] @@ -2671,8 +2672,8 @@ public async Task WriteRequestPayload_APIsThrowExceptionForDeltaLinkInDeltaResou } })); - Assert.Equal(Strings.ODataWriterCore_QueryDeltaLinkInRequest, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_QueryDeltaLinkInRequest, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryDeltaLinkInRequest, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryDeltaLinkInRequest, syncException.Message); } [Fact] @@ -2714,8 +2715,8 @@ public async Task WriteRequestPayload_APIsThrowExceptionForDeferredNestedResourc } })); - Assert.Equal(Strings.ODataWriterCore_DeferredLinkInRequest, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_DeferredLinkInRequest, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_DeferredLinkInRequest, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_DeferredLinkInRequest, syncException.Message); } [Fact] @@ -2749,7 +2750,7 @@ public async Task WriteResponsePayload_APIsThrowExceptionForNestedResourceInfoAt } })); - var exceptionMessage = Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "NestedResourceInfo"); + var exceptionMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "NestedResourceInfo"); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -2786,7 +2787,7 @@ public async Task WriteProperty_APIsThrowExceptionForPropertyAtTopLevel() } })); - var exceptionMessage = Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "Property"); + var exceptionMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "Property"); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -2831,7 +2832,7 @@ public async Task WriteProperty_APIsThrowExceptionForPriorWritePropertyOperation } })); - var exceptionMessage = Strings.ODataWriterCore_PropertyValueAlreadyWritten(streetProperty.Name); + var exceptionMessage = Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, streetProperty.Name); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -2878,7 +2879,7 @@ public async Task WriteProperty_APIsThrowExceptionForNonPrimitivePropertyValue() } })); - var exceptionMessage = Strings.ODataWriterCore_InvalidStateTransition("Property", "Resource"); + var exceptionMessage = Error.Format(SRResources.ODataWriterCore_InvalidStateTransition, "Property", "Resource"); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -2915,8 +2916,8 @@ public async Task WriteTopLevelResourceSet_APIsThrowExceptionForResourceWriter() } })); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, syncException.Message); } [Fact] @@ -2950,8 +2951,8 @@ public async Task WriteTopLevelResource_APIsThrowExceptionForResourceSetWriter() } })); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, syncException.Message); } [Fact] @@ -2988,7 +2989,7 @@ public async Task WriteNestedResourceSet_APIsThrowExceptionForResourceSetNotNest } })); - var expectedMessage = Strings.ODataWriterCore_InvalidTransitionFromResource("Resource", "ResourceSet"); + var expectedMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, "Resource", "ResourceSet"); Assert.Equal(expectedMessage, asyncException.Message); Assert.Equal(expectedMessage, syncException.Message); @@ -3028,7 +3029,7 @@ public async Task WriteNestedResource_APIsThrowExceptionForResourceNotNestedInNe } })); - var expectedMessage = Strings.ODataWriterCore_InvalidTransitionFromResource("Resource", "Resource"); + var expectedMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, "Resource", "Resource"); Assert.Equal(expectedMessage, asyncException.Message); Assert.Equal(expectedMessage, syncException.Message); @@ -3067,7 +3068,7 @@ public async Task WriteNestedResourceInfo_ThrowsExceptionForParentResourceIsNull } })); - var expectedMessage = Strings.ODataWriterCore_InvalidTransitionFromNullResource("Resource", "NestedResourceInfo"); + var expectedMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromNullResource, "Resource", "NestedResourceInfo"); Assert.Equal(expectedMessage, asyncException.Message); Assert.Equal(expectedMessage, syncException.Message); @@ -3113,7 +3114,7 @@ public async Task WriteNestedDeltaResourceSet_APIsThrowException() } })); - var expectedMessage = Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeltaResourceSet"); + var expectedMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeltaResourceSet"); Assert.Equal(expectedMessage, asyncException.Message); Assert.Equal(expectedMessage, syncException.Message); @@ -3162,7 +3163,7 @@ public async Task WriteNestedDeletedResource_APIsThrowException(DeltaDeletedEntr } })); - var expectedMessage = Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeletedResource"); + var expectedMessage = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeletedResource"); Assert.Equal(expectedMessage, asyncException.Message); Assert.Equal(expectedMessage, syncException.Message); @@ -3204,8 +3205,8 @@ public async Task WriteDeltaLink_APIsThrowExceptionForResourceSetWriter() } })); - Assert.Equal(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, syncException.Message); } [Fact] @@ -3243,8 +3244,8 @@ public async Task WriteDeletedDeltaLink_APIsThrowExceptionForResourceSetWriter() } })); - Assert.Equal(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, syncException.Message); } [Fact] @@ -3284,7 +3285,7 @@ public async Task WriteStart_APIsThrowExceptionForResourceWriterInCompletedState } })); - var expected = Strings.ODataWriterCore_InvalidTransitionFromCompleted("Completed", "Resource"); + var expected = Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, "Completed", "Resource"); Assert.Equal(expected, asyncException.Message); Assert.Equal(expected, syncException.Message); @@ -3327,7 +3328,7 @@ public async Task WriteEnd_APIsThrowExceptionForResourceWriterInCompletedState() } })); - var expected = Strings.ODataWriterCore_WriteEndCalledInInvalidState("Completed"); + var expected = Error.Format(SRResources.ODataWriterCore_WriteEndCalledInInvalidState, "Completed"); Assert.Equal(expected, asyncException.Message); Assert.Equal(expected, syncException.Message); @@ -3383,8 +3384,8 @@ public async Task WriteEnd_APIsThrowExceptionForBinaryStreamNotDisposed() } })); - Assert.Equal(Strings.ODataWriterCore_StreamNotDisposed, asyncException.Message); - Assert.Equal(Strings.ODataWriterCore_StreamNotDisposed, syncException.Message); + Assert.Equal(SRResources.ODataWriterCore_StreamNotDisposed, asyncException.Message); + Assert.Equal(SRResources.ODataWriterCore_StreamNotDisposed, syncException.Message); } [Fact] @@ -3421,8 +3422,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForChangesetStartedWithinC } })); - Assert.Equal(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet, syncException.Message); } [Fact] @@ -3458,8 +3459,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForEndChangesetNotPrececed } })); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet, syncException.Message); } [Fact] @@ -3497,8 +3498,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForEndBatchBeforeEndChange } })); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet, syncException.Message); } [Fact] @@ -3532,8 +3533,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForNoStartBatch() } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromStart, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromStart, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromStart, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromStart, syncException.Message); } [Fact] @@ -3569,8 +3570,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForMultipleStartBatch() } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchStarted, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchStarted, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchStarted, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchStarted, syncException.Message); } [Fact] @@ -3608,8 +3609,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForStateTransitionAfterEnd } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchCompleted, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromBatchCompleted, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchCompleted, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromBatchCompleted, syncException.Message); } [Fact] @@ -3643,8 +3644,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForOperationResponseMessag } })); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateResponseOperationWhenWritingRequest, syncException.Message); } [Fact] @@ -3680,8 +3681,8 @@ await writer.CreateOperationRequestMessageAsync( } })); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotCreateRequestOperationWhenWritingResponse, syncException.Message); } [Fact] @@ -3721,8 +3722,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForInvalidTransitionFromEn } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted, syncException.Message); } [Fact] @@ -3784,8 +3785,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForInvalidTransitionFromOp } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed, syncException.Message); } [Fact] @@ -3839,8 +3840,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForInvalidTransitionFromOp } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamRequested, syncException.Message); } [Fact] @@ -3882,8 +3883,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForInvalidTransitionFromOp } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationCreated, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromOperationCreated, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationCreated, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromOperationCreated, syncException.Message); } [Fact] @@ -3921,8 +3922,8 @@ public async Task WriteBatchRequest_APIsThrowExceptionForInvalidTransitionFromCh } })); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetStarted, syncException.Message); } [Fact] @@ -3962,7 +3963,7 @@ await writer.CreateOperationRequestMessageAsync( } })); - var exceptionMessage = Strings.ODataBatch_InvalidHttpMethodForChangeSetRequest("GET"); + var exceptionMessage = Error.Format(SRResources.ODataBatch_InvalidHttpMethodForChangeSetRequest, "GET"); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -4005,7 +4006,7 @@ await writer.CreateOperationRequestMessageAsync( } })); - var exceptionMessage = Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(ODataConstants.ContentIdHeader); + var exceptionMessage = Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, ODataConstants.ContentIdHeader); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -4048,7 +4049,7 @@ public async Task WriteBatchRequest_APIsThrowExceptionForMaxPartsPerBatchLimitEx } })); - var exceptionMessage = Strings.ODataBatchWriter_MaxBatchSizeExceeded(1); + var exceptionMessage = Error.Format(SRResources.ODataBatchWriter_MaxBatchSizeExceeded, 1); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -4095,7 +4096,7 @@ await writer.CreateOperationRequestMessageAsync( } })); - var exceptionMessage = Strings.ODataBatchWriter_MaxChangeSetSizeExceeded(1); + var exceptionMessage = Error.Format(SRResources.ODataBatchWriter_MaxChangeSetSizeExceeded, 1); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -4140,7 +4141,7 @@ await writer.CreateOperationRequestMessageAsync( } })); - var exceptionMessage = Strings.ODataBatchWriter_DuplicateContentIDsNotAllowed(1); + var exceptionMessage = Error.Format(SRResources.ODataBatchWriter_DuplicateContentIDsNotAllowed, 1); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); @@ -4199,7 +4200,7 @@ await writer.CreateOperationRequestMessageAsync( } })); - var exceptionMessage = Strings.ODataBatchReader_DependsOnIdNotFound("1", "2"); + var exceptionMessage = Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "1", "2"); Assert.Equal(exceptionMessage, asyncException.Message); Assert.Equal(exceptionMessage, syncException.Message); diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextTests.cs index 2efa760eb3..759c218d0f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonOutputContextTests.cs @@ -11,12 +11,12 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.Spatial; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -79,7 +79,7 @@ public void ThrowsOnWriteNullPropertyResponseWithoutModel() { ODataProperty property = new ODataProperty { Name = "Prop", Value = null }; Action test = () => WriteAndValidate(outputContext => outputContext.WriteProperty(property), "", writingResponse: true); - test.Throws(ODataErrorStrings.ODataMessageWriter_CannotWriteTopLevelNull); + test.Throws(SRResources.ODataMessageWriter_CannotWriteTopLevelNull); } [Fact] @@ -729,7 +729,7 @@ public async Task WriteInStreamError_ThrowsExceptionIfInvokedWhenWritingParamate await jsonOutputContext.WriteInStreamErrorAsync(this.nullReferenceError, /*includeDebugInformation*/ false); })); - Assert.Equal(Strings.ODataParameterWriter_InStreamErrorNotSupported, exception.Message); + Assert.Equal(SRResources.ODataParameterWriter_InStreamErrorNotSupported, exception.Message); } [Fact] @@ -745,7 +745,7 @@ public async Task WriteInStreamError_ThrowsExceptionIfInvokedWhenWritingBatchAsy await jsonOutputContext.WriteInStreamErrorAsync(this.nullReferenceError, /*includeDebugInformation*/ false); })); - Assert.Equal(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch, exception.Message); } #endregion Async Tests diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterDeserializerTests.cs index 8daf70dbdf..b0cf423a58 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterDeserializerTests.cs @@ -9,10 +9,10 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -233,7 +233,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForMissingParameter() transferProductAction)); Assert.Equal( - ErrorStrings.ODataParameterReaderCore_ParametersMissingInPayload("TransferProduct", "categoryId"), + Error.Format(SRResources.ODataParameterReaderCore_ParametersMissingInPayload, "TransferProduct", "categoryId"), exception.Message); } @@ -251,7 +251,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForUnexpectedMetadataReferen getRatingFunction)); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.GetRating"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.GetRating"), exception.Message); } @@ -269,7 +269,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForUnexpectedODataInstanceAn getRatingFunction)); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.id"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.id"), exception.Message); } @@ -287,7 +287,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForUnexpectedPropertyWithout getRatingFunction)); Assert.Equal( - ErrorStrings.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters("productId"), + Error.Format(SRResources.ODataJsonParameterDeserializer_PropertyAnnotationWithoutPropertyForParameters, "productId"), exception.Message); } @@ -307,7 +307,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForUnsupportedPrimitiveParam setPhotoAction)); Assert.Equal( - ErrorStrings.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType("photo", EdmPrimitiveTypeKind.Stream), + Error.Format(SRResources.ODataJsonParameterDeserializer_UnsupportedPrimitiveParameterType, "photo", EdmPrimitiveTypeKind.Stream), exception.Message); } @@ -329,7 +329,7 @@ public async Task ReadParameterAsync_ThrowsExceptionForUnexpectedPrimitiveCollec setAttributesAction)); Assert.Equal( - ErrorStrings.ODataJsonParameterDeserializer_NullCollectionExpected("PrimitiveValue", "attrs"), + Error.Format(SRResources.ODataJsonParameterDeserializer_NullCollectionExpected, "PrimitiveValue", "attrs"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterReaderTests.cs index bf13fc25b1..fbe93eadf6 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterReaderTests.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Microsoft.Test.OData.Utils.ODataLibTest; @@ -78,7 +79,7 @@ public void ParameterReaderShouldThrowIfMissingNonNullableNonOptionalParameter() const string payload = "{ }"; Action test = () => this.RunParameterReaderTest(payload); - test.Throws(Strings.ODataParameterReaderCore_ParametersMissingInPayload("ActionImport", "days")); + test.Throws(Error.Format(SRResources.ODataParameterReaderCore_ParametersMissingInPayload, "ActionImport", "days")); } [Fact] @@ -724,7 +725,7 @@ public async Task ReadEmptyNonNullableNonOptionalParameterAsync_ThrowsException( (jsonParameterReader) => DoReadAsync(jsonParameterReader))); Assert.Equal( - Strings.ODataParameterReaderCore_ParametersMissingInPayload("ActionImport", "rating"), + Error.Format(SRResources.ODataParameterReaderCore_ParametersMissingInPayload, "ActionImport", "rating"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterWriterTests.cs index 5a6adee087..e787faee0b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonParameterWriterTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; @@ -731,7 +732,7 @@ public async Task WriteParameterAsync_ThrowsExceptionForDuplicatedParameterName( })); Assert.Equal( - Strings.ODataParameterWriterCore_DuplicatedParameterNameNotAllowed("LuckyNumber"), + Error.Format(SRResources.ODataParameterWriterCore_DuplicatedParameterNameNotAllowed, "LuckyNumber"), exception.Message); } @@ -748,7 +749,7 @@ public async Task WriteParameterAsync_ThrowsExceptionForParameterNameNotFoundInE writingResponse: false)); Assert.Equal( - Strings.ODataParameterWriterCore_ParameterNameNotFoundInOperation("prodId", "GetRating"), + Error.Format(SRResources.ODataParameterWriterCore_ParameterNameNotFoundInOperation, "prodId", "GetRating"), exception.Message); } @@ -764,7 +765,7 @@ public async Task WriteParameterAsync_ThrowsExceptionForWriterInCompletedState() })); Assert.Equal( - Strings.ODataParameterWriterCore_CannotWriteInErrorOrCompletedState, + SRResources.ODataParameterWriterCore_CannotWriteInErrorOrCompletedState, exception.Message); } @@ -781,7 +782,7 @@ public async Task WriteParameterAsync_ThrowsExceptionForWriterNotInParameterWrit })); Assert.Equal( - Strings.ODataParameterWriterCore_CannotWriteParameter, + SRResources.ODataParameterWriterCore_CannotWriteParameter, exception.Message); } @@ -802,7 +803,7 @@ public async Task CreateCollectionWriterAsync_ThrowsExceptionForEntityCollection writingResponse: false)); Assert.Equal( - Strings.ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind("product", "Entity"), + Error.Format(SRResources.ODataParameterWriterCore_CannotCreateCollectionWriterOnNonCollectionTypeKind, "product", "Entity"), exception.Message); } @@ -823,7 +824,7 @@ public async Task CreateResourceWriterAsync_ThrowsExceptionForNonStructuredType( writingResponse: false)); Assert.Equal( - Strings.ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind("color", "Enum"), + Error.Format(SRResources.ODataParameterWriterCore_CannotCreateResourceWriterOnNonEntityOrComplexTypeKind, "color", "Enum"), exception.Message); } @@ -844,7 +845,7 @@ public async Task CreateResourceSetWriterAsync_ThrowsExceptionForNonStructuredTy writingResponse: false)); Assert.Equal( - Strings.ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind("color", "Enum"), + Error.Format(SRResources.ODataParameterWriterCore_CannotCreateResourceSetWriterOnNonStructuredCollectionTypeKind, "color", "Enum"), exception.Message); } @@ -862,7 +863,7 @@ public async Task WriteParameterAsync_ThrowsExceptionForMissingParameterInParame writingResponse: false)); Assert.Equal( - Strings.ODataParameterWriterCore_MissingParameterInParameterPayload("'b'", "Add"), + Error.Format(SRResources.ODataParameterWriterCore_MissingParameterInParameterPayload, "'b'", "Add"), exception.Message); } @@ -911,7 +912,7 @@ public async Task WriteStartAsync_ThrowsExceptionForWriterInCanWriteParameterSta await jsonParameterWriter.WriteStartAsync(); }); - Assert.Equal(Strings.ODataParameterWriterCore_CannotWriteStart, exception.Message); + Assert.Equal(SRResources.ODataParameterWriterCore_CannotWriteStart, exception.Message); } [Fact] @@ -926,7 +927,7 @@ public async Task WriteEndAsync_ThrowsExceptionForWriterInStartState() await jsonParameterWriter.WriteEndAsync(); }); - Assert.Equal(Strings.ODataParameterWriterCore_CannotWriteEnd, exception.Message); + Assert.Equal(SRResources.ODataParameterWriterCore_CannotWriteEnd, exception.Message); } /// diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonPropertySerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonPropertySerializerTests.cs index a5bc5164d5..32b91a9521 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonPropertySerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonPropertySerializerTests.cs @@ -11,6 +11,7 @@ using System.Text; using System.Text.Json; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; @@ -485,7 +486,7 @@ public void WritingEdmPrimitiveConstraintPropertyShouldThrowWithNotAllowedValue( var primitiveTypeProperty = new ODataProperty { Name = "PrimitiveConstraintProperty", Value = value }; Action action = () => this.SerializeProperty(this.entityType, primitiveTypeProperty); var exception = Assert.Throws(action); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint(fullTypeName, "property", "PrimitiveConstraintProperty"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, fullTypeName, "property", "PrimitiveConstraintProperty"), exception.Message); } #region Serializing regular properties diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonReaderTests.cs index 457ada5caa..10b71961f2 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonReaderTests.cs @@ -10,10 +10,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -2126,7 +2126,7 @@ public async Task ReadNestedResourceSetAsync_ThrowsExceptionForInvalidItemsInRes (jsonReader) => JsonReaderUtils.DoReadAsync(jsonReader), isResponse: true)); - Assert.Equal(ErrorStrings.ODataJsonReader_CannotReadResourcesOfResourceSet("PrimitiveValue"), + Assert.Equal(Error.Format(SRResources.ODataJsonReader_CannotReadResourcesOfResourceSet, "PrimitiveValue"), exception.Message); } @@ -2148,7 +2148,7 @@ public async Task ReadV401NestedDeltaResourceSetAsync_ThrowsExceptionForInvalidI this.customerEntityType, (jsonReader) => JsonReaderUtils.DoReadAsync(jsonReader))); - Assert.Equal(ErrorStrings.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet("PrimitiveValue"), + Assert.Equal(Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidNodeTypeForItemsInResourceSet, "PrimitiveValue"), exception.Message); } @@ -2170,7 +2170,7 @@ public async Task ReadNestedResourceAsync_ThrowsExceptionForNonNullableStructura (jsonReader) => JsonReaderUtils.DoReadAsync(jsonReader))); Assert.Equal( - ErrorStrings.ReaderValidationUtils_NullNamedValueForNonNullableType("BillingAddress", "NS.Address"), + Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNonNullableType, "BillingAddress", "NS.Address"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonResourceDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonResourceDeserializerTests.cs index 61532e00a6..78c70f1e0f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonResourceDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonResourceDeserializerTests.cs @@ -9,12 +9,12 @@ using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Microsoft.OData.Json; using Microsoft.Spatial; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -863,7 +863,7 @@ public async Task ReadResourceContentWithUndeclaredComplexPropertySingletonForNo (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource("StartArray", "HomeAddress"), + Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadSingletonNestedResource, "StartArray", "HomeAddress"), exception.Message); } @@ -911,7 +911,7 @@ public async Task ReadResourceContentWithUndeclaredComplexCollectionPropertyForN (resourceState) => { })); Assert.Equal( - ErrorStrings.ReaderValidationUtils_NullNamedValueForNullableType("PhysicalAddresses", "Collection(NS.Address)"), + Error.Format(SRResources.ReaderValidationUtils_NullNamedValueForNullableType, "PhysicalAddresses", "Collection(NS.Address)"), exception.Message); } @@ -934,7 +934,7 @@ public async Task ReadResourceContentWithUndeclaredEntityCollectionPropertyForNo (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource("StartObject", "ReviewedProducts"), + Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadCollectionNestedResource, "StartObject", "ReviewedProducts"), exception.Message); } @@ -1377,7 +1377,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForRepeatedPropertyInO (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(repeatedProperty, "#NS.Top5Products"), + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, repeatedProperty, "#NS.Top5Products"), exception.Message); } @@ -1397,7 +1397,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForOperationMissingTar (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty("#NS.Top5Products"), + Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, "#NS.Top5Products"), exception.Message); } @@ -1417,7 +1417,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForOperationPropertyVa (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue("#NS.Top5Products", JsonNodeType.PrimitiveValue), + Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, "#NS.Top5Products", JsonNodeType.PrimitiveValue), exception.Message); } @@ -1437,7 +1437,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForODataIdAnnotationPr (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty("odata.id"), + Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, "odata.id"), exception.Message); } @@ -1457,7 +1457,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForODataEtagAnnotation (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty("odata.etag"), + Error.Format(SRResources.ODataJsonResourceDeserializer_ResourceInstanceAnnotationPrecededByProperty, "odata.etag"), exception.Message); } @@ -1477,7 +1477,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForUnexpectedODataRemo (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload, + SRResources.ODataJsonResourceDeserializer_UnexpectedDeletedEntryInResponsePayload, exception.Message); } @@ -1497,7 +1497,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForODataBindPropertyAn (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_EmptyBindArray("odata.bind"), + Error.Format(SRResources.ODataJsonResourceDeserializer_EmptyBindArray, "odata.bind"), exception.Message); } @@ -1517,7 +1517,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForODataTypeAnnotation (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue("odata.type"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_ODataTypeAnnotationInPrimitiveValue, "odata.type"), exception.Message); } @@ -1559,7 +1559,7 @@ await jsonResourceDeserializer.ReadPayloadStartAsync( propertyAndAnnotationCollector)); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst, + SRResources.ODataJsonResourceDeserializer_ResourceTypeAnnotationNotFirst, exception.Message); } } @@ -1580,7 +1580,7 @@ public async Task ReadResourceContentAsync_ThrowsExceptionForUnexpectedODataDelt (resourceState) => { })); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.deltaLink"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.deltaLink"), exception.Message); } @@ -1599,7 +1599,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForMiss (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound("value"), + Error.Format(SRResources.ODataJsonResourceDeserializer_ExpectedResourceSetPropertyNotFound, "value"), exception.Message); } @@ -1621,7 +1621,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForRepe (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation(repeatedProperty, "#NS.RateCategories"), + Error.Format(SRResources.ODataJsonResourceDeserializer_MultipleOptionalPropertiesInOperation, repeatedProperty, "#NS.RateCategories"), exception.Message); } @@ -1641,7 +1641,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForOper (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_OperationMissingTargetProperty("#NS.RateCategories"), + Error.Format(SRResources.ODataJsonResourceDeserializer_OperationMissingTargetProperty, "#NS.RateCategories"), exception.Message); } @@ -1661,7 +1661,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForOper (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue("#NS.RateCategories", JsonNodeType.PrimitiveValue), + Error.Format(SRResources.ODataJsonOperationsDeserializerUtils_OperationsPropertyMustHaveObjectValue, "#NS.RateCategories", JsonNodeType.PrimitiveValue), exception.Message); } @@ -1680,7 +1680,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForRequ (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet("value"), + Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyAnnotationInTopLevelResourceSet, "value"), exception.Message); } @@ -1700,7 +1700,7 @@ public async Task ReadTopLevelResourceSetAnnotationsAsync_ThrowsExceptionForUnex (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet("Id", "value"), + Error.Format(SRResources.ODataJsonResourceDeserializer_InvalidPropertyInTopLevelResourceSet, "Id", "value"), exception.Message); } @@ -1720,7 +1720,7 @@ public async Task ReadTopLevelDeltaResourceSetAnnotationsAsync_ThrowsExceptionFo (resourceSet, propertyAndAnnotationCollector) => { })); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.RateCategories"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.RateCategories"), exception.Message); } @@ -1739,7 +1739,7 @@ public async Task ReadResourceSetContentAsync_ThrowsExceptionForValuePropertyNot () => jsonResourceDeserializer.ReadResourceSetContentStartAsync()); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart("StartObject"), + Error.Format(SRResources.ODataJsonResourceDeserializer_CannotReadResourceSetContentStart, "StartObject"), exception.Message); } } @@ -1761,7 +1761,7 @@ public async Task ReadDeletedResourceAsync_ThrowsExceptionForMissingODataIdAnnot () => jsonResourceDeserializer.ReadDeletedResourceAsync()); Assert.Equal( - ErrorStrings.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties, + SRResources.ODataWriterCore_DeltaResourceWithoutIdOrKeyProperties, exception.Message); } } @@ -1783,7 +1783,7 @@ public async Task ReadDeletedResourceAsync_ThrowsExceptionForODataRemovedAnnotat () => jsonResourceDeserializer.ReadDeletedResourceAsync()); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject("NaO"), + Error.Format(SRResources.ODataJsonResourceDeserializer_DeltaRemovedAnnotationMustBeObject, "NaO"), exception.Message); } } @@ -1807,7 +1807,7 @@ public async Task ReadDeletedEntryAsync_ThrowsExceptionForNestedContent(string p () => jsonResourceDeserializer.ReadDeletedEntryAsync()); Assert.Equal( - ErrorStrings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry, + SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry, exception.Message); } } @@ -1831,7 +1831,7 @@ public void ReadDeletedEntry_ThrowsExceptionForNestedContent(string payload) () => jsonResourceDeserializer.ReadDeletedEntry()); Assert.Equal( - ErrorStrings.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry, + SRResources.ODataWriterCore_NestedContentNotAllowedIn40DeletedEntry, exception.Message); } } @@ -1855,7 +1855,7 @@ public async Task ReadNextLinkAnnotationAtResourceSetEndAsync_ThrowsExceptionFor (nestedResourceSet) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation("odata.nextLink", "Products"), + Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, "odata.nextLink", "Products"), exception.Message); } @@ -1878,7 +1878,7 @@ public async Task ReadNextLinkAnnotationAtResourceSetEndAsync_ThrowsExceptionFor (nestedResourceSet) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation("odata.count", "Products"), + Error.Format(SRResources.ODataJsonResourceDeserializer_DuplicateNestedResourceSetAnnotation, "odata.count", "Products"), exception.Message); } @@ -1900,7 +1900,7 @@ public async Task ReadNextLinkAnnotationAtResourceSetEndAsync_ThrowsExceptionFor (nestedResourceSet) => { })); Assert.Equal( - ErrorStrings.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet("odata.deltaLink", "Products"), + Error.Format(SRResources.ODataJsonResourceDeserializer_UnexpectedPropertyAnnotationAfterExpandedResourceSet, "odata.deltaLink", "Products"), exception.Message); } @@ -1923,7 +1923,7 @@ public async Task ReadNextLinkAnnotationAtResourceSetEndAsync_ThrowsExceptionFor isResponse: false)); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation("Products", "odata.nextLink"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedPropertyAnnotation, "Products", "odata.nextLink"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonSerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonSerializerTests.cs index a1a34fc062..fc3aa1b142 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonSerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonSerializerTests.cs @@ -10,6 +10,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; @@ -226,7 +227,7 @@ public void WriteTopLevelErrorWithResourceInstanceAnnotationNoTypeNameShouldThro error.InstanceAnnotations = instanceAnnotations; Action writeError = () => serializer.WriteTopLevelError(error, false); - writeError.Throws(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + writeError.Throws(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); }); } @@ -268,7 +269,7 @@ public void WriteTopLevelErrorWithCollectionOfResourceInstanceAnnotationWithNoTy error.InstanceAnnotations = instanceAnnotations; Action writeError = () => serializer.WriteTopLevelError(error, false); - writeError.Throws(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + writeError.Throws(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); }); } @@ -279,7 +280,7 @@ public void UrlToStringShouldThrowWithNoMetadataAndMetadataDocumentUriIsNotProvi var serializer = GetSerializer(stream, null, true, false); var uri = new Uri("TestUri", UriKind.Relative); Action uriToStrongError = () => serializer.UriToString(uri); - uriToStrongError.Throws(Strings.ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata(UriUtils.UriToString(uri))); + uriToStrongError.Throws(Error.Format(SRResources.ODataJsonSerializer_RelativeUriUsedWithoutMetadataDocumentUriOrMetadata, UriUtils.UriToString(uri))); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentDeserializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentDeserializerTests.cs index 6853441b1b..5b16b2c48e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentDeserializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentDeserializerTests.cs @@ -9,10 +9,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -80,7 +80,7 @@ public void ReadServiceDocumentWithMultiSingletonInfo() public void ReadServiceDocumentWithSingletonInfoWithNameAbsent() { Action test = () => ReadServiceDocument(DefaultEmptyServiceDocumentStarter.Replace("REPLACE", @"{""url"":""singleton"", ""kind"":""Singleton""}")); - test.Throws(Strings.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement(ODataJsonConstants.ODataServiceDocumentElementName)); + test.Throws(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement, ODataJsonConstants.ODataServiceDocumentElementName)); } [Fact] @@ -95,7 +95,7 @@ public void ReadServiceDocumentWithSingletonInfoWithKindAbsent() public void ReaderServiceDocumentWithSingletonInfoWithEmptyUrl() { Action test = () => ReadServiceDocument(DefaultEmptyServiceDocumentStarter.Replace("REPLACE", @"{""url"":"""", ""name"":""singleton""}")); - test.Throws(Strings.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement(ODataJsonConstants.ODataServiceDocumentElementUrlName)); + test.Throws(Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement, ODataJsonConstants.ODataServiceDocumentElementUrlName)); } #endregion @@ -165,7 +165,7 @@ public void ReadServiceDocument_ThrowsExceptionForRepeatedPropertyInServiceDocum var exception = Assert.Throws(() => ReadServiceDocument(payload)); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement(property), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement, property), exception.Message); } @@ -305,7 +305,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedODataAnno (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument("odata.type", "value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocument, "odata.type", "value"), exception.Message); } @@ -322,7 +322,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedODataProp (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument("odata.type", "value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocument, "odata.type", "value"), exception.Message); } @@ -339,7 +339,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedMetadataR (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.Top5Customers"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.Top5Customers"), exception.Message); } @@ -355,7 +355,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedPropertyA (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty("value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, "value"), exception.Message); } @@ -370,7 +370,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForMissingODataValuePr (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument("value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingValuePropertyInServiceDocument, "value"), exception.Message); } @@ -387,7 +387,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForRepeatedODataValueP (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument("value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocument, "value"), exception.Message); } @@ -403,7 +403,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedPropertyI (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument("unexpectedProp", "value"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocument, "unexpectedProp", "value"), exception.Message); } @@ -419,7 +419,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedODataInst (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement("odata.type"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_InstanceAnnotationInServiceDocumentElement, "odata.type"), exception.Message); } @@ -435,7 +435,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedODataProp (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement("odata.type"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationInServiceDocumentElement, "odata.type"), exception.Message); } @@ -455,7 +455,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForRepeatedPropertyInS (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement(property), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_DuplicatePropertiesInServiceDocumentElement, property), exception.Message); } @@ -474,7 +474,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForMissingOrNullRequir (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement(property), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_MissingRequiredPropertyInServiceDocumentElement, property), exception.Message); } @@ -490,7 +490,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForServiceDocumentElem (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ValidationUtils_ServiceDocumentElementUrlMustNotBeNull, + SRResources.ValidationUtils_ServiceDocumentElementUrlMustNotBeNull, exception.Message); } @@ -506,7 +506,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedMetadataR (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.Top5Customers"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.Top5Customers"), exception.Message); } @@ -522,7 +522,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedPropertyA (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty("name"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_PropertyAnnotationWithoutProperty, "name"), exception.Message); } @@ -538,7 +538,7 @@ public async Task ReadServiceDocumentAsync_ThrowsExceptionForUnexpectedPropertyI (jsonServiceDocumentDeserializer) => jsonServiceDocumentDeserializer.ReadServiceDocumentAsync())); Assert.Equal( - ErrorStrings.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement("unexpectedProp", "name", "url"), + Error.Format(SRResources.ODataJsonServiceDocumentDeserializer_UnexpectedPropertyInServiceDocumentElement, "unexpectedProp", "name", "url"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentSerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentSerializerTests.cs index 7a899f1240..d5cdcc5001 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentSerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonServiceDocumentSerializerTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; @@ -110,7 +111,7 @@ public void WriteNullFunctionImportShouldThrow() //Note: Only testing one of three exceptions that occurs in the Validate ServiceDocumentElements because if one throws then we know that the code path is going through // the validation method. If the validation method is changed then in the future two exception tests might be needed. - WriteServiceDocumentShouldError(serviceDocument).Throws(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem); + WriteServiceDocumentShouldError(serviceDocument).Throws(SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem); } public static IEnumerable GetWriteServiceDocumentTestData() @@ -238,7 +239,7 @@ public static IEnumerable GetWriteServiceDocumentExceptionsTestData() { FunctionImports = new List { null } }, - Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem + SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem }; // Null EntitySet (Singletons handled the same) @@ -248,7 +249,7 @@ public static IEnumerable GetWriteServiceDocumentExceptionsTestData() { EntitySets = new List { null } }, - Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem + SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem }; // EntitySet with null value as Url (Singletons handled the same) @@ -261,7 +262,7 @@ public static IEnumerable GetWriteServiceDocumentExceptionsTestData() new ODataEntitySetInfo { Name = "Customers", Url = null } } }, - Strings.ValidationUtils_ResourceMustSpecifyUrl + SRResources.ValidationUtils_ResourceMustSpecifyUrl }; // EntitySet with null value as Name (Singletons handled the same) @@ -274,7 +275,7 @@ public static IEnumerable GetWriteServiceDocumentExceptionsTestData() new ODataEntitySetInfo { Name = null, Url = new Uri("http://tempuri.org/Customers") } } }, - Strings.ValidationUtils_ResourceMustSpecifyName("http://tempuri.org/Customers") + Error.Format(SRResources.ValidationUtils_ResourceMustSpecifyName, "http://tempuri.org/Customers") }; } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValidationUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValidationUtilsTests.cs index f1855799f7..8ae4d372af 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValidationUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValidationUtilsTests.cs @@ -5,9 +5,9 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -25,7 +25,7 @@ public void ValidateMetadataReferencePropertyNameShouldNotThrowWhenNameIsHashThe public void ValidateMetadataReferencePropertyNameShouldThrowWhenNameIsOpenMetadataReferenceProperty() { Action action = () => ODataJsonValidationUtils.ValidateMetadataReferencePropertyName(metadataDocumentUri, "http://www.example.com/$metadata#foo"); - action.Throws(ErrorStrings.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported("http://www.example.com/$metadata#foo", metadataDocumentUri.AbsoluteUri)); + action.Throws(Error.Format(SRResources.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, "http://www.example.com/$metadata#foo", metadataDocumentUri.AbsoluteUri)); } [Fact] @@ -38,28 +38,28 @@ public void ValidateMetadataReferencePropertyNameShouldNotThrowWhenNameIsMetadat public void ValidateMetadataReferencePropertyNameShouldThrowWhenNameIsWithoutHash() { Action action = () => ODataJsonValidationUtils.ValidateMetadataReferencePropertyName(metadataDocumentUri, "bar"); - action.Throws(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty("bar")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "bar")); } [Fact] public void ValidateMetadataReferencePropertyNameShouldThrowWhenNameIsAbsoluteUriWithoutHash() { Action action = () => ODataJsonValidationUtils.ValidateMetadataReferencePropertyName(metadataDocumentUri, "http://www.example.com/foo"); - action.Throws(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty("http://www.example.com/foo")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "http://www.example.com/foo")); } [Fact] public void ValidateMetadataReferencePropertyNameShouldThrowWhenNameIsIdentifierHashIdentifier() { Action action = () => ODataJsonValidationUtils.ValidateMetadataReferencePropertyName(metadataDocumentUri, "foo#baz"); - action.Throws(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty("foo#baz")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "foo#baz")); } [Fact] public void ValidateMetadataReferencePropertyNameShouldThrowWhenNameIsJustHash() { Action action = () => ODataJsonValidationUtils.ValidateMetadataReferencePropertyName(metadataDocumentUri, "#"); - action.Throws(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty("#")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "#")); } [Fact] @@ -99,7 +99,7 @@ public void ValidateOperationShouldThrowWhenOperationMetadataIsNull() { ODataOperation operation = new ODataAction(); Action action = () => ODataJsonValidationUtils.ValidateOperation(metadataDocumentUri, operation); - action.Throws(ErrorStrings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(operation.GetType().Name)); + action.Throws(Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, operation.GetType().Name)); } [Fact] @@ -107,7 +107,7 @@ public void ValidateOperationShouldThrowWhenOperationMetadataIsNotMetadataRefere { ODataOperation operation = new ODataAction {Metadata = new Uri("foobaz", UriKind.Relative)}; Action action = () => ODataJsonValidationUtils.ValidateOperation(metadataDocumentUri, operation); - action.Throws(ErrorStrings.ValidationUtils_InvalidMetadataReferenceProperty("foobaz")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "foobaz")); } [Fact] @@ -115,7 +115,7 @@ public void ValidateOperationShouldThrowWhenOperationMetadataIsOpenAndOperationT { ODataOperation operation = new ODataAction {Metadata = new Uri("http://www.example.com/foo#baz")}; Action action = () => ODataJsonValidationUtils.ValidateOperation(metadataDocumentUri, operation); - action.Throws(ErrorStrings.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported("http://www.example.com/foo#baz", metadataDocumentUri.AbsoluteUri)); + action.Throws(Error.Format(SRResources.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, "http://www.example.com/foo#baz", metadataDocumentUri.AbsoluteUri)); } [Fact] @@ -123,7 +123,7 @@ public void ValidateOperationShouldThrowWhenOperationMetadataIsOpenAndOperationT { ODataOperation operation = new ODataAction {Metadata = new Uri("http://www.example.com/foo#baz"), Target = new Uri("http://www.example.com")}; Action action = () => ODataJsonValidationUtils.ValidateOperation(metadataDocumentUri, operation); - action.Throws(ErrorStrings.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported("http://www.example.com/foo#baz", metadataDocumentUri.AbsoluteUri)); + action.Throws(Error.Format(SRResources.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, "http://www.example.com/foo#baz", metadataDocumentUri.AbsoluteUri)); } [Fact] @@ -137,7 +137,7 @@ public void ValidateOperationShouldNotThrowWhenOperationMetadataIsNotOpenAndOper public void ValidateOperationPropertyShouldThrowWhenPropertyValueIsNull() { Action action = () => ODataJsonValidationUtils.ValidateOperationPropertyValueIsNotNull(null, "target", "#action1"); - action.Throws(ErrorStrings.ODataJsonValidationUtils_OperationPropertyCannotBeNull("target", "#action1")); + action.Throws(Error.Format(SRResources.ODataJsonValidationUtils_OperationPropertyCannotBeNull, "target", "#action1")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerAsyncTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerAsyncTests.cs index 4e3b3567dc..bca346f51e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerAsyncTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerAsyncTests.cs @@ -9,10 +9,10 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -383,7 +383,7 @@ public async Task WriteCollectionValueAsync_ThrowsExceptionForOpenProperty_ForTy /* isOpenProperty */ true); })); - Assert.Equal(ODataErrorStrings.WriterValidationUtils_MissingTypeNameWithMetadata, exception.Message); + Assert.Equal(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata, exception.Message); } [Fact] @@ -407,7 +407,7 @@ public async Task WriteCollectionValueAsync_ThrowsExceptionForTopLevelProperty_F /* isOpenProperty */ false); })); - Assert.Equal(ODataErrorStrings.ODataJsonValueSerializer_MissingTypeNameOnCollection, exception.Message); + Assert.Equal(SRResources.ODataJsonValueSerializer_MissingTypeNameOnCollection, exception.Message); } [Fact] @@ -469,7 +469,7 @@ public async Task WriteUntypedValueAsync_ThrowsExceptionForRawValueNullOrEmpty() }); }); - Assert.Equal(ODataErrorStrings.ODataJsonValueSerializer_MissingRawValueOnUntyped, exception.Message); + Assert.Equal(SRResources.ODataJsonValueSerializer_MissingRawValueOnUntyped, exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerTests.cs index 73e0fffd12..c56b012946 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonValueSerializerTests.cs @@ -10,6 +10,7 @@ using System.IO; using System.Text; using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Json; @@ -44,7 +45,7 @@ public void WritingCollectionValueShouldFailWhenNoTypeSpecified() Action test = () => serializer.WriteCollectionValue(collectionValue, null, null, false, false, false); - test.Throws(Strings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); + test.Throws(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForCollectionValueInRequest); } [Fact] @@ -57,7 +58,7 @@ public void WritingCollectionValueDifferingFromExpectedTypeShouldFail() var stringCollectionTypeRef = EdmCoreModel.GetCollection(EdmCoreModel.Instance.GetString(true)); Action test = () => serializer.WriteCollectionValue(collectionValue, stringCollectionTypeRef, null, false, false, false); - test.Throws(Strings.ValidationUtils_IncompatibleType("Collection(Edm.Int32)", "Collection(Edm.String)")); + test.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "Collection(Edm.Int32)", "Collection(Edm.String)")); } [Fact] @@ -70,7 +71,7 @@ public void WritingCollectionValueDifferingFromExpectedTypeShouldFail_WithoutEdm var stringCollectionTypeRef = EdmCoreModel.GetCollection(EdmCoreModel.Instance.GetString(true)); Action test = () => serializer.WriteCollectionValue(collectionValue, stringCollectionTypeRef, null, false, false, false); - test.Throws(Strings.ValidationUtils_IncompatibleType("Collection(Edm.Int32)", "Collection(Edm.String)")); + test.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "Collection(Edm.Int32)", "Collection(Edm.String)")); } [Fact] @@ -102,7 +103,7 @@ public void WritingCollectionValueWithNullValueForNonNullableElementTypeShouldFa var stringCollectionTypeRef = EdmCoreModel.GetCollection(EdmCoreModel.Instance.GetInt32(false)); Action test = () => serializer.WriteCollectionValue(collectionValue, stringCollectionTypeRef, null, false, false, false); - test.Throws(Strings.ValidationUtils_NonNullableCollectionElementsMustNotBeNull); + test.Throws(SRResources.ValidationUtils_NonNullableCollectionElementsMustNotBeNull); } [Fact] @@ -114,7 +115,7 @@ public void WritingTypeDefinitionValueWithValueOfIncompatibleTypeShouldFail() Action test = () => serializer.WritePrimitiveValue("123", uint64); - test.Throws(Strings.ValidationUtils_IncompatiblePrimitiveItemType("Edm.String", true, "NS.UInt64", true)); + test.Throws(Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, "Edm.String", true, "NS.UInt64", true)); } [Fact] @@ -142,7 +143,7 @@ public void WritingResourceValueWithoutMetadataTypeAndWithoutTypeNameInRequestSh Action test = () => serializer.WriteResourceValue(resourceValue, null, false, null); - test.Throws(Strings.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); + test.Throws(SRResources.ODataJsonPropertyAndValueSerializer_NoExpectedTypeOrTypeNameSpecifiedForResourceValueRequest); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonWriterTests.cs index 66c57c996a..2629914b29 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ODataJsonWriterTests.cs @@ -1876,7 +1876,7 @@ public async Task WriteNestedResourceInfoAsync_ThrowsExceptionForNestedResourceI this.customerEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "NestedResourceInfo"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "NestedResourceInfo"), exception.Message); } @@ -1891,7 +1891,7 @@ public async Task WritePropertyInfoAsync_ThrowsExceptionForPropertyInfoAtTopLeve this.customerEntitySet, this.customerEntityType)); - Assert.Equal(Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "Property"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "Property"), exception.Message); } [Fact] @@ -1914,7 +1914,7 @@ public async Task WritePropertyInfoAsync_ThrowsExceptionForPriorWritePropertyOpe this.orderEntityType)); Assert.Equal( - Strings.ODataWriterCore_PropertyValueAlreadyWritten(stateProperty.Name), + Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, stateProperty.Name), exception.Message); } @@ -1937,7 +1937,7 @@ public async Task WritePropertyInfoAsync_ThrowsExceptionForDisallowedPropertyVal this.orderEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidStateTransition("Property", "Resource"), + Error.Format(SRResources.ODataWriterCore_InvalidStateTransition, "Property", "Resource"), exception.Message); } @@ -1953,7 +1953,7 @@ public async Task WriteTopLevelResourceSetAsync_ThrowsExceptionForWriterNotConfi this.customerEntityType, writingResourceSet: false)); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, exception.Message); } [Fact] @@ -1968,7 +1968,7 @@ public async Task WriteTopLevelResourceAsync_ThrowsExceptionForWriterConfiguredF this.customerEntityType, writingResourceSet: true)); - Assert.Equal(Strings.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_CannotWriteTopLevelResourceWithResourceSetWriter, exception.Message); } [Fact] @@ -1985,7 +1985,7 @@ public async Task WriteDeltaResourceSetAsync_ThrowsExceptionForWriterNotConfigur writingDelta: true)); Assert.Equal( - Strings.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, + SRResources.ODataWriterCore_CannotWriteTopLevelResourceSetWithResourceWriter, exception.Message); } @@ -2006,7 +2006,7 @@ public async Task WriteDeltaLinkAsync_ThrowsExceptionForWritedNotConfiguredForWr writingResourceSet: false, writingDelta: false)); - Assert.Equal(Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "DeltaLink"), + Assert.Equal(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "DeltaLink"), exception.Message); } @@ -2027,7 +2027,7 @@ public async Task WriteDeltaDeletedLinkAsync_ThrowsExceptionForWriterNotConfigur writingResourceSet: false, writingDelta: false)); - Assert.Equal(Strings.ODataWriterCore_InvalidTransitionFromStart("Start", "DeltaDeletedLink"), + Assert.Equal(Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromStart, "Start", "DeltaDeletedLink"), exception.Message); } @@ -2047,7 +2047,7 @@ public async Task WriteNestedResourceInfoAsync_ThrowsExceptionForParentResourceI this.customerEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromNullResource("Resource", "NestedResourceInfo"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromNullResource, "Resource", "NestedResourceInfo"), exception.Message); } @@ -2068,7 +2068,7 @@ public async Task WriteNestedResourceAsync_ThrowsExceptionForResourceNotNestedIn this.orderEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromResource("Resource", "Resource"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, "Resource", "Resource"), exception.Message); } @@ -2089,7 +2089,7 @@ public async Task WriteNestedResourceSetAsync_ThrowsExceptionForResourceSetNotNe this.customerEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromResource("Resource", "ResourceSet"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromResource, "Resource", "ResourceSet"), exception.Message); } @@ -2118,7 +2118,7 @@ public async Task WriteNestedDeletedResourceAsync_ThrowsException(DeltaDeletedEn writingDelta: true)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeletedResource"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeletedResource"), exception.Message); } @@ -2141,7 +2141,7 @@ public async Task WriteDeletedResourceAsync_ThrowsExceptionWhenWrittenWithinType writingDelta: true)); Assert.Equal( - Strings.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, + SRResources.ODataWriterCore_CannotWriteDeltaWithResourceSetWriter, exception.Message); } @@ -2166,7 +2166,7 @@ public async Task WriteNestedDeltaResourceSetAsync_ThrowsException() writingDelta: true)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromExpandedLink("NestedResourceInfoWithContent", "DeltaResourceSet"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromExpandedLink, "NestedResourceInfoWithContent", "DeltaResourceSet"), exception.Message); } @@ -2186,7 +2186,7 @@ public async Task WriteRequestPayloadAsync_ThrowsExceptionForCountInResourceSet( writingParameter: false, writingRequest: true)); - Assert.Equal(Strings.ODataWriterCore_QueryCountInRequest, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryCountInRequest, exception.Message); } [Fact] @@ -2205,7 +2205,7 @@ public async Task WriteRequestPayloadAsync_ThrowsExceptionForNextPageLinkInDelta writingParameter: false, writingRequest: true)); - Assert.Equal(Strings.ODataWriterCore_QueryNextLinkInRequest, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryNextLinkInRequest, exception.Message); } [Fact] @@ -2224,7 +2224,7 @@ public async Task WriteRequestPayloadAsync_ThrowsExceptionForDeltaLinkInDeltaRes writingParameter: false, writingRequest: true)); - Assert.Equal(Strings.ODataWriterCore_QueryDeltaLinkInRequest, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_QueryDeltaLinkInRequest, exception.Message); } [Fact] @@ -2252,7 +2252,7 @@ public async Task WriteRequestPayloadAsync_ThrowsExceptionForDeferredNestedResou writingParameter: false, writingRequest: true)); - Assert.Equal(Strings.ODataWriterCore_DeferredLinkInRequest, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_DeferredLinkInRequest, exception.Message); } [Fact] @@ -2274,7 +2274,7 @@ public async Task WriteStartAsync_ThrowsExceptionForWriterInCompletedState() this.customerEntityType)); Assert.Equal( - Strings.ODataWriterCore_InvalidTransitionFromCompleted("Completed", "Resource"), + Error.Format(SRResources.ODataWriterCore_InvalidTransitionFromCompleted, "Completed", "Resource"), exception.Message); } @@ -2296,7 +2296,7 @@ public async Task WriteEndAsync_ThrowsExceptionForWriterInCompletedState() this.customerEntitySet, this.customerEntityType)); - Assert.Equal(Strings.ODataWriterCore_WriteEndCalledInInvalidState("Completed"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataWriterCore_WriteEndCalledInInvalidState, "Completed"), exception.Message); } [Fact] @@ -2331,7 +2331,7 @@ public async Task WriteEndAsync_ThrowsExceptionForBinaryStreamNotDisposed() this.orderEntitySet, this.orderEntityType)); - Assert.Equal(Strings.ODataWriterCore_StreamNotDisposed, exception.Message); + Assert.Equal(SRResources.ODataWriterCore_StreamNotDisposed, exception.Message); } #endregion Exception Cases diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/PooledByteBufferWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/PooledByteBufferWriterTests.cs index 95399d54bb..f088bb1774 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/PooledByteBufferWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/PooledByteBufferWriterTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; @@ -127,7 +128,7 @@ public void GetSpan_ThrowsExceptionIfExceedsMaxBufferSize() Action action = () => bufferWriter.GetSpan(PooledByteBufferWriter.MaximumBufferSize); int newSize = initialBufferSize + PooledByteBufferWriter.MaximumBufferSize; - action.Throws(Strings.ODataMessageWriter_Buffer_Maximum_Size_Exceeded(newSize)); + action.Throws(Error.Format(SRResources.ODataMessageWriter_Buffer_Maximum_Size_Exceeded, newSize)); } [Fact] @@ -138,7 +139,7 @@ public void GetMemory_ThrowsExceptionIfExceedsMaxBufferSize() Action action = () => bufferWriter.GetMemory(PooledByteBufferWriter.MaximumBufferSize); int newSize = initialBufferSize + PooledByteBufferWriter.MaximumBufferSize; - action.Throws(Strings.ODataMessageWriter_Buffer_Maximum_Size_Exceeded(newSize)); + action.Throws(Error.Format(SRResources.ODataMessageWriter_Buffer_Maximum_Size_Exceeded, newSize)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ReorderingJsonReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ReorderingJsonReaderTests.cs index d0da89255d..3d4405b317 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ReorderingJsonReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Json/ReorderingJsonReaderTests.cs @@ -7,9 +7,9 @@ using System; using System.IO; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Json { @@ -489,7 +489,7 @@ public async Task CreateReadStreamAsync_ThrowsExceptionForInvalidBinaryFormat() })); Assert.Equal( - ErrorStrings.JsonReader_InvalidBinaryFormat("AQIDBAUGBwgJAA"), + Error.Format(SRResources.JsonReader_InvalidBinaryFormat, "AQIDBAUGBwgJAA"), exception.Message); } @@ -504,7 +504,7 @@ public async Task CreateTextStreamAsync_ThrowsExceptionForReaderNotOnPropertyNod (reorderingReader) => reorderingReader.CreateTextReaderAsync())); Assert.Equal( - ErrorStrings.JsonReader_CannotCreateTextReader, + SRResources.JsonReader_CannotCreateTextReader, exception.Message); } @@ -523,7 +523,7 @@ public async Task ReadReorderedPayloadAsync_ThrowsExceptionForInvalidInstanceAnn })); Assert.Equal( - ErrorStrings.JsonReaderExtensions_UnexpectedInstanceAnnotationName("invalid.annotation"), + Error.Format(SRResources.JsonReaderExtensions_UnexpectedInstanceAnnotationName, "invalid.annotation"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/MediaTypeUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/MediaTypeUtilsTests.cs index be2ecbd055..3db12e7211 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/MediaTypeUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/MediaTypeUtilsTests.cs @@ -4,11 +4,11 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Linq; using System.Text; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -392,7 +392,7 @@ public void AlterContentTypeForJsonPaddingIfNeededShouldThrowIfAtom() { const string original = "application/atom+xml"; Action target = () => MediaTypeUtils.AlterContentTypeForJsonPadding(original); - target.Throws(Strings.ODataMessageWriter_JsonPaddingOnInvalidContentType("application/atom+xml")); + target.Throws(Error.Format(SRResources.ODataMessageWriter_JsonPaddingOnInvalidContentType, "application/atom+xml")); } [Fact] @@ -432,7 +432,7 @@ public void AlterContentTypeForJsonPaddingIfNeededShouldFailIfAppJsonIsNotAtStar { const string original = "tricky/application/json"; Action target = () => MediaTypeUtils.AlterContentTypeForJsonPadding(original); - target.Throws(Strings.ODataMessageWriter_JsonPaddingOnInvalidContentType("tricky/application/json")); + target.Throws(Error.Format(SRResources.ODataMessageWriter_JsonPaddingOnInvalidContentType, "tricky/application/json")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/NavigationPropertyOnComplexTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/NavigationPropertyOnComplexTests.cs index e2bef36d5f..109e2541ae 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/NavigationPropertyOnComplexTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/NavigationPropertyOnComplexTests.cs @@ -13,6 +13,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Tests.UriParser; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { @@ -71,7 +72,7 @@ public void ParseNavOnComplex() uri = new Uri(@"http://host/People('abc')/Addresses/City"); Action parse = () => new ODataUriParser(Model, ServiceRoot, uri).ParsePath().ToList(); - parse.Throws(Strings.RequestUriProcessor_CannotQueryCollections("Addresses")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, "Addresses")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousReaderTests.cs index dd0167a2dd..74ed79d2ee 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousReaderTests.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -72,7 +73,7 @@ public void CallCreateResponseMessageMoreThanOnceShouldFail() var asyncReader = this.CreateAsyncReader(payload); asyncReader.CreateResponseMessage(); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_UnexpectedEndOfInput); + test.Throws(SRResources.ODataAsyncReader_UnexpectedEndOfInput); } [Fact] @@ -81,7 +82,7 @@ public void ReadingIncompleteResponseMessageShouldFail() string payload = "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nOData-Version: 4.0\r\n"; var asyncReader = this.CreateAsyncReader(payload); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_UnexpectedEndOfInput); + test.Throws(SRResources.ODataAsyncReader_UnexpectedEndOfInput); } [Fact] @@ -90,7 +91,7 @@ public void ReadingBadStatusCodeShouldFail() string payload = "HTTP/1.1 200.1 OK\r\nContent-Type: application/json\r\nOData-Version: 4.0\r\n\r\n{\"@odata.context\":\"http://host/service/$metadata#MySingleton\",\"Id\":1}"; var asyncReader = this.CreateAsyncReader(payload); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_NonIntegerHttpStatusCode("200.1")); + test.Throws(Error.Format(SRResources.ODataAsyncReader_NonIntegerHttpStatusCode, "200.1")); } [Fact] @@ -99,7 +100,7 @@ public void ReadingBadNewLineShouldFail() string payload = "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nOData-Version: 4.0\r\n\n{\"@odata.context\":\"http://host/service/$metadata#MySingleton\",\"Id\":1}"; var asyncReader = this.CreateAsyncReader(payload); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_InvalidNewLineEncountered('\n')); + test.Throws(Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, '\n')); } [Fact] @@ -108,7 +109,7 @@ public void ReadingBadHttpVersionShouldFail() string payload = "HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nOData-Version: 4.0\r\n\r\n{\"@odata.context\":\"http://host/service/$metadata#MySingleton\",\"Id\":1}"; var asyncReader = this.CreateAsyncReader(payload); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_InvalidHttpVersionSpecified("HTTP/1.0", ODataConstants.HttpVersionInAsync)); + test.Throws(Error.Format(SRResources.ODataAsyncReader_InvalidHttpVersionSpecified, "HTTP/1.0", ODataConstants.HttpVersionInAsync)); } [Fact] @@ -117,7 +118,7 @@ public void ReadingBadResponseLineVersionShouldFail() string payload = "HTTP/1.1 200OK\r\nContent-Type: application/json\r\nOData-Version: 4.0\r\n\r\n{\"@odata.context\":\"http://host/service/$metadata#MySingleton\",\"Id\":1}"; var asyncReader = this.CreateAsyncReader(payload); Action test = () => asyncReader.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncReader_InvalidResponseLine("HTTP/1.1 200OK")); + test.Throws(Error.Format(SRResources.ODataAsyncReader_InvalidResponseLine, "HTTP/1.1 200OK")); } private ODataAsynchronousReader CreateAsyncReader(string payload) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousWriterTests.cs index d58861a69b..b6623a4cbb 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataAsynchronousWriterTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -67,7 +68,7 @@ public void CallCreateResponseMessageMoreThanOnceShouldFail() var asyncWriter = this.TestInit(); asyncWriter.CreateResponseMessage(); Action test = () => asyncWriter.CreateResponseMessage(); - test.Throws(Strings.ODataAsyncWriter_CannotCreateResponseMoreThanOnce); + test.Throws(SRResources.ODataAsyncWriter_CannotCreateResponseMoreThanOnce); } [Fact] @@ -125,7 +126,7 @@ public async Task CreateResponseMessageAsync_ThrowsExceptionForMultipleInvocatio await asynchronousWriter.CreateResponseMessageAsync(); })); - Assert.Equal(Strings.ODataAsyncWriter_CannotCreateResponseMoreThanOnce, exception.Message); + Assert.Equal(SRResources.ODataAsyncWriter_CannotCreateResponseMoreThanOnce, exception.Message); } [Fact] @@ -135,7 +136,7 @@ public async Task OnInStreamErrorAsync_ThrowsException() () => SetupAsynchronousWriterAndRunTestAsync( (asynchronousWriter) => ((IODataOutputInStreamErrorListener)asynchronousWriter).OnInStreamErrorAsync())); - Assert.Equal(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, exception.Message); + Assert.Equal(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, exception.Message); } private ODataAsynchronousWriter TestInit() diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataBatchReaderStreamTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataBatchReaderStreamTests.cs index cbffdcb01a..ae89bb93e1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataBatchReaderStreamTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataBatchReaderStreamTests.cs @@ -8,9 +8,9 @@ using System.Collections.Generic; using System.IO; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.MultipartMixed; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -20,7 +20,7 @@ public class ODataBatchReaderStreamTests public void ReadFirstNonEmptyLineShouldThrowOnEndOfInput() { Action readAtEndOfInput = () => CreateBatchReaderStream("").ReadFirstNonEmptyLine(); - readAtEndOfInput.Throws(ErrorStrings.ODataBatchReaderStream_UnexpectedEndOfInput); + readAtEndOfInput.Throws(SRResources.ODataBatchReaderStream_UnexpectedEndOfInput); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataCollectionStartSerializationInfoTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataCollectionStartSerializationInfoTests.cs index 3d6be94a5c..7a0bde2f4f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataCollectionStartSerializationInfoTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataCollectionStartSerializationInfoTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -42,7 +43,7 @@ public void SettingEmptyCollectionTypeNameShouldThrow() public void SettingTypeNameWithoutCollectionWrapperToCollectionTypeNameShouldThrow() { Action action = () => this.testSubject.CollectionTypeName = "Edm.String"; - action.Throws(Strings.ValidationUtils_InvalidCollectionTypeName("Edm.String")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidCollectionTypeName, "Edm.String")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataContextUriBuilderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataContextUriBuilderTests.cs index f42343a187..22bbb87dda 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataContextUriBuilderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataContextUriBuilderTests.cs @@ -12,6 +12,7 @@ using Microsoft.OData.Edm; using Microsoft.Spatial; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { @@ -49,7 +50,7 @@ public ODataContextUriBuilderTests() public void BuildContextUrlforUnsupportedPayloadKindShouldThrowException() { Action action = () => this.responseContextUriBuilder.BuildContextUri(ODataPayloadKind.MetadataDocument); - action.Throws(Strings.ODataContextUriBuilder_UnsupportedPayloadKind(ODataPayloadKind.MetadataDocument.ToString())); + action.Throws(Error.Format(SRResources.ODataContextUriBuilder_UnsupportedPayloadKind, ODataPayloadKind.MetadataDocument.ToString())); } [Fact] @@ -62,7 +63,7 @@ public void WriteServiceDocumentUri() public void ShouldRequireMetadataDocumentUriInResponses() { Action action = () => ODataContextUriBuilder.Create(null, true); - action.Throws(Strings.ODataOutputContext_MetadataDocumentUriMissing); + action.Throws(SRResources.ODataOutputContext_MetadataDocumentUriMissing); } #region context uri with $select and $expand @@ -398,7 +399,7 @@ public void ShouldThrowIfEntitySetAndTypeInfoIsMissingWithoutSerializationInfoOn foreach (ODataVersion version in Versions) { Action test = () => this.CreateFeedContextUri(ResponseTypeContextWithoutTypeInfo, version); - test.Throws(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + test.Throws(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); } } @@ -459,7 +460,7 @@ public void ShouldThrowIfEntitySetAndTypeInfoIsMissingOnEntryResponse() foreach (ODataVersion version in Versions) { Action test = () => this.CreateEntryContextUri(ResponseTypeContextWithoutTypeInfo, version); - test.Throws(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + test.Throws(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); } } @@ -657,7 +658,7 @@ public void BuildPropertyContextUriForCollectionPropertyValueWithNoNameShouldFai foreach (ODataVersion version in Versions) { Action withStream = () => this.CreatePropertyContextUri(new ODataCollectionValue(), version); - withStream.Throws(Strings.ODataContextUriBuilder_TypeNameMissingForProperty); + withStream.Throws(SRResources.ODataContextUriBuilder_TypeNameMissingForProperty); } } @@ -667,7 +668,7 @@ public void BuildPropertyContextUriForStreamValueShouldFail() foreach (ODataVersion version in Versions) { Action withStream = () => this.CreatePropertyContextUri(new ODataStreamReferenceValue(), version); - withStream.Throws(Strings.ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource); + withStream.Throws(SRResources.ODataContextUriBuilder_StreamValueMustBePropertiesOfODataResource); } } #endregion value context uri @@ -690,7 +691,7 @@ public void CollectionSerializationInfoShouldOverrideEdmMetadata() public void ShouldThrowIfTypeNameIsMissingOnCollectionResponse() { Action action = () => Assert.Equal(this.CreateCollectionContextUri(serializationInfo: null, itemTypeReference: null).OriginalString, BuildExpectedContextUri("#Collection(Edm.Guid)")); - action.Throws(Strings.ODataContextUriBuilder_TypeNameMissingForTopLevelCollection); + action.Throws(SRResources.ODataContextUriBuilder_TypeNameMissingForTopLevelCollection); } #endregion collection context uri diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinkTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinkTests.cs index 5f839a03ca..d41657646a 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinkTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinkTests.cs @@ -10,10 +10,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -120,7 +120,7 @@ public void ReadForEntityReferenceLinkIDAppearBeforeContextShouldThrow() { var deserializer = this.CreateJsonEntryAndFeedDeserializer("{\"@odata.id\":\"http://host/Customers(1)\",\"@odata.context\":\"http://odata.org/test/$metadata#$ref\",\"@TestNamespace.unknown\":123,\"@custom.annotation\":456}"); Action readResult = () => deserializer.ReadEntityReferenceLink(); - readResult.Throws(ODataErrorStrings.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); + readResult.Throws(SRResources.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); } [Fact] @@ -129,7 +129,7 @@ public void ReadForEntityReferenceLinkWithoutIDButAnnotationShouldThrow() string payload = "{\"@odata.context\":\"http://odata.org/test/$metadata#$ref\",\"@odataa.unknown\":123}"; var deserializer = this.CreateJsonEntryAndFeedDeserializer(payload); Action readResult = () => deserializer.ReadEntityReferenceLink(); - readResult.Throws(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + readResult.Throws(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } [Fact] @@ -138,7 +138,7 @@ public void ReadForEntityReferenceLinkOnlyContextShouldThrow() string payload = "{\"@odata.context\":\"http://odata.org/test/$metadata#$ref\"}"; var deserializer = this.CreateJsonEntryAndFeedDeserializer(payload); Action readResult = () => deserializer.ReadEntityReferenceLink(); - readResult.Throws(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + readResult.Throws(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } [Fact] @@ -147,7 +147,7 @@ public void ReadForEntityReferenceLinkWithEmptyPayloadShouldThrow() string payload = "{}"; var deserializer = this.CreateJsonEntryAndFeedDeserializer(payload); Action readResult = () => deserializer.ReadEntityReferenceLink(); - readResult.Throws(ODataErrorStrings.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); + readResult.Throws(SRResources.ODataJsonDeserializer_ContextLinkNotFoundAsFirstProperty); } [Fact] @@ -156,7 +156,7 @@ public void ReadForEntityReferenceLinkAnnotationAppearBeforeIDShouldThrow() string payload = "{\"@odata.context\":\"http://odata.org/test/$metadata#$ref\",\"@TestNamespace.unknown\":123,\"@odata.id\":\"http://host/Customers(1)\",\"@custom.annotation\":456}"; var deserializer = this.CreateJsonEntryAndFeedDeserializer(payload); Action readResult = () => deserializer.ReadEntityReferenceLink(); - readResult.Throws(ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty(ODataAnnotationNames.ODataId)); + readResult.Throws(Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, ODataAnnotationNames.ODataId)); } [Fact] @@ -179,9 +179,9 @@ public void WriteForEntityReferenceLinkWithDuplicateAnnotationNameShouldThrow() referencelink.InstanceAnnotations.Add(new ODataInstanceAnnotation("TestNamespace.unknown", new ODataPrimitiveValue(456))); string expectedPayload = "{\"@odata.context\":\"http://odata.org/test/$metadata#$ref\",\"@odata.id\":\"http://host/Customers(1)\",\"@TestNamespace.unknown\":123,\"@TestNamespace.unknown\":456}"; Action writeResult = () => WriteAndValidate(referencelink, expectedPayload, writingResponse: false); - writeResult.Throws(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("TestNamespace.unknown")); + writeResult.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "TestNamespace.unknown")); writeResult = () => WriteAndValidate(referencelink, expectedPayload, writingResponse: true); - writeResult.Throws(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("TestNamespace.unknown")); + writeResult.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "TestNamespace.unknown")); } [Fact] @@ -242,7 +242,7 @@ public void ReadEntityReferenceLinks_ThrowsExceptionForInvalidPropertyAnnotation () => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinks()); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks("value"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks, "value"), exception.Message); } } @@ -266,7 +266,7 @@ public void ReadEntityReferenceLink_ThrowsExceptionForInvalidPropertyOrAnnotatio () => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLink()); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink("UnexpectedProp"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink, "UnexpectedProp"), exception.Message); } } @@ -382,7 +382,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForUnexpectedODat (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties("odata.deltaLink"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedAnnotationProperties, "odata.deltaLink"), exception.Message); } @@ -398,7 +398,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForUnexpectedProp (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound("UnexpectedProp", "value"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidEntityReferenceLinksPropertyFound, "UnexpectedProp", "value"), exception.Message); } @@ -414,7 +414,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForUnsupportedODa (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks, + SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLinks, exception.Message); } @@ -429,7 +429,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForExpectedEntity (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound("value"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_ExpectedEntityReferenceLinksPropertyNotFound, "value"), exception.Message); } @@ -445,7 +445,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForMetadataRefere (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.Top2Orders"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.Top2Orders"), exception.Message); } @@ -461,7 +461,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForInvalidPropert (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks("value"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyAnnotationInEntityReferenceLinks, "value"), exception.Message); } @@ -477,7 +477,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForEntityReferenc (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue("PrimitiveValue"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkMustBeObjectValue, "PrimitiveValue"), exception.Message); } @@ -493,7 +493,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForMultipleRefere (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink("odata.id"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MultipleUriPropertiesInEntityReferenceLink, "odata.id"), exception.Message); } @@ -509,7 +509,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForUnexpectedODat (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink("odata.nextLink", "odata.id"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidPropertyInEntityReferenceLink, "odata.nextLink", "odata.id"), exception.Message); } @@ -525,7 +525,7 @@ public async Task ReadEntityReferenceLinksAsync_ThrowsExceptionForEntityReferenc (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinksAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull("odata.id"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_EntityReferenceLinkUrlCannotBeNull, "odata.id"), exception.Message); } @@ -542,7 +542,7 @@ public async Task ReadEntityReferenceLinkAsync_ThrowsExceptionForCustomAnnotatio (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinkAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty("odata.id"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, "odata.id"), exception.Message); } @@ -561,7 +561,7 @@ public async Task ReadEntityReferenceLinkAsync_ThrowsExceptionForInvalidProperty (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinkAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink("UnexpectedProp"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_InvalidAnnotationInEntityReferenceLink, "UnexpectedProp"), exception.Message); } @@ -577,7 +577,7 @@ public async Task ReadEntityReferenceLinkAsync_ThrowsExceptionForUnexpectedMetad (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinkAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty("#NS.Top2Orders"), + Error.Format(SRResources.ODataJsonPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty, "#NS.Top2Orders"), exception.Message); } @@ -592,7 +592,7 @@ public async Task ReadEntityReferenceLinkAsync_ThrowsExceptionForMissingEntityRe (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinkAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty("odata.id"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_MissingEntityReferenceLinkProperty, "odata.id"), exception.Message); } @@ -608,7 +608,7 @@ public async Task ReadEntityReferenceLinkAsync_ThrowsExceptionForUnsupportedODat (jsonEntityReferenceLinkDeserializer) => jsonEntityReferenceLinkDeserializer.ReadEntityReferenceLinkAsync())); Assert.Equal( - ODataErrorStrings.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink("odata.type"), + Error.Format(SRResources.ODataJsonEntityReferenceLinkDeserializer_PropertyAnnotationForEntityReferenceLink, "odata.type"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinksTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinksTests.cs index 0feeb8bb94..a3f6299b0f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinksTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataEntityReferenceLinksTests.cs @@ -12,7 +12,7 @@ using Microsoft.OData.Json; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { @@ -249,9 +249,9 @@ public void WriteForEntityReferenceLinksWithDuplicateAnnotationNameShouldThrow() referencelinks.InstanceAnnotations.Add(new ODataInstanceAnnotation("TestNamespace.name", new ODataPrimitiveValue(654))); string expectedPayload = "{\"@odata.context\":\"http://odata.org/test/$metadata#Collection($ref)\",\"@TestNamespace.name\":321,\"@TestNamespace.name\":654,\"value\":[{\"@odata.id\":\"http://host/Customers(1)\",\"@Is.New\":true},{\"@odata.id\":\"http://host/Customers(2)\",\"@TestNamespace.unknown\":123,\"@custom.annotation\":456}]}"; Action writeResult = () => WriteAndValidate(referencelinks, expectedPayload, writingResponse: false); - writeResult.Throws(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("TestNamespace.name")); + writeResult.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "TestNamespace.name")); writeResult = () => WriteAndValidate(referencelinks, expectedPayload, writingResponse: true); - writeResult.Throws(ODataErrorStrings.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection("TestNamespace.name")); + writeResult.Throws(Error.Format(SRResources.JsonInstanceAnnotationWriter_DuplicateAnnotationNameInCollection, "TestNamespace.name")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataFeedTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataFeedTests.cs index 6327fdd7ad..51fe00eba8 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataFeedTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataFeedTests.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -70,7 +71,7 @@ public void SettingDeltaLinkWhenNextPageLinkIsAlreadySetShouldThrow() { this.odataFeed.NextPageLink = new Uri("http://www.example.com/nextPageLink"); Action test = () => this.odataFeed.DeltaLink = new Uri("http://www.example.com/deltaLink"); - test.Throws(Strings.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); + test.Throws(SRResources.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); } [Fact] @@ -78,7 +79,7 @@ public void SettingNextPageLinkWhenDeltaLinkIsAlreadySetShouldThrow() { this.odataFeed.DeltaLink = new Uri("http://www.example.com/deltaLink"); Action test = () => this.odataFeed.NextPageLink = new Uri("http://www.example.com/nextPageLink"); - test.Throws(Strings.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); + test.Throws(SRResources.ODataResourceSet_MustNotContainBothNextPageLinkAndDeltaLink); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataInstanceAnnotationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataInstanceAnnotationTests.cs index 151c75d1a0..6eea3adc87 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataInstanceAnnotationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataInstanceAnnotationTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -27,7 +28,7 @@ public void InstanceAnnotationNameWithoutPeriodInTheMiddleShouldThrowArgumentExc foreach (string name in new[] { "foo", ".foo", "foo." }) { Action test = () => new ODataInstanceAnnotation(name, new ODataPrimitiveValue("value")); - test.Throws(Strings.ODataInstanceAnnotation_NeedPeriodInName(name)); + test.Throws(Error.Format(SRResources.ODataInstanceAnnotation_NeedPeriodInName, name)); } } @@ -37,7 +38,7 @@ public void AtInInstanceAnnotationNameShouldThrowArgumentException() foreach (string name in new[] { "@foo.bar", "foo.b@ar", "foo.bar@" }) { Action test = () => new ODataInstanceAnnotation(name, new ODataPrimitiveValue("value")); - test.Throws(Strings.ODataInstanceAnnotation_BadTermName(name)); + test.Throws(Error.Format(SRResources.ODataInstanceAnnotation_BadTermName, name)); } } @@ -47,7 +48,7 @@ public void HashInInstanceAnnotationNameShouldThrowArgumentException() foreach (string name in new[] { "#foo.bar", "foo.b#ar", "foo.bar#" }) { Action test = () => new ODataInstanceAnnotation(name, new ODataPrimitiveValue("value")); - test.Throws(Strings.ODataInstanceAnnotation_BadTermName(name)); + test.Throws(Error.Format(SRResources.ODataInstanceAnnotation_BadTermName, name)); } } @@ -56,7 +57,7 @@ public void ReservedNameAsInstanceAnnotationNameShouldThrowArgumentException() { const string annotationName = "odata.unknown"; Action add = () => new ODataInstanceAnnotation(annotationName, new ODataPrimitiveValue("value")); - add.Throws(Strings.ODataInstanceAnnotation_ReservedNamesNotAllowed(annotationName, "odata.")); + add.Throws(Error.Format(SRResources.ODataInstanceAnnotation_ReservedNamesNotAllowed, annotationName, "odata.")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderSettingsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderSettingsTests.cs index 682a522c8e..64e737aef4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderSettingsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderSettingsTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -190,25 +191,25 @@ public void ODataMessageReaderSettingsErrorTest() { // MaxPartsPerBatch Action test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxPartsPerBatch = -1 } }; - test.Throws(Strings.ExceptionUtils_CheckIntegerNotNegative("-1") + " (Parameter 'MaxPartsPerBatch')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckIntegerNotNegative, "-1") + " (Parameter 'MaxPartsPerBatch')"); // MaxOperationsPerChangeset test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxOperationsPerChangeset = -1 } }; - test.Throws(Strings.ExceptionUtils_CheckIntegerNotNegative("-1") + " (Parameter 'MaxOperationsPerChangeset')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckIntegerNotNegative, "-1") + " (Parameter 'MaxOperationsPerChangeset')"); // MaxNestingDepth test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxNestingDepth = -1 } }; - test.Throws(Strings.ExceptionUtils_CheckIntegerPositive("-1") + " (Parameter 'MaxNestingDepth')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckIntegerPositive, "-1") + " (Parameter 'MaxNestingDepth')"); test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxNestingDepth = 0 } }; - test.Throws(Strings.ExceptionUtils_CheckIntegerPositive("0") + " (Parameter 'MaxNestingDepth')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckIntegerPositive, "0") + " (Parameter 'MaxNestingDepth')"); // MaxMessageSize test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxReceivedMessageSize = -1 } }; - test.Throws(Strings.ExceptionUtils_CheckLongPositive("-1") + " (Parameter 'MaxReceivedMessageSize')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckLongPositive, "-1") + " (Parameter 'MaxReceivedMessageSize')"); test = () => new ODataMessageReaderSettings() { MessageQuotas = new ODataMessageQuotas() { MaxReceivedMessageSize = 0 } }; - test.Throws(Strings.ExceptionUtils_CheckLongPositive("0") + " (Parameter 'MaxReceivedMessageSize')"); + test.Throws(Error.Format(SRResources.ExceptionUtils_CheckLongPositive, "0") + " (Parameter 'MaxReceivedMessageSize')"); } private void CompareMessageReaderSettings(ODataMessageReaderSettings expected, ODataMessageReaderSettings actual) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderTests.cs index 317be44b68..24893f0f52 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageReaderTests.cs @@ -124,7 +124,7 @@ public void ErrorLocationReportedByMessageReaderForBadEdmxShouldBeAbsolute() ODataMessageReader reader = new ODataMessageReader(responseMessage, new ODataMessageReaderSettings(), new EdmModel()); const string expectedErrorMessage = - "The metadata document could not be read from the message content.\r\n" + + "The metadata document could not be read from the message content." + "UnexpectedXmlElement : The schema element 'Invalid' was not expected in the given context. : (6, 8)\r\n"; Action test = () => reader.ReadMetadataDocument(); @@ -152,7 +152,7 @@ public void ErrorLocationReportedByMessageReaderForBadEdmxOfSingleLineShouldBeAb ODataMessageReader reader = new ODataMessageReader(responseMessage, new ODataMessageReaderSettings(), new EdmModel()); const string expectedErrorMessage = - "The metadata document could not be read from the message content.\r\n" + + "The metadata document could not be read from the message content." + "UnexpectedXmlElement : The schema element 'Invalid' was not expected in the given context. : (1, 250)\r\n"; Action test = () => reader.ReadMetadataDocument(); diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterSettingsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterSettingsTests.cs index 34c6722b90..db29a324fe 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterSettingsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterSettingsTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { @@ -492,7 +492,7 @@ public void MaxPartsPerBatchShouldThrowIfSetToNegativeNumber() { Action testSubject = () => this.settings.MessageQuotas.MaxPartsPerBatch = -1; var exception = Assert.Throws(testSubject); - Assert.StartsWith(ODataErrorStrings.ExceptionUtils_CheckIntegerNotNegative(-1), exception.Message); + Assert.StartsWith(Error.Format(SRResources.ExceptionUtils_CheckIntegerNotNegative, -1), exception.Message); } [Fact] @@ -500,7 +500,7 @@ public void MaxOperationsPerChangesetShouldThrowIfSetToNegativeNumber() { Action testSubject = () => this.settings.MessageQuotas.MaxOperationsPerChangeset = -1; var exception = Assert.Throws(testSubject); - Assert.StartsWith(ODataErrorStrings.ExceptionUtils_CheckIntegerNotNegative(-1), exception.Message); + Assert.StartsWith(Error.Format(SRResources.ExceptionUtils_CheckIntegerNotNegative, -1), exception.Message); } [Fact] @@ -508,7 +508,7 @@ public void MaxNestingDepthShouldThrowIfSetToNonPositiveNumber() { Action testSubject = () => this.settings.MessageQuotas.MaxNestingDepth = 0; var exception = Assert.Throws(testSubject); - Assert.StartsWith(ODataErrorStrings.ExceptionUtils_CheckIntegerPositive(0), exception.Message); + Assert.StartsWith(Error.Format(SRResources.ExceptionUtils_CheckIntegerPositive, 0), exception.Message); } #endregion Error tests diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterTests.cs index 301e72a7d2..489ac46852 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMessageWriterTests.cs @@ -18,6 +18,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm.Csdl; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { @@ -32,7 +33,7 @@ public void ConstructorWithRequestMessageAndJsonPaddingSettingEnabledFails() { ODataMessageWriterSettings settings = new ODataMessageWriterSettings { JsonPCallback = "functionName" }; Action constructorCall = () => new ODataMessageWriter(new DummyRequestMessage(), settings); - constructorCall.Throws(Strings.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage); + constructorCall.Throws(SRResources.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage); } [Fact] @@ -50,7 +51,7 @@ public void CreateCollectionWriterWithEntityCollectionTypeShouldFail() var writer = new ODataMessageWriter(new DummyRequestMessage()); var entityElementType = new EdmEntityTypeReference(new EdmEntityType("Fake", "Fake"), true); Action createWriterWithEntityCollectionType = () => writer.CreateODataCollectionWriter(entityElementType); - createWriterWithEntityCollectionType.Throws(Strings.ODataMessageWriter_NonCollectionType("Fake.Fake")); + createWriterWithEntityCollectionType.Throws(Error.Format(SRResources.ODataMessageWriter_NonCollectionType, "Fake.Fake")); } [Fact] @@ -285,7 +286,7 @@ public void WhenInjectingODataUtf8JsonWriterFactory_ThrowException_IfFactoryRetu Value = "This is a test ия" }); - writePropertyAction.Throws(Strings.ODataMessageWriter_JsonWriterFactory_ReturnedNull(false, Encoding.UTF8.WebName)); + writePropertyAction.Throws(Error.Format(SRResources.ODataMessageWriter_JsonWriterFactory_ReturnedNull, false, Encoding.UTF8.WebName)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchOutputContextApiTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchOutputContextApiTests.cs index f32cab5c10..10505652a4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchOutputContextApiTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchOutputContextApiTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text.RegularExpressions; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -948,8 +949,8 @@ public async Task WriteMultipartMixedBatchRequestWithChangeset_APIsYieldSameResu } })); - Assert.Equal(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound("Content-ID"), asyncException.Message); - Assert.Equal(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound("Content-ID"), syncException.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, "Content-ID"), asyncException.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, "Content-ID"), syncException.Message); } [Fact] @@ -995,8 +996,8 @@ public async Task WriteMultipartMixedBatchRequest_APIsYieldSameResultForDependsO } })); - Assert.Equal(Strings.ODataBatchReader_DependsOnIdNotFound(3, 2), asyncException.Message); - Assert.Equal(Strings.ODataBatchReader_DependsOnIdNotFound(3, 2), syncException.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, 3, 2), asyncException.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, 3, 2), syncException.Message); } [Fact] @@ -1027,8 +1028,8 @@ public async Task OnInStreamError_APIsYieldSameResult() } })); - Assert.Equal(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch, asyncException.Message); - Assert.Equal(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch, syncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch, asyncException.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch, syncException.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchWriterTests.cs index 4a30c08150..56b66044ae 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataMultipartMixedBatchWriterTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.MultipartMixed; using Xunit; @@ -639,7 +640,7 @@ public async Task WriteMultipartMixedBatchRequestWithChangesetAsync_ThrowsExcept // Try to create operation request message with null content id })); - Assert.Equal(Strings.ODataBatchOperationHeaderDictionary_KeyNotFound(ODataConstants.ContentIdHeader), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchOperationHeaderDictionary_KeyNotFound, ODataConstants.ContentIdHeader), exception.Message); } [Fact] @@ -661,7 +662,7 @@ public async Task WriteMultipartMixedBatchRequestAsync_ThrowsExceptionForDepends "POST", new Uri($"{ServiceUri}/Orders"), "2", BatchPayloadUriOption.AbsoluteUri, dependsOnIds); })); - Assert.Equal(Strings.ODataBatchReader_DependsOnIdNotFound("3", "2"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "3", "2"), exception.Message); } [Fact] @@ -671,7 +672,7 @@ public async Task OnInStreamErrorAsync_ThrowsException() () => SetupMultipartMixedBatchWriterAndRunTestAsync( (multipartMixedBatchWriter) => multipartMixedBatchWriter.OnInStreamErrorAsync())); - Assert.Equal(Strings.ODataBatchWriter_CannotWriteInStreamErrorForBatch, exception.Message); + Assert.Equal(SRResources.ODataBatchWriter_CannotWriteInStreamErrorForBatch, exception.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataOperationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataOperationTests.cs index eb5f820865..8d052590f8 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataOperationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataOperationTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Evaluation; using Microsoft.OData.Tests.Evaluation; using Microsoft.OData.Tests.Json; @@ -119,7 +120,7 @@ public void MetadataBuilderShouldNotAffectUserAssignedTarget() public void SetMetadataBuilderShouldThrowWhemContextUriIsNotSet() { Action test = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - test.Throws(Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(this.testSubject.GetType().Name)); + test.Throws(Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, this.testSubject.GetType().Name)); } [Fact] @@ -171,7 +172,7 @@ public void SettingTargetToNullShouldOverrideTargetFromFullBuilder() public void SetMetadataBuildShouldThrowWhenMetadataIsNull() { Action test = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - test.Throws(Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(this.testSubject.GetType().Name)); + test.Throws(Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, this.testSubject.GetType().Name)); } [Fact] @@ -186,7 +187,7 @@ public void SetMetadataBuilderShouldThrowWhenNameIsOpenMetadataReferenceProperty { this.testSubject.Metadata = new Uri("http://www.example.com/$metadata#foo"); Action test = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - test.Throws(Strings.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported("http://www.example.com/$metadata#foo", MetadataDocumentUri.AbsoluteUri)); + test.Throws(Error.Format(SRResources.ODataJsonValidationUtils_OpenMetadataReferencePropertyNotSupported, "http://www.example.com/$metadata#foo", MetadataDocumentUri.AbsoluteUri)); } [Fact] @@ -201,7 +202,7 @@ public void SetMetadataBuilderShouldThrowWhenNameIsWithoutHash() { this.testSubject.Metadata = new Uri("Action1", UriKind.Relative); Action action = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - action.Throws(Strings.ValidationUtils_InvalidMetadataReferenceProperty("Action1")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "Action1")); } [Fact] @@ -209,7 +210,7 @@ public void SetMetadataBuilderShouldThrowWhenNameIsAbsoluteUriWithoutHash() { this.testSubject.Metadata = new Uri("http://www.example.com/Action1"); Action action = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - action.Throws(Strings.ValidationUtils_InvalidMetadataReferenceProperty("http://www.example.com/Action1")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "http://www.example.com/Action1")); } [Fact] @@ -217,7 +218,7 @@ public void SetMetadataBuilderShouldThrowWhenNameIsIdentifierHashIdentifier() { this.testSubject.Metadata = new Uri("Action#1", UriKind.Relative); Action action = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - action.Throws(Strings.ValidationUtils_InvalidMetadataReferenceProperty("Action#1")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "Action#1")); } [Fact] @@ -225,7 +226,7 @@ public void SetMetadataBuilderShouldThrowWhenNameIsJustHash() { this.testSubject.Metadata = new Uri("#", UriKind.Relative); Action action = () => this.testSubject.SetMetadataBuilder(ODataResourceMetadataBuilder.Null, MetadataDocumentUri); - action.Throws(Strings.ValidationUtils_InvalidMetadataReferenceProperty("#")); + action.Throws(Error.Format(SRResources.ValidationUtils_InvalidMetadataReferenceProperty, "#")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPreferenceHeaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPreferenceHeaderTests.cs index 8e828e60e6..aba2eece9e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPreferenceHeaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPreferenceHeaderTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Globalization; @@ -77,7 +78,7 @@ public void SetReturnContentToEmptyPreferHeaderShouldSetHeader() public void SetAnnotationFilterToEmptyShouldThrow() { Action test = () => this.preferHeader.AnnotationFilter = ""; - test.Throws(Strings.ExceptionUtils_ArgumentStringEmpty + " (Parameter 'AnnotationFilter')"); + test.Throws(SRResources.ExceptionUtils_ArgumentStringEmpty + " (Parameter 'AnnotationFilter')"); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPrimitiveValueTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPrimitiveValueTests.cs index e9091432e6..d638272c7e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPrimitiveValueTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPrimitiveValueTests.cs @@ -4,9 +4,9 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -16,7 +16,7 @@ public class ODataPrimitiveValueTests public void CreatingNullPrimitiveValueShouldFail() { Action testSubject = () => new ODataPrimitiveValue(null); - testSubject.Throws(ErrorStrings.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull); + testSubject.Throws(SRResources.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromNull); } [Fact] @@ -24,7 +24,7 @@ public void CreatingNestedODataPrimitiveValueShouldFail() { ODataPrimitiveValue innerPrimitiveValue = new ODataPrimitiveValue(42); Action testSubject = () => new ODataPrimitiveValue(innerPrimitiveValue); - testSubject.Throws(ErrorStrings.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType("Microsoft.OData.ODataPrimitiveValue")); + testSubject.Throws(Error.Format(SRResources.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType, "Microsoft.OData.ODataPrimitiveValue")); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPropertyTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPropertyTests.cs index 9cba106642..d93bedead0 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPropertyTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataPropertyTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -68,7 +69,7 @@ public void IfValueIsODataPrimitiveValueThenODataValueShouldBeReferenceEqual() public void SettingValueToNonPrimitiveTypeShouldThrow() { Action testSubject = () => this.property.Value = new ODataMessageWriterSettings(); - testSubject.Throws(Strings.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType("Microsoft.OData.ODataMessageWriterSettings")); + testSubject.Throws(Error.Format(SRResources.ODataPrimitiveValue_CannotCreateODataPrimitiveValueFromUnsupportedValueType, "Microsoft.OData.ODataMessageWriterSettings")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawInputContextTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawInputContextTests.cs index 9f98b4f15e..bea264b9b4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawInputContextTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawInputContextTests.cs @@ -11,10 +11,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Json; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -244,7 +244,7 @@ public async Task ReadRawInputAsync_ThrowsExceptionForInvalidNewLine(string payl })); Assert.Equal( - ErrorStrings.ODataAsyncReader_InvalidNewLineEncountered(lastChar), + Error.Format(SRResources.ODataAsyncReader_InvalidNewLineEncountered, lastChar), exception.Message); } @@ -263,7 +263,7 @@ public async Task ReadRawInputAsync_ThrowsExceptionForInvalidInput() })); Assert.Equal( - ErrorStrings.ODataAsyncReader_UnexpectedEndOfInput, + SRResources.ODataAsyncReader_UnexpectedEndOfInput, exception.Message); } @@ -285,7 +285,7 @@ public async Task ReadRawInputAsync_ThrowsExceptionForDuplicateHeaders() })); Assert.Equal( - ErrorStrings.ODataAsyncReader_DuplicateHeaderFound("Content-Type"), + Error.Format(SRResources.ODataAsyncReader_DuplicateHeaderFound, "Content-Type"), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextApiTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextApiTests.cs index 3aa9155d98..f8db971f4c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextApiTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextApiTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.Spatial; using Xunit; @@ -253,8 +254,8 @@ await messageWriter.WriteErrorAsync( "; - Assert.Equal(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, asyncException.Message); - Assert.Equal(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, syncException.Message); + Assert.Equal(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, asyncException.Message); + Assert.Equal(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, syncException.Message); Assert.Equal(expected, asyncResult); Assert.Equal(expected, syncResult); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextTests.cs index 46281d439d..23edfcad18 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRawOutputContextTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -114,7 +115,7 @@ public async Task WriteInStreamErrorAsync_ThrowsExceptionForODataAsynchronousWri await rawOutputContext.WriteInStreamErrorAsync(this.nullReferenceError, false); })); - Assert.Equal(Strings.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, exception.Message); + Assert.Equal(SRResources.ODataAsyncWriter_CannotWriteInStreamErrorForAsync, exception.Message); } [Fact] @@ -128,7 +129,7 @@ public async Task WriteInStreamErrorAsync_ThrowsExceptionForOutputInStreamErrorL await rawOutputContext.WriteInStreamErrorAsync(this.nullReferenceError, false); })); - Assert.Equal(Strings.ODataMessageWriter_CannotWriteInStreamErrorForRawValues, exception.Message); + Assert.Equal(SRResources.ODataMessageWriter_CannotWriteInStreamErrorForRawValues, exception.Message); } private async Task SetupRawOutputContextAndRunTestAsync(Func func) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataReaderDerivedTypeConstraintTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataReaderDerivedTypeConstraintTests.cs index 121a8fc805..134b4f80c4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataReaderDerivedTypeConstraintTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataReaderDerivedTypeConstraintTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Vocabularies; @@ -144,7 +145,7 @@ public void ReadingResourceForSingletonWithoutDerivedTypeConstraintsWorksButWith Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmMe, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation source", "Me"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation source", "Me"), exception.Message); } #endregion @@ -217,7 +218,7 @@ public void ReadingResourceForEntitySetWithoutDerivedTypeConstraintsWorksButWith Action test = () => ReadEntitySetPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.VipCustomer", "navigation source", "Customers"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.VipCustomer", "navigation source", "Customers"), exception.Message); } #endregion @@ -289,7 +290,7 @@ public void ReadingResourceForEntityWorksWithoutDerivedTypeConstraintsButFailedW Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation source", "Customers"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation source", "Customers"), exception.Message); } #endregion @@ -403,7 +404,7 @@ public void ReadingSingleNavigationProppertyWithNotAllowedTypeWorksWithoutDerive Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.VipCustomer", "nested resource", "FriendCustomer"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.VipCustomer", "nested resource", "FriendCustomer"), exception.Message); } [Fact] @@ -428,7 +429,7 @@ public void ReadingMultipleNavigationProppertyWithOrWithoutDerivedTypeConstraint Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.VipCustomer", "nested resource", "FriendCustomers"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.VipCustomer", "nested resource", "FriendCustomers"), exception.Message); } #endregion @@ -523,7 +524,7 @@ public void ReadingingSingleComplexProppertyWithNotAllowedTypeWorksWithoutDerive Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmMe, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.UsAddress", "nested resource", "Location"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.UsAddress", "nested resource", "Location"), exception.Message); } [Fact] @@ -543,7 +544,7 @@ public void ReadingMultipleComplexProppertyWithOrWithoutDerivedTypeConstraintWor Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.UsAddress", "nested resource", "Locations"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.UsAddress", "nested resource", "Locations"), exception.Message); } #endregion @@ -595,7 +596,7 @@ public void ReadingEdmPrimitiveProppertyWithNotAllowedTypeWorksWithoutDerivedTyp Action test = () => ReadEntityPayload(payload, this.edmModel, this.edmCustomers, this.edmCustomerType); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("Edm.Double", "property", "Data"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "Edm.Double", "property", "Data"), exception.Message); } #endregion @@ -628,7 +629,7 @@ public void ReadingDeltaResourceSetMultipleNavigationProppertyWithOrWithoutDeriv Action test = () => ReadDeltaPayload(payload, this.edmModel, this.edmCustomerType, ODataVersion.V401); var exception = Assert.Throws(test); - Assert.Equal(Strings.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "nested resource", "FriendCustomers"), exception.Message); + Assert.Equal(Error.Format(SRResources.ReaderValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "nested resource", "FriendCustomers"), exception.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRequestMessageTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRequestMessageTests.cs index 34078d59a8..40fcd3cdd6 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRequestMessageTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataRequestMessageTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using Xunit; @@ -72,7 +73,7 @@ public void SetHeaderIsNotAllowedWhenReading() var odataRequestMessage = new ODataRequestMessage(simulatedRequestMessage, false, false, -1); Action setHeader = (() => odataRequestMessage.SetHeader(headerName, headerValueAfter)); - setHeader.Throws(Strings.ODataMessage_MustNotModifyMessage); + setHeader.Throws(SRResources.ODataMessage_MustNotModifyMessage); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataResourceTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataResourceTests.cs index 3b7c66864f..082771fec6 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataResourceTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataResourceTests.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Evaluation; using Microsoft.OData.Tests.Evaluation; @@ -282,7 +283,7 @@ public void ODataResourcePropertyWithODataResourceValueThrows() }; var exception = Assert.Throws(test); - Assert.Equal(Strings.ODataResource_PropertyValueCannotBeODataResourceValue("ResourceProperty"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataResource_PropertyValueCannotBeODataResourceValue, "ResourceProperty"), exception.Message); } [Fact] @@ -306,7 +307,7 @@ public void ODataResourcePropertyWithCollectionODataResourceValueThrows() }; var exception = Assert.Throws(test); - Assert.Equal(Strings.ODataResource_PropertyValueCannotBeODataResourceValue("CollectionProperty"), exception.Message); + Assert.Equal(Error.Format(SRResources.ODataResource_PropertyValueCannotBeODataResourceValue, "CollectionProperty"), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataUtilsTests.cs index f92c9a32e3..88e0c46efc 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataUtilsTests.cs @@ -6,6 +6,7 @@ using System; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -171,7 +172,7 @@ public void TestGenerateServiceDocument() public void TestServiceDocumentWhenNoContainer() { Action action = () => (new EdmModel()).GenerateServiceDocument(); - action.Throws(Strings.ODataUtils_ModelDoesNotHaveContainer); + action.Throws(SRResources.ODataUtils_ModelDoesNotHaveContainer); } private IEdmModel CreateTestModel() diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterCoreTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterCoreTests.cs index adb1116c99..2e00881c5a 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterCoreTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterCoreTests.cs @@ -8,6 +8,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -164,7 +165,7 @@ public void ValidateNoMetadataShouldThrow() var entry = new ODataResource(); Action test = () => coreWriter.GetEntityType2(entry); - test.Throws(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + test.Throws(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); } private static EdmModel CreateTestModel() diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterDerivedTypeConstraintTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterDerivedTypeConstraintTests.cs index 0c4942d6ef..74ed80067f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterDerivedTypeConstraintTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterDerivedTypeConstraintTests.cs @@ -7,6 +7,7 @@ using System; using System.IO; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Vocabularies; @@ -173,7 +174,7 @@ public void WritingResourceForSingletonWithoutDerivedTypeConstraintsWorksButWith Action test = () => GetWriterOutput(this.edmModel, writeNormalCustomerAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation source", "Me"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation source", "Me"), exception.Message); } #endregion @@ -255,7 +256,7 @@ public void WritingResourceForEntitySetWithoutDerivedTypeConstraintsWorksButWith Action test = () => GetWriterOutput(this.edmModel, writeCustomersAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation source", "Customers"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation source", "Customers"), exception.Message); } #endregion @@ -321,7 +322,7 @@ public void WritingResourceForEntityWorksWithoutDerivedTypeConstraintsButFailedW Action test = () => GetWriterOutput(this.edmModel, writeCustomersAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation source", "Customers"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation source", "Customers"), exception.Message); } #endregion @@ -447,7 +448,7 @@ public void WritingSingleNavigationProppertyWithNotAllowedTypeWorksWithoutDerive Action test = () => GetWriterOutput(this.edmModel, writeNavigationPropertyAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.NormalCustomer", "property", "FriendCustomer"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "property", "FriendCustomer"), exception.Message); } [Fact] @@ -491,7 +492,7 @@ public void WritingMultipleNavigationProppertyWithOrWithoutDerivedTypeConstraint Action test = () => GetWriterOutput(this.edmModel, writeNavigationPropertyAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.VipCustomer", "property", "FriendCustomers"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.VipCustomer", "property", "FriendCustomers"), exception.Message); } #endregion @@ -597,7 +598,7 @@ public void WritingSingleComplexProppertyWithNotAllowedTypeWorksWithoutDerivedTy Action test = () => GetWriterOutput(this.edmModel, writePropertyAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.CnAddress", "property", "Location"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.CnAddress", "property", "Location"), exception.Message); } [Fact] @@ -636,7 +637,7 @@ public void WritingMultipleComplexProppertyWithOrWithoutDerivedTypeConstraintWor Action test = () => GetWriterOutput(this.edmModel, writePropertyAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("NS.UsAddress", "property", "Locations"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.UsAddress", "property", "Locations"), exception.Message); } #endregion @@ -700,7 +701,7 @@ public void WritingEdmPrimitiveProppertyWithNotAllowedTypeWorksWithoutDerivedTyp Action test = () => GetWriterOutput(this.edmModel, writeAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint("Edm.Double", "property", "Data"), exception.Message); + Assert.Equal(Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "Edm.Double", "property", "Data"), exception.Message); } #endregion @@ -790,7 +791,7 @@ public void WritingResourceWithTypeNotInHeritanceTreeWithResourceSetTypeThrows() // Act & Assert Action test = () => GetWriterOutput(model, writeAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes("microsoft.graph.contact", "microsoft.graph.directoryObject"), exception.Message); + Assert.Equal(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, "microsoft.graph.contact", "microsoft.graph.directoryObject"), exception.Message); } [Fact] @@ -819,7 +820,7 @@ public void WritingResourceWithBaseTypeWhileExpectedTypeIsSubTypeThrows() // Act & Assert Action test = () => GetWriterOutput(model, writeAction); var exception = Assert.Throws(test); - Assert.Equal(Strings.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes("microsoft.graph.directoryObject", "microsoft.graph.group"), exception.Message); + Assert.Equal(Error.Format(SRResources.ResourceSetWithoutExpectedTypeValidator_IncompatibleTypes, "microsoft.graph.directoryObject", "microsoft.graph.group"), exception.Message); } private static IEdmModel GetGraphModel() diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterValidationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterValidationTests.cs index a48015465f..a04071140c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterValidationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ODataWriterValidationTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Edm.Vocabularies.V1; @@ -276,7 +277,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint( + Error.Format(SRResources.WriterValidationUtils_ValueTypeNotAllowedInDerivedTypeConstraint, "NS.GlobalAddress", "property", "ShippingAddress"), @@ -317,7 +318,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_UnrecognizedTypeName("Collection(Str)"), + Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, "Collection(Str)"), exception.Message); }, odataVersion); } @@ -355,7 +356,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_UnsupportedPrimitiveType("System.Object"), + Error.Format(SRResources.ValidationUtils_UnsupportedPrimitiveType, "System.Object"), exception.Message); }, odataVersion); } @@ -395,7 +396,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_IncorrectTypeKind("Edm.Int32", "Collection", "Primitive"), + Error.Format(SRResources.ValidationUtils_IncorrectTypeKind, "Edm.Int32", "Collection", "Primitive"), exception.Message); }, odataVersion); } @@ -434,7 +435,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_IncompatibleType("Collection(Edm.Int32)", "Collection(Edm.String)"), + Error.Format(SRResources.ValidationUtils_IncompatibleType, "Collection(Edm.Int32)", "Collection(Edm.String)"), exception.Message); }, odataVersion); } @@ -468,7 +469,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection("Customer"), + Error.Format(SRResources.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection, "Customer"), exception.Message); }, odataVersion); } @@ -486,7 +487,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => })); Assert.Equal( - Strings.ODataMessageWriter_CannotWriteTopLevelNull, + SRResources.ODataMessageWriter_CannotWriteTopLevelNull, exception.Message); }, odataVersion); } @@ -521,7 +522,7 @@ await resourceWriter.WriteStartAsync(new ODataProperty }); Assert.Equal( - Strings.ValidationUtils_IncompatiblePrimitiveItemType("Edm.Double", "False", "Edm.Decimal", "False"), + Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, "Edm.Double", "False", "Edm.Decimal", "False"), exception.Message); }, odataVersion); } @@ -545,7 +546,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("NS.Product", "NS.Customer"), + Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "NS.Product", "NS.Customer"), exception.Message); }, odataVersion); } @@ -575,7 +576,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_NonPrimitiveTypeForPrimitiveValue("Collection(Edm.String)"), + Error.Format(SRResources.ValidationUtils_NonPrimitiveTypeForPrimitiveValue, "Collection(Edm.String)"), exception.Message); }, odataVersion); } @@ -606,7 +607,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_PropertiesMustNotContainReservedChars("Customer.Name", "':', '.', '@'"), + Error.Format(SRResources.ValidationUtils_PropertiesMustNotContainReservedChars, "Customer.Name", "':', '.', '@'"), exception.Message); }, odataVersion); } @@ -639,7 +640,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_PropertiesMustHaveNonEmptyName, + SRResources.WriterValidationUtils_PropertiesMustHaveNonEmptyName, exception.Message); }, odataVersion); } @@ -669,7 +670,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_PropertyDoesNotExistOnType("NonExistentProperty", "NS.Customer"), + Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "NonExistentProperty", "NS.Customer"), exception.Message); }, odataVersion); } @@ -700,7 +701,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue("Emails"), + Error.Format(SRResources.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue, "Emails"), exception.Message); }, odataVersion); } @@ -731,7 +732,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue("Photo"), + Error.Format(SRResources.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue, "Photo"), exception.Message); }, odataVersion); } @@ -772,7 +773,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_StreamPropertyInRequest("Photo"), + Error.Format(SRResources.WriterValidationUtils_StreamPropertyInRequest, "Photo"), exception.Message); }, odataVersion); } @@ -812,7 +813,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_MismatchPropertyKindForStreamProperty("Name"), + Error.Format(SRResources.ValidationUtils_MismatchPropertyKindForStreamProperty, "Name"), exception.Message); }, odataVersion); } @@ -861,7 +862,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata("http://tempuri.org/Orders(1)/Items"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata, "http://tempuri.org/Orders(1)/Items"), exception.Message); }, odataVersion); } @@ -895,7 +896,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -929,7 +930,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -965,7 +966,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent("http://tempuri.org/Customers(1)/Orders"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent, "http://tempuri.org/Customers(1)/Orders"), exception.Message); }, odataVersion); } @@ -997,7 +998,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -1041,7 +1042,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata("http://tempuri.org/Customers(7)/Orders"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata, "http://tempuri.org/Customers(7)/Orders"), exception.Message); }, odataVersion); } @@ -1074,7 +1075,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_NullCollectionItemForNonNullableType("Edm.String"), + Error.Format(SRResources.ValidationUtils_NullCollectionItemForNonNullableType, "Edm.String"), exception.Message); }, odataVersion); } @@ -1104,7 +1105,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue("Name", "Edm.String"), + Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, "Name", "Edm.String"), exception.Message); }, odataVersion); } @@ -1137,7 +1138,7 @@ await resourceWriter.WriteEntityReferenceLinkAsync( }); Assert.Equal( - Strings.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, + SRResources.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, exception.Message); }, odataVersion); } @@ -1167,7 +1168,7 @@ public async Task WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNullAsy })); Assert.Equal( - Strings.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, + SRResources.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, exception.Message); } } @@ -1195,7 +1196,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_NextPageLinkInRequest, + SRResources.WriterValidationUtils_NextPageLinkInRequest, exception.Message); }, odataVersion); } @@ -1233,7 +1234,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_OperationInRequest("http://tempuri.org/$metadata#Default.SendOffers"), + Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "http://tempuri.org/$metadata#Default.SendOffers"), exception.Message); }, odataVersion); } @@ -1265,7 +1266,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_EnumerableContainsANullItem("ODataResource.Actions"), + Error.Format(SRResources.ValidationUtils_EnumerableContainsANullItem, "ODataResource.Actions"), exception.Message); }, odataVersion); } @@ -1302,7 +1303,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata("ODataAction"), + Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, "ODataAction"), exception.Message); }, odataVersion); } @@ -1351,7 +1352,7 @@ public async Task ValidationUtils_StreamReferenceValuesNotSupportedInCollections }); Assert.Equal( - Strings.ValidationUtils_StreamReferenceValuesNotSupportedInCollections, + SRResources.ValidationUtils_StreamReferenceValuesNotSupportedInCollections, exception.Message); } } @@ -1400,7 +1401,7 @@ public async Task ValidationUtils_NestedCollectionsAreNotSupportedAsync(ODataVer }); Assert.Equal( - Strings.ValidationUtils_NestedCollectionsAreNotSupported, + SRResources.ValidationUtils_NestedCollectionsAreNotSupported, exception.Message); } } @@ -1438,7 +1439,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_NonNullableCollectionElementsMustNotBeNull, + SRResources.ValidationUtils_NonNullableCollectionElementsMustNotBeNull, exception.Message); }, odataVersion); } @@ -1488,7 +1489,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => () => messageWriter.WriteErrorAsync(odataError, includeDebugInformation: true)); Assert.Equal( - Strings.ValidationUtils_RecursionDepthLimitReached(1), + Error.Format(SRResources.ValidationUtils_RecursionDepthLimitReached, 1), exception.Message); }, odataVersion); } @@ -1528,7 +1529,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.WriterValidationUtils_MissingTypeNameWithMetadata, + SRResources.WriterValidationUtils_MissingTypeNameWithMetadata, exception.Message); }, odataVersion); } @@ -1569,7 +1570,7 @@ await SetupRequestMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_TypeNameMustNotBeEmpty, + SRResources.ValidationUtils_TypeNameMustNotBeEmpty, exception.Message); }, odataVersion); } @@ -1619,7 +1620,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => () => messageWriter.WriteServiceDocumentAsync(serviceDocument)); Assert.Equal( - Strings.ValidationUtils_ResourceMustSpecifyUrl, + SRResources.ValidationUtils_ResourceMustSpecifyUrl, exception.Message); }, odataVersion); } @@ -1642,7 +1643,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => () => messageWriter.WriteServiceDocumentAsync(serviceDocument)); Assert.Equal( - Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem, + SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem, exception.Message); }, odataVersion); } @@ -1675,7 +1676,7 @@ await SetupResponseMessageWriterAndRunTestAsync(async (messageWriter) => }); Assert.Equal( - Strings.ValidationUtils_MaxDepthOfNestedEntriesExceeded(2), + Error.Format(SRResources.ValidationUtils_MaxDepthOfNestedEntriesExceeded, 2), exception.Message); }, odataVersion); } @@ -1692,7 +1693,7 @@ public async Task WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOr }); Assert.Equal( - Strings.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute('/'), + Error.Format(SRResources.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute, '/'), exception.Message); } @@ -1708,7 +1709,7 @@ public async Task WriterValidationUtils_MessageWriterSettingsJsonPaddingOnReques }); Assert.Equal( - Strings.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage, + SRResources.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage, exception.Message); } @@ -1747,7 +1748,7 @@ public void ValidationUtils_UnsupportedPrimitiveType(ODataVersion odataVersion) }); Assert.Equal( - Strings.ValidationUtils_UnsupportedPrimitiveType("System.Object"), + Error.Format(SRResources.ValidationUtils_UnsupportedPrimitiveType, "System.Object"), exception.Message); }, odataVersion); } @@ -1787,7 +1788,7 @@ public void ValidationUtils_IncorrectTypeKind(ODataVersion odataVersion) }); Assert.Equal( - Strings.ValidationUtils_IncorrectTypeKind("Edm.Int32", "Collection", "Primitive"), + Error.Format(SRResources.ValidationUtils_IncorrectTypeKind, "Edm.Int32", "Collection", "Primitive"), exception.Message); }, odataVersion); } @@ -1826,7 +1827,7 @@ public void ValidationUtils_IncompatibleType(ODataVersion odataVersion) }); Assert.Equal( - Strings.ValidationUtils_IncompatibleType("Collection(Edm.Int32)", "Collection(Edm.String)"), + Error.Format(SRResources.ValidationUtils_IncompatibleType, "Collection(Edm.Int32)", "Collection(Edm.String)"), exception.Message); }, odataVersion); } @@ -1860,7 +1861,7 @@ public void WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection(ODat }); Assert.Equal( - Strings.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection("Customer"), + Error.Format(SRResources.WriterValidationUtils_NestedResourceInfoMustSpecifyIsCollection, "Customer"), exception.Message); }, odataVersion); } @@ -1878,7 +1879,7 @@ public void ODataMessageWriter_CannotWriteTopLevelNull(ODataVersion odataVersion })); Assert.Equal( - Strings.ODataMessageWriter_CannotWriteTopLevelNull, + SRResources.ODataMessageWriter_CannotWriteTopLevelNull, exception.Message); }, odataVersion); } @@ -1913,7 +1914,7 @@ public void ValidationUtils_IncompatiblePrimitiveItemType(ODataVersion odataVers }); Assert.Equal( - Strings.ValidationUtils_IncompatiblePrimitiveItemType("Edm.Double", "False", "Edm.Decimal", "False"), + Error.Format(SRResources.ValidationUtils_IncompatiblePrimitiveItemType, "Edm.Double", "False", "Edm.Decimal", "False"), exception.Message); }, odataVersion); } @@ -1937,7 +1938,7 @@ public void WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPrope }); Assert.Equal( - Strings.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType("NS.Product", "NS.Customer"), + Error.Format(SRResources.WriterValidationUtils_NestedResourceTypeNotCompatibleWithParentPropertyType, "NS.Product", "NS.Customer"), exception.Message); }, odataVersion); } @@ -1967,7 +1968,7 @@ public void ValidationUtils_NonPrimitiveTypeForPrimitiveValue(ODataVersion odata }); Assert.Equal( - Strings.ValidationUtils_NonPrimitiveTypeForPrimitiveValue("Collection(Edm.String)"), + Error.Format(SRResources.ValidationUtils_NonPrimitiveTypeForPrimitiveValue, "Collection(Edm.String)"), exception.Message); }, odataVersion); } @@ -1998,7 +1999,7 @@ public void ValidationUtils_PropertiesMustNotContainReservedChars(ODataVersion o }); Assert.Equal( - Strings.ValidationUtils_PropertiesMustNotContainReservedChars("Customer.Name", "':', '.', '@'"), + Error.Format(SRResources.ValidationUtils_PropertiesMustNotContainReservedChars, "Customer.Name", "':', '.', '@'"), exception.Message); }, odataVersion); } @@ -2031,7 +2032,7 @@ public void WriterValidationUtils_PropertiesMustHaveNonEmptyName(string property }); Assert.Equal( - Strings.WriterValidationUtils_PropertiesMustHaveNonEmptyName, + SRResources.WriterValidationUtils_PropertiesMustHaveNonEmptyName, exception.Message); }, odataVersion); } @@ -2061,7 +2062,7 @@ public void ValidationUtils_PropertyDoesNotExistOnType(ODataVersion odataVersion }); Assert.Equal( - Strings.ValidationUtils_PropertyDoesNotExistOnType("NonExistentProperty", "NS.Customer"), + Error.Format(SRResources.ValidationUtils_PropertyDoesNotExistOnType, "NonExistentProperty", "NS.Customer"), exception.Message); }, odataVersion); } @@ -2092,7 +2093,7 @@ public void WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue(OData }); Assert.Equal( - Strings.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue("Emails"), + Error.Format(SRResources.WriterValidationUtils_CollectionPropertiesMustNotHaveNullValue, "Emails"), exception.Message); }, odataVersion); } @@ -2123,7 +2124,7 @@ public void WriterValidationUtils_StreamPropertiesMustNotHaveNullValue(ODataVers }); Assert.Equal( - Strings.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue("Photo"), + Error.Format(SRResources.WriterValidationUtils_StreamPropertiesMustNotHaveNullValue, "Photo"), exception.Message); }, odataVersion); } @@ -2164,7 +2165,7 @@ public void WriterValidationUtils_StreamPropertyInRequest(ODataVersion odataVers }); Assert.Equal( - Strings.WriterValidationUtils_StreamPropertyInRequest("Photo"), + Error.Format(SRResources.WriterValidationUtils_StreamPropertyInRequest, "Photo"), exception.Message); }, odataVersion); } @@ -2204,7 +2205,7 @@ public void ValidationUtils_MismatchPropertyKindForStreamProperty(ODataVersion o }); Assert.Equal( - Strings.ValidationUtils_MismatchPropertyKindForStreamProperty("Name"), + Error.Format(SRResources.ValidationUtils_MismatchPropertyKindForStreamProperty, "Name"), exception.Message); }, odataVersion); } @@ -2253,7 +2254,7 @@ public void WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceM }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata("http://tempuri.org/Orders(1)/Items"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourceSetPayloadAndResourceMetadata, "http://tempuri.org/Orders(1)/Items"), exception.Message); }, odataVersion); } @@ -2287,7 +2288,7 @@ public void WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetM }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkWithResourcePayloadAndResourceSetMetadata, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -2321,7 +2322,7 @@ public void WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceConten }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceContent, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -2357,7 +2358,7 @@ public void WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetCo }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent("http://tempuri.org/Customers(1)/Orders"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetContent, "http://tempuri.org/Customers(1)/Orders"), exception.Message); }, odataVersion); } @@ -2389,7 +2390,7 @@ public void WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetada }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata("http://tempuri.org/Orders(1)/Customer"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionTrueWithResourceMetadata, "http://tempuri.org/Orders(1)/Customer"), exception.Message); }, odataVersion); } @@ -2433,7 +2434,7 @@ public void WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMe }); Assert.Equal( - Strings.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata("http://tempuri.org/Customers(7)/Orders"), + Error.Format(SRResources.WriterValidationUtils_ExpandedLinkIsCollectionFalseWithResourceSetMetadata, "http://tempuri.org/Customers(7)/Orders"), exception.Message); }, odataVersion); } @@ -2466,7 +2467,7 @@ public void ValidationUtils_NullCollectionItemForNonNullableType(ODataVersion od }); Assert.Equal( - Strings.ValidationUtils_NullCollectionItemForNonNullableType("Edm.String"), + Error.Format(SRResources.ValidationUtils_NullCollectionItemForNonNullableType, "Edm.String"), exception.Message); }, odataVersion); } @@ -2496,7 +2497,7 @@ public void WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue(ODat }); Assert.Equal( - Strings.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue("Name", "Edm.String"), + Error.Format(SRResources.WriterValidationUtils_NonNullablePropertiesMustNotHaveNullValue, "Name", "Edm.String"), exception.Message); }, odataVersion); } @@ -2529,7 +2530,7 @@ public void WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull(ODataVersi }); Assert.Equal( - Strings.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, + SRResources.WriterValidationUtils_EntityReferenceLinkUrlMustNotBeNull, exception.Message); }, odataVersion); } @@ -2559,7 +2560,7 @@ public void WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull(ODataVer })); Assert.Equal( - Strings.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, + SRResources.WriterValidationUtils_EntityReferenceLinksLinkMustNotBeNull, exception.Message); } } @@ -2587,7 +2588,7 @@ public void WriterValidationUtils_NextPageLinkInRequest(ODataVersion odataVersio }); Assert.Equal( - Strings.WriterValidationUtils_NextPageLinkInRequest, + SRResources.WriterValidationUtils_NextPageLinkInRequest, exception.Message); }, odataVersion); } @@ -2625,7 +2626,7 @@ public void WriterValidationUtils_OperationInRequest(ODataVersion odataVersion) }); Assert.Equal( - Strings.WriterValidationUtils_OperationInRequest("http://tempuri.org/$metadata#Default.SendOffers"), + Error.Format(SRResources.WriterValidationUtils_OperationInRequest, "http://tempuri.org/$metadata#Default.SendOffers"), exception.Message); }, odataVersion); } @@ -2657,7 +2658,7 @@ public void ValidationUtils_EnumerableContainsANullItem(ODataVersion odataVersio }); Assert.Equal( - Strings.ValidationUtils_EnumerableContainsANullItem("ODataResource.Actions"), + Error.Format(SRResources.ValidationUtils_EnumerableContainsANullItem, "ODataResource.Actions"), exception.Message); }, odataVersion); } @@ -2694,7 +2695,7 @@ public void ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata(ODataVersion }); Assert.Equal( - Strings.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata("ODataAction"), + Error.Format(SRResources.ValidationUtils_ActionsAndFunctionsMustSpecifyMetadata, "ODataAction"), exception.Message); }, odataVersion); } @@ -2743,7 +2744,7 @@ public void ValidationUtils_StreamReferenceValuesNotSupportedInCollections(OData }); Assert.Equal( - Strings.ValidationUtils_StreamReferenceValuesNotSupportedInCollections, + SRResources.ValidationUtils_StreamReferenceValuesNotSupportedInCollections, exception.Message); } } @@ -2792,7 +2793,7 @@ public void ValidationUtils_NestedCollectionsAreNotSupported(ODataVersion odataV }); Assert.Equal( - Strings.ValidationUtils_NestedCollectionsAreNotSupported, + SRResources.ValidationUtils_NestedCollectionsAreNotSupported, exception.Message); } } @@ -2830,7 +2831,7 @@ public void ValidationUtils_NonNullableCollectionElementsMustNotBeNull(ODataVers }); Assert.Equal( - Strings.ValidationUtils_NonNullableCollectionElementsMustNotBeNull, + SRResources.ValidationUtils_NonNullableCollectionElementsMustNotBeNull, exception.Message); }, odataVersion); } @@ -2880,7 +2881,7 @@ public void ValidationUtils_RecursionDepthLimitReached(ODataVersion odataVersion () => messageWriter.WriteError(odataError, includeDebugInformation: true)); Assert.Equal( - Strings.ValidationUtils_RecursionDepthLimitReached(1), + Error.Format(SRResources.ValidationUtils_RecursionDepthLimitReached, 1), exception.Message); }, odataVersion); } @@ -2920,7 +2921,7 @@ public void WriterValidationUtils_MissingTypeNameWithMetadata(ODataVersion odata }); Assert.Equal( - Strings.WriterValidationUtils_MissingTypeNameWithMetadata, + SRResources.WriterValidationUtils_MissingTypeNameWithMetadata, exception.Message); }, odataVersion); } @@ -2961,7 +2962,7 @@ public void ValidationUtils_TypeNameMustNotBeEmpty(ODataVersion odataVersion) }); Assert.Equal( - Strings.ValidationUtils_TypeNameMustNotBeEmpty, + SRResources.ValidationUtils_TypeNameMustNotBeEmpty, exception.Message); }, odataVersion); } @@ -3011,7 +3012,7 @@ public void ValidationUtils_ResourceMustSpecifyUrl(ODataVersion odataVersion) () => messageWriter.WriteServiceDocument(serviceDocument)); Assert.Equal( - Strings.ValidationUtils_ResourceMustSpecifyUrl, + SRResources.ValidationUtils_ResourceMustSpecifyUrl, exception.Message); }, odataVersion); } @@ -3034,7 +3035,7 @@ public void ValidationUtils_WorkspaceResourceMustNotContainNullItem(ODataVersion () => messageWriter.WriteServiceDocument(serviceDocument)); Assert.Equal( - Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem, + SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem, exception.Message); }, odataVersion); } @@ -3067,7 +3068,7 @@ public void ValidationUtils_MaxDepthOfNestedEntriesExceeded(ODataVersion odataVe }); Assert.Equal( - Strings.ValidationUtils_MaxDepthOfNestedEntriesExceeded(2), + Error.Format(SRResources.ValidationUtils_MaxDepthOfNestedEntriesExceeded, 2), exception.Message); }, odataVersion); } @@ -3084,7 +3085,7 @@ public void WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolu }); Assert.Equal( - Strings.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute('/'), + Error.Format(SRResources.WriterValidationUtils_MessageWriterSettingsBaseUriMustBeNullOrAbsolute, '/'), exception.Message); } @@ -3100,7 +3101,7 @@ public void WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessa }); Assert.Equal( - Strings.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage, + SRResources.WriterValidationUtils_MessageWriterSettingsJsonPaddingOnRequestMessage, exception.Message); } @@ -3129,7 +3130,7 @@ public void ValidationUtils_ResourceWithoutMediaResourceAndMLETypeAsync(ODataVer }); Assert.Equal( - Strings.ValidationUtils_ResourceWithoutMediaResourceAndMLEType("NS.Product"), + Error.Format(SRResources.ValidationUtils_ResourceWithoutMediaResourceAndMLEType, "NS.Product"), exception.Message); } @@ -3165,7 +3166,7 @@ public void ValidationUtils_ResourceWithMediaResourceAndNonMLETypeAsync(ODataVer }); Assert.Equal( - Strings.ValidationUtils_ResourceWithMediaResourceAndNonMLEType("NS.Customer"), + Error.Format(SRResources.ValidationUtils_ResourceWithMediaResourceAndNonMLEType, "NS.Customer"), exception.Message); } @@ -3192,7 +3193,7 @@ public void ValidationUtils_LinkMustSpecifyName(ODataVersion odataVersion) }); Assert.Equal( - Strings.ValidationUtils_LinkMustSpecifyName, + SRResources.ValidationUtils_LinkMustSpecifyName, exception.Message); } @@ -3211,7 +3212,7 @@ public void WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeN }); Assert.Equal( - Strings.WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute('/'), + Error.Format(SRResources.WriterValidationUtils_MessageWriterSettingsServiceDocumentUriMustBeNullOrAbsolute, '/'), exception.Message); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/Query/ODataUriUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/Query/ODataUriUtilsTests.cs index 1e000531ed..e4fef7e4f1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/Query/ODataUriUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/Query/ODataUriUtilsTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.Tests.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.Query { @@ -40,7 +41,7 @@ public void TestIntegerConvertFromUriLiteralThrowOverflow(string value) Action test = () => ODataUriUtils.ConvertFromUriLiteral(value, ODataVersion.V4, EdmCoreModel.Instance, numberType); - test.Throws(Strings.ODataUriUtils_ConvertFromUriLiteralOverflowNumber("Edm.Int16", "Value was either too large or too small for an Int16.")); + test.Throws(Error.Format(SRResources.ODataUriUtils_ConvertFromUriLiteralOverflowNumber, "Edm.Int16", "Value was either too large or too small for an Int16.")); } [Fact] @@ -164,7 +165,7 @@ public void TestBinaryConvertFromUriLiteral() // Invalid base64 value. Action action = () => { ODataUriUtils.ConvertFromUriLiteral("binary'AwEEAQUJAgYFAwUJ='", ODataVersion.V4); }; - action.Throws(Strings.UriQueryExpressionParser_UnrecognizedLiteral("Edm.Binary", "binary'AwEEAQUJAgYFAwUJ='", "0", "binary'AwEEAQUJAgYFAwUJ='")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedLiteral, "Edm.Binary", "binary'AwEEAQUJAgYFAwUJ='", "0", "binary'AwEEAQUJAgYFAwUJ='")); } #region enum testings @@ -220,11 +221,11 @@ public void TestDateTimeOffsetConvertFromUriLiteral() { // Date is not in right format Action action = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-1T12:12:12-11:00", ODataVersion.V4); - action.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-1T12:12:12-11:00")); + action.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-1T12:12:12-11:00")); // Time is not in right format Action action2 = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-01T12:12:2-11:00", ODataVersion.V4); - action2.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-01T12:12:2-11:00")); + action2.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-01T12:12:2-11:00")); // Date and Time separator is incorrect // Call from DataUriUtils, it will parse till blank space which is a correct Date @@ -233,24 +234,24 @@ public void TestDateTimeOffsetConvertFromUriLiteral() // Date is not with limit Action action4 = () => ODataUriUtils.ConvertFromUriLiteral("1997-13-01T12:12:12-11:00", ODataVersion.V4); - action4.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-13-01T12:12:12-11:00")); + action4.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-13-01T12:12:12-11:00")); // Time is not within limit Action action5 = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-01T12:12:62-11:00", ODataVersion.V4); - action5.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-01T12:12:62-11:00")); + action5.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-01T12:12:62-11:00")); // Timezone separator is incorrect // Call from DataUriUtils, it will parse till blank space, so error message string is without timezone information. Action action6 = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-01T12:12:02 11:00", ODataVersion.V4); - action6.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-01T12:12:02")); + action6.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-01T12:12:02")); // Timezone is not within limit Action action7 = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-01T12:12:02-15:00", ODataVersion.V4); - action7.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-01T12:12:02-15:00")); + action7.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-01T12:12:02-15:00")); // Timezone is not specified Action action8 = () => ODataUriUtils.ConvertFromUriLiteral("1997-07-01T12:12:02", ODataVersion.V4); - action8.Throws(Strings.UriUtils_DateTimeOffsetInvalidFormat("1997-07-01T12:12:02")); + action8.Throws(Error.Format(SRResources.UriUtils_DateTimeOffsetInvalidFormat, "1997-07-01T12:12:02")); } [Fact] @@ -276,7 +277,7 @@ public void TestCollectionConvertFromBracketCollection() public void TestCollectionConvertWithMismatchedBracket() { Action parse = () => ODataUriUtils.ConvertFromUriLiteral("[1,2,3)", ODataVersion.V4, HardCodedTestModel.TestModel, new EdmCollectionTypeReference(new EdmCollectionType(EdmCoreModel.Instance.GetInt32(false)))); - parse.Throws(Strings.ExpressionLexer_UnbalancedBracketExpression); + parse.Throws(SRResources.ExpressionLexer_UnbalancedBracketExpression); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ReadOnlyEnumerableTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ReadOnlyEnumerableTests.cs index 64513a3f62..08fabc0402 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ReadOnlyEnumerableTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ReadOnlyEnumerableTests.cs @@ -4,11 +4,11 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using System; using System.Collections.Generic; using System.Linq; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests { @@ -65,14 +65,14 @@ public void ToReadOnlyEnumerableShouldThrowForNullSource() { IEnumerable enumerable = null; Action test = () => enumerable.ToReadOnlyEnumerable("Integers"); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Integers")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Integers")); } [Fact] public void ToReadOnlyEnumerableShouldThrowForListSource() { Action test = () => (new List()).ToReadOnlyEnumerable("Integers"); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Integers")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Integers")); } [Fact] @@ -87,14 +87,14 @@ public void GetOrCreateReadOnlyEnumerableShouldThrowForNullSource() { IEnumerable enumerable = null; Action test = () => enumerable.GetOrCreateReadOnlyEnumerable("Integers"); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Integers")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Integers")); } [Fact] public void GetOrCreateReadOnlyEnumerableShouldThrowForListSource() { Action test = () => (new List()).GetOrCreateReadOnlyEnumerable("Integers"); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Integers")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Integers")); } [Fact] @@ -120,14 +120,14 @@ public void ConcatToReadOnlyEnumerableShouldThrowForNullSource() { IEnumerable enumerable = null; Action test = () => enumerable.ConcatToReadOnlyEnumerable("Properties", new ODataProperty()); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Properties")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Properties")); } [Fact] public void ConcatToReadOnlyEnumerableShouldThrowForListSource() { Action test = () => new List().ConcatToReadOnlyEnumerable("Properties", new ODataProperty()); - test.Throws(ErrorStrings.ReaderUtils_EnumerableModified("Properties")); + test.Throws(Error.Format(SRResources.ReaderUtils_EnumerableModified, "Properties")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/DisablePrimitiveTypeConversionTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/DisablePrimitiveTypeConversionTests.cs index 817991a4ce..64d7622a9a 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/DisablePrimitiveTypeConversionTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/DisablePrimitiveTypeConversionTests.cs @@ -8,9 +8,9 @@ using System.IO; using System.Linq; using System.Text; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.ScenarioTests.Reader { @@ -69,7 +69,7 @@ public void JsonShouldConvertDeclaredPropertyValueToMetadataTypeByDefault() public void JsonShouldFailIfPayloadTypeDoesNotMatchMetadataTypeByDefault() { Action readWithWrongType = () => this.ReadPropertyValueInJson("String", "AQ==", "Edm.Binary", this.defaultSettings); - readWithWrongType.Throws(ODataErrorStrings.ValidationUtils_IncompatibleType("Edm.Binary", "Edm.String")); + readWithWrongType.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "Edm.Binary", "Edm.String")); } private object ReadPropertyValueInJson(string propertyName, string propertyValue, string typeName, ODataMessageReaderSettings settings) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateReaderJsonTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateReaderJsonTests.cs index 0e69b16403..2a54d117c7 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateReaderJsonTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateReaderJsonTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.Tests.Json; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.Reader.Json { @@ -53,7 +53,7 @@ public void InvalidDateReaderTest() foreach (var testCase in testCases) { Action action = () => this.VerifyDateValueReader(testCase.Payload, "Edm.Date", null); - action.Throws(ErrorStrings.ReaderValidationUtils_CannotConvertPrimitiveValue(testCase.Show, "Edm.Date")); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, testCase.Show, "Edm.Date")); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateTimeReaderJsonTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateTimeReaderJsonTests.cs index 42c191629a..e61173bc9e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateTimeReaderJsonTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/DateTimeReaderJsonTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.Tests.Json; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.Reader.Json { @@ -54,7 +54,7 @@ public void InvalidDateTimeOffsetReaderTest() foreach (var testCase in testCases) { Action action = () => this.VerifyDateTimeValueReader(testCase.Payload, "Edm.DateTimeOffset", null); - action.Throws(ErrorStrings.ReaderValidationUtils_CannotConvertPrimitiveValue(testCase.Show, "Edm.DateTimeOffset")); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, testCase.Show, "Edm.DateTimeOffset")); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/ODataJsonSingletonReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/ODataJsonSingletonReaderTests.cs index 4044cc0845..d8d253ce64 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/ODataJsonSingletonReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/ODataJsonSingletonReaderTests.cs @@ -7,6 +7,7 @@ using System; using System.IO; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Core.Tests.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.OData.Json; @@ -96,7 +97,7 @@ public void ReadSingletonWithContextUriHasKey() "\"@odata.context\":\"http://odata.org/test/$metadata#MySingleton(10)\"}"; Action readResult = () => this.ReadSingleton(payload); - readResult.Throws(Strings.ODataJsonContextUriParser_LastSegmentIsKeySegment("http://odata.org/test/$metadata#MySingleton(10)")); + readResult.Throws(Error.Format(SRResources.ODataJsonContextUriParser_LastSegmentIsKeySegment, "http://odata.org/test/$metadata#MySingleton(10)")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/TimeOfDayReaderJsonTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/TimeOfDayReaderJsonTests.cs index c1eee0949a..d582c0b884 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/TimeOfDayReaderJsonTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/Json/TimeOfDayReaderJsonTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.Tests.Json; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.Reader.Json { @@ -56,7 +56,7 @@ public void InvalidTimeOfDayReaderTest() foreach (var testCase in testCases) { Action action = () => this.VerifyTimeOfDayValueReader(testCase.Payload, "Edm.TimeOfDay", null); - action.Throws(ErrorStrings.ReaderValidationUtils_CannotConvertPrimitiveValue(testCase.Show, "Edm.TimeOfDay")); + action.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, testCase.Show, "Edm.TimeOfDay")); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/MetadataReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/MetadataReaderTests.cs index 037b501eaf..b3ada83159 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/MetadataReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Reader/MetadataReaderTests.cs @@ -13,6 +13,7 @@ using Microsoft.OData.Edm; using Xunit; using Microsoft.OData.Json; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.Reader { @@ -134,7 +135,7 @@ public void VerifyErrorElementNotFoundForErrorMetadataDocumentThrows() }; Action test = () => this.ReadMetadataDocument(map, "main"); - test.Throws(Strings.ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName("code")); + test.Throws(Error.Format(SRResources.ODataXmlErrorDeserializer_MultipleErrorElementsWithSameName, "code")); } [Theory] @@ -194,7 +195,7 @@ public void VerifyInnerErrorElementNotFoundForErrorMetadataDocumentThrows() }; Action test = () => this.ReadMetadataDocument(map, "main"); - test.Throws(Strings.ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName("stacktrace")); + test.Throws(Error.Format(SRResources.ODataXmlErrorDeserializer_MultipleInnerErrorElementsWithSameName, "stacktrace")); } private IEdmModel ReadMetadataDocument(Dictionary map, string mainUrl) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/ContextUrlWriterReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/ContextUrlWriterReaderTests.cs index 476dd7115a..d1dac94c60 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/ContextUrlWriterReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/ContextUrlWriterReaderTests.cs @@ -16,6 +16,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; +using Microsoft.OData.Core; using Xunit; namespace Microsoft.OData.Tests.ScenarioTests.Roundtrip diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/AsyncBatchRoundtripJsonTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/AsyncBatchRoundtripJsonTests.cs index efbbf276ea..6889994664 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/AsyncBatchRoundtripJsonTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/AsyncBatchRoundtripJsonTests.cs @@ -7,6 +7,7 @@ using System; using System.IO; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -70,14 +71,14 @@ public void AsyncBatchJsonTestJsonBatchWithMissingTopLevelPropertyThrowsExceptio byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeApplicationJson); - test.Throws(Strings.ODataBatchReader_JsonBatchTopLevelPropertyMissing); + test.Throws(SRResources.ODataBatchReader_JsonBatchTopLevelPropertyMissing); } [Fact] public void AsyncBatchJsonTestWithInvalidBatchContentThrowsException() { Action test = () => AsyncBatchJsonTestFromSpecExample85(null); - test.Throws(Strings.JsonReader_InvalidNumberFormat("--")); + test.Throws(Error.Format(SRResources.JsonReader_InvalidNumberFormat, "--")); } [Fact] @@ -87,7 +88,7 @@ public void AsyncBatchJsonTestWithoutBatchStartedStatusThrowsException() BatchPayloadUriOption.AbsoluteUri, batchContentTypeApplicationJson, SkipBatchWriterStep.BatchStarted); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromStart); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromStart); } [Fact] @@ -105,7 +106,7 @@ public void AsyncBatchJsonTestCreateOperationAfterCreateBatchWriterThrowsExcepti Action test = () => batchWriter.CreateOperationRequestMessage( "POST", new Uri(serviceDocumentUri + "/Customers"), "1", payloadUriOption); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromStart); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromStart); } } @@ -143,7 +144,7 @@ public void AsyncBatchJsonTestWithoutOperationBatchCompletedStatusThrowsExceptio // Attempt to start another change set before ending the current one. Action test = () => batchWriter.WriteStartChangeset(); - test.Throws(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); + test.Throws(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); } } @@ -163,7 +164,7 @@ public void AsyncBatchJsonTestWriteEndBatchBeforeWriteEndChangesetThrowsExceptio batchWriter.WriteStartChangeset(); Action test = () => batchWriter.WriteEndBatch(); - test.Throws(Strings.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet); + test.Throws(SRResources.ODataBatchWriter_CannotCompleteBatchWithActiveChangeSet); } } @@ -182,7 +183,7 @@ public void AsyncBatchJsonTestWriteEndChangesetBeforeWriteStartChangesetThrowsEx batchWriter.WriteStartBatch(); Action test = () => batchWriter.WriteEndChangeset(); - test.Throws(Strings.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet); + test.Throws(SRResources.ODataBatchWriter_CannotCompleteChangeSetWithoutActiveChangeSet); } } @@ -201,7 +202,7 @@ public void AsyncBatchJsonTestWriteStartBatchAfterWriteStartBatchThrowsException batchWriter.WriteStartBatch(); Action test = () => batchWriter.WriteStartBatch(); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromBatchStarted); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromBatchStarted); } } @@ -221,7 +222,7 @@ public void AsyncBatchJsonTestNestedWriteStartChangeSetThrowsException() batchWriter.WriteStartChangeset(); Action test = () => batchWriter.WriteStartChangeset(); - test.Throws(Strings.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); + test.Throws(SRResources.ODataBatchWriter_CannotStartChangeSetWithActiveChangeSet); } } @@ -274,7 +275,7 @@ public void AsyncBatchJsonTestInvalidOperationAfterOperationContentStreamDispose } Action test = () => batchWriter.WriteStartBatch(); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromOperationContentStreamDisposed); } } @@ -295,7 +296,7 @@ public void AsyncBatchJsonTestInvalidOperationAfterWriteEndChangeSetThrowsExcept batchWriter.WriteEndChangeset(); Action test = () => batchWriter.WriteStartBatch(); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromChangeSetCompleted); } } @@ -317,7 +318,7 @@ public void AsyncBatchJsonTestInvalidOperationAfterWriteEndBatchThrowsException( batchWriter.WriteEndBatch(); Action test = () => batchWriter.WriteEndBatch(); - test.Throws(Strings.ODataBatchWriter_InvalidTransitionFromBatchCompleted); + test.Throws(SRResources.ODataBatchWriter_InvalidTransitionFromBatchCompleted); } } @@ -347,7 +348,7 @@ public void AsyncBatchJsonTestWriteRequestExceedMaxPartsPerBatchThrowsException( "POST", new Uri(serviceDocumentUri + "/Customers"), "1", payloadUriOption); Action test = () => batchWriter.CreateOperationRequestMessage("PATCH", new Uri(serviceDocumentUri + "/Customers('ALFKI')"), "2", payloadUriOption); - test.Throws(Strings.ODataBatchWriter_MaxBatchSizeExceeded(maxPartsPerBatch)); + test.Throws(Error.Format(SRResources.ODataBatchWriter_MaxBatchSizeExceeded, maxPartsPerBatch)); } } @@ -379,7 +380,7 @@ public void AsyncBatchJsonTestWriteRequestExceedMaxOperationsPerChangesetThrowsE "POST", new Uri(serviceDocumentUri + "/Customers"), "1", payloadUriOption); Action test = () => batchWriter.CreateOperationRequestMessage("PATCH", new Uri(serviceDocumentUri + "/Customers('ALFKI')"), "2", payloadUriOption); - test.Throws(Strings.ODataBatchWriter_MaxChangeSetSizeExceeded(maxOperationsPerChangeset)); + test.Throws(Error.Format(SRResources.ODataBatchWriter_MaxChangeSetSizeExceeded, maxOperationsPerChangeset)); } } #endregion @@ -398,7 +399,7 @@ public void AsyncBatchJsonTestMultipartMixedBatchWithInvalidHeaderThrowsExceptio byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeMultipartMixed); - test.Throws(Strings.ODataBatchReaderStream_InvalidHeaderSpecified("--changeset_4faeec78-01a5-40c4-863e-9915be75db31--")); + test.Throws(Error.Format(SRResources.ODataBatchReaderStream_InvalidHeaderSpecified, "--changeset_4faeec78-01a5-40c4-863e-9915be75db31--")); } [Fact] @@ -418,7 +419,7 @@ public void AsyncBatchJsonTestMultipartMixedWithBadFormatHttpMethodOperationThro byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeMultipartMixed); - test.Throws(Strings.ODataBatchReaderStream_InvalidRequestLine("POSThttp://service/CustomersHTTP/1.1")); + test.Throws(Error.Format(SRResources.ODataBatchReaderStream_InvalidRequestLine, "POSThttp://service/CustomersHTTP/1.1")); } [Fact] @@ -437,7 +438,7 @@ public void AsyncBatchJsonTestMultipartMixedWithMissingHttpMethodOperationPayloa byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeMultipartMixed); - test.Throws(Strings.ODataBatchReaderStream_InvalidRequestLine("OData-Version: 4.0")); + test.Throws(Error.Format(SRResources.ODataBatchReaderStream_InvalidRequestLine, "OData-Version: 4.0")); } [Fact] @@ -457,7 +458,7 @@ public void AsyncBatchJsonTestMultipartMixedWithBadFormatHttpVersionThrowsExcept byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeMultipartMixed); - test.Throws(Strings.ODataBatchReaderStream_InvalidHttpVersionSpecified("HTTPLOL/1.1", ODataConstants.HttpVersionInBatching)); + test.Throws(Error.Format(SRResources.ODataBatchReaderStream_InvalidHttpVersionSpecified, "HTTPLOL/1.1", ODataConstants.HttpVersionInBatching)); } [Fact] @@ -477,7 +478,7 @@ public void AsyncBatchJsonTestMultipartMixedWithGetRequestThrowsException() byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeMultipartMixed); - test.Throws(Strings.ODataBatch_InvalidHttpMethodForChangeSetRequest("GET")); + test.Throws(Error.Format(SRResources.ODataBatch_InvalidHttpMethodForChangeSetRequest, "GET")); } [Fact] @@ -539,7 +540,7 @@ public void AsyncBatchJsonTestReadRequestNoMessageCreatedForRequestThrowsExcepti { } }; - test.Throws(Strings.ODataBatchReader_NoMessageWasCreatedForOperation); + test.Throws(SRResources.ODataBatchReader_NoMessageWasCreatedForOperation); } } @@ -583,7 +584,7 @@ public void AsyncBatchJsonTestReadRequestExceedMaxPartsPerBatchThrowsException() } } }; - test.Throws(Strings.ODataBatchReader_MaxBatchSizeExceeded(maxPartsPerBatch)); + test.Throws(Error.Format(SRResources.ODataBatchReader_MaxBatchSizeExceeded, maxPartsPerBatch)); } } @@ -627,7 +628,7 @@ public void AsyncBatchJsonTestReadRequestExceedMaxOperationsPerChangesetThrowsEx } } }; - test.Throws(Strings.ODataBatchReader_MaxChangeSetSizeExceeded(maxOperationsPerChangeset)); + test.Throws(Error.Format(SRResources.ODataBatchReader_MaxChangeSetSizeExceeded, maxOperationsPerChangeset)); } } #endregion @@ -654,7 +655,7 @@ public void AsyncBatchJsonTestJsonBatchWithMissingMethodThrowsException() byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeApplicationJson); - test.Throws(Strings.ODataBatchReader_RequestPropertyMissing("METHOD")); + test.Throws(Error.Format(SRResources.ODataBatchReader_RequestPropertyMissing, "METHOD")); } [Fact] @@ -676,7 +677,7 @@ public void AsyncBatchJsonTestJsonBatchWithMissingUrlThrowsException() byte[] requestPayload = ConvertStringToByteArray(payload); Action test = () => this.ServiceReadAsyncBatchRequestAndWriteAsyncResponse(requestPayload, batchContentTypeApplicationJson); - test.Throws(Strings.ODataBatchReader_RequestPropertyMissing("URL")); + test.Throws(Error.Format(SRResources.ODataBatchReader_RequestPropertyMissing, "URL")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/ODataJsonBatchAtomicityGroupTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/ODataJsonBatchAtomicityGroupTests.cs index ddec3db0aa..848d43a486 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/ODataJsonBatchAtomicityGroupTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Roundtrip/Json/ODataJsonBatchAtomicityGroupTests.cs @@ -337,7 +337,7 @@ public void JsonBatchAtomicityGroupTestCases() }", RequestMessageDependsOnIdVerifier = null, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed("g1r1", "g1") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_DependsOnRequestIdIsPartOfAtomicityGroupNotAllowed, "g1r1", "g1") }, new ODataJsonBatchPayloadTestCase { @@ -371,7 +371,7 @@ public void JsonBatchAtomicityGroupTestCases() }", RequestMessageDependsOnIdVerifier = null, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_DependsOnIdNotFound("invalidId", "g2r6") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "invalidId", "g2r6") }, new ODataJsonBatchPayloadTestCase { @@ -401,7 +401,7 @@ public void JsonBatchAtomicityGroupTestCases() }", RequestMessageDependsOnIdVerifier = null, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_DuplicateContentIDsNotAllowed("duplicate") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_DuplicateContentIDsNotAllowed, "duplicate") }, new ODataJsonBatchPayloadTestCase { @@ -432,7 +432,7 @@ public void JsonBatchAtomicityGroupTestCases() }", RequestMessageDependsOnIdVerifier = null, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_DependsOnIdNotFound("invalidId", "duplicate") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "invalidId", "duplicate") }, new ODataJsonBatchPayloadTestCase { @@ -463,7 +463,7 @@ public void JsonBatchAtomicityGroupTestCases() }", RequestMessageDependsOnIdVerifier = null, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_DependsOnIdNotFound("r2", "r1") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_DependsOnIdNotFound, "r2", "r1") }, new ODataJsonBatchPayloadTestCase { @@ -501,7 +501,7 @@ public void JsonBatchAtomicityGroupTestCases() new List(){ "g1", "g1r1" } }, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed("g1", "g1") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_SameRequestIdAsAtomicityGroupIdNotAllowed, "g1", "g1") }, new ODataJsonBatchPayloadTestCase { @@ -528,7 +528,7 @@ public void JsonBatchAtomicityGroupTestCases() new List(){ "g1r1" } }, ExceptionType = typeof(ODataException), - TokenInExceptionMessage = Strings.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed("g1r1", "g1r1") + TokenInExceptionMessage = Error.Format(SRResources.ODataBatchReader_SelfReferenceDependsOnRequestIdNotAllowed, "g1r1", "g1r1") }, }; diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamReadingTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamReadingTests.cs index f3fadcadef..bda836f110 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamReadingTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamReadingTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -1036,7 +1037,7 @@ public void CannotReadPartialStream() } }; - readPartialStream.Throws(Strings.ODataReaderCore_ReadCalledWithOpenStream); + readPartialStream.Throws(SRResources.ODataReaderCore_ReadCalledWithOpenStream); } } @@ -1070,7 +1071,7 @@ public void CannotIgnoreInlineStream() } }; - readPartialStream.Throws(Strings.ODataReaderCore_ReadCalledWithOpenStream); + readPartialStream.Throws(SRResources.ODataReaderCore_ReadCalledWithOpenStream); } } @@ -1336,7 +1337,7 @@ public void CannotSkipStreamProperties() } }; - action.Throws(Strings.ODataReaderCore_ReadCalledWithOpenStream); + action.Throws(SRResources.ODataReaderCore_ReadCalledWithOpenStream); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamWritingTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamWritingTests.cs index 977a71e6f4..4daafa7bd5 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamWritingTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Streaming/ODataJsonStreamWritingTests.cs @@ -6,6 +6,7 @@ using System; using System.IO; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -606,7 +607,7 @@ public void CannotWriteValueForODataProperty() }, null); - writeWithExtraValue.Throws(Strings.ODataWriterCore_PropertyValueAlreadyWritten("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, "textAsStream")); } [Fact] @@ -631,7 +632,7 @@ public void CannotStreamValueForODataProperty() }, null); - writeWithExtraValue.Throws(Strings.ODataWriterCore_PropertyValueAlreadyWritten("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, "textAsStream")); } [Fact] @@ -656,7 +657,7 @@ public void CannotWriteValueTwice() }, null); - writeWithExtraValue.Throws(Strings.ODataWriterCore_PropertyValueAlreadyWritten("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, "textAsStream")); } [Fact] @@ -681,7 +682,7 @@ public void CannotWriteAndStreamProperty() }, null); - writeWithExtraValue.Throws(Strings.DuplicatePropertyNamesNotAllowed("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, "textAsStream")); } [Fact] @@ -706,7 +707,7 @@ public void CannotStreamAndWriteProperty() }, null); - writeWithExtraValue.Throws(Strings.DuplicatePropertyNamesNotAllowed("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.DuplicatePropertyNamesNotAllowed, "textAsStream")); } [Fact] @@ -727,7 +728,7 @@ public void CannotWritePrimitiveValueTwice() }, null); - writeWithExtraValue.Throws(Strings.ODataWriterCore_PropertyValueAlreadyWritten("textAsStream")); + writeWithExtraValue.Throws(Error.Format(SRResources.ODataWriterCore_PropertyValueAlreadyWritten, "textAsStream")); } #region Test Helper Methods diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CountFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CountFunctionalTests.cs index d90e726120..f2b16e8c7d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CountFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CountFunctionalTests.cs @@ -9,7 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -50,21 +50,21 @@ public void NullInputCase() public void EmptyInputCase() { Action createWithInvalidInput = () => ParseCount(""); - createWithInvalidInput.Throws(ODataErrorStrings.ODataUriParser_InvalidCount("")); + createWithInvalidInput.Throws(Error.Format(SRResources.ODataUriParser_InvalidCount, "")); } [Fact] public void InvalidCaseThrows() { Action createWithInvalidInput = () => ParseCount("True"); - createWithInvalidInput.Throws(ODataErrorStrings.ODataUriParser_InvalidCount("True")); + createWithInvalidInput.Throws(Error.Format(SRResources.ODataUriParser_InvalidCount, "True")); } [Fact] public void InvalidThrows() { Action createWithInvalidInput = () => ParseCount("fasle"); - createWithInvalidInput.Throws(ODataErrorStrings.ODataUriParser_InvalidCount("fasle")); + createWithInvalidInput.Throws(Error.Format(SRResources.ODataUriParser_InvalidCount, "fasle")); } private static bool? ParseCount(string p) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CustomUriFunctionsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CustomUriFunctionsTests.cs index 1cd421d6a9..37bdd9a462 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CustomUriFunctionsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/CustomUriFunctionsTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Tests.UriParser; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -94,7 +95,7 @@ public void AddCustomFunction_CannotAddFunctionWhichAlreadyExistsAsBuiltInWithSa GEO_DISTANCE_BUILTIN_FUNCTION_SIGNATURE); // Assert - addCustomFunction.Throws(Strings.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature(BUILT_IN_GEODISTANCE_FUNCTION_NAME)); + addCustomFunction.Throws(Error.Format(SRResources.CustomUriFunctions_AddCustomUriFunction_BuiltInExistsFullSignature, BUILT_IN_GEODISTANCE_FUNCTION_NAME)); } finally { @@ -148,7 +149,7 @@ public void AddCustomFunction_CannotAddFunctionWithFullSignatureExistsAsCustomFu CustomUriFunctions.AddCustomUriFunction(customFunctionName, newCustomFunctionSignature); // Assert - addCustomFunction.Throws(Strings.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists(customFunctionName)); + addCustomFunction.Throws(Error.Format(SRResources.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists, customFunctionName)); } finally { @@ -174,7 +175,7 @@ public void AddCustomFunction_CannotAddFunctionWithFullSignatureExistsAsCustomFu CustomUriFunctions.AddCustomUriFunction(customFunctionName, newCustomFunctionSignature); // Asserts - addCustomFunction.Throws(Strings.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists(customFunctionName)); + addCustomFunction.Throws(Error.Format(SRResources.CustomUriFunctions_AddCustomUriFunction_CustomFunctionOverloadExists, customFunctionName)); } finally { diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EntityReferenceFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EntityReferenceFunctionalTests.cs index 05ddba4c85..69fc87524a 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EntityReferenceFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EntityReferenceFunctionalTests.cs @@ -7,10 +7,10 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Tests.UriParser; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -29,7 +29,7 @@ public void UseMultipleEscapeSequencesWithRefInKeyAsSegment() [Fact] public void EntityReferenceCannotAppearAfterMetadata() { - PathFunctionalTestsUtil.RunParseErrorPath("$metadata/$ref", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$metadata")); + PathFunctionalTestsUtil.RunParseErrorPath("$metadata/$ref", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$metadata")); } [Fact] @@ -46,31 +46,31 @@ public void EntityReferenceCanAppearAfterSingleton() public void EntityReferenceCannotAppearAfterBatch() { // Note: Case where $ref is after batch reference is in PathFunctionaltests.cs (EntityReferenceCannotAppearAfterBatchReference) - PathFunctionalTestsUtil.RunParseErrorPath("$batch/$ref", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.BatchSegment)); + PathFunctionalTestsUtil.RunParseErrorPath("$batch/$ref", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.BatchSegment)); } [Fact] public void KeyLookupCannotAppearAfterCountAfterEntityReference() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$ref/$count(1)", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$ref/$count(1)", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void KeyLookupCannotAppearAfterEntityReference() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/$ref(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/$ref(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void EntityReferenceCannotAppearAfterProperty() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/SSN/$ref", ODataErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("SSN", "$ref")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/SSN/$ref", Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "SSN", "$ref")); } [Fact] public void CountCannotAppearAfterEntityReferenceCollectionProperties() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$ref/$count", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$ref/$count", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] @@ -104,7 +104,7 @@ public void EntityReferenceCanAppearAfterAFilteredEntitySet() [Fact] public void EntityReferenceCannotAppearAfterAValueSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/$value/$ref", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$value")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/$value/$ref", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$value")); } [Fact] @@ -117,13 +117,13 @@ public void EntityReferenceCanAppearAfterAComplexProperty() [Fact] public void EntityReferenceCannotAppearAfterReferenceSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("People/$ref/$ref", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$ref")); + PathFunctionalTestsUtil.RunParseErrorPath("People/$ref/$ref", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$ref")); } [Fact] public void EntityReferenceCannotAppearAfterEachSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("People/$each/$ref", ODataErrorStrings.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); + PathFunctionalTestsUtil.RunParseErrorPath("People/$each/$ref", SRResources.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); } [Fact] @@ -150,7 +150,7 @@ public void EntityReferenceCanAppearAfterBoundFunctionReturningSingleEntity() [Fact] public void EntityReferenceCannotAppearAfterBoundAction() { - PathFunctionalTestsUtil.RunParseErrorPath("People/Fully.Qualified.Namespace.AdoptShibaInu/$ref", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.AdoptShibaInu")); + PathFunctionalTestsUtil.RunParseErrorPath("People/Fully.Qualified.Namespace.AdoptShibaInu/$ref", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.AdoptShibaInu")); } [Fact] @@ -181,7 +181,7 @@ public void KeyOnCollectionEntityReferencesShouldWork() [Fact] public void CannotGoToPropetyOnEntityReference() { - PathFunctionalTestsUtil.RunParseErrorPath("People(7)/MyDog/$ref/Color", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + PathFunctionalTestsUtil.RunParseErrorPath("People(7)/MyDog/$ref/Color", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EnumFilterFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EnumFilterFunctionalTests.cs index 64b9bb37b9..fd30a3a8a5 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EnumFilterFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/EnumFilterFunctionalTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -395,7 +396,7 @@ public void ParseFilterWithEnumUndefinedMember() public void ParseFilterWithEmptyEnumValue() { Action parse = () => ParseFilter("Color has NS.Color''", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.Color''")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.Color''")); } [Fact] @@ -461,63 +462,63 @@ public void ParseFilterEnumTypesMismatch4() public void ParseFilterEnumTypesUndefined1() { Action parse = () => ParseFilter("NS1234.Color'Green' eq Color", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS1234.Color'Green'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS1234.Color'Green'")); } [Fact] public void ParseFilterEnumTypesUndefined2() { Action parse = () => ParseFilter("NS.BadColor'Green' eq Color", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.BadColor'Green'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.BadColor'Green'")); } [Fact] public void ParseFilterEnumMemberUndefined1() { Action parse = () => ParseFilter("NS.Color'_54' has NS.Color'Green'", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.Color'_54'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.Color'_54'")); } [Fact] public void ParseFilterEnumMemberUndefined2() { Action parse = () => ParseFilter("NS.ColorFlags'GreenYellow' has NS.ColorFlags'Green'", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.ColorFlags'GreenYellow'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.ColorFlags'GreenYellow'")); } [Fact] public void ParseFilterEnumMemberUndefined3() { Action parse = () => ParseFilter("NS.ColorFlags'Green,Yellow' has NS.ColorFlags'Green'", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.ColorFlags'Green,Yellow'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.ColorFlags'Green,Yellow'")); } [Fact] public void ParseFilterEnumMemberUndefined4() { Action parse = () => ParseFilter("ColorFlags has NS.ColorFlags'Red,2'", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.Binder_IsNotValidEnumConstant("NS.ColorFlags'Red,2'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "NS.ColorFlags'Red,2'")); } [Fact] public void ParseFilterEnumTypesWrongCast1() { Action parse = () => ParseFilter("cast(NS.ColorFlags'Green', 'Edm.Int64') eq 2", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.CastBinder_EnumOnlyCastToOrFromString); + parse.Throws(SRResources.CastBinder_EnumOnlyCastToOrFromString); } [Fact] public void ParseFilterEnumTypesWrongCast2() { Action parse = () => ParseFilter("cast(321, 'NS.ColorFlags') eq 2", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.CastBinder_EnumOnlyCastToOrFromString); + parse.Throws(SRResources.CastBinder_EnumOnlyCastToOrFromString); } [Fact] public void ParseFilterEnumTypesWrongCast3() { Action parse = () => ParseFilter("cast(321, 'NS.NotExistingColorFlags') eq 2", this.userModel, this.entityType, this.entitySet); - parse.Throws(Strings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + parse.Throws(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } [Theory] @@ -573,7 +574,7 @@ public void ParseFilterWithInOperatorWithEnumsMemberFloatIntegralValue_ThrowColl Action test = () => ParseFilter(filterQuery, this.userModel, this.entityType, this.entitySet); // Assert - test.Throws(Strings.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType("NS.Color", "Edm.Single")); // Float are of Type Edm.Single + test.Throws(Error.Format(SRResources.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType, "NS.Color", "Edm.Single")); // Float are of Type Edm.Single } [Theory] @@ -589,7 +590,7 @@ public void ParseFilterWithInOperatorWithEnumsInvalidIntegralValues_ThrowsIsNotV Action action = () => ParseFilter(filterQuery, this.userModel, this.entityType, this.entitySet); // Assert - action.Throws(Strings.Binder_IsNotValidEnumConstant(errorMessageParam)); + action.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, errorMessageParam)); } [Fact] @@ -602,7 +603,7 @@ public void ParseFilterWithInOperatorWithEnumsMemberNameWithoutSingleQuotes_Thro Action action = () => ParseFilter(filterQuery, this.userModel, this.entityType, this.entitySet); // Assert - action.Throws(Strings.MetadataBinder_PropertyNotDeclared(this.entityType.FullName, "Red")); + action.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, this.entityType.FullName, "Red")); } [Theory] @@ -621,7 +622,7 @@ public void ParseFilterWithInOperatorWithEnumsInvalidMemberNames_ThrowsIsNotVali Action action = () => ParseFilter(filterQuery, this.userModel, this.entityType, this.entitySet); // Assert - action.Throws(Strings.Binder_IsNotValidEnumConstant(expectedExceptionParameter)); + action.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, expectedExceptionParameter)); } private T GetIEdmType(string typeName) where T : IEdmType diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ExpandOptionFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ExpandOptionFunctionalTests.cs index 63d9cc1aef..67d55a7b30 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ExpandOptionFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ExpandOptionFunctionalTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -96,7 +97,7 @@ public void SkipWithInvalidValue() { // Arrange & Act & Assert Action action = () => this.Run("MyContainedDog($skip=SKIP)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidSkipOption("SKIP")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, "SKIP")); } [Fact] @@ -124,11 +125,11 @@ public void TopWithInvalidValue() { // Arrange & Act & Assert Action action = () => this.Run("MyContainedDog($top=TOP)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidTopOption("TOP")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "TOP")); // Arrange & Act & Assert action = () => this.Run("MyContainedDog($top=-1)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidTopOption("-1")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "-1")); } [Fact] @@ -147,11 +148,11 @@ public void TopOnSelectWithInvalidValue() { // Arrange & Act & Assert Action action = () => this.RunSelect("PreviousAddresses($top=TOP)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidTopOption("TOP")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "TOP")); // Arrange & Act & Assert action = () => this.RunSelect("PreviousAddresses($top=-1)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidTopOption("-1")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "-1")); } #endregion $top @@ -167,10 +168,10 @@ public void CountWithValidValue() public void CountWithInvalidValue() { Action action = () => this.Run("MyContainedDog($count=COUNT)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidCountOption("COUNT")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidCountOption, "COUNT")); action = () => this.Run("MyContainedDog($count=-2)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidCountOption("-2")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidCountOption, "-2")); } #endregion $count @@ -202,21 +203,21 @@ public void LevelsWithZeroValueShouldWork() public void LevelsWithNegativeValueShouldThrow() { Action action = () => this.Run("Fully.Qualified.Namespace.Manager/DirectReports($levels=-1)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidLevelsOption("-1")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidLevelsOption, "-1")); } [Fact] public void LevelsWithInvalidValue() { Action action = () => this.Run("Fully.Qualified.Namespace.Manager/DirectReports($levels=LEVEL)", PersonType, PeopleSet); - action.Throws(Strings.UriSelectParser_InvalidLevelsOption("LEVEL")); + action.Throws(Error.Format(SRResources.UriSelectParser_InvalidLevelsOption, "LEVEL")); } [Fact] public void LevelsOnInvalidNavigationProperty() { Action action = () => this.Run("MyPaintings($levels=6)", PersonType, PeopleSet); - action.Throws(Strings.ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType("MyPaintings", "Fully.Qualified.Namespace.Painting", "Fully.Qualified.Namespace.Person")); + action.Throws(Error.Format(SRResources.ExpandItemBinder_LevelsNotAllowedOnIncompatibleRelatedType, "MyPaintings", "Fully.Qualified.Namespace.Painting", "Fully.Qualified.Namespace.Person")); } #endregion $levels diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FilterAndOrderByFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FilterAndOrderByFunctionalTests.cs index e4c27c234a..83ec39b2f2 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FilterAndOrderByFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FilterAndOrderByFunctionalTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; using Microsoft.OData.Tests.ScenarioTests.UriBuilder; @@ -15,7 +16,6 @@ using Microsoft.Spatial; using Microsoft.Test.OData.Utils.Metadata; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -99,7 +99,7 @@ public void ParseFilterFloatValuesNeedPromotionThrows(string text) { //Non-ConstantNode "ID" whose type is float cannot be promoted to Decimal Action parse = () => ParseFilter(text, HardCodedTestModel.TestModel, HardCodedTestModel.GetPet2Type(), HardCodedTestModel.GetPet2Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Single", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Single", "Edm.Decimal", "Equal")); } [Theory] @@ -119,7 +119,7 @@ public void ParseFilterDoubleValuesWithOptionalSuffixThrows() // double and (implicit) decimal are incompatible string decimalPrecisionStr = "3258.678765765489753678965390"; Action parse = () => ParseFilter("ID eq " + decimalPrecisionStr, HardCodedTestModel.TestModel, HardCodedTestModel.GetPet3Type(), HardCodedTestModel.GetPet3Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Double", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Double", "Edm.Decimal", "Equal")); } [Fact] @@ -133,7 +133,7 @@ public void ParseFilterDoubleValuesNeedPromotion() //Non-ConstantNode whose type is Single cannot be promoted to Decimal Action parse = () => ParseFilter("ID eq 123M", HardCodedTestModel.TestModel, HardCodedTestModel.GetPet3Type(), HardCodedTestModel.GetPet3Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Double", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Double", "Edm.Decimal", "Equal")); } #if !NETCOREAPP @@ -166,7 +166,7 @@ public void ParseFilterDecimalValuesWithOptionalSuffix() // numeric string overflowing all types: parse = () => ParseFilter("1.79769313486232E+30700 eq " + decimalPrecisionStr, HardCodedTestModel.TestModel, HardCodedTestModel.GetPet3Type(), HardCodedTestModel.GetPet3Set()); - parse.Throws(ODataErrorStrings.ExpressionLexer_InvalidNumericString("1.79769313486232E+30700")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_InvalidNumericString, "1.79769313486232E+30700")); } #endif @@ -229,13 +229,13 @@ public void ParseFilterPropertyAndConstantsWithOptionalSuffix() ((ConstantNode)((BinaryOperatorNode)filterQueryNode.Expression).Right).ShouldBeConstantQueryNode(11111111111100000000D); Action parse = () => filterQueryNode = ParseFilter("SingleID eq 2.34243223423235234423400003m", HardCodedTestModel.TestModel, HardCodedTestModel.GetPet1Type(), HardCodedTestModel.GetPet1Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Single", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Single", "Edm.Decimal", "Equal")); parse = () => ParseFilter("DoubleID eq DecimalID", HardCodedTestModel.TestModel, HardCodedTestModel.GetPet1Type(), HardCodedTestModel.GetPet1Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Double", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Double", "Edm.Decimal", "Equal")); parse = () => ParseFilter("SingleID eq DecimalID", HardCodedTestModel.TestModel, HardCodedTestModel.GetPet1Type(), HardCodedTestModel.GetPet1Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Single", "Edm.Decimal", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Single", "Edm.Decimal", "Equal")); } [Fact] @@ -320,7 +320,7 @@ public void ParseFilterWithBoolean() bon.Right.ShouldBeConstantQueryNode(false); Action parse = () => ParseFilter("ID eq 1", HardCodedTestModel.TestModel, HardCodedTestModel.GetPet5Type(), HardCodedTestModel.GetPet5Set()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandsError("Edm.Boolean", "Edm.Int32", "Equal")); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Boolean", "Edm.Int32", "Equal")); } @@ -423,21 +423,21 @@ public void ParseFilterWithEntityCollectionCountWithFilterOption() public void ParseFilterWithEntityCollectionCountWithUnbalanceParenthesisThrows() { Action parse = () => ParseFilter("MyFriendsDogs/$count($filter=Color eq 'Brown' gt 1", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(50, "MyFriendsDogs/$count($filter=Color eq 'Brown' gt 1")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 50, "MyFriendsDogs/$count($filter=Color eq 'Brown' gt 1")); } [Fact] public void ParseFilterWithEntityCollectionCountWithEmptyParenthesisThrows() { Action parse = () => ParseFilter("MyFriendsDogs/$count()", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.UriParser_EmptyParenthesis); + parse.Throws(SRResources.UriParser_EmptyParenthesis); } [Fact] public void ParseFilterWithEntityCollectionCountWithIllegalQueryOptionThrows() { Action parse = () => ParseFilter("MyFriendsDogs/$count($orderby=Color) gt 1", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_IllegalQueryOptioninDollarCount); + parse.Throws(SRResources.UriQueryExpressionParser_IllegalQueryOptioninDollarCount); } [Fact] @@ -471,7 +471,7 @@ public void ParseFilterWithEntityCollectionCountWithFilterAndSearchOptions() public void ParseFilterWithSingleValueCountWithFilterAndSearchOptionsThrows() { Action parse = () => ParseFilter("ID/$count($filter=Color eq 'Brown';$search=brown) gt 1", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.MetadataBinder_CountSegmentNextTokenNotCollectionValue); + parse.Throws(SRResources.MetadataBinder_CountSegmentNextTokenNotCollectionValue); } [Fact] @@ -497,7 +497,7 @@ public void ReplaceShouldWork() public void FilterWithKeyLookupOnNavPropIsNotAllowed() { Action parse = () => ParseFilter("MyPeople(987)", HardCodedTestModel.TestModel, HardCodedTestModel.GetDogType()); - parse.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("MyPeople")); + parse.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "MyPeople")); } [Fact] @@ -541,7 +541,7 @@ public void AnyIsCaseSensitive() { Action parse = () => ParseFilter("MyPeople/Any()", HardCodedTestModel.TestModel, HardCodedTestModel.GetDogType()); - parse.Throws(ODataErrorStrings.FunctionCallBinder_UriFunctionMustHaveHaveNullParent("Any")); + parse.Throws(Error.Format(SRResources.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, "Any")); } [Fact] @@ -699,14 +699,14 @@ public void FilterByWithNonEntityType() public void FilterWithIncompatibleTypeShouldThrow() { Action action = () => ParseFilter("contains($it,'6')", HardCodedTestModel.TestModel, EdmCoreModel.Instance.GetPrimitiveType(EdmPrimitiveTypeKind.Int32)); - action.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound("contains", "contains(Edm.String Nullable=true, Edm.String Nullable=true)")); + action.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "contains", "contains(Edm.String Nullable=true, Edm.String Nullable=true)")); } [Fact] public void FilterWithInvalidParameterShouldThrow() { Action action = () => ParseFilter("$It gt 6", HardCodedTestModel.TestModel, EdmCoreModel.Instance.GetPrimitiveType(EdmPrimitiveTypeKind.Int32)); - action.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Edm.Int32", "$It")); + action.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Edm.Int32", "$It")); } [Fact] @@ -714,7 +714,7 @@ public void BadCastShouldResultInNiceException() { Action parse = () => ParseOrderBy("MyDog/Missing.Type/Color", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.CastBinder_ChildTypeIsNotEntity("Missing.Type")); + parse.Throws(Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "Missing.Type")); } [Fact] @@ -733,7 +733,7 @@ public void OrderByWithEntityExpressionShouldThrow() { Action parse = () => ParseOrderBy("MyDog", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.MetadataBinder_OrderByExpressionNotSingleValue); + parse.Throws(SRResources.MetadataBinder_OrderByExpressionNotSingleValue); } [Fact] @@ -741,14 +741,14 @@ public void OrderByWithEntityCollectionExpressionShouldThrow() { Action parse = () => ParseOrderBy("MyPeople", HardCodedTestModel.TestModel, HardCodedTestModel.GetDogType()); - parse.Throws(ODataErrorStrings.MetadataBinder_OrderByExpressionNotSingleValue); + parse.Throws(SRResources.MetadataBinder_OrderByExpressionNotSingleValue); } [Fact] public void NegateAnEntityShouldThrow() { Action parse = () => ParseOrderBy("-MyDog", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.MetadataBinder_IncompatibleOperandError(HardCodedTestModel.GetPersonMyDogNavProp().Type.FullName(), UnaryOperatorKind.Negate)); + parse.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandError, HardCodedTestModel.GetPersonMyDogNavProp().Type.FullName(), UnaryOperatorKind.Negate)); } [Fact] @@ -849,7 +849,7 @@ public void InvalidPropertyNameThrowsUsefulErrorMessage() { // regression test for: [Fuzz] InvalidCastException being thrown for filter/orderby with query "PersonMetadataId /c" Action parseInvalidPropertyName = () => ParseFilter("PersonMetadataId /c", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseInvalidPropertyName.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "PersonMetadataId")); + parseInvalidPropertyName.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "PersonMetadataId")); } [Fact] @@ -873,7 +873,7 @@ public void TrailingDollarSegmentThows() { // regression test for: [UriParser] Trailing $ lost Action parseWithTrailingDollarSign = () => ParseOrderBy("Name/$", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithTrailingDollarSign.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Edm.String", "$")); + parseWithTrailingDollarSign.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Edm.String", "$")); } [Fact] @@ -882,7 +882,7 @@ public void ArbitraryFunctionCallsNotAllowed() // regression test for: [UriParser] day() allowed. What does that mean? // make sure arbitrary funcitons aren't allowed... Action parseArbitraryFunctionCall = () => ParseFilter("gobbldygook() eq 20", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseArbitraryFunctionCall.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("gobbldygook")); + parseArbitraryFunctionCall.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "gobbldygook")); } [Fact] @@ -893,7 +893,7 @@ public void EmptyFunctionCallParametersAreProperlyValidated() Action parseWithInvalidParameters = () => ParseFilter("day() eq 20", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); FunctionSignatureWithReturnType[] signatures = FunctionCallBinder.ExtractSignatures( FunctionCallBinder.GetUriFunctionSignatures("day")); // to match the error message... blah - parseWithInvalidParameters.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + parseWithInvalidParameters.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "day", UriFunctionsHelper.BuildFunctionSignatureListDescription("day", signatures))); } @@ -906,7 +906,7 @@ public void FunctionCallParametersAreValidated() Action parseWithInvalidParameters = () => ParseFilter("day(1) eq 20", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); FunctionSignatureWithReturnType[] signatures = FunctionCallBinder.ExtractSignatures( FunctionCallBinder.GetUriFunctionSignatures("day")); // to match the error message... blah - parseWithInvalidParameters.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + parseWithInvalidParameters.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "day", UriFunctionsHelper.BuildFunctionSignatureListDescription("day", signatures))); } @@ -916,7 +916,7 @@ public void AnyAllOnAPrimitiveShouldThrowODataException() { // regression test for: [URIParser] $filter with Any/All throws invalid cast instead of Odata Exception Action anyOnPrimitiveType = () => ParseFilter("Name/any(a: a eq 'Bob')", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - anyOnPrimitiveType.Throws(ODataErrorStrings.MetadataBinder_LambdaParentMustBeCollection); + anyOnPrimitiveType.Throws(SRResources.MetadataBinder_LambdaParentMustBeCollection); } #region Custom Functions @@ -983,7 +983,7 @@ public void FunctionWithComplexParameterInJsonWithSingleQuotesInsteadOfDoubleQuo public void FunctionWithInvalidComplexParameterThrows() { Action parseInvalidComplex = () => ParseFilter("Fully.Qualified.Namespace.CanMoveToAddress(address={}})", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseInvalidComplex.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("}", "53", "Fully.Qualified.Namespace.CanMoveToAddress(address={}})")); + parseInvalidComplex.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", "53", "Fully.Qualified.Namespace.CanMoveToAddress(address={}})")); } [Fact] @@ -1066,14 +1066,14 @@ public void FunctionsBoundToCollectionTypesWork() public void CannotFindFunctionWithMatchedParameters() { Action parseWithExplicitBindingParam = () => ParseFilter("Fully.Qualified.Namespace.HasDog(person=$it)", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithExplicitBindingParam.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("Fully.Qualified.Namespace.HasDog")); // no '...HasDog' method has parameter type of '$it' RangeVariableToken. + parseWithExplicitBindingParam.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "Fully.Qualified.Namespace.HasDog")); // no '...HasDog' method has parameter type of '$it' RangeVariableToken. } [Fact] public void CannotAddEntityAsBindingParameterToFunction() { Action parseWithExplicitBindingParam = () => ParseFilter("HasDog(person=People(1))", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithExplicitBindingParam.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("People")); + parseWithExplicitBindingParam.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "People")); } [Fact] @@ -1131,7 +1131,7 @@ public void ParseFilterWithFunctionCallBoundToPrimitiveShouldNotLookForFunctions { var model = ModelBuildingHelpers.GetModelFunctionsOnNonEntityTypes(); Action parse = () => ParseFilter("ID/IsPrime()", model, model.EntityTypes().Single(e => e.Name == "Vegetable"), null); - parse.Throws(ODataErrorStrings.FunctionCallBinder_UriFunctionMustHaveHaveNullParent("IsPrime")); + parse.Throws(Error.Format(SRResources.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, "IsPrime")); } [Fact] @@ -1139,14 +1139,14 @@ public void ParseFilterWithFunctionCallBoundToPrimitiveWithoutParensShouldNotLoo { var model = ModelBuildingHelpers.GetModelFunctionsOnNonEntityTypes(); Action parse = () => ParseFilter("ID/Test.IsPrime", model, model.EntityTypes().Single(e => e.Name == "Vegetable"), null); - parse.Throws(ODataErrorStrings.CastBinder_ChildTypeIsNotEntity("Test.IsPrime")); + parse.Throws(Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "Test.IsPrime")); } [Fact] public void FunctionWithExpressionParameterThrows() { Action parseWithExpressionParameter = () => ParseFilter("OwnsTheseDogs(dogNames=Dogs(0))", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithExpressionParameter.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("Dogs")); + parseWithExpressionParameter.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "Dogs")); } [Fact] @@ -1154,7 +1154,7 @@ public void FunctionWithMultipleParametersWithTheSameNameThrows() { var model = ModelBuildingHelpers.GetModelWithFunctionWithDuplicateParameterNames(); Action parseWithMultipleParameters = () => ParseFilter("Test.Foo(p2='stuff', p2=1)", model, model.EntityTypes().Single(e => e.Name == "Vegetable")); - parseWithMultipleParameters.Throws(ODataErrorStrings.FunctionCallParser_DuplicateParameterOrEntityKeyName); + parseWithMultipleParameters.Throws(SRResources.FunctionCallParser_DuplicateParameterOrEntityKeyName); } [Fact] @@ -1177,7 +1177,7 @@ public void LongFunctionChainWorksInFilter() public void ActionsThrowOnClosedTypeInFilter() { Action parseWithAction = () => ParseFilter("Move", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithAction.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "Move")); + parseWithAction.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "Move")); } [Fact] @@ -1401,14 +1401,14 @@ public void ReferenceComputeAliasCreatedBeforeAggrageteThrows() {"$apply", "compute(FavoriteNumber mul 2 as DoubleFavorite)/aggregate(DoubleFavorite with sum as Total)"} }); Action parseAction = () => { odataQueryOptionParser.ParseApply(); odataQueryOptionParser.ParseOrderBy(); }; - parseAction.Throws(ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue("DoubleFavorite")); + parseAction.Throws(Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, "DoubleFavorite")); } [Fact] public void ActionsThrowOnClosedInOrderby() { Action parseWithAction = () => ParseOrderBy("Move asc", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithAction.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "Move")); + parseWithAction.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "Move")); } [Fact] @@ -1466,7 +1466,7 @@ public void LongFunctionChain() public void FunctionBindingFailsIfParameterNameIsIncorrect() { Action parseWithIncorrectName = () => ParseFilter("Fully.Qualified.Namespace.HasDog(inOfFiCe=true)", HardCodedTestModel.TestModel, HardCodedTestModel.GetEmployeeType()); - parseWithIncorrectName.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("Fully.Qualified.Namespace.HasDog")); // no '...HasDog' method has parameter 'inOfFiCe'. + parseWithIncorrectName.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "Fully.Qualified.Namespace.HasDog")); // no '...HasDog' method has parameter 'inOfFiCe'. } [Fact] @@ -1483,14 +1483,14 @@ public void FunctionWithoutBindingParameterShouldWorkInFilterOrderby() public void FunctionCallWithKeyExpressionShouldFail() { Action parse = () => ParseFilter("AllMyFriendsDogs(inOffice=true)(1) ne null", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(32, "AllMyFriendsDogs(inOffice=true)(1) ne null")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 32, "AllMyFriendsDogs(inOffice=true)(1) ne null")); } [Fact] public void FunctionCallWithKeyExpressionShouldFailEvenIfFunctionHasNoParameters() { Action parse = () => ParseFilter("AllMyFriendsDogs(1) ne null", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.MetadataBinder_UnknownFunction("AllMyFriendsDogs")); + parse.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "AllMyFriendsDogs")); } [Fact] @@ -1498,7 +1498,7 @@ public void AmbiguousFunctionCallThrows() { var model = ModelBuildingHelpers.GetModelWithFunctionOverloadsWithSameParameterNames(); Action parse = () => ParseFilter("Test.Foo(p2='1')", model, model.EntityTypes().Single(x => x.Name == "Vegetable")); - parse.Throws(ODataErrorStrings.FunctionOverloadResolver_NoSingleMatchFound("Test.Foo", "p2")); + parse.Throws(Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "Test.Foo", "p2")); } [Fact] @@ -1951,7 +1951,7 @@ public void FilterWithInOperationWithStringConstant() public void FilterWithInOperationWithMismatchedOperandTypes() { Action parse = () => ParseFilter("ID in RelatedSSNs", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType("Edm.String", "Edm.Int32")); + parse.Throws(Error.Format(SRResources.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType, "Edm.String", "Edm.Int32")); } [Fact] @@ -2079,7 +2079,7 @@ public void FilterWithInOperationWithEnumsInvalidMemberIntegralValue_ThrowsIsNot Action action = () => ParseFilter(filterQuery, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); // Assert - action.Throws(ODataErrorStrings.Binder_IsNotValidEnumConstant("53")); + action.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "53")); } [Theory] @@ -2096,7 +2096,7 @@ public void FilterWithInOperationWithEnumsInvalidMemberNames_ThrowsIsNotValidEnu Action action = () => ParseFilter(filterQuery, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); // Assert - action.Throws(ODataErrorStrings.Binder_IsNotValidEnumConstant(expectedExceptionParameter)); + action.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, expectedExceptionParameter)); } [Fact] @@ -2190,7 +2190,7 @@ public void FilterWithInOperationWithMalformCollection(string collection) { string filterClause = $"SSN in {collection}"; Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.StringItemShouldBeQuoted("d")); + parse.Throws(Error.Format(SRResources.StringItemShouldBeQuoted, "d")); } [Fact] @@ -2489,7 +2489,7 @@ public void FilterWithInOperationWithInvalidNullLiteral(string collection, strin { string filterClause = $"SSN in {collection}"; Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.StringItemShouldBeQuoted(error)); + parse.Throws(Error.Format(SRResources.StringItemShouldBeQuoted, error)); } [Fact] @@ -2659,7 +2659,7 @@ public void FilterWithInOperationWithEmptyStringAndWhitespaceInSquareBrackets(st public void FilterWithInOperationGuidWithEmptyQuotesThrows(string filterClause, string quotedString) { Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue(quotedString, "Edm.Guid")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, quotedString, "Edm.Guid")); } [Theory] @@ -2672,7 +2672,7 @@ public void FilterWithInOperationGuidWithEmptyQuotesThrows(string filterClause, public void FilterWithInOperationDateTimeOffsetWithEmptyQuotesThrows(string filterClause, string quotedString) { Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue(quotedString, "Edm.DateTimeOffset")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, quotedString, "Edm.DateTimeOffset")); } [Theory] @@ -2685,7 +2685,7 @@ public void FilterWithInOperationDateTimeOffsetWithEmptyQuotesThrows(string filt public void FilterWithInOperationDateWithEmptyQuotesThrows(string filterClause, string quotedString) { Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue(quotedString, "Edm.Date")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, quotedString, "Edm.Date")); } [Theory] @@ -2696,7 +2696,7 @@ public void FilterWithInOperationWithQuotedGuidCollectionWithInvalidValuesThrows string filterClause = $"MyGuid in {guidsCollection}"; Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue("", "Edm.Guid")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, "", "Edm.Guid")); } [Theory] @@ -2707,7 +2707,7 @@ public void FilterWithInOperationWithQuotedDateTimeOffsetCollectionWithInvalidVa string filterClause = $"Birthdate in {dateTimeOffsetCollection}"; Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue("", "Edm.DateTimeOffset")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, "", "Edm.DateTimeOffset")); } [Theory] @@ -2718,14 +2718,14 @@ public void FilterWithInOperationWithQuotedDateCollectionWithInvalidValuesThrows string filterClause = $"MyDate in {dateCollection}"; Action parse = () => ParseFilter(filterClause, HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(Strings.ReaderValidationUtils_CannotConvertPrimitiveValue("", "Edm.Date")); + parse.Throws(Error.Format(SRResources.ReaderValidationUtils_CannotConvertPrimitiveValue, "", "Edm.Date")); } [Fact] public void FilterWithInOperationWithMismatchedClosureCollection() { Action parse = () => ParseFilter("ID in (1,2,3]", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + parse.Throws(SRResources.ExpressionLexer_UnbalancedBracketExpression); } [Fact] @@ -2812,7 +2812,7 @@ public void OrderByWithInOperationWithMismatchedOperandTypes() { Action parse = () => ParseOrderBy("ID in RelatedSSNs", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); parse.Throws( - ODataErrorStrings.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType("Edm.String", "Edm.Int32")); + Error.Format(SRResources.Nodes_InNode_CollectionItemTypeMustBeSameAsSingleItemType, "Edm.String", "Edm.Int32")); } [Fact] @@ -2919,7 +2919,7 @@ public void OrderByWithInOperationWithBracketedCollection() public void OrderByWithInOperationWithMismatchedClosureCollection() { Action parse = () => ParseOrderBy("ID in (1,2,3]", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType()); - parse.Throws(ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + parse.Throws(SRResources.ExpressionLexer_UnbalancedBracketExpression); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FullUriFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FullUriFunctionalTests.cs index c13fbf7cd9..31c16d092d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FullUriFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/FullUriFunctionalTests.cs @@ -12,7 +12,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -86,7 +86,7 @@ public void SelectOrExpandCanOnlyBeCalledOnEntity() { ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://www.odata.com/OData"), new Uri("http://www.odata.com/OData/People(1)/Name?$select=Name")); Action parseWithNonEntity = () => parser.ParseUri(); - parseWithNonEntity.Throws(ODataErrorStrings.UriParser_TypeInvalidForSelectExpand("Edm.String")); + parseWithNonEntity.Throws(Error.Format(SRResources.UriParser_TypeInvalidForSelectExpand, "Edm.String")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/OpenPropertiesFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/OpenPropertiesFunctionalTests.cs index d70af30166..82459de6b2 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/OpenPropertiesFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/OpenPropertiesFunctionalTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -65,7 +65,7 @@ public void ParseFilterWithClosedTypeAndOpenPropertyExpectException() Action parse = () => ParseFilter("PhantomProperty ne 'Bug'", HardCodedTestModel.TestModel, personType); var expectedMessage = - ODataErrorStrings.MetadataBinder_PropertyNotDeclared( + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, personType.FullTypeName(), "PhantomProperty"); @@ -112,7 +112,7 @@ public void ParseFilterWithOpenComplexPropertyOnClosedTypeExpectException() Action parse = () => ParseFilter("PhantomProperty1/PhantomProperty2 eq 'abc'", HardCodedTestModel.TestModel, personType); var expectedMessage = - ODataErrorStrings.MetadataBinder_PropertyNotDeclared( + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, personType.FullTypeName(), "PhantomProperty1"); @@ -170,7 +170,7 @@ public void ParseFilterWithOpenPropertyAfterCastExpectException() Action parse = () => ParseFilter("Critics/Fully.Qualified.Namespace.Dog/any()", HardCodedTestModel.TestModel, HardCodedTestModel.GetPaintingType()); var expectedMessage = - ODataErrorStrings.MetadataBinder_HierarchyNotFollowed( + Error.Format(SRResources.MetadataBinder_HierarchyNotFollowed, HardCodedTestModel.GetDogType().FullTypeName(), ""); diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ParameterAliasFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ParameterAliasFunctionalTests.cs index e25e3a3620..a4c8e0d18b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ParameterAliasFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/ParameterAliasFunctionalTests.cs @@ -11,13 +11,12 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { public class ParameterAliasFunctionalTests { - #region alias in path [Fact] public void ParsePath_AliasInFunctionImport() @@ -119,7 +118,7 @@ public void ParsePath_AliasInFunctionImport_InvalidAliasName() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("!", 5, "id=@p!1")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "!", 5, "id=@p!1")); } [Fact] @@ -203,7 +202,7 @@ public void ParsePath_IntArgumentOnShortParameter() Assert.Equal("Edm.Int16", constNode.TypeReference.FullName()); }); // TODO: This is a bug repro. Remove this assertion after the bug is fixed. - parseUri.Throws(ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Int32", "Edm.Int16")); + parseUri.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Int32", "Edm.Int16")); } [Theory] @@ -346,7 +345,7 @@ public void ParseFilter_AliasInFunction_CircleReference() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parse.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -423,7 +422,7 @@ public void ParseFilter_AliasInFilterPathSegment_AliasAsFirstSegment() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(Strings.RequestUriProcessor_SyntaxError); + parse.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -434,7 +433,7 @@ public void ParseFilter_AliasInFilterPathSegment_FilterSegmentOnSingleton() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_CannotApplyFilterOnSingleEntities("Boss")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_CannotApplyFilterOnSingleEntities, "Boss")); } [Fact] @@ -445,7 +444,7 @@ public void ParseFilter_AliasInFilterPathSegment_SingleEntity() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_CannotApplyFilterOnSingleEntities("People")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_CannotApplyFilterOnSingleEntities, "People")); } [Fact] @@ -521,7 +520,7 @@ public void ParseFilter_AliasInFilterPathSegment_InvalidAliasName() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("!", 2, "@p!1")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "!", 2, "@p!1")); } [Fact] @@ -532,7 +531,7 @@ public void ParseFilter_AliasInFilterPathSegment_AliasAsNonBoolean() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue); + parse.Throws(SRResources.MetadataBinder_FilterExpressionNotSingleValue); } [Fact] @@ -564,7 +563,7 @@ public void ParseFilter_AliasInFilterPathSegment_AliasWithCircleReference() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parse.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -575,7 +574,7 @@ public void ParseFilter_AliasInFilterPathSegment_AliasIsItself() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parse.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -681,7 +680,7 @@ public void ParseFilter_ExpressionInFilterPathSegment_ValueAsInteger() { }); - parse.Throws(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue); + parse.Throws(SRResources.MetadataBinder_FilterExpressionNotSingleValue); } [Fact] @@ -693,7 +692,7 @@ public void ParseFilter_AliasInFilterPathSegment_ExpressionResolvesToInteger() { }); - parse.Throws(ODataErrorStrings.MetadataBinder_FilterExpressionNotSingleValue); + parse.Throws(SRResources.MetadataBinder_FilterExpressionNotSingleValue); } [Fact] @@ -817,7 +816,7 @@ public void ParseFilter_AliasInFilterPathSegment_RefThenFilterSegment() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$ref")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$ref")); } [Fact] @@ -849,7 +848,7 @@ public void ParseFilter_AliasInFilterPathSegment_CountThenFilterSegment() (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$count")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$count")); } // NOTE: Per OData 4.01 spec, the $filter query option must not be used in conjunction with both @@ -951,7 +950,7 @@ public void ParseFilter_AliasInFilterPathSegment_FilterSegmentAfterNonComposable (oDataPath, filterClause, orderByClause, selectExpandClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.AdoptShibaInu")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.AdoptShibaInu")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/PathFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/PathFunctionalTests.cs index c98af59d1c..b89d211597 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/PathFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/PathFunctionalTests.cs @@ -13,7 +13,7 @@ using Microsoft.OData.Edm; using Microsoft.Spatial; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -76,7 +76,7 @@ public void SimpleNavigationPropertyLinkSegment() public void MultipleUnnamedKeysThrowsException() { Action parsePath = () => PathFunctionalTestsUtil.RunParsePath("People(7,8,9)"); - parsePath.Throws(ODataErrorStrings.RequestUriProcessor_KeysMustBeNamed); + parsePath.Throws(SRResources.RequestUriProcessor_KeysMustBeNamed); } [Fact] @@ -92,7 +92,7 @@ public void SimpleActionImport() public void VoidServiceOperationIsNotComposable() { Action parsePath = () => PathFunctionalTestsUtil.RunParsePath("GetNothing/foo"); - parsePath.Throws(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("GetNothing")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "GetNothing")); } [Fact] @@ -121,7 +121,7 @@ public void PrimitiveServiceOperationShouldAllowButIgnoreEmptyParens() public void PrimitiveServiceOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { Action parsePath = () => PathFunctionalTestsUtil.RunParsePath("GetSomeNumber/foo"); - parsePath.Throws(ODataErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("GetSomeNumber", "foo")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "GetSomeNumber", "foo")); } [Fact] @@ -136,7 +136,7 @@ public void ComplexServiceOperationIsComposable() public void ComplexServiceOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { Action parsePath = () => PathFunctionalTestsUtil.RunParsePath("GetSomeAddress/foo"); - parsePath.Throws(ODataErrorStrings.RequestUriProcessor_ResourceNotFound("foo")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "foo")); } [Fact] @@ -150,7 +150,7 @@ public void EntityServiceOperationIsComposable() [Fact] public void EntityServiceOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("GetCoolestPerson/foo", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("foo")); + PathFunctionalTestsUtil.RunParseErrorPath("GetCoolestPerson/foo", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "foo")); } [Fact] @@ -165,19 +165,19 @@ public void EntitySetServiceOperationIsComposable() [Fact] public void EntitySetServiceOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("GetCoolPeople/foo", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("GetCoolPeople/foo", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void PrimitiveCollectionOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("GetSomeNumbers/foo", ODataErrorStrings.RequestUriProcessor_CannotQueryCollections("GetSomeNumbers")); + PathFunctionalTestsUtil.RunParseErrorPath("GetSomeNumbers/foo", Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, "GetSomeNumbers")); } [Fact] public void ComplexCollectionServiceOperationThrowsRightErrorWhenFollowedByUnrecognizedSegment() { - PathFunctionalTestsUtil.RunParseErrorPath("GetSomeAddresses/foo", ODataErrorStrings.RequestUriProcessor_CannotQueryCollections("GetSomeAddresses")); + PathFunctionalTestsUtil.RunParseErrorPath("GetSomeAddresses/foo", Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, "GetSomeAddresses")); } [Fact] @@ -356,7 +356,7 @@ public void FunctionWithoutEntitySetPath() [Fact] public void CannotAddParametersToActions() { - PathFunctionalTestsUtil.RunParseErrorPath("Context.MoveEveryone(streetAddress='stuff')", ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates("Context.MoveEveryone")); + PathFunctionalTestsUtil.RunParseErrorPath("Context.MoveEveryone(streetAddress='stuff')", Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, "Context.MoveEveryone")); } [Fact] @@ -364,7 +364,7 @@ public void NothingCanComeAfterAnAction() { // TODO: We can improve error message drastically when we refactor path parsing // The 'Walk' action returns an Address - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/Fully.Qualified.Namespace.Walk/City", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.Walk")); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/Fully.Qualified.Namespace.Walk/City", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.Walk")); } #region Functions @@ -420,13 +420,13 @@ public void FunctionWithAliasedParameters() [Fact] public void FunctionWithPositionalParmeterShouldThrow() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.Employee/Fully.Qualified.Namespace.HasDog(true)", ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates("Fully.Qualified.Namespace.HasDog")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.Employee/Fully.Qualified.Namespace.HasDog(true)", Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, "Fully.Qualified.Namespace.HasDog")); } [Fact] public void FunctionWithMultiplePositionalParametersShouldThrow() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(true, 'Fido')", ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates("Fully.Qualified.Namespace.HasDog")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(true, 'Fido')", Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, "Fully.Qualified.Namespace.HasDog")); } [Fact] @@ -452,14 +452,14 @@ public void FunctionsAreComposable() [Fact] public void FunctionWithBogusBracketsThrows() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.CanMoveToAddress(address={}})", ODataErrorStrings.ExpressionLexer_InvalidCharacter("}", "10", "address={}}")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.CanMoveToAddress(address={}})", Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", "10", "address={}}")); } [Fact] public void FunctionBoundToPrimitiveCannotBeInvoked() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Vegetables(0)/ID/IsPrime()", ModelBuildingHelpers.GetModelFunctionsOnNonEntityTypes()); - parse.Throws(ODataErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("ID", "IsPrime()")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "ID", "IsPrime()")); } [Fact] @@ -569,7 +569,7 @@ public void FunctionWithCollectionOfComplexParameterInJsonWorks() public void AmbiguousFunctionCallThrows() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Vegetables(0)/Test.Foo(p2='1')", ModelBuildingHelpers.GetModelWithFunctionOverloadsWithSameParameterNames()); - parse.Throws(ODataErrorStrings.FunctionOverloadResolver_NoSingleMatchFound("Test.Foo", "p2")); + parse.Throws(Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "Test.Foo", "p2")); } [Fact] @@ -583,20 +583,20 @@ public void ActionBoundToComplexTypeWorks() public void ActionBoundToPrimitiveThrows() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Vegetables(0)/ID/Subtract", ModelBuildingHelpers.GetModelFunctionsOnNonEntityTypes()); - parse.Throws(ODataErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("ID", "Subtract")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "ID", "Subtract")); } [Fact] public void FunctionWithExpressionParameterThrows() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.OwnsTheseDogs(dogNames=Dogs(0))", ODataErrorStrings.MetadataBinder_UnknownFunction("Dogs")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.OwnsTheseDogs(dogNames=Dogs(0))", Error.Format(SRResources.MetadataBinder_UnknownFunction, "Dogs")); } [Fact] public void FunctionWithMultipleParametersWithTheSameNameThrows() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Foo(p2='stuff', p2='1')", ModelBuildingHelpers.GetModelWithFunctionWithDuplicateParameterNames()); - parse.Throws(ODataErrorStrings.FunctionCallParser_DuplicateParameterOrEntityKeyName); + parse.Throws(SRResources.FunctionCallParser_DuplicateParameterOrEntityKeyName); } #endregion @@ -712,25 +712,25 @@ public void CastShouldBeAllowedOnComplexValueCollection() [Fact] public void InvalidCastShouldNotBeAllowedOnSingleComplex() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/MyAddress/Fully.Qualified.Namespace.OpenAddress", ODataErrorStrings.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType("Fully.Qualified.Namespace.OpenAddress", HardCodedTestModel.GetAddressType().FullName())); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/MyAddress/Fully.Qualified.Namespace.OpenAddress", Error.Format(SRResources.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, "Fully.Qualified.Namespace.OpenAddress", HardCodedTestModel.GetAddressType().FullName())); } [Fact] public void InvalidCastShouldNotBeAllowedOnComplexCollection() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/PreviousAddresses/Fully.Qualified.Namespace.OpenAddress", ODataErrorStrings.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType("Fully.Qualified.Namespace.OpenAddress", HardCodedTestModel.GetAddressType().FullName())); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/PreviousAddresses/Fully.Qualified.Namespace.OpenAddress", Error.Format(SRResources.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, "Fully.Qualified.Namespace.OpenAddress", HardCodedTestModel.GetAddressType().FullName())); } [Fact] public void InvalidCastShouldNotBeAllowedOnSingleEntity() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(2)/Fully.Qualified.Namespace.Person", ODataErrorStrings.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType("Fully.Qualified.Namespace.Person", HardCodedTestModel.GetDogType().FullName())); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(2)/Fully.Qualified.Namespace.Person", Error.Format(SRResources.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, "Fully.Qualified.Namespace.Person", HardCodedTestModel.GetDogType().FullName())); } [Fact] public void InvalidCastShouldNotBeAllowedOnEntityCollection() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs/Fully.Qualified.Namespace.Person", ODataErrorStrings.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType("Fully.Qualified.Namespace.Person", HardCodedTestModel.GetDogType().FullName())); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs/Fully.Qualified.Namespace.Person", Error.Format(SRResources.RequestUriProcessor_InvalidTypeIdentifier_UnrelatedType, "Fully.Qualified.Namespace.Person", HardCodedTestModel.GetDogType().FullName())); } [Fact] @@ -761,7 +761,7 @@ public void KeysExpressionsCanHaveWhitespace() public void KeysDuplicatedError() { Action action = () => PathFunctionalTestsUtil.RunParsePath("Dogs( ID = 1, ID = 1)"); - action.Throws(ODataErrorStrings.FunctionCallParser_DuplicateParameterOrEntityKeyName); + action.Throws(SRResources.FunctionCallParser_DuplicateParameterOrEntityKeyName); } [Fact] @@ -837,7 +837,7 @@ public void ExplicitKeysCanBeNamed() [Fact] public void IfKeyIsExplicitlySetToValueOfImplicitKeyThrowError() { - PathFunctionalTestsUtil.RunParseErrorPath("People(32)/MyLions(ID1=64)", ODataErrorStrings.BadRequest_KeyMismatch(HardCodedTestModel.GetLionType().FullName())); + PathFunctionalTestsUtil.RunParseErrorPath("People(32)/MyLions(ID1=64)", Error.Format(SRResources.BadRequest_KeyMismatch, HardCodedTestModel.GetLionType().FullName())); } [Fact] @@ -850,7 +850,7 @@ public void KeyLookupCannotAppearAfterBatchReference() Action parse = () => parser.ParsePath(); - parse.Throws(ODataErrorStrings.RequestUriProcessor_SyntaxError); + parse.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -972,22 +972,22 @@ public void FunctionParameterBooleanTrue() PathFunctionalTestsUtil.RunParsePath("GetPet5(id=false)").LastSegment.ShouldBeOperationImportSegment(HardCodedTestModel.GetFunctionImportForGetPet5()).ShouldHaveParameterCount(1).ShouldHaveConstantParameter("id", false); - PathFunctionalTestsUtil.RunParseErrorPath("GetPet5(id=1)", ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Int32", "Edm.Boolean")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet5(id=1)", Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Int32", "Edm.Boolean")); } [Fact] public void FunctionParameterWithUnmatchType() { // long - PathFunctionalTestsUtil.RunParseErrorPath("GetPet1(id=102F)", ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Single", "Edm.Int64")); - PathFunctionalTestsUtil.RunParseErrorPath("GetPet1(id=9223372036854775808)" /*bigger than long*/, ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Decimal", "Edm.Int64")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet1(id=102F)", Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Single", "Edm.Int64")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet1(id=9223372036854775808)" /*bigger than long*/, Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Decimal", "Edm.Int64")); // single - PathFunctionalTestsUtil.RunParseErrorPath("GetPet2(id=102.0D)", ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Double", "Edm.Single")); - PathFunctionalTestsUtil.RunParseErrorPath("GetPet2(id=3402823000000000000000000000000000000000)" /*bigger than Single*/, ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Double", "Edm.Single")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet2(id=102.0D)", Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Double", "Edm.Single")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet2(id=3402823000000000000000000000000000000000)" /*bigger than Single*/, Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Double", "Edm.Single")); // double - PathFunctionalTestsUtil.RunParseErrorPath("GetPet3(id=12M)", ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.Decimal", "Edm.Double")); + PathFunctionalTestsUtil.RunParseErrorPath("GetPet3(id=12M)", Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Decimal", "Edm.Double")); // decimal // TODO: Whether different type should throw exception even when 102F can be promoted to 102M? @@ -1000,43 +1000,43 @@ public void FunctionParameterWithUnmatchType() [Fact] public void KeyLookupCannotAppearTwiceInARow() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)(2)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)(2)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void KeyLookupCannotAppearAfterStructuralProperty() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/Color(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/Color(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void KeyLookupCannotAppearAfterMetadata() { - PathFunctionalTestsUtil.RunParseErrorPath("$metadata(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("$metadata(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void KeyLookupCannotAppearAfterCount() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$count(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/MyPeople/$count(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void KeyLookupCannotAppearAfterNamedStream() { - PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/NamedStream(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs(1)/NamedStream(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void KeyLookupCannotAppearAfterVoidServiceOperation() { - PathFunctionalTestsUtil.RunParseErrorPath("GetNothing(1)", ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates("GetNothing")); + PathFunctionalTestsUtil.RunParseErrorPath("GetNothing(1)", Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, "GetNothing")); } [Fact] public void KeyLookupCannotAppearAfterNonComposableFunctionWithoutParameters() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.AllMyFriendsDogsNonComposable(1)", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.AllMyFriendsDogsNonComposable")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.AllMyFriendsDogsNonComposable(1)", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.AllMyFriendsDogsNonComposable")); } [Fact] @@ -1049,7 +1049,7 @@ public void KeyLookupCanAppearAfterComposableFunctionWithoutParameters() [Fact] public void KeyLookupCannotAppearAfterFunctionWithParameters() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.AllMyFriendsDogs(inOffice=true)(1)", ODataErrorStrings.ExpressionLexer_SyntaxError(14, "inOffice=true)(1")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.AllMyFriendsDogs(inOffice=true)(1)", Error.Format(SRResources.ExpressionLexer_SyntaxError, 14, "inOffice=true)(1")); } [Fact] @@ -1064,7 +1064,7 @@ public void BatchRequest() public void BatchCannotAppearAfterSomethingElse() { // TODO: Error message isn't great, could improve - PathFunctionalTestsUtil.RunParseErrorPath("Dogs/$batch", ODataErrorStrings.RequestUriProcessor_CannotQueryCollections("Dogs")); + PathFunctionalTestsUtil.RunParseErrorPath("Dogs/$batch", Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, "Dogs")); } [Fact] @@ -1112,20 +1112,20 @@ public void ValidMetadataRequest() [Fact] public void NothingCanAppearAfterMetadata() { - PathFunctionalTestsUtil.RunParseErrorPath("$metadata/Dogs", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$metadata")); + PathFunctionalTestsUtil.RunParseErrorPath("$metadata/Dogs", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$metadata")); } [Fact] public void MetadataCannotAppearAfterAnotherSegment() { // TODO: We can improve error message drastically when we refactor path parsing - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/$metadata", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("$metadata")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/$metadata", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$metadata")); } [Fact] public void KeyLookupOnSingleTypeCastIsInvalid() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.Employee(1)", ODataErrorStrings.RequestUriProcessor_SyntaxError); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.Employee(1)", SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -1167,39 +1167,39 @@ public void ValueRequestOnComplexPropertyIsValid() public void ValueRequestOnServiceRootIsInvalid() { // TODO: improve error message wehn refactoring / cleaning up code - PathFunctionalTestsUtil.RunParseErrorPath("$value", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("$value")); + PathFunctionalTestsUtil.RunParseErrorPath("$value", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$value")); } [Fact] public void NothingCanAppearAfterValue() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/MyAddress/$value/City", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$value")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/MyAddress/$value/City", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$value")); } [Fact] public void NothingCanAppearAfterEnumValue() { - PathFunctionalTestsUtil.RunParseErrorPath("Pet2Set(1)/PetColorPattern/$value/City", ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("$value")); + PathFunctionalTestsUtil.RunParseErrorPath("Pet2Set(1)/PetColorPattern/$value/City", Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "$value")); } [Fact] public void ReservedWordsAreCaseSensitive() { // TODO: Should the error message talk about $ being special? Would this be OK if there was a $metaDATA EntitySet? Is that allowed? - PathFunctionalTestsUtil.RunParseErrorPath("$metaDATA", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("$metaDATA")); + PathFunctionalTestsUtil.RunParseErrorPath("$metaDATA", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$metaDATA")); } [Fact] public void DirectValueServiceOperationWithKeyLookupIsInvalid() { - PathFunctionalTestsUtil.RunParseErrorPath("DirectValuePrimitiveServiceOperation(ID='Bob')", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("DirectValuePrimitiveServiceOperation")); + PathFunctionalTestsUtil.RunParseErrorPath("DirectValuePrimitiveServiceOperation(ID='Bob')", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "DirectValuePrimitiveServiceOperation")); } [Fact] public void SystemQueryOptionsThatDoNotBelongInPathAreBlocked() { // TODO: Should the error message talk about $ being special? - PathFunctionalTestsUtil.RunParseErrorPath("$top", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("$top")); + PathFunctionalTestsUtil.RunParseErrorPath("$top", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$top")); } [Fact] @@ -1234,7 +1234,7 @@ public void ValueOnCollectionShouldThrow() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Dogs(1)/Nicknames/$value"); - parse.Throws(ODataErrorStrings.PathParser_CannotUseValueOnCollection); + parse.Throws(SRResources.PathParser_CannotUseValueOnCollection); } [Fact] @@ -1242,7 +1242,7 @@ public void ValueOnEntityCollectionShouldThrow() { Action parse = () => PathFunctionalTestsUtil.RunParsePath("Dogs/$value"); - parse.Throws(ODataErrorStrings.PathParser_CannotUseValueOnCollection); + parse.Throws(SRResources.PathParser_CannotUseValueOnCollection); } [Fact] @@ -1339,7 +1339,7 @@ public void UriOverloadWithBadUriShouldThrow() var parser = new ODataUriParser(HardCodedTestModel.TestModel, serviceRoot, path); Action parse = () => parser.ParsePath(); - parse.Throws(ODataErrorStrings.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri(path, serviceRoot)); + parse.Throws(Error.Format(SRResources.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri, path, serviceRoot)); } [Fact] @@ -1347,7 +1347,7 @@ public void UriOverloadWithoutServiceRootShouldThrow() { Action parse = () => new ODataUriParser(HardCodedTestModel.TestModel, null, new Uri("https://www.tomatosoup.com:1234/OData/V3/Dogs")); - parse.Throws(ODataErrorStrings.UriParser_NeedServiceRootForThisOverload); + parse.Throws(SRResources.UriParser_NeedServiceRootForThisOverload); } [Fact] @@ -1371,14 +1371,14 @@ public void FunctionsOnCollectionsWithParametersWork() [Fact] public void CannotExplicitlyAddBindingParameterToFunction() { - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(person=$it)", Strings.RequestUriProcessor_ResourceNotFound("Fully.Qualified.Namespace.HasDog")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(person=$it)", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "Fully.Qualified.Namespace.HasDog")); } [Fact] public void CannotAddEntityAsBindingParameterToFunction() { // bindable functions don't require the first parameter be specified, since its already implied in the path. - PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(person=People(1))", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("Fully.Qualified.Namespace.HasDog")); + PathFunctionalTestsUtil.RunParseErrorPath("People(1)/Fully.Qualified.Namespace.HasDog(person=People(1))", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "Fully.Qualified.Namespace.HasDog")); } [Fact] @@ -1392,7 +1392,7 @@ public void LongFunctionChain() [Fact] public void FunctionBindingFailsIfParameterNameIsWronglyCased() { - PathFunctionalTestsUtil.RunParseErrorPath("Fully.Qualified.Namespace.HasDog(inOfFiCe=true)", ODataErrorStrings.RequestUriProcessor_ResourceNotFound("Fully.Qualified.Namespace.HasDog")); + PathFunctionalTestsUtil.RunParseErrorPath("Fully.Qualified.Namespace.HasDog(inOfFiCe=true)", Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "Fully.Qualified.Namespace.HasDog")); } [Fact] @@ -1427,7 +1427,7 @@ public void ExceptionShouldThrowForInvalidParameter() { ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://gobbldgook/"), new Uri("http://gobbldgook/GetCoolPeople(id=test, limit=1)")); Action action = () => parser.ParsePath(); - action.Throws(ODataErrorStrings.MetadataBinder_ParameterNotInScope("id=test")); + action.Throws(Error.Format(SRResources.MetadataBinder_ParameterNotInScope, "id=test")); } #region enum property in path @@ -1530,7 +1530,7 @@ public void KeyOfTypeDefinitionShouldWork() public void KeyOfIncompatibleTypeDefinitionShouldFail() { Action action = () => PathFunctionalTestsUtil.RunParsePath("Pet6Set(ID='abc')"); - action.Throws(ODataErrorStrings.BadRequest_KeyMismatch(HardCodedTestModel.GetPet6Type().FullTypeName())); + action.Throws(Error.Format(SRResources.BadRequest_KeyMismatch, HardCodedTestModel.GetPet6Type().FullTypeName())); } [Fact] @@ -1544,7 +1544,7 @@ public void FunctionImportWithTypeDefinitionShouldWork() public void FunctionImportWithImcompatibleTypeDefinitionShouldFail() { Action action = () => PathFunctionalTestsUtil.RunParsePath("GetPet6(id='abc')"); - action.Throws(ODataErrorStrings.MetadataBinder_CannotConvertToType("Edm.String", "Fully.Qualified.Namespace.IdType")); + action.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.String", "Fully.Qualified.Namespace.IdType")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SearchFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SearchFunctionalTests.cs index 2ed68c93a2..6e356e9ee9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SearchFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SearchFunctionalTests.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.Tests.UriParser; using Microsoft.OData.UriParser; using Xunit; @@ -91,34 +92,34 @@ public void CombinationTest() public void ErrorTest() { Action action = () => this.RunSearchTest("NOT"); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(3, "NOT")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 3, "NOT")); action = () => this.RunSearchTest("("); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(1, "(")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 1, "(")); action = () => this.RunSearchTest("(something"); - action.Throws(Strings.UriQueryExpressionParser_CloseParenOrOperatorExpected(10, "(something")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, 10, "(something")); action = () => this.RunSearchTest("AND OR"); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(0, "AND OR")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 0, "AND OR")); action = () => this.RunSearchTest("kit ("); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(5, "kit (")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 5, "kit (")); action = () => this.RunSearchTest("kit ( A"); - action.Throws(Strings.UriQueryExpressionParser_CloseParenOrOperatorExpected(7, "kit ( A")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, 7, "kit ( A")); action = () => this.RunSearchTest("kit )"); - action.Throws(Strings.ExpressionLexer_SyntaxError(5, "kit )")); + action.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 5, "kit )")); } [Fact] public void LexerErrorTest() { Action action = () => this.RunSearchTest("\""); - action.Throws(Strings.ExpressionLexer_UnterminatedStringLiteral(1, "\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_UnterminatedStringLiteral, 1, "\"")); action = () => this.RunSearchTest("A \""); - action.Throws(Strings.ExpressionLexer_UnterminatedStringLiteral(3, "A \"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_UnterminatedStringLiteral, 3, "A \"")); action = () => this.RunSearchTest("A \" BC"); - action.Throws(Strings.ExpressionLexer_UnterminatedStringLiteral(6, "A \" BC")); + action.Throws(Error.Format(SRResources.ExpressionLexer_UnterminatedStringLiteral, 6, "A \" BC")); action = () => this.RunSearchTest("\\\""); - action.Throws(Strings.ExpressionLexer_InvalidCharacter("\\", 0, "\\\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "\\", 0, "\\\"")); action = () => this.RunSearchTest("\"\\t\""); - action.Throws(Strings.ExpressionLexer_InvalidEscapeSequence("t", 2, "\"\\t\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidEscapeSequence, "t", 2, "\"\\t\"")); } private SearchClause RunSearchTest(string search) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SelectExpandFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SelectExpandFunctionalTests.cs index 2fb3e55e66..cf69c7a08b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SelectExpandFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SelectExpandFunctionalTests.cs @@ -12,8 +12,8 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; using Microsoft.OData.UriParser.Aggregation; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -57,14 +57,14 @@ public void SelectWithEmptyStringMeansEverything() public void SelectPropertiesWithRefOperationThrows() { Action readResult = () => RunParseSelectExpand("MyLions/$ref", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - readResult.Throws(ODataErrorStrings.UriSelectParser_SystemTokenInSelectExpand("$ref", "MyLions/$ref")); + readResult.Throws(Error.Format(SRResources.UriSelectParser_SystemTokenInSelectExpand, "$ref", "MyLions/$ref")); } [Fact] public void SelectPropertiesWithDollarCountOperationThrows() { Action readResult = () => RunParseSelectExpand("MyLions/$count", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - readResult.Throws(ODataErrorStrings.ExpressionToken_DollarCountNotAllowedInSelect); + readResult.Throws(SRResources.ExpressionToken_DollarCountNotAllowedInSelect); } [Fact] @@ -128,7 +128,7 @@ public void SelectComplexPropertyWithCast() public void SelectComplexPropertyWithWrongCast() { Action parse = () => ParseSingleSelectForPerson("MyAddress/Fully.Qualified.Namespace.OpenAddress"); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] @@ -142,7 +142,7 @@ public void SelectComplexCollectionProperty() public void SelectComplexCollectionPropertyWrongSubProp() { Action parse = () => ParseSingleSelectForPerson("PreviousAddresses/WrongProp"); - parse.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Address", "WrongProp")); + parse.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Address", "WrongProp")); } [Fact] @@ -159,7 +159,7 @@ public void SelectComplexCollectionPropertyWithCast() public void SelectComplexCollectionPropertyWithWrongCast() { Action parse = () => ParseSingleSelectForPerson("PreviousAddresses/Fully.Qualified.Namespace.OpenAddress"); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] @@ -245,7 +245,7 @@ public void MultipleSelectionsWorkWithoutEntitySet() public void CallingAFunctionIsNotRecognizedInSelect() { Action test = () => ParseSingleSelectForPerson("HasDog(inOffice=true)"); - test.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid("(inOffice=true)")); + test.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "(inOffice=true)")); } [Fact] @@ -448,7 +448,7 @@ public void SelectMissingPropertyFailsOnNotOpenType() { Action parse = () => RunParseSelectExpand("SomeOpenProperty", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetPersonType(), "SomeOpenProperty")); + parse.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetPersonType(), "SomeOpenProperty")); } [Fact] @@ -474,14 +474,14 @@ public void SelectPropertyThroughNavPropWithoutExpandFails() { Action parse = () => RunParseSelectExpand("MyDog/Color", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] public void NonPathExpressionThrowsInSelect() { Action parseWithExpressionInSelect = () => RunParseSelectExpand("Name eq 'Name'", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithExpressionInSelect.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid("Name eq 'Name'")); + parseWithExpressionInSelect.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "Name eq 'Name'")); } [Fact] @@ -498,7 +498,7 @@ public void NullExpandAndNonExistingSelectThrowsUsefulErrorMessage() { // regression coverage for: [URIParser] ArgumentNullException instead of Incorrect Type Action parseWithNullExpand = () => RunParseSelectExpand("NonExistingProperty", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithNullExpand.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "NonExistingProperty")); + parseWithNullExpand.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "NonExistingProperty")); } [Fact] @@ -506,7 +506,7 @@ public void InvalidPropertyWithDollarSignThrowsUsefulErrorMessage() { // regression test for: [Fuzz] UriParser NulRefs in Select and Expand Action parseInvalidWithDollarSign = () => RunParseSelectExpand("Name$(comma)", null, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseInvalidWithDollarSign.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid("Name$(comma)")); + parseInvalidWithDollarSign.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "Name$(comma)")); } [Fact] @@ -554,14 +554,14 @@ public void ExpandCannotGoThroughNavigationProperties() { Action parse = () => RunParseSelectExpand(null, "MyDog/MyPeople", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); + parse.Throws(SRResources.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); } [Fact] public void MultipleNestedQueryOptionsMustBeSeparatedBySemiColon() { Action parseWithNonSemiColonTerminatedQueryOptions = () => RunParseSelectExpand(null, "MyDog($select=Color,$expand=MyPeople)", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithNonSemiColonTerminatedQueryOptions.Throws(ODataErrorStrings.UriSelectParser_SystemTokenInSelectExpand("$expand", "Color,$expand=MyPeople")); + parseWithNonSemiColonTerminatedQueryOptions.Throws(Error.Format(SRResources.UriSelectParser_SystemTokenInSelectExpand, "$expand", "Color,$expand=MyPeople")); } [Fact] @@ -576,7 +576,7 @@ public void ExpandNavigationWithNavigationAfterRefOperationThrows() { const string expandClauseText = "MyDog/$ref/MyPeople"; Action readResult = () => RunParseSelectExpand(null, expandClauseText, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - readResult.Throws(ODataErrorStrings.ExpressionToken_NoPropAllowedAfterRef); + readResult.Throws(SRResources.ExpressionToken_NoPropAllowedAfterRef); } [Fact] @@ -584,7 +584,7 @@ public void ExpandNavigationWithNavigationAfterDollarCountOperationThrows() { const string expandClauseText = "MyDog/$count/MyPeople"; Action readResult = () => RunParseSelectExpand(null, expandClauseText, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - readResult.Throws(ODataErrorStrings.ExpressionToken_NoPropAllowedAfterDollarCount); + readResult.Throws(SRResources.ExpressionToken_NoPropAllowedAfterDollarCount); } [Fact] @@ -647,7 +647,7 @@ public void MultipleExpansionsShouldWork() public void NonPathExpressionThrowsInExpand() { Action parseWithExpressionInExpand = () => RunParseSelectExpand(null, "Name eq 'Name'", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseWithExpressionInExpand.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid("Name eq 'Name'")); + parseWithExpressionInExpand.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "Name eq 'Name'")); } [Fact] @@ -782,7 +782,7 @@ public void MaxExpandDepthSettingShouldBeEnforced() ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://host/"), new Uri("http://host/People?$expand=MyDog($expand=MyPeople;)")); parser.Settings.MaximumExpansionDepth = 1; Action parse = () => parser.ParseSelectAndExpand(); - parse.Throws(ODataErrorStrings.UriParser_ExpandDepthExceeded(2, 1)); + parse.Throws(Error.Format(SRResources.UriParser_ExpandDepthExceeded, 2, 1)); } [Fact] @@ -791,7 +791,7 @@ public void MaxExpandCountSettingShouldBeEnforced() ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://host/"), new Uri("http://host/People?$expand=MyDog,MyLions")); parser.Settings.MaximumExpansionCount = 1; Action parse = () => parser.ParseSelectAndExpand(); - parse.Throws(ODataErrorStrings.UriParser_ExpandCountExceeded(2, 1)); + parse.Throws(Error.Format(SRResources.UriParser_ExpandCountExceeded, 2, 1)); } [Theory] @@ -856,7 +856,7 @@ public void SelectPropertyThroughNavPropWithExpandFails() { Action parse = () => RunParseSelectExpand("MyPeople/Name", "MyPeople", HardCodedTestModel.GetDogType(), HardCodedTestModel.GetDogsSet()); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] @@ -1111,7 +1111,7 @@ public void ExpandSyntacticErrorMessageSpecifiesExpandAsWellAsSelect() // regression coverage for: [UriParser] Error message wrong when term not valid in expand part of select expand // regression coverage for: [URIParser] Change UriSelectParser_TermIsNotValid error message for expand Action createWithExpandSyntaxError = () => RunParseSelectExpand(null, "Microsoft.Test.Taupo.OData.WCFService.Customer/Orders('id')", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - createWithExpandSyntaxError.Throws(Strings.UriSelectParser_TermIsNotValid("('id')")); + createWithExpandSyntaxError.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "('id')")); } [Fact] @@ -1234,7 +1234,7 @@ public void SelectOnEnumTypeWorks() public void NestedOptionsWithoutClosingParenthesisThrows() { Action parse = () => RunParseSelectExpand(null, "MyPaintings($filter=true", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPaintingsSet()); - parse.Throws(ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + parse.Throws(SRResources.ExpressionLexer_UnbalancedBracketExpression); } [Fact] @@ -1587,7 +1587,7 @@ public void DollarThisinFilterInsideSelectInsideExpandShouldReferenceSelectedIte public void SelectAndExpandShouldFailOnSelectWrongComplexProperties() { Action parse = () => RunParseSelectExpand("Name,MyAddress/City/Street,MyDog", "MyDog($select=Color)", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] @@ -1595,7 +1595,7 @@ public void SelectAndExpandShouldFailOnSelectComplexPropertiesWithWrongTypeCast( { Action parse = () => RunParseSelectExpand("Name,MyAddress/Fully.Qualified.Namespace.OpenAddress/HomeNO,MyDog", "MyDog($select=Color)", HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parse.Throws(ODataErrorStrings.SelectBinder_MultiLevelPathInSelect); + parse.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } // TODO: Tests cases with query options @@ -1870,7 +1870,7 @@ public void ExpandWithNavigationPropWithUndefinedTypeThrows(string query) // Assert // Exception: The type Fully.Qualified.Namespace.UndefinedType is not defined in the model. - action.Throws(ODataErrorStrings.ExpandItemBinder_CannotFindType("Fully.Qualified.Namespace.UndefinedType")); + action.Throws(Error.Format(SRResources.ExpandItemBinder_CannotFindType, "Fully.Qualified.Namespace.UndefinedType")); } // $expand=navProp/fully.qualified.type($filter=prop) @@ -2215,7 +2215,7 @@ public void SelectAfterApplyReferencingCollapsedPropertyThrows() odataQueryOptionParser.ParseApply(); Action action = () => odataQueryOptionParser.ParseSelectAndExpand(); - action.Throws(ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue("FavoriteNumber")); + action.Throws(Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, "FavoriteNumber")); } [Fact] @@ -2321,7 +2321,7 @@ public void FilterAfterApplyReferencingCollapsedPropertyThrows(string nestedClau Action action = () => odataQueryOptionParser.ParseSelectAndExpand(); - action.Throws(ODataErrorStrings.ApplyBinder_GroupByPropertyNotPropertyAccessValue("Color")); + action.Throws(Error.Format(SRResources.ApplyBinder_GroupByPropertyNotPropertyAccessValue, "Color")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SemanticTreeFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SemanticTreeFunctionalTests.cs index 0d1d49e740..a3775514d9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SemanticTreeFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SemanticTreeFunctionalTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -198,7 +198,7 @@ public void RangeVariableNameUsedOutsideOfScopeShouldFailIfTypeIsNotOpen() { // Repro for: Syntactic parser assumes any token which matches the name of a previously used range variable is also a range variable, even after the scope has been exited Action parse = () => HardCodedTestModel.ParseUri("Dogs?$filter=MyPeople/all(a: true) and a ne null", this.edmModel); - parse.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Dog", "a")); + parse.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Dog", "a")); } [Fact] @@ -206,7 +206,7 @@ public void RangeVariableRedefinedInsideScopeShouldFailWithUsefulError() { // Repro for: Semantic binding fails with useless error message when a range variable is redefined within a nested any/all Action parse = () => HardCodedTestModel.ParseUri("Dogs?$filter=MyPeople/all(a: a/MyPaintings/any(a:true))", this.edmModel); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared("a")); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_RangeVariableAlreadyDeclared, "a")); } [Fact] @@ -397,7 +397,7 @@ public void CountQueryWithDuplicateCount() { //Ensure $-sign is required. parser.EnableNoDollarQueryOptions = false; - test.Throws(Strings.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce("$count")); + test.Throws(Error.Format(SRResources.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, "$count")); } finally { @@ -590,14 +590,14 @@ public void PrimitiveCollectionTypeShouldBeAllowedUnderComplexType() public void FilterThroughMissingNavigationOrComplexPropertyShouldThrowOurException() { Action parse = () => HardCodedTestModel.ParseUri("People?$filter=Missing/ID eq 1", this.edmModel); - parse.Throws(Strings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "Missing")); + parse.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "Missing")); } [Fact] public void FilterThroughMissingPropertyShouldThrowOurException() { Action parse = () => HardCodedTestModel.ParseUri("People?$filter=Missing eq 1", this.edmModel); - parse.Throws(Strings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "Missing")); + parse.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "Missing")); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SetBasedOperationTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SetBasedOperationTests.cs index 28fdbfa23c..994ad7b05f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SetBasedOperationTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SetBasedOperationTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -27,7 +27,7 @@ public void SetBasedOperations_EachSegmentAsFirstSegment_ThrowsException() (oDataPath, filterClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_EachOnRoot); + parse.Throws(SRResources.RequestUriProcessor_EachOnRoot); } [Fact] @@ -39,7 +39,7 @@ public void SetBasedOperations_EachSegmentOnSingleton_ThrowsException() { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_CannotApplyEachOnSingleEntities("Boss")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_CannotApplyEachOnSingleEntities, "Boss")); } [Fact] @@ -50,7 +50,7 @@ public void SetBasedOperations_EachSegmentOnSingleEntity_ThrowsException() (oDataPath, filterClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_CannotApplyEachOnSingleEntities("People")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_CannotApplyEachOnSingleEntities, "People")); } [Fact] @@ -373,7 +373,7 @@ public void SetBasedOperations_EachSegmentOnSetBasedActionOnCollectionResults_Th (oDataPath, filterClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.SummonPuppies")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.SummonPuppies")); } [Fact] @@ -401,7 +401,7 @@ public void SetBasedOperations_NonActionPathSegmentAfterEachSegment_ThrowsExcept (oDataPath, filterClause, aliasNodes) => { }); - parse.Throws(ODataErrorStrings.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); + parse.Throws(SRResources.RequestUriProcessor_OnlySingleOperationCanFollowEachPathSegment); } [Fact] @@ -412,7 +412,7 @@ public void SetBasedOperations_EachSegmentWithParenthesisExpression_ThrowsExcept (oDataPath, filterClause, aliasNodes) => { }); - parse.Throws(Strings.RequestUriProcessor_SyntaxError); + parse.Throws(SRResources.RequestUriProcessor_SyntaxError); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SpatialFuntionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SpatialFuntionalTests.cs index 7e09dc9c44..5d2be396b5 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SpatialFuntionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/SpatialFuntionalTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -28,7 +28,7 @@ public void EqualityNotDefinedForGeography() ParseFilter("GeographyPoint eq geography'POINT(10 30)'", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); filterWithGeography.Throws( - ODataErrorStrings.MetadataBinder_IncompatibleOperandsError( + Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.GeographyPoint, true).FullName(), EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.GeographyPoint, true).FullName(), BinaryOperatorKind.Equal)); @@ -42,7 +42,7 @@ public void EqualityNotDefinedForGeometry() ParseFilter("GeometryPoint eq geometry'POINT(10 30)'", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); filterWithGeography.Throws( - ODataErrorStrings.MetadataBinder_IncompatibleOperandsError( + Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.GeometryPoint, true).FullName(), EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.GeometryPoint, true).FullName(), BinaryOperatorKind.Equal)); @@ -76,7 +76,7 @@ public void DistanceOnlyWorksBetweenTwoPoints() BuiltInUriFunctions.TryGetBuiltInFunction(functionName, out signatures); Action parseDistanceWithNonPointOperand = () => ParseFilter("geo.distance(GeometryLineString, geometry'POINT(10 30)') eq 2", HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetPeopleSet()); - parseDistanceWithNonPointOperand.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound(functionName, UriFunctionsHelper.BuildFunctionSignatureListDescription(functionName, signatures))); + parseDistanceWithNonPointOperand.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, functionName, UriFunctionsHelper.BuildFunctionSignatureListDescription(functionName, signatures))); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/TopAndSkipFunctionalTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/TopAndSkipFunctionalTests.cs index 3124667bc5..5b5e5ab67e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/TopAndSkipFunctionalTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/UriParser/TopAndSkipFunctionalTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.UriParser { @@ -45,7 +46,7 @@ public void InvaidTopValueThrows() foreach (var input in SharedInvalidNumericInput) { Action action = () => ParseTop(input); - action.Throws(Strings.SyntacticTree_InvalidTopQueryOptionValue(input)); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidTopQueryOptionValue, input)); } } @@ -70,7 +71,7 @@ public void InvalidSkipValueThrows() foreach (var input in SharedInvalidNumericInput) { Action action = () => ParseSkip(input); - action.Throws(Strings.SyntacticTree_InvalidSkipQueryOptionValue(input)); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidSkipQueryOptionValue, input)); } } #endregion $skip option @@ -108,7 +109,7 @@ public void InvaidIndexValueThrows(string value) { var parser = new ODataQueryOptionParser(EdmCoreModel.Instance, null, null, new Dictionary() { { "$index", value } }); Action action = () => parser.ParseIndex(); - action.Throws(Strings.SyntacticTree_InvalidIndexQueryOptionValue(value)); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidIndexQueryOptionValue, value)); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/CommonWritingValidationScenarioTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/CommonWritingValidationScenarioTests.cs index 5d6ba88b00..43295a735f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/CommonWritingValidationScenarioTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/CommonWritingValidationScenarioTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.IO; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -32,7 +33,7 @@ public void WriteEntryWithFakeTypeShouldFailWithUnrecognizedTypeName() odataWriter.WriteEnd(); }; - test.Throws(Strings.ValidationUtils_UnrecognizedTypeName("DefaultNamespace.FakeType")); + test.Throws(Error.Format(SRResources.ValidationUtils_UnrecognizedTypeName, "DefaultNamespace.FakeType")); } } @@ -74,7 +75,7 @@ public void WriteEntryWithNoTypeNameAndNoWriterMetadataShouldFailWithMissingType odataWriter.WriteEnd(); }; - test.Throws(Strings.WriterValidationUtils_MissingTypeNameWithMetadata); + test.Throws(SRResources.WriterValidationUtils_MissingTypeNameWithMetadata); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/Json/ODataJsonInheritComplexCollectionWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/Json/ODataJsonInheritComplexCollectionWriterTests.cs index 3eb804c2c1..9c4f566746 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/Json/ODataJsonInheritComplexCollectionWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ScenarioTests/Writer/Json/ODataJsonInheritComplexCollectionWriterTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.Json; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.ScenarioTests.Writer.Json { @@ -117,7 +118,7 @@ public void ShouldThrowForComplexCollectionResponseWithoutUserModelAndWithoutIte { Action sync = () => WriteAndValidateSync(/*itemTypeReference*/ null, this.collectionStartWithoutSerializationInfo, items, "", writingResponse: true); // Action async = () => WriteAndValidateAsync(/*itemTypeReference*/ null, this.collectionStartWithoutSerializationInfo, items, "", writingResponse: true); - sync.Throws(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + sync.Throws(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); // Assert.Throws(async); } @@ -186,7 +187,7 @@ public void ShouldThrowForComplexCollectionResponseWithoutUserModelAndWithoutIte { Action sync = () => WriteAndValidateSync(/*itemTypeReference*/ null, this.collectionStartWithoutSerializationInfo, derivedItems, "", writingResponse: true); //Action async = () => WriteAndValidateAsync(/*itemTypeReference*/ null, this.collectionStartWithoutSerializationInfo, derivedItems, "", writingResponse: true); - sync.Throws(Strings.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); + sync.Throws(SRResources.ODataContextUriBuilder_NavigationSourceOrTypeNameMissingForResourceOrResourceSet); //Assert.Throws(async); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/SelectedPropertiesNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/SelectedPropertiesNodeTests.cs index 9d3bf4aef7..8acebc53f1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/SelectedPropertiesNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/SelectedPropertiesNodeTests.cs @@ -6,9 +6,9 @@ using System; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.Evaluation { @@ -94,7 +94,7 @@ public SelectedPropertiesNodeTests() public void MalformedSelectClauseShouldFail() { Action action = () => SelectedPropertiesNode.Create("*/Name"); - action.Throws(ErrorStrings.SelectedPropertiesNode_StarSegmentNotLastSegment); + action.Throws(SRResources.SelectedPropertiesNode_StarSegmentNotLastSegment); } [Fact] @@ -249,7 +249,7 @@ public void TypeSegmentWithWildcardShouldFailWhenGettingStreams() { var node = SelectedPropertiesNode.Create("TestModel.City/*"); Action action = () => node.GetSelectedStreamProperties(this.cityType); - action.Throws(ErrorStrings.SelectedPropertiesNode_StarSegmentAfterTypeSegment); + action.Throws(SRResources.SelectedPropertiesNode_StarSegmentAfterTypeSegment); } [Fact] @@ -257,7 +257,7 @@ public void TypeSegmentWithWildcardShouldFailWhenGettingNavigations() { var node = SelectedPropertiesNode.Create("TestModel.City/*"); Action action = () => node.GetSelectedNavigationProperties(this.cityType); - action.Throws(ErrorStrings.SelectedPropertiesNode_StarSegmentAfterTypeSegment); + action.Throws(SRResources.SelectedPropertiesNode_StarSegmentAfterTypeSegment); } [Fact] @@ -265,7 +265,7 @@ public void TypeSegmentWithWildcardShouldFailWhenRecursing() { var node = SelectedPropertiesNode.Create("TestModel.City/*"); Action action = () => node.GetSelectedPropertiesForNavigationProperty(this.cityType, "Districts"); - action.Throws(ErrorStrings.SelectedPropertiesNode_StarSegmentAfterTypeSegment); + action.Throws(SRResources.SelectedPropertiesNode_StarSegmentAfterTypeSegment); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/BinaryOperatorBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/BinaryOperatorBinderTests.cs index e6d05980e4..2fef71bb82 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/BinaryOperatorBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/BinaryOperatorBinderTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -352,7 +353,7 @@ public void CollectionLeftTokenShouldFail() var binaryOperatorQueryToken = new BinaryOperatorToken(BinaryOperatorKind.And, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_BinaryOperatorOperandNotSingleValue("And")); + bind.Throws(Error.Format(SRResources.MetadataBinder_BinaryOperatorOperandNotSingleValue, "And")); } [Fact] @@ -364,7 +365,7 @@ public void CollectionRightTokenShouldFail() var binaryOperatorToken = new BinaryOperatorToken(BinaryOperatorKind.Equal, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorToken); - bind.Throws(Strings.MetadataBinder_BinaryOperatorOperandNotSingleValue("Equal")); + bind.Throws(Error.Format(SRResources.MetadataBinder_BinaryOperatorOperandNotSingleValue, "Equal")); } [Fact] @@ -375,7 +376,7 @@ public void LeftTokenTypeImcompatibleWithOperatorShouldFail() var binaryOperatorToken = new BinaryOperatorToken(BinaryOperatorKind.GreaterThan, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandsError("Edm.Boolean", "Edm.Int32", BinaryOperatorKind.GreaterThan)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Boolean", "Edm.Int32", BinaryOperatorKind.GreaterThan)); } [Fact] @@ -386,7 +387,7 @@ public void LeftTokenTypeIncompatibleWithOperatorAndRightTokenNullShouldFail() var binaryOperatorQueryToken = new BinaryOperatorToken(BinaryOperatorKind.And, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandsError("Edm.DateTimeOffset", "", BinaryOperatorKind.And)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.DateTimeOffset", "", BinaryOperatorKind.And)); } [Fact] @@ -397,7 +398,7 @@ public void LeftTokenTypeIncompatibleWithOperatorAndRightTokenOpenPropertyShould var binaryOperatorQueryToken = new BinaryOperatorToken(BinaryOperatorKind.And, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandsError("Edm.DateTimeOffset", "", BinaryOperatorKind.And)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.DateTimeOffset", "", BinaryOperatorKind.And)); } [Fact] @@ -408,7 +409,7 @@ public void RightTokenTypeImcompatibleWithOperatorShouldFail() var binaryOperatorQueryToken = new BinaryOperatorToken(BinaryOperatorKind.Multiply, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandsError("Edm.Int32", "Edm.String", BinaryOperatorKind.Multiply)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Int32", "Edm.String", BinaryOperatorKind.Multiply)); } [Fact] @@ -419,7 +420,7 @@ public void LeftTokenTypeImcompatibleWithRightTokenShouldFail() var binaryOperatorQueryToken = new BinaryOperatorToken(BinaryOperatorKind.Equal, new LiteralToken("foo"), new LiteralToken("bar")); Action bind = () => this.binaryOperatorBinder.BindBinaryOperator(binaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandsError("Edm.Boolean", "Edm.Int32", BinaryOperatorKind.Equal)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandsError, "Edm.Boolean", "Edm.Int32", BinaryOperatorKind.Equal)); } /// diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/DottedIdentifierBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/DottedIdentifierBinderTests.cs index 9bd8f45488..9b235ed752 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/DottedIdentifierBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/DottedIdentifierBinderTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -110,7 +110,7 @@ public void OR_NonFlagEnumValues_Error() // NonFlagShape can't OR 2 member values 'Rectangle,foursquare' var castToken = new DottedIdentifierToken("Fully.Qualified.Namespace.NonFlagShape'Rectangle,foursquare'", new DummyToken()); Action parse = () => this.dottedIdentifierBinder.BindDottedIdentifier(castToken); - parse.Throws(ODataErrorStrings.Binder_IsNotValidEnumConstant("Fully.Qualified.Namespace.NonFlagShape'Rectangle,foursquare'")); + parse.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, "Fully.Qualified.Namespace.NonFlagShape'Rectangle,foursquare'")); } [Fact] @@ -119,7 +119,7 @@ public void CastWithNonChildTypeShouldThrow() var castToken = new DottedIdentifierToken("Fully.Qualified.Namespace.Lion", null); Action bind = () => this.dottedIdentifierBinder.BindDottedIdentifier(castToken); - bind.Throws(Strings.MetadataBinder_HierarchyNotFollowed(HardCodedTestModel.GetLionType().FullName(), HardCodedTestModel.GetPersonType().FullName())); + bind.Throws(Error.Format(SRResources.MetadataBinder_HierarchyNotFollowed, HardCodedTestModel.GetLionType().FullName(), HardCodedTestModel.GetPersonType().FullName())); } @@ -131,7 +131,7 @@ public void CastWithOpenTypeShouldThrow() var castToken = new DottedIdentifierToken("Fully.Qualified.Namespace.Lion", new EndPathToken("Critics", new DummyToken())); Action bind = () => this.dottedIdentifierBinder.BindDottedIdentifier(castToken); - bind.Throws(Strings.MetadataBinder_HierarchyNotFollowed(HardCodedTestModel.GetLionType().FullName(), "")); + bind.Throws(Error.Format(SRResources.MetadataBinder_HierarchyNotFollowed, HardCodedTestModel.GetLionType().FullName(), "")); } [Fact] @@ -140,7 +140,7 @@ public void CastOnMissingTypeShouldThrow() var castToken = new DottedIdentifierToken("Missing.Type", null); Action bind = () => this.dottedIdentifierBinder.BindDottedIdentifier(castToken); - bind.Throws(Strings.CastBinder_ChildTypeIsNotEntity("Missing.Type")); + bind.Throws(Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "Missing.Type")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/EndPathBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/EndPathBinderTests.cs index e8f49e0868..75f93d4784 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/EndPathBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/EndPathBinderTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -56,7 +57,7 @@ public void ShouldThrowIfParameterIsNotInScope() var token = new EndPathToken("Color", new RangeVariableToken("notInScope")); Action bind = () => this.propertyBinder.BindEndPath(token); - bind.Throws(Strings.MetadataBinder_ParameterNotInScope("notInScope")); + bind.Throws(Error.Format(SRResources.MetadataBinder_ParameterNotInScope, "notInScope")); } [Fact] @@ -172,7 +173,7 @@ public void CreateParentShouldThrowIfBindingStateWithoutImplicitParameter() { var state = new BindingState(this.configuration); Action createparent = () => EndPathBinder.CreateParentFromImplicitRangeVariable(state); - createparent.Throws(Strings.MetadataBinder_PropertyAccessWithoutParentParameter); + createparent.Throws(SRResources.MetadataBinder_PropertyAccessWithoutParentParameter); } [Fact] @@ -238,7 +239,7 @@ public void ShouldThrowIfTypeNotOpen() token, parentNode); getQueryNode.Throws( - Strings.MetadataBinder_PropertyNotDeclared(parentNode.GetEdmTypeReference().FullName(), + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, parentNode.GetEdmTypeReference().FullName(), token.Identifier)); } @@ -273,7 +274,7 @@ public void ShouldThrowIfSingleValueNodeOfCollectionNavigationNodeIsUsedOutsideA Action bind = () => endPathBinder.BindEndPath(token); - bind.Throws(Strings.MetadataBinder_PropertyAccessSourceNotSingleValue("FastestOwner")); + bind.Throws(Error.Format(SRResources.MetadataBinder_PropertyAccessSourceNotSingleValue, "FastestOwner")); } [Fact] @@ -290,7 +291,7 @@ public void ShouldThrowIfUnknownPropertyOfCollectionNavigationNodeIsUsed() Action bind = () => endPathBinder.BindEndPath(token); - bind.Throws(Strings.MetadataBinder_PropertyAccessSourceNotSingleValue("MissingProperty")); + bind.Throws(Error.Format(SRResources.MetadataBinder_PropertyAccessSourceNotSingleValue, "MissingProperty")); } /// diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/ExpandBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/ExpandBinderTests.cs index afe5325784..782a82b3c4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/ExpandBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/ExpandBinderTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -29,7 +29,7 @@ public void BindingOnTreeWithWithMultipleNavPropPathsThrows() // Act & Assert Action test = () => BinderForPerson.Bind(expandToken, null); - test.Throws(ODataErrorStrings.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); + test.Throws(SRResources.ExpandItemBinder_TraversingMultipleNavPropsInTheSamePath); } // $expand=MyDog @@ -119,7 +119,7 @@ public void NonexistentPropertyThrowsUsefulError() // Act & Assert Action test = () => BinderForPerson.Bind(expandToken, null); - test.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetPersonType().FullName(), "Blah")); + test.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetPersonType().FullName(), "Blah")); } [Fact] @@ -130,7 +130,7 @@ public void NonNavigationPropertyThrowsUsefulErrorIfKnobIsNotFlipped() // Act Action test = () => BinderForPerson.Bind(expandToken, null); - test.Throws(ODataErrorStrings.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty("Shoe", HardCodedTestModel.GetPersonType().FullName())); + test.Throws(Error.Format(SRResources.ExpandItemBinder_PropertyIsNotANavigationPropertyOrComplexProperty, "Shoe", HardCodedTestModel.GetPersonType().FullName())); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/FunctionCallBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/FunctionCallBinderTests.cs index db8b3992e3..4620d6c569 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/FunctionCallBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/FunctionCallBinderTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -78,7 +78,7 @@ public void BindFunctionEmptyArguments() FunctionSignatureWithReturnType[] signatures = FunctionCallBinder.ExtractSignatures( FunctionCallBinder.GetUriFunctionSignatures("day")); // to match the error message... blah - bindWithEmptyArguments.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + bindWithEmptyArguments.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "day", UriFunctionsHelper.BuildFunctionSignatureListDescription("day", signatures))); } @@ -93,7 +93,7 @@ public void CannotBindArbitraryNumberOfOpenParametersWithCorrectNonOpenParameter FunctionSignatureWithReturnType[] signatures = FunctionCallBinder.ExtractSignatures( FunctionCallBinder.GetUriFunctionSignatures("day")); // to match the error message... blah - bindWithEmptyArguments.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + bindWithEmptyArguments.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "day", UriFunctionsHelper.BuildFunctionSignatureListDescription("day", signatures))); } @@ -106,7 +106,7 @@ public void BindFunctionNullArgumentTypeArgumentCountMatchesFunctionSignature() var arguments = new List() { new LiteralToken("ignored"), new LiteralToken("ignored") }; var token = new FunctionCallToken("day", arguments); Action bindWithTooManyNonTypedArgs = () => functionCallBinder.BindFunctionCall(token); - bindWithTooManyNonTypedArgs.Throws(ODataErrorStrings.FunctionCallBinder_CannotFindASuitableOverload("day", "2")); + bindWithTooManyNonTypedArgs.Throws(Error.Format(SRResources.FunctionCallBinder_CannotFindASuitableOverload, "day", "2")); } //TypePromoteArguments tests @@ -218,7 +218,7 @@ public void TypePromoteArgumentsMismatchedTypes() new ConstantNode("Hello"), }; Action a = () => FunctionCallBinder.TypePromoteArguments(signature, nodes); - a.Throws(Strings.MetadataBinder_CannotConvertToType("Edm.Int32", "Edm.String")); + a.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Int32", "Edm.String")); } [Fact] @@ -231,7 +231,7 @@ public void TypePromoteArgumentsMismatchedTypeAndNull() new ConstantNode("Hello") }; Action a = () => FunctionCallBinder.TypePromoteArguments(signature, nodes); - a.Throws(Strings.MetadataBinder_CannotConvertToType("Edm.String", "Edm.Int32")); + a.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.String", "Edm.Int32")); } @@ -245,7 +245,7 @@ public void TypePromoteArgumentsMismatchedTypeAndOpenProperty() new ConstantNode("Hello") }; Action a = () => FunctionCallBinder.TypePromoteArguments(signature, nodes); - a.Throws(Strings.MetadataBinder_CannotConvertToType("Edm.String", "Edm.Int32")); + a.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.String", "Edm.Int32")); } [Fact] @@ -290,7 +290,7 @@ public void ShouldThrowWhenArgumentsAreNotSingleValue() }; Action bind = () => FunctionCallBinder.ValidateArgumentsAreSingleValue("year", argumentNodes); - bind.Throws(Strings.MetadataBinder_FunctionArgumentNotSingleValue("year")); + bind.Throws(Error.Format(SRResources.MetadataBinder_FunctionArgumentNotSingleValue, "year")); } [Fact] @@ -319,7 +319,7 @@ public void MatchArgumentsToSignatureDuplicateSignature() new SingleValuePropertyAccessNode(new ConstantNode(null)/*parent*/, new EdmStructuralProperty(new EdmEntityType("MyNamespace", "MyEntityType"), "myPropertyName", argumentNodes[1].GetEdmTypeReference()))}, nameSignatures); - bind.Throws(Strings.MetadataBinder_NoApplicableFunctionFound( + bind.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "IndexOf", UriFunctionsHelper.BuildFunctionSignatureListDescription("IndexOf", nameSignatures.Select(nameSig => nameSig.Value)))); } @@ -358,7 +358,7 @@ public void MatchArgumentsToSignatureNoMatchEmpty() new SingleValuePropertyAccessNode(new ConstantNode(null)/*parent*/, new EdmStructuralProperty(new EdmEntityType("MyNamespace", "MyEntityType"), "myPropertyName", argumentNodes[0].GetEdmTypeReference()))}, new List>()); - bind.Throws(Strings.MetadataBinder_NoApplicableFunctionFound( + bind.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "year", UriFunctionsHelper.BuildFunctionSignatureListDescription("year", new FunctionSignatureWithReturnType[0]))); } @@ -378,7 +378,7 @@ public void MatchArgumentsToSignatureNoMatchContainsSignatures() new SingleValuePropertyAccessNode(new ConstantNode(null)/*parent*/, new EdmStructuralProperty(new EdmEntityType("MyNamespace", "MyEntityType"), "myPropertyName", argumentNodes[0].GetEdmTypeReference()))}, this.GetHardCodedYearFunctionSignatureForTest()); - bind.Throws(Strings.MetadataBinder_NoApplicableFunctionFound( + bind.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, "year", UriFunctionsHelper.BuildFunctionSignatureListDescription( "year", @@ -445,7 +445,7 @@ public void CastMustHaveOneOrTwoArguments() Action createWithMoreThanTwoArgs = () => this.functionCallBinder.BindFunctionCall(functionWithMoreThanTwoArgs); - createWithMoreThanTwoArgs.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands(3)); + createWithMoreThanTwoArgs.Throws(Error.Format(SRResources.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands, 3)); } [Fact] @@ -457,7 +457,7 @@ public void CastMustHaveATypeArgument() }; FunctionCallToken function = new FunctionCallToken("cast", args); Action createWithoutATypeArg = () => this.functionCallBinder.BindFunctionCall(function); - createWithoutATypeArg.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + createWithoutATypeArg.Throws(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } [Fact] @@ -469,7 +469,7 @@ public void CastShouldFailIfTypeArgumentIsACollection() }; Action bind = () => this.functionCallBinder.BindFunctionCall(new FunctionCallToken("cast", args)); - bind.Throws(Strings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + bind.Throws(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } [Fact] @@ -482,7 +482,7 @@ public void CastShouldFailIfSourceArgumentIsACollection() }; Action bind = () => this.functionCallBinder.BindFunctionCall(new FunctionCallToken("cast", args)); - bind.Throws(Strings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + bind.Throws(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } [Fact] @@ -494,7 +494,7 @@ public void IsOfShouldFailIfTypeArgumentIsACollection() }; Action bind = () => this.functionCallBinder.BindFunctionCall(new FunctionCallToken("isof", args)); - bind.Throws(Strings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + bind.Throws(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } [Fact] @@ -507,7 +507,7 @@ public void IsOfShouldFailIfSourceArgumentIsACollection() }; Action bind = () => this.functionCallBinder.BindFunctionCall(new FunctionCallToken("isof", args)); - bind.Throws(Strings.MetadataBinder_CastOrIsOfCollectionsNotSupported); + bind.Throws(SRResources.MetadataBinder_CastOrIsOfCollectionsNotSupported); } [Fact] @@ -520,7 +520,7 @@ public void TypeMustBeLastArgumentToCast() }; FunctionCallToken function = new FunctionCallToken("cast", args); Action createWithOutOfOrderArgs = () => this.functionCallBinder.BindFunctionCall(function); - createWithOutOfOrderArgs.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + createWithOutOfOrderArgs.Throws(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } [Fact] @@ -582,7 +582,7 @@ public void IsOfFunctionMustHaveExactlyTwoArguments() Action createWithMoreThanTwoArgs = () => this.functionCallBinder.BindFunctionCall(functionWithMoreThanTwoArgs); - createWithMoreThanTwoArgs.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands(3)); + createWithMoreThanTwoArgs.Throws(Error.Format(SRResources.MetadataBinder_CastOrIsOfExpressionWithWrongNumberOfOperands, 3)); } [Fact] @@ -594,7 +594,7 @@ public void IsOfMustHaveATypeArgument() }; FunctionCallToken function = new FunctionCallToken("cast", args); Action createWithoutATypeArg = () => this.functionCallBinder.BindFunctionCall(function); - createWithoutATypeArg.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + createWithoutATypeArg.Throws(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } [Fact] @@ -607,7 +607,7 @@ public void TypeMustBeLastArgumentToIsOf() }; FunctionCallToken function = new FunctionCallToken("isof", args); Action createWithOutOfOrderArgs = () => this.functionCallBinder.BindFunctionCall(function); - createWithOutOfOrderArgs.Throws(ODataErrorStrings.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); + createWithOutOfOrderArgs.Throws(SRResources.MetadataBinder_CastOrIsOfFunctionWithoutATypeArgument); } [Fact] @@ -624,7 +624,7 @@ public void LengthWorksWithExactlyOneArgument() FunctionSignatureWithReturnType[] signatures = FunctionCallBinder.ExtractSignatures( FunctionCallBinder.GetUriFunctionSignatures(function.Name)); - createWithMoreThanOneArg.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithMoreThanOneArg.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, function.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(function.Name, signatures))); } @@ -639,7 +639,7 @@ public void LengthArgMustBeSingleValueNode() FunctionCallToken function = new FunctionCallToken("geo.length", args); Action createWithNonSingleValueNode = () => this.functionCallBinder.BindFunctionCall(function); - createWithNonSingleValueNode.Throws(ODataErrorStrings.MetadataBinder_UnsupportedQueryTokenKind("CustomQueryOption")); + createWithNonSingleValueNode.Throws(Error.Format(SRResources.MetadataBinder_UnsupportedQueryTokenKind, "CustomQueryOption")); } [Fact] @@ -654,7 +654,7 @@ public void LengthArgMustBeLineStringType() FunctionCallToken function = new FunctionCallToken("geo.length", args); Action createWithNonLineStringType = () => this.functionCallBinder.BindFunctionCall(function); - createWithNonLineStringType.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "GeometryLinePolygon")); + createWithNonLineStringType.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "GeometryLinePolygon")); } [Fact] @@ -696,13 +696,13 @@ public void IntersectsMustBeCalledWithTwoArgs() FunctionSignatureWithReturnType[] signatures; BuiltInUriFunctions.TryGetBuiltInFunction(functionWithOneArg.Name, out signatures); - createWithOneArg.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithOneArg.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, functionWithOneArg.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(functionWithOneArg.Name, signatures))); BuiltInUriFunctions.TryGetBuiltInFunction(functionWithMoreThanTwoArgs.Name, out signatures); - createWithMoreThanTwoArgs.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithMoreThanTwoArgs.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, functionWithMoreThanTwoArgs.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(functionWithMoreThanTwoArgs.Name, signatures))); } @@ -811,31 +811,31 @@ public void IntersectArgsMustBeOrderedCorrectly() FunctionSignatureWithReturnType[] signatures; BuiltInUriFunctions.TryGetBuiltInFunction(geometryPointNonGeometryPolyToken.Name, out signatures); - createWithGeometryPointNonGeometryPoly.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithGeometryPointNonGeometryPoly.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, geometryPointNonGeometryPolyToken.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(geometryPointNonGeometryPolyToken.Name, signatures))); BuiltInUriFunctions.TryGetBuiltInFunction(geometryPolyNonGeometryPointToken.Name, out signatures); - createWithGeometryPolyNonGeometryPoint.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithGeometryPolyNonGeometryPoint.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, geometryPolyNonGeometryPointToken.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(geometryPolyNonGeometryPointToken.Name, signatures))); BuiltInUriFunctions.TryGetBuiltInFunction(geographyPointNonGeographyPolyToken.Name, out signatures); - createWithGeographyPointNonGeographyPoly.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithGeographyPointNonGeographyPoly.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, geographyPointNonGeographyPolyToken.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(geographyPointNonGeographyPolyToken.Name, signatures))); BuiltInUriFunctions.TryGetBuiltInFunction(geographyPolyNonGeographyPointToken.Name, out signatures); - createWithGeographyPolyNonGeographyPoint.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithGeographyPolyNonGeographyPoint.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, geographyPolyNonGeographyPointToken.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(geographyPolyNonGeographyPointToken.Name, signatures))); BuiltInUriFunctions.TryGetBuiltInFunction(garbageToken.Name, out signatures); - createWithGarbage.Throws(ODataErrorStrings.MetadataBinder_NoApplicableFunctionFound( + createWithGarbage.Throws(Error.Format(SRResources.MetadataBinder_NoApplicableFunctionFound, garbageToken.Name, UriFunctionsHelper.BuildFunctionSignatureListDescription(garbageToken.Name, signatures))); } @@ -1234,7 +1234,7 @@ public void GetFunctionSignaturesShouldThrowOnIncorrectName() { Action bind = () => FunctionCallBinder.GetUriFunctionSignatures("rarg"); - bind.Throws(Strings.MetadataBinder_UnknownFunction("rarg")); + bind.Throws(Error.Format(SRResources.MetadataBinder_UnknownFunction, "rarg")); } [Fact] @@ -1242,7 +1242,7 @@ public void BuiltInFunctionsCannotHaveParentNodes() { FunctionCallToken functionCallToken = new FunctionCallToken("substring", null, new EndPathToken("Name", null)); Action bindWithNonNullParent = () => this.functionCallBinder.BindFunctionCall(functionCallToken); - bindWithNonNullParent.Throws(ODataErrorStrings.FunctionCallBinder_UriFunctionMustHaveHaveNullParent("substring")); + bindWithNonNullParent.Throws(Error.Format(SRResources.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, "substring")); } [Fact] @@ -1253,7 +1253,7 @@ public void FunctionsMustHaveEntityBindingTypes() null, new EndPathToken("Color", new InnerPathToken("MyDog", null, null))); Action bindWithNonEntityBindingType = () => this.functionCallBinder.BindFunctionCall(functionCallToken); - bindWithNonEntityBindingType.Throws(ODataErrorStrings.FunctionCallBinder_UriFunctionMustHaveHaveNullParent("ChangeOwner")); + bindWithNonEntityBindingType.Throws(Error.Format(SRResources.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, "ChangeOwner")); } [Fact] @@ -1274,7 +1274,7 @@ public void CannotCallFunctionInOpenTypeSpace() }, new EndPathToken("OpenProperty", new InnerPathToken("MyFavoritePainting", null, null))); Action bindOpenFunction = () => this.functionCallBinder.BindFunctionCall(functionCall); - bindOpenFunction.Throws(ODataErrorStrings.FunctionCallBinder_CallingFunctionOnOpenProperty("Fully.Qualified.Namespace.FindMyOwner")); + bindOpenFunction.Throws(Error.Format(SRResources.FunctionCallBinder_CallingFunctionOnOpenProperty, "Fully.Qualified.Namespace.FindMyOwner")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/InnerPathTokenBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/InnerPathTokenBinderTests.cs index 6c13270673..2d8a146bcd 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/InnerPathTokenBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/InnerPathTokenBinderTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -44,7 +44,7 @@ public void MissingPropertyShouldThrow() Action bind = () => binder.BindInnerPathSegment(token); string expectedMessage = - ODataErrorStrings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetDogType().FullTypeName(), MissingPropertyName); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetDogType().FullTypeName(), MissingPropertyName); bind.Throws(expectedMessage); } @@ -149,7 +149,7 @@ public void InnerPathTokenBinderShouldFailIfPropertySourceIsNotASingleValue() var token = new InnerPathToken("MyDog", new InnerPathToken("MyPeople", null, null), null); Action bind = () => binder.BindInnerPathSegment(token); - bind.Throws(Strings.MetadataBinder_PropertyAccessSourceNotSingleValue("MyDog")); + bind.Throws(Error.Format(SRResources.MetadataBinder_PropertyAccessSourceNotSingleValue, "MyDog")); } #endregion @@ -203,7 +203,7 @@ public void EnsureParentIsEntityForNavPropThrowsIfNotEntity() { var parent = new ConstantNode(null); Action targetMethod = () => InnerPathTokenBinder.EnsureParentIsResourceForNavProp(parent); - targetMethod.Throws(ODataErrorStrings.MetadataBinder_NavigationPropertyNotFollowingSingleEntityType); + targetMethod.Throws(SRResources.MetadataBinder_NavigationPropertyNotFollowingSingleEntityType); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/KeyBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/KeyBinderTests.cs index 565944b77c..c7cd55a2c9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/KeyBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/KeyBinderTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -52,7 +53,7 @@ public void KeyLookupWithMultipleUnnamedKeysShouldThrow() var namedValues = new[] { new NamedValue(null, new LiteralToken(123)), new NamedValue(null, new LiteralToken(456)), }; Action bind = () => this.keyBinder.BindKeyValues(collectionNode, namedValues, model); - bind.Throws(Strings.MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties(HardCodedTestModel.GetLionSet().EntityType.FullTypeName())); + bind.Throws(Error.Format(SRResources.MetadataBinder_UnnamedKeyValueOnTypeWithMultipleKeyProperties, HardCodedTestModel.GetLionSet().EntityType.FullTypeName())); } [Fact] @@ -62,7 +63,7 @@ public void KeyLookupWithOneOfTwoKeysMissingShouldThrow() var namedValues = new[] { new NamedValue("ID1", new LiteralToken(123)) }; Action bind = () => this.keyBinder.BindKeyValues(collectionNode, namedValues, model); - bind.Throws(Strings.MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues(collectionNode.ItemType.FullName())); + bind.Throws(Error.Format(SRResources.MetadataBinder_NotAllKeyPropertiesSpecifiedInKeyValues, collectionNode.ItemType.FullName())); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/LambdaBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/LambdaBinderTests.cs index 3738dcb10f..f9c1f1419b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/LambdaBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/LambdaBinderTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -92,7 +93,7 @@ public void BindLambdaTokenShouldFailForNonCollectionParent() var allToken = this.CreateTestAllQueryToken(); Action bind = () => binder.BindLambdaToken(allToken, state); - bind.Throws(Strings.MetadataBinder_LambdaParentMustBeCollection); + bind.Throws(SRResources.MetadataBinder_LambdaParentMustBeCollection); } [Fact] @@ -116,7 +117,7 @@ public void BindLambdaTokenShouldFailForNullExpression() var allToken = this.CreateTestAllQueryToken(); Action bind = () => binder.BindLambdaToken(allToken, state); - bind.Throws(Strings.MetadataBinder_AnyAllExpressionNotSingleValue); + bind.Throws(SRResources.MetadataBinder_AnyAllExpressionNotSingleValue); } [Fact] @@ -128,7 +129,7 @@ public void BindLambdaTokenShouldFailForNonBoolExpression() var allToken = this.CreateTestAnyQueryToken(); Action bind = () => binder.BindLambdaToken(allToken, state); - bind.Throws(Strings.MetadataBinder_AnyAllExpressionNotSingleValue); + bind.Throws(SRResources.MetadataBinder_AnyAllExpressionNotSingleValue); } /// diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingTests.cs index 571aa5427f..d02946d687 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingTests.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -31,7 +31,7 @@ public void MetadataBinderProcessSkipWithNullReturnsNull() public void MetadataBinderProcessSkipWithNegativeNumberShouldThrow() { Action metadataBinderAction = () => MetadataBinder.ProcessSkip(-1); - metadataBinderAction.Throws(ODataErrorStrings.MetadataBinder_SkipRequiresNonNegativeInteger("-1")); + metadataBinderAction.Throws(Error.Format(SRResources.MetadataBinder_SkipRequiresNonNegativeInteger, "-1")); } [Fact] @@ -52,7 +52,7 @@ public void MetadataBinderProcessTopWithNullReturnsNull() public void MetadataBinderProcessTopWithNegativeNumberShouldThrow() { Action metadataBinderAction = () => MetadataBinder.ProcessTop(-1); - metadataBinderAction.Throws(ODataErrorStrings.MetadataBinder_TopRequiresNonNegativeInteger("-1")); + metadataBinderAction.Throws(Error.Format(SRResources.MetadataBinder_TopRequiresNonNegativeInteger, "-1")); } [Fact] @@ -69,12 +69,12 @@ public void MetadataBinderProcessQueryOptionsWithNullBindStateShouldThrow() // Test null bind state Action metadataBinderAction = () => MetadataBinder.ProcessQueryOptions(null, bindInfo.BindMethod); - metadataBinderAction.Throws(ODataErrorStrings.MetadataBinder_QueryOptionsBindStateCannotBeNull); + metadataBinderAction.Throws(SRResources.MetadataBinder_QueryOptionsBindStateCannotBeNull); // Test bind state that doesn't have query options populated metadataBinderAction = () => MetadataBinder.ProcessQueryOptions(bindInfo.BindingState, bindInfo.BindMethod); metadataBinderAction.Throws( - ODataErrorStrings.MetadataBinder_QueryOptionsBindStateCannotBeNull); + SRResources.MetadataBinder_QueryOptionsBindStateCannotBeNull); } [Fact] @@ -84,7 +84,7 @@ public void MetadataBinderProcessQueryOptionsWithNullBindMethodShouldThrow() Action metadataBinderAction = () => MetadataBinder.ProcessQueryOptions(bindInfo.BindingState, null); metadataBinderAction.Throws( - ODataErrorStrings.MetadataBinder_QueryOptionsBindMethodCannotBeNull); + SRResources.MetadataBinder_QueryOptionsBindMethodCannotBeNull); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingUtilsTests.cs index 91251d0747..b3c6097082 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/MetadataBindingUtilsTests.cs @@ -8,8 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; -using System.Linq; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -49,7 +48,7 @@ public void IfTypesCannotPromoteErrorIsThrown() SingleValueNode node = new ConstantNode(7); var targetType = EdmCoreModel.Instance.GetSpatial(EdmPrimitiveTypeKind.GeographyMultiLineString, false); Action convertMethod = () => MetadataBindingUtils.ConvertToTypeIfNeeded(node, targetType); - convertMethod.Throws(ODataErrorStrings.MetadataBinder_CannotConvertToType(node.TypeReference.FullName(), targetType.FullName())); + convertMethod.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, node.TypeReference.FullName(), targetType.FullName())); } [Fact] @@ -174,7 +173,7 @@ public void IfTypePromotionNeededForEnum_SourceIsIntegerExceedingDefinedIntegral Action convertIfNeeded = () => MetadataBindingUtils.ConvertToTypeIfNeeded(source, targetTypeReference); // Assert - convertIfNeeded.Throws(ODataErrorStrings.Binder_IsNotValidEnumConstant(enumValue.ToString())); + convertIfNeeded.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, enumValue.ToString())); } [Fact] @@ -192,7 +191,7 @@ public void IfTypePromotionNeeded_SourceIsFloatMemberValuesAndTargetIsEnum_Canno Action convertIfNeeded = () => MetadataBindingUtils.ConvertToTypeIfNeeded(source, targetTypeReference); // Assert - convertIfNeeded.Throws(ODataErrorStrings.MetadataBinder_CannotConvertToType(source.TypeReference.FullName(), targetTypeReference.FullName())); + convertIfNeeded.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, source.TypeReference.FullName(), targetTypeReference.FullName())); } } @@ -211,7 +210,7 @@ public void IfTypePromotionNeeded_SourceIsFloatMemberValuesInStringAndTargetIsEn Action convertIfNeeded = () => MetadataBindingUtils.ConvertToTypeIfNeeded(source, targetTypeReference); // Assert - convertIfNeeded.Throws(ODataErrorStrings.Binder_IsNotValidEnumConstant(enumValue)); + convertIfNeeded.Throws(Error.Format(SRResources.Binder_IsNotValidEnumConstant, enumValue)); } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectBinderTests.cs index c88996c737..48c868da26 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectBinderTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; using Xunit; @@ -31,7 +32,7 @@ public void SystemTokenInSelectionThrows() Action test = () => BinderForPerson.Bind(null, selectToken); // Assert - test.Throws(Strings.SelectExpandBinder_SystemTokenInSelect("$value")); + test.Throws(Error.Format(SRResources.SelectExpandBinder_SystemTokenInSelect, "$value")); } [Fact] @@ -204,7 +205,7 @@ public void InvlidIdentifierInSelectionThrows() Action test = () => BinderForPerson.Bind(null, selectToken); // Assert - test.Throws(Strings.MetadataBinder_InvalidIdentifierInQueryOption("Dotted.Name")); + test.Throws(Error.Format(SRResources.MetadataBinder_InvalidIdentifierInQueryOption, "Dotted.Name")); } [Fact] @@ -248,7 +249,7 @@ public void MultiLevelPathAfterNavigationPropertyThrows() Action test = () => BinderForPerson.Bind(null, selectToken); // Assert - test.Throws(Strings.SelectBinder_MultiLevelPathInSelect); + test.Throws(SRResources.SelectBinder_MultiLevelPathInSelect); } [Theory] @@ -263,7 +264,7 @@ public void QueryOptionsNestedInNotAllowedSelectionThrows(string select, string Action test = () => BinderForPerson.Bind(null, selectToken); // Assert - test.Throws(Strings.SelectExpandBinder_InvalidQueryOptionNestedSelection(identifier)); + test.Throws(Error.Format(SRResources.SelectExpandBinder_InvalidQueryOptionNestedSelection, identifier)); } [Fact] @@ -279,7 +280,7 @@ public void FunctionCallsInSelectTreeThrows() Action test = () => BinderForPerson.Bind(null, selectToken); // Arrange - test.Throws(Strings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetPersonType(), "substring")); + test.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetPersonType(), "substring")); } [Fact] @@ -295,7 +296,7 @@ public void CustomFunctionsThrow() Action test = () => BinderForPerson.Bind(null, selectToken); // Assert - test.Throws(Strings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetPersonType(), "GetCoolPeople")); + test.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetPersonType(), "GetCoolPeople")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectExpandPathBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectExpandPathBinderTests.cs index 250932b9ce..c9183504aa 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectExpandPathBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectExpandPathBinderTests.cs @@ -8,8 +8,8 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; using System.Linq; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -53,7 +53,7 @@ public void InvalidTypeSegmentThrowsException() PathSegmentToken firstNonTypeToken; IEdmStructuredType entityType = HardCodedTestModel.GetPersonType(); Action followInvalidTypeSegment = () => SelectExpandPathBinder.FollowTypeSegments(typeSegment, HardCodedTestModel.TestModel, 800, DefaultUriResolver, ref entityType, out firstNonTypeToken); - followInvalidTypeSegment.Throws(ODataErrorStrings.SelectExpandPathBinder_FollowNonTypeSegment("Stuff")); + followInvalidTypeSegment.Throws(Error.Format(SRResources.SelectExpandPathBinder_FollowNonTypeSegment, "Stuff")); } [Fact] @@ -63,7 +63,7 @@ public void MaxRecursiveDepthIsRespected() PathSegmentToken firstNonTypeToken; IEdmStructuredType entityType = HardCodedTestModel.GetPersonType(); Action followLongChain = () => SelectExpandPathBinder.FollowTypeSegments(typeSegment, HardCodedTestModel.TestModel, 1, DefaultUriResolver, ref entityType, out firstNonTypeToken); - followLongChain.Throws(ODataErrorStrings.ExpandItemBinder_PathTooDeep); + followLongChain.Throws(SRResources.ExpandItemBinder_PathTooDeep); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectPathSegmentTokenBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectPathSegmentTokenBinderTests.cs index a7143b9208..e794479e7b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectPathSegmentTokenBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/SelectPathSegmentTokenBinderTests.cs @@ -9,7 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -89,7 +89,7 @@ public void DifferentQualifiedActionNameShouldWork() public void OperationWithParenthesesShouldNotWork() { Action action = () => SelectPathSegmentTokenBinder.ConvertNonTypeTokenToSegment(new NonSystemToken("Move()", null, null), HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), DefaultUriResolver); - action.Throws(ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "Move()")); + action.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "Move()")); } [Fact] @@ -191,14 +191,14 @@ public void UnfoundProperyOnOpenTypeResultsInOpenPropertySelectionItem() public void UnfoundProperyOnClosedTypeThrows() { Action visit = () => SelectPathSegmentTokenBinder.ConvertNonTypeTokenToSegment(new NonSystemToken("Missing", null, null), HardCodedTestModel.TestModel, HardCodedTestModel.GetPersonType(), DefaultUriResolver); - visit.Throws(Strings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetPersonType(), "Missing")); + visit.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetPersonType(), "Missing")); } [Fact] public void UnQualifiedActionNameShouldThrow() { Action visit = () => SelectPathSegmentTokenBinder.ConvertNonTypeTokenToSegment(new NonSystemToken("Walk", null, null), HardCodedTestModel.TestModel, HardCodedTestModel.GetDogType(), DefaultUriResolver); - visit.Throws(Strings.MetadataBinder_PropertyNotDeclared(HardCodedTestModel.GetDogType(), "Walk")); + visit.Throws(Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, HardCodedTestModel.GetDogType(), "Walk")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/UnaryOperatorBinderTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/UnaryOperatorBinderTests.cs index e54c70bb17..762c35d1e9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/UnaryOperatorBinderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Binders/UnaryOperatorBinderTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Binders { @@ -88,7 +89,7 @@ public void NonSingleValueQueryNodeShouldFail() var unaryOperatorToken = new UnaryOperatorToken(UnaryOperatorKind.Negate, new LiteralToken("foo")); Action bind = () => this.unaryOperatorBinder.BindUnaryOperator(unaryOperatorToken); - bind.Throws(Strings.MetadataBinder_UnaryOperatorOperandNotSingleValue(UnaryOperatorKind.Negate.ToString())); + bind.Throws(Error.Format(SRResources.MetadataBinder_UnaryOperatorOperandNotSingleValue, UnaryOperatorKind.Negate.ToString())); } [Fact] @@ -99,7 +100,7 @@ public void SingleValueQueryNodeWithImcompatibleTypeReferenceShouldFail() var unaryOperatorQueryToken = new UnaryOperatorToken(UnaryOperatorKind.Negate, new LiteralToken("foo")); Action bind = () => this.unaryOperatorBinder.BindUnaryOperator(unaryOperatorQueryToken); - bind.Throws(Strings.MetadataBinder_IncompatibleOperandError("Edm.DateTimeOffset", UnaryOperatorKind.Negate)); + bind.Throws(Error.Format(SRResources.MetadataBinder_IncompatibleOperandError, "Edm.DateTimeOffset", UnaryOperatorKind.Negate)); } /// diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExceptionUtilTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExceptionUtilTests.cs index 8fc491c2f6..db56c2234b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExceptionUtilTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExceptionUtilTests.cs @@ -4,6 +4,7 @@ // //--------------------------------------------------------------------- +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -28,16 +29,16 @@ public void SyntaxErrorHelperShouldThrowNormalODataException() public void NotFoundHelperShouldSetMessageCorrectly() { var exception = ExceptionUtil.CreateResourceNotFoundError("foo"); - Assert.Equal(Strings.RequestUriProcessor_ResourceNotFound("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "foo"), exception.Message); } [Fact] public void SyntaxErrorHelperShouldSetMessageCorrectly() { var exception = ExceptionUtil.CreateSyntaxError(); - Assert.Equal(Strings.RequestUriProcessor_SyntaxError, exception.Message); + Assert.Equal(SRResources.RequestUriProcessor_SyntaxError, exception.Message); - string a = Strings.General_InternalError(Microsoft.OData.UriParser.InternalErrorCodes.UriQueryExpressionParser_ParseComparison); + string a = Error.Format(SRResources.General_InternalError, OData.UriParser.InternalErrorCodes.UriQueryExpressionParser_ParseComparison); } } } \ No newline at end of file diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExpressionLexerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExpressionLexerTests.cs index 9ac0d72bf8..3ed7c16a8c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExpressionLexerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ExpressionLexerTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser { @@ -221,7 +221,7 @@ public void ShouldErrorWhenIncorrectCharacterAtStart() bool result = lexer.TryPeekNextToken(out resultToken, out error); Assert.False(result); Assert.NotNull(error); - Assert.Equal(ODataErrorStrings.ExpressionLexer_InvalidCharacter("#", "0", "#$*@#"), error.Message); + Assert.Equal(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "#", "0", "#$*@#"), error.Message); } // internal ExpressionToken NextToken() @@ -241,7 +241,7 @@ public void ShouldThrowWhenIncorrectCharacterAtStart() { ExpressionLexer lexer = new ExpressionLexer("#$*@#", false, false); Action nextToken = () => lexer.NextToken(); - nextToken.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("#", "0", "#$*@#")); + nextToken.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "#", "0", "#$*@#")); } // internal object ReadLiteralToken() @@ -333,7 +333,7 @@ public void ShouldThrowWhenNotLiteralToken() { ExpressionLexer lexer = new ExpressionLexer("potato", false, false); Action read = () => lexer.ReadLiteralToken(); - read.Throws(ODataErrorStrings.ExpressionLexer_ExpectedLiteralToken("potato")); + read.Throws(Error.Format(SRResources.ExpressionLexer_ExpectedLiteralToken, "potato")); } // internal string ReadDottedIdentifier() @@ -366,7 +366,7 @@ public void ShouldThrowWhenNotGivenIdentifierToken() { ExpressionLexer lexer = new ExpressionLexer("2.43", false, false); Action read = () => lexer.ReadDottedIdentifier(false); - read.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError("0", "2.43")); + read.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, "0", "2.43")); } [Fact] @@ -382,7 +382,7 @@ public void ShouldThrowWhenGivenStarInDontAcceptStarMode() { ExpressionLexer lexer = new ExpressionLexer("m.*", true, false); Action read = () => lexer.ReadDottedIdentifier(false); - read.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError("3", "m.*")); + read.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, "3", "m.*")); } [Fact] @@ -390,7 +390,7 @@ public void StarMustBeLastTokenInDottedIdentifier() { ExpressionLexer lexer = new ExpressionLexer("m.*.blah", true, false); Action read = () => lexer.ReadDottedIdentifier(true); - read.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError("3", "m.*.blah")); + read.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, "3", "m.*.blah")); } // internal ExpressionToken PeekNextToken() @@ -408,7 +408,7 @@ public void PeekingShouldThrowWhenIncorrectCharacterAtStart() { ExpressionLexer lexer = new ExpressionLexer("#$*@#", false, false); Action peek = () => lexer.PeekNextToken(); - peek.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("#", "0", "#$*@#")); + peek.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "#", "0", "#$*@#")); } // internal void ValidateToken(ExpressionTokenKind t) @@ -425,7 +425,7 @@ public void ShouldThrowWhenCurrentTokenIsNotExpressionKind() { ExpressionLexer lexer = new ExpressionLexer("null", true, false); Action validate = () => lexer.ValidateToken(ExpressionTokenKind.Question); - validate.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(4, "null")); + validate.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 4, "null")); } [Fact] @@ -516,15 +516,15 @@ public void SpatialLiteralNegative_MissingQuotes() [Fact] public void SpatialLiteralNegative_WrongQuotes() { - ValidateLexerException("geography\"foo\"", Strings.ExpressionLexer_InvalidCharacter("\"", 9, "geography\"foo\"")); - ValidateLexerException("geometry\"foo\"", Strings.ExpressionLexer_InvalidCharacter("\"", 8, "geometry\"foo\"")); + ValidateLexerException("geography\"foo\"", Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "\"", 9, "geography\"foo\"")); + ValidateLexerException("geometry\"foo\"", Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "\"", 8, "geometry\"foo\"")); } [Fact] public void SpatialLiteralNegative_UnterminatedQuote() { - ValidateLexerException("geography'foo", Strings.ExpressionLexer_UnterminatedLiteral(13, "geography'foo")); - ValidateLexerException("geometry'foo", Strings.ExpressionLexer_UnterminatedLiteral(12, "geometry'foo")); + ValidateLexerException("geography'foo", Error.Format(SRResources.ExpressionLexer_UnterminatedLiteral, 13, "geography'foo")); + ValidateLexerException("geometry'foo", Error.Format(SRResources.ExpressionLexer_UnterminatedLiteral, 12, "geometry'foo")); } [Fact] @@ -684,21 +684,21 @@ public void EdmValidNamesNotAllowedInUri_Combinations() public void ExpressionLexerShouldFailByDefaultForAtSymbol() { Action lex = () => new ExpressionLexer("@", moveToFirstToken: true, useSemicolonDelimiter: false); - lex.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(1, "@")); + lex.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 1, "@")); } [Fact] public void ExpressionLexerShouldFailAtSymbolIsLastCharacter() { Action lex = () => new ExpressionLexer("@", moveToFirstToken: true, useSemicolonDelimiter: false, parsingFunctionParameters: true); - lex.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(1, "@")); + lex.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 1, "@")); } [Fact] public void ExpressionLexerShouldExpectIdentifierStartAfterAtSymbol() { Action lex = () => new ExpressionLexer("@1", moveToFirstToken: true, useSemicolonDelimiter: false, parsingFunctionParameters: true); - lex.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter("1", 1, "@1")); + lex.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "1", 1, "@1")); } [Fact] @@ -840,13 +840,13 @@ public void FunctionWithCollectionParameter() [Fact] public void ComplexValueMustBeEndedByBracket() { - ValidateLexerException("{stuff : morestuff", ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + ValidateLexerException("{stuff : morestuff", SRResources.ExpressionLexer_UnbalancedBracketExpression); } [Fact] public void OverClosedBracketsThrow() { - ValidateLexerException("{stuff: morestuff}}", ODataErrorStrings.ExpressionLexer_InvalidCharacter("}", "18", "{stuff: morestuff}}")); + ValidateLexerException("{stuff: morestuff}}", Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", "18", "{stuff: morestuff}}")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveBuiltinIdentifierTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveBuiltinIdentifierTests.cs index be2ede2e8a..0166cbfd30 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveBuiltinIdentifierTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveBuiltinIdentifierTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Metadata { @@ -28,21 +29,21 @@ public void CaseInsensitiveBatchMetadataCountSegmentShouldWork() "$Batch", uriParser => uriParser.ParsePath(), odataPath => odataPath.LastSegment.ShouldBeBatchSegment(), - Strings.RequestUriProcessor_ResourceNotFound("$Batch")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$Batch")); this.TestCaseInsensitiveBuiltIn( "$metadata", "$METADATA", uriParser => uriParser.ParsePath(), odataPath => odataPath.LastSegment.ShouldBeMetadataSegment(), - Strings.RequestUriProcessor_ResourceNotFound("$METADATA")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$METADATA")); this.TestCaseInsensitiveBuiltIn( "People/$count", "People/$cOUNT", uriParser => uriParser.ParsePath(), odataPath => odataPath.LastSegment.ShouldBeCountSegment(), - Strings.RequestUriProcessor_CannotQueryCollections("People")); + Error.Format(SRResources.RequestUriProcessor_CannotQueryCollections, "People")); } [Fact] @@ -53,14 +54,14 @@ public void CaseInsensitiveRefValueSegmentShouldWork() "People(1)/MyDog/$REF", uriParser => uriParser.ParsePath(), odataPath => odataPath.LastSegment.ShouldBeNavigationPropertyLinkSegment(HardCodedTestModel.GetPersonMyDogNavProp()), - Strings.RequestUriProcessor_ResourceNotFound("$REF")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$REF")); this.TestCaseInsensitiveBuiltIn( "People(1)/MyDog/$value", "People(1)/MyDog/$vaLue", uriParser => uriParser.ParsePath(), odataPath => odataPath.LastSegment.ShouldBeValueSegment(), - Strings.RequestUriProcessor_ResourceNotFound("$vaLue")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "$vaLue")); } #endregion @@ -182,14 +183,14 @@ public void CaseInsensitiveNestedSelectExpandShouldWork() { new PropertySegment(HardCodedTestModel.GetPersonNameProp()), })), - Strings.UriSelectParser_TermIsNotValid("($SELECT=Name)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($SELECT=Name)")); this.TestCaseInsensitiveBuiltIn( "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($expand=MyDog)", "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($EXPAND=MyDog)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).SelectAndExpand, clause => clause.SelectedItems.Single().ShouldBeExpansionFor(HardCodedTestModel.GetPersonMyDogNavProp()), - Strings.UriSelectParser_TermIsNotValid("($EXPAND=MyDog)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($EXPAND=MyDog)")); } [Fact] @@ -200,14 +201,14 @@ public void CaseInsensitiveNestedFilterOrderbyShouldWork() "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($FILTER=Name eq 'su')", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).FilterOption, filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Equal), - Strings.UriSelectParser_TermIsNotValid("($FILTER=Name eq 'su')")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($FILTER=Name eq 'su')")); this.TestCaseInsensitiveBuiltIn( "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($orderby=Name)", "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($orderBY=Name)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).OrderByOption, orderby => orderby.Expression.ShouldBeSingleValuePropertyAccessQueryNode(HardCodedTestModel.GetPersonNameProp()), - Strings.UriSelectParser_TermIsNotValid("($orderBY=Name)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($orderBY=Name)")); } [Fact] @@ -218,7 +219,7 @@ public void CaseInsensitiveNestedSearchShouldWork() "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($SEARCH=Name)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).SearchOption, clause => clause.Expression.ShouldBeSearchTermNode("Name"), - Strings.UriSelectParser_TermIsNotValid("($SEARCH=Name)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($SEARCH=Name)")); } [Fact] @@ -229,21 +230,21 @@ public void CaseInsensitiveNestedTopSkipCountShouldWork() "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($toP=1;$skIp=2;$COUnt=true)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).TopOption, val => Assert.Equal(1, val), - Strings.UriSelectParser_TermIsNotValid("($toP=1;$skIp=2;$COUnt=true)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($toP=1;$skIp=2;$COUnt=true)")); this.TestCaseInsensitiveBuiltIn( "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($top=1;$skip=2;$count=true)", "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($toP=1;$skIp=2;$COUnt=true)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).SkipOption, val => Assert.Equal(2, val), - Strings.UriSelectParser_TermIsNotValid("($toP=1;$skIp=2;$COUnt=true)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($toP=1;$skIp=2;$COUnt=true)")); this.TestCaseInsensitiveBuiltIn( "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($top=1;$skip=2;$count=true)", "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($toP=1;$skIp=2;$COUnt=true)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).CountOption, val => Assert.True(val), - Strings.UriSelectParser_TermIsNotValid("($toP=1;$skIp=2;$COUnt=true)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($toP=1;$skIp=2;$COUnt=true)")); } [Fact] @@ -254,14 +255,14 @@ public void CaseInsensitiveNestedLevelsMaxShouldWork() "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($LEVELS=3)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).LevelsOption, clause => Assert.Equal(3, clause.Level), - Strings.UriSelectParser_TermIsNotValid("($LEVELS=3)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($LEVELS=3)")); this.TestCaseInsensitiveBuiltIn( "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($levels=max)", "Boss/Fully.Qualified.Namespace.Manager?$expand=DirectReports($LEVELS=MAX)", uriParser => (uriParser.ParseSelectAndExpand().SelectedItems.Single() as ExpandedNavigationSelectItem).LevelsOption, clause => Assert.True(clause.IsMaxLevel), - Strings.UriSelectParser_TermIsNotValid("($LEVELS=MAX)")); + Error.Format(SRResources.UriSelectParser_TermIsNotValid, "($LEVELS=MAX)")); } [Fact] @@ -296,7 +297,7 @@ public void CaseInsensitiveContainsShouldWork() "People?$filter=CONTAINS(Name,'SU')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeSingleValueFunctionCallQueryNode("contains", EdmCoreModel.Instance.GetBoolean(false)), - Strings.MetadataBinder_UnknownFunction("CONTAINS")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "CONTAINS")); } [Fact] @@ -307,7 +308,7 @@ public void CaseInsensitiveMatchesPatternShouldWork() "People?$filter=MATCHESPATTERN(Name,'SU')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeSingleValueFunctionCallQueryNode("matchesPattern", EdmCoreModel.Instance.GetBoolean(false)), - Strings.MetadataBinder_UnknownFunction("MATCHESPATTERN")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "MATCHESPATTERN")); } [Fact] @@ -318,14 +319,14 @@ public void CaseInsensitiveStartswithEndswithShouldWork() "People?$filter=STARTSWITH(Name,'SU')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeSingleValueFunctionCallQueryNode("startswith", EdmCoreModel.Instance.GetBoolean(false)), - Strings.MetadataBinder_UnknownFunction("STARTSWITH")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "STARTSWITH")); this.TestCaseInsensitiveBuiltIn( "People?$filter=endswith(Name,'SU')", "People?$filter=ENDSWITH(Name,'SU')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeSingleValueFunctionCallQueryNode("endswith", EdmCoreModel.Instance.GetBoolean(false)), - Strings.MetadataBinder_UnknownFunction("ENDSWITH")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "ENDSWITH")); } [Fact] @@ -336,7 +337,7 @@ public void CaseInsensitiveLengthwithShouldWork() "People?$orderby=LENgTH(Name)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("length", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("LENgTH")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "LENgTH")); } [Fact] @@ -347,7 +348,7 @@ public void CaseInsensitiveIndexOfShouldWork() "People?$orderby=INDEXOF(Name, 'o')", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("indexof", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("INDEXOF")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "INDEXOF")); } [Fact] @@ -358,7 +359,7 @@ public void CaseInsensitiveSubStringShouldWork() "People?$orderby=Substring(Name, 1, 2)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("substring", EdmCoreModel.Instance.GetString(true)), - Strings.MetadataBinder_UnknownFunction("Substring")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "Substring")); } [Fact] @@ -369,14 +370,14 @@ public void CaseInsensitiveTolowerToupperShouldWork() "People?$orderby=TOLOWER(Name)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("tolower", EdmCoreModel.Instance.GetString(true)), - Strings.MetadataBinder_UnknownFunction("TOLOWER")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "TOLOWER")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=toupper(Name)", "People?$orderby=TOUPPER(Name)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("toupper", EdmCoreModel.Instance.GetString(true)), - Strings.MetadataBinder_UnknownFunction("TOUPPER")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "TOUPPER")); } [Fact] @@ -387,14 +388,14 @@ public void CaseInsensitiveTrimConcatShouldWork() "People?$orderby=TRIM(Name)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("trim", EdmCoreModel.Instance.GetString(true)), - Strings.MetadataBinder_UnknownFunction("TRIM")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "TRIM")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=concat(Name,'sh')", "People?$orderby=Concat(Name,'sh')", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("concat", EdmCoreModel.Instance.GetString(true)), - Strings.MetadataBinder_UnknownFunction("Concat")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "Concat")); } [Fact] @@ -405,21 +406,21 @@ public void CaseInsensitiveYearMonthDayShouldWork() "People?$orderby=YEAR(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("year", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("YEAR")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "YEAR")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=month(FavoriteDate)", "People?$orderby=MONTH(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("month", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("MONTH")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "MONTH")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=day(FavoriteDate)", "People?$orderby=DAY(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("day", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("DAY")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "DAY")); } [Fact] @@ -430,28 +431,28 @@ public void CaseInsensitiveHourMinuteSecondFractionalsecondsShouldWork() "People?$orderby=HoUR(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("hour", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("HoUR")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "HoUR")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=minute(FavoriteDate)", "People?$orderby=MinuTe(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("minute", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("MinuTe")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "MinuTe")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=second(FavoriteDate)", "People?$orderby=sEcond(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("second", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("sEcond")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "sEcond")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=fractionalseconds(FavoriteDate)", "People?$orderby=frActionalseconds(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("fractionalseconds", EdmCoreModel.Instance.GetDecimal(false)), - Strings.MetadataBinder_UnknownFunction("frActionalseconds")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "frActionalseconds")); } [Fact] @@ -462,21 +463,21 @@ public void CaseInsensitiveRoundFloorCeilingShouldWork() "People?$orderby=ROUND(ID)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("round", EdmCoreModel.Instance.GetDouble(false)), - Strings.MetadataBinder_UnknownFunction("ROUND")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "ROUND")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=floor(ID)", "People?$orderby=flooR(ID)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("floor", EdmCoreModel.Instance.GetDouble(false)), - Strings.MetadataBinder_UnknownFunction("flooR")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "flooR")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=ceiling(ID)", "People?$orderby=CEILING(ID)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("ceiling", EdmCoreModel.Instance.GetDouble(false)), - Strings.MetadataBinder_UnknownFunction("CEILING")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "CEILING")); } [Fact] @@ -487,21 +488,21 @@ public void CaseInsensitiveMindatetimeMaxdatetimeNowShouldWork() "People?$orderby=minDatetime()", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("mindatetime", EdmCoreModel.Instance.GetDateTimeOffset(false)), - Strings.MetadataBinder_UnknownFunction("minDatetime")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "minDatetime")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=maxdatetime()", "People?$orderby=MAxdatetime()", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("maxdatetime", EdmCoreModel.Instance.GetDateTimeOffset(false)), - Strings.MetadataBinder_UnknownFunction("MAxdatetime")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "MAxdatetime")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=now()", "People?$orderby=NOW()", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("now", EdmCoreModel.Instance.GetDateTimeOffset(false)), - Strings.MetadataBinder_UnknownFunction("NOW")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "NOW")); } [Fact] @@ -512,14 +513,14 @@ public void CaseInsensitiveTotalsecondsTotaloffsetminutesShouldWork() "People?$orderby=totalsecoNDs(TimeEmployed)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("totalseconds", EdmCoreModel.Instance.GetDecimal(false)), - Strings.MetadataBinder_UnknownFunction("totalsecoNDs")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "totalsecoNDs")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=totaloffsetminutes(FavoriteDate)", "People?$orderby=totaloffsetminuteS(FavoriteDate)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("totaloffsetminutes", EdmCoreModel.Instance.GetInt32(false)), - Strings.MetadataBinder_UnknownFunction("totaloffsetminuteS")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "totaloffsetminuteS")); } [Fact] @@ -530,14 +531,14 @@ public void CaseInsensitiveIsofCastShouldWork() "People?$orderby=cAst(1, Edm.String)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("cast", EdmCoreModel.Instance.GetString(false)), - Strings.MetadataBinder_UnknownFunction("cAst")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "cAst")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=isof(1, Edm.String)", "People?$orderby=iSOf(1, Edm.String)", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("isof", EdmCoreModel.Instance.GetBoolean(true)), - Strings.MetadataBinder_UnknownFunction("iSOf")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "iSOf")); } [Fact] @@ -548,21 +549,21 @@ public void CaseInsensitiveGeoFuncsShouldWork() "People?$orderby=geo.DIstance(geometry'Point(10 30)', geometry'Point(7 28)')", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("geo.distance", EdmCoreModel.Instance.GetDouble(true)), - Strings.MetadataBinder_UnknownFunction("geo.DIstance")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "geo.DIstance")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=geo.length(geometry'LineString(1 1, 2 2)')", "People?$orderby=geo.LENGTH(geometry'LineString(1 1, 2 2)')", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("geo.length", EdmCoreModel.Instance.GetDouble(true)), - Strings.MetadataBinder_UnknownFunction("geo.LENGTH")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "geo.LENGTH")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=geo.intersects(geometry'Point(10 30)',geometry'Polygon((10 30, 7 28, 6 6, 10 30))')", "People?$orderby=geo.iNTersects(geometry'Point(10 30)',geometry'Polygon((10 30, 7 28, 6 6, 10 30))')", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeSingleValueFunctionCallQueryNode("geo.intersects", EdmCoreModel.Instance.GetBoolean(true)), - Strings.MetadataBinder_UnknownFunction("geo.iNTersects")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "geo.iNTersects")); } #endregion @@ -575,14 +576,14 @@ public void CaseInsensitiveAnyAllShouldWork() "Dogs(1)?$filter=Nicknames/ANY(d:d eq 'a')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeAnyQueryNode(), - Strings.UriQueryExpressionParser_CloseParenOrCommaExpected("15", "Nicknames/ANY(d:d eq 'a')")); + Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, "15", "Nicknames/ANY(d:d eq 'a')")); this.TestCaseInsensitiveBuiltIn( "Dogs(1)?$filter=Nicknames/all(d:d eq 'a')", "Dogs(1)?$filter=Nicknames/aLL(d:d eq 'a')", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeAllQueryNode(), - Strings.UriQueryExpressionParser_CloseParenOrCommaExpected("15", "Nicknames/aLL(d:d eq 'a')")); + Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, "15", "Nicknames/aLL(d:d eq 'a')")); } [Fact] @@ -593,14 +594,14 @@ public void CaseInsensitiveAscDescShouldWork() "People?$orderby=Name aSC", uriParser => uriParser.ParseOrderBy(), orderby => Assert.Equal(OrderByDirection.Ascending, orderby.Direction), - Strings.ExpressionLexer_SyntaxError("8", "Name aSC")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "8", "Name aSC")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=Name desc", "People?$orderby=Name DESC", uriParser => uriParser.ParseOrderBy(), orderby => Assert.Equal(OrderByDirection.Descending, orderby.Direction), - Strings.ExpressionLexer_SyntaxError("9", "Name DESC")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "9", "Name DESC")); } [Fact] @@ -611,13 +612,13 @@ public void CaseInsensitiveAndOrShouldWork() "People?$filter=true AND false", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.And), - Strings.ExpressionLexer_SyntaxError("8", "true AND false")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "8", "true AND false")); this.TestCaseInsensitiveBuiltIn( "People?$filter=true or false", "People?$filter=true oR false", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Or), - Strings.ExpressionLexer_SyntaxError("7", "true oR false")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "7", "true oR false")); } [Fact] @@ -628,14 +629,14 @@ public void CaseInsensitiveAddSubShouldWork() "People?$orderby=ID ADD 1", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Add), - Strings.ExpressionLexer_SyntaxError("6", "ID ADD 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "6", "ID ADD 1")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=ID sub 1", "People?$orderby=ID Sub 1", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Subtract), - Strings.ExpressionLexer_SyntaxError("6", "ID Sub 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "6", "ID Sub 1")); } [Fact] @@ -646,21 +647,21 @@ public void CaseInsensitiveMulDivModShouldWork() "People?$orderby=ID mUl 1", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Multiply), - Strings.ExpressionLexer_SyntaxError("6", "ID mUl 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "6", "ID mUl 1")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=ID div 1", "People?$orderby=ID diV 1", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Divide), - Strings.ExpressionLexer_SyntaxError("6", "ID diV 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "6", "ID diV 1")); this.TestCaseInsensitiveBuiltIn( "People?$orderby=ID mod 1", "People?$orderby=ID MoD 1", uriParser => uriParser.ParseOrderBy(), orderby => orderby.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Modulo), - Strings.ExpressionLexer_SyntaxError("6", "ID MoD 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "6", "ID MoD 1")); } [Fact] @@ -671,7 +672,7 @@ public void CaseInsensitiveNotShouldWork() "People?$filter=NOT false", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeUnaryOperatorNode(UnaryOperatorKind.Not), - Strings.ExpressionLexer_SyntaxError("9", "NOT false")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "9", "NOT false")); } [Fact] @@ -682,14 +683,14 @@ public void CaseInsensitiveEqNeShouldWork() "People?$filter=Name EQ 'su'", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Equal), - Strings.ExpressionLexer_SyntaxError("7", "Name EQ 'su'")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "7", "Name EQ 'su'")); this.TestCaseInsensitiveBuiltIn( "People?$filter=Name ne 'su'", "People?$filter=Name NE 'su'", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.NotEqual), - Strings.ExpressionLexer_SyntaxError("7", "Name NE 'su'")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "7", "Name NE 'su'")); } [Fact] @@ -700,14 +701,14 @@ public void CaseInsensitiveLtLeShouldWork() "People?$filter=ID LT 1", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.LessThan), - Strings.ExpressionLexer_SyntaxError("5", "ID LT 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "5", "ID LT 1")); this.TestCaseInsensitiveBuiltIn( "People?$filter=ID le 1", "People?$filter=ID LE 1", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.LessThanOrEqual), - Strings.ExpressionLexer_SyntaxError("5", "ID LE 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "5", "ID LE 1")); } [Fact] @@ -718,14 +719,14 @@ public void CaseInsensitiveGtGeShouldWork() "People?$filter=ID GT 1", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.GreaterThan), - Strings.ExpressionLexer_SyntaxError("5", "ID GT 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "5", "ID GT 1")); this.TestCaseInsensitiveBuiltIn( "People?$filter=ID ge 1", "People?$filter=ID GE 1", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.GreaterThanOrEqual), - Strings.ExpressionLexer_SyntaxError("5", "ID GE 1")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "5", "ID GE 1")); } [Fact] @@ -736,7 +737,7 @@ public void CaseInsensitiveHasShouldWork() "Pet2Set?$filter=PetColorPattern HaS Fully.Qualified.Namespace.ColorPattern'SolidYellow'", uriParser => uriParser.ParseFilter(), filter => filter.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Has), - Strings.ExpressionLexer_SyntaxError("19", "PetColorPattern HaS Fully.Qualified.Namespace.ColorPattern'SolidYellow'")); + Error.Format(SRResources.ExpressionLexer_SyntaxError, "19", "PetColorPattern HaS Fully.Qualified.Namespace.ColorPattern'SolidYellow'")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveResolverTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveResolverTests.cs index c8fba2d9d2..cae42dc946 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveResolverTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/CaseInsensitiveResolverTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Metadata { @@ -29,7 +30,7 @@ public void CaseInsensitiveTypeCastInPath() "People/TesTNS.PERsON", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeTypeSegment(new EdmCollectionType(new EdmEntityTypeReference(PersonType, false))), - Strings.RequestUriProcessor_SyntaxError); + SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -40,7 +41,7 @@ public void CaseInsensitiveTypeCastOnComplexTypeInPath() "People(1)/Addr/TestNS.ADDress", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeTypeSegment(AddrType), - Strings.RequestUriProcessor_ResourceNotFound("TestNS.ADDress")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "TestNS.ADDress")); } [Fact] @@ -60,7 +61,7 @@ public void CaseInsensitiveTypeCastNameNonexistInPath() this.TestCaseInsensitiveNotExist( "People/NS.WHY", parser => parser.ParsePath(), - Strings.RequestUriProcessor_SyntaxError); + SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -76,7 +77,7 @@ public void CaseInsensitiveTypeCastInSelectExpand() new TypeSegment(PersonType, PeopleSet), new PropertySegment(PersonNameProp), })), - Strings.ExpandItemBinder_CannotFindType("TesTNS.PERsON")); + Error.Format(SRResources.ExpandItemBinder_CannotFindType, "TesTNS.PERsON")); } [Fact] @@ -92,7 +93,7 @@ public void CaseInsensitiveTypeCastOnComplexTypeInSelectExpand() new PropertySegment(AddrProperty), new TypeSegment(AddrType, null), })), - Strings.SelectBinder_MultiLevelPathInSelect); + SRResources.SelectBinder_MultiLevelPathInSelect); } [Fact] @@ -117,7 +118,7 @@ public void CaseInsensitiveTypeCastNonexistTypeInSelectExpand() this.TestCaseInsensitiveNotExist( "People?$select=NS.WHY/Supername", parser => parser.ParseSelectAndExpand(), - Strings.ExpandItemBinder_CannotFindType("NS.WHY")); + Error.Format(SRResources.ExpandItemBinder_CannotFindType, "NS.WHY")); } [Fact] @@ -128,7 +129,7 @@ public void CaseInsensitiveTypeCastInOrderBy() "People?$orderby=TesTNS.PERsON/Name", (parser) => parser.ParseOrderBy(), (clause) => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PersonNameProp), - Strings.CastBinder_ChildTypeIsNotEntity("TesTNS.PERsON")); + Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "TesTNS.PERsON")); } [Fact] @@ -139,7 +140,7 @@ public void CaseInsensitiveTypeCastOnComplexTypeInFilter() "People?$filter=TestNS.Person/Addr/TestNS.AddrESS/ZipCode eq '550'", parser => parser.ParseFilter(), clause => clause.Expression.ShouldBeBinaryOperatorNode(BinaryOperatorKind.Equal).Left.ShouldBeSingleValuePropertyAccessQueryNode(ZipCodeProperty), - Strings.CastBinder_ChildTypeIsNotEntity("TestNS.AddrESS")); + Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "TestNS.AddrESS")); } //[Fact(Skip = "#582: Do not support built-in type name case insensitive. EnumValue's type name case insensitve also not supported.")] @@ -174,7 +175,7 @@ public void CaseInsensitiveTypeCastNonexistTypeInOrderby() this.TestCaseInsensitiveNotExist( "People?$orderby=NS.WHY/Supername", parser => parser.ParseOrderBy(), - Strings.CastBinder_ChildTypeIsNotEntity("NS.WHY")); + Error.Format(SRResources.CastBinder_ChildTypeIsNotEntity, "NS.WHY")); } #endregion @@ -187,7 +188,7 @@ public void CaseInsensitiveEntitySetName() "PeoplE", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeEntitySetSegment(PeopleSet), - Strings.RequestUriProcessor_ResourceNotFound("PeoplE")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "PeoplE")); } [Fact] @@ -209,7 +210,7 @@ public void CaseInsensitiveSingletonName() "BOSS", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeSingletonSegment(Boss), - Strings.RequestUriProcessor_ResourceNotFound("BOSS")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "BOSS")); } [Fact] @@ -229,7 +230,7 @@ public void CaseInsensitiveNonExistNavigationSource() this.TestCaseInsensitiveNotExist( "WUKONG", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("WUKONG")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "WUKONG")); } [Fact] @@ -240,7 +241,7 @@ public void CaseInsensitiveEntitySetKeyName() "PetSet(key1=1, KEY2='stm')", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeKeySegment(new KeyValuePair("key1", 1), new KeyValuePair("key2", "stm")), - Strings.BadRequest_KeyMismatch(PetType.FullTypeName())); + Error.Format(SRResources.BadRequest_KeyMismatch, PetType.FullTypeName())); } [Fact] @@ -251,7 +252,7 @@ public void CaseInsensitiveEntitySetKeyNameConflicts() "PetSetCon(KeY=1, kEy='stm')", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeKeySegment(new KeyValuePair("key", 1), new KeyValuePair("KEY", "stm")), - Strings.BadRequest_KeyMismatch(PetCon.FullTypeName())); + Error.Format(SRResources.BadRequest_KeyMismatch, PetCon.FullTypeName())); } [Fact] @@ -260,7 +261,7 @@ public void CaseInsensitiveEntitySetKeyNameNonexist() this.TestCaseInsensitiveNotExist( "PetSet(key1=1, key3='stm')", parser => parser.ParsePath(), - Strings.BadRequest_KeyMismatch(PetType.FullTypeName())); + Error.Format(SRResources.BadRequest_KeyMismatch, PetType.FullTypeName())); } #endregion @@ -273,7 +274,7 @@ public void CaseInsensitivePropertyNameInPath() "People(1)/nAmE", (parser) => parser.ParsePath(), (path) => path.LastSegment.ShouldBePropertySegment(PersonNameProp), - Strings.RequestUriProcessor_ResourceNotFound("nAmE")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "nAmE")); } [Fact] @@ -282,7 +283,7 @@ public void CaseInsensitivePropertyNameNonexistNameInPath() this.TestCaseInsensitiveNotExist( "People(1)/Name1", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("Name1")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "Name1")); } [Fact] @@ -293,7 +294,7 @@ public void CaseInsensitivePropertyNameConflictsInPath() "People(1)/pEn", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeNavigationPropertySegment(PersonNavPen), - Strings.UriParserMetadata_MultipleMatchingPropertiesFound("pEn", "TestNS.Person")); + Error.Format(SRResources.UriParserMetadata_MultipleMatchingPropertiesFound, "pEn", "TestNS.Person")); } [Fact] @@ -304,7 +305,7 @@ public void CaseInsensitivePropertyNameForComplexTypeInPath() "People(1)/addr/zipcode", (parser) => parser.ParsePath(), (path) => path.LastSegment.ShouldBePropertySegment(ZipCodeProperty), - Strings.RequestUriProcessor_ResourceNotFound("addr")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "addr")); } [Fact] @@ -320,7 +321,7 @@ public void CaseInsensitivePropertyNameInSelectExpand() new PropertySegment(AddrProperty), new PropertySegment(ZipCodeProperty), })), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "ADDR")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "ADDR")); } [Fact] @@ -329,7 +330,7 @@ public void CaseInsensitivePropertyNameNonexistInSelectExpand() this.TestCaseInsensitiveNotExist( "People?$select=Name1", parser => parser.ParseSelectAndExpand(), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "Name1")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "Name1")); } [Fact] @@ -340,7 +341,7 @@ public void CaseInsensitivePropertyNameConflictsInSelectExpand() "People(1)?$expand=PeN", parser => parser.ParseSelectAndExpand(), clause => clause.SelectedItems.Single().ShouldBeExpansionFor(PersonNavPen), - Strings.UriParserMetadata_MultipleMatchingPropertiesFound("PeN", "TestNS.Person")); + Error.Format(SRResources.UriParserMetadata_MultipleMatchingPropertiesFound, "PeN", "TestNS.Person")); } [Fact] @@ -351,7 +352,7 @@ public void CaseInsensitivePropertyNameInOrderBy() "People?$orderby=nAmE", (parser) => parser.ParseOrderBy(), (clause) => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PersonNameProp), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "nAmE")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "nAmE")); } [Fact] @@ -360,7 +361,7 @@ public void CaseInsensitivePropertyNonexistNameInOrderBy() this.TestCaseInsensitiveNotExist( "People?$orderby=Nam2e", (parser) => parser.ParseOrderBy(), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "Nam2e")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "Nam2e")); } [Fact] @@ -389,7 +390,7 @@ public void CaseInsensitivePropertyNameForComplexTypeInFilter() parameters[0].ShouldBeSingleValuePropertyAccessQueryNode(ZipCodeProperty); parameters[1].ShouldBeConstantQueryNode("2"); }, - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "ADDR")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "ADDR")); } #endregion @@ -402,7 +403,7 @@ public void CaseInsensitiveBoundOperationNameInPath() "People(1)/TestNS.FindPENCIL", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil1P), - Strings.RequestUriProcessor_ResourceNotFound("TestNS.FindPENCIL")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "TestNS.FindPENCIL")); } [Fact] @@ -413,7 +414,7 @@ public void CaseInsensitiveBoundOperationNameConflictsInPath() "People(1)/TestNS.FinDPenCilsCoN", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencilsCon), - Strings.FunctionOverloadResolver_NoSingleMatchFound("TestNS.FinDPenCilsCoN", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "TestNS.FinDPenCilsCoN", "")); } [Fact] @@ -422,7 +423,7 @@ public void CaseInsensitiveNonExistBoundOperationInPath() this.TestCaseInsensitiveNotExist( "People(1)/TestNS.FindPencilEx", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("TestNS.FindPencilEx")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "TestNS.FindPencilEx")); } [Fact] @@ -433,7 +434,7 @@ public void CaseInsensitiveBoundOperationWithParameterNameInPath() "People(1)/TestNS.FindPENCIL(piD=5)", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil2P), - Strings.RequestUriProcessor_ResourceNotFound("TestNS.FindPENCIL")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "TestNS.FindPENCIL")); } [Fact] @@ -453,7 +454,7 @@ public void CaseInsensitiveBoundOperationWithParameterNameNonExistInPath() this.TestCaseInsensitiveNotExist( "People(1)/TestNS.FindPencil(piT=5)", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("TestNS.FindPencil")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "TestNS.FindPencil")); } [Fact] @@ -464,7 +465,7 @@ public void CaseInsensitiveBoundOperationWithParameterNameInOrderBy() "People?$orderby=TestNS.FindPencil(PID=5)/Id", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PencilId), - Strings.MetadataBinder_UnknownFunction("TestNS.FindPencil")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "TestNS.FindPencil")); } #endregion @@ -477,7 +478,7 @@ public void CaseInsensitiveOperationImportName() "FEED", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationImportSegment(FeedImport), - Strings.RequestUriProcessor_ResourceNotFound("FEED")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "FEED")); } [Fact] @@ -488,7 +489,7 @@ public void CaseInsensitiveOperationImportNameConflicts() "fEEdCon", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationImportSegment(FeedConImport), - Strings.FunctionOverloadResolver_MultipleActionImportOverloads("fEEdCon")); + Error.Format(SRResources.FunctionOverloadResolver_MultipleActionImportOverloads, "fEEdCon")); } [Fact] @@ -497,7 +498,7 @@ public void CaseInsensitiveNonExistOperationImport() this.TestCaseInsensitiveNotExist( "FeedSheep", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("FeedSheep")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "FeedSheep")); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/ODataUriResolverTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/ODataUriResolverTests.cs index 0144e0f0dd..9b5fd80375 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/ODataUriResolverTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/ODataUriResolverTests.cs @@ -11,6 +11,7 @@ using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Metadata { @@ -223,7 +224,7 @@ public void TestStringAsEnumInKey() Assert.Equal("color", keyInfo.Key); keyInfo.Value.ShouldBeODataEnumValue("TestNS.Color", "2"); }, - Strings.RequestUriProcessor_SyntaxError); + SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -243,7 +244,7 @@ public void TestStringAsEnumInKeyUsingKeyAsSegment() Assert.Equal("color", keyInfo.Key); keyInfo.Value.ShouldBeODataEnumValue("TestNS.Color", "2"); }, - Strings.RequestUriProcessor_SyntaxError); + SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -265,7 +266,7 @@ public void TestStringAsEnumInNamedKey() Assert.Equal("id", keyInfo1.Key); Assert.Equal(1, keyInfo1.Value); }, - Strings.BadRequest_KeyMismatch(MoonType2.FullTypeName())); + Error.Format(SRResources.BadRequest_KeyMismatch, MoonType2.FullTypeName())); } #endregion @@ -365,7 +366,7 @@ public void ResolveType_ThrowsErrors_IfThereAreDuplicates_WithImmutableModel(boo var resolver = new ODataUriResolver { EnableCaseInsensitive = true }; var exception = Assert.Throws(() => resolver.ResolveType(model, "ns.models.person")); - Assert.Equal(Strings.UriParserMetadata_MultipleMatchingTypesFound("ns.models.person"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriParserMetadata_MultipleMatchingTypesFound, "ns.models.person"), exception.Message); } #endregion @@ -521,7 +522,7 @@ public void ResolveTerm_ThrowsException_IfThereAreDuplicates() var resolver = new ODataUriResolver { EnableCaseInsensitive = true }; var exception = Assert.Throws(() => resolver.ResolveTerm(model, "ns.someTerm")); - Assert.Equal(Strings.UriParserMetadata_MultipleMatchingTypesFound("ns.someTerm"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriParserMetadata_MultipleMatchingTypesFound, "ns.someTerm"), exception.Message); } #endregion @@ -587,7 +588,7 @@ public void ResolveNavigationSource_ThrowsException_IfMultipleMatchesFound(bool var resolver = new ODataUriResolver { EnableCaseInsensitive = true }; var exception = Assert.Throws(() => resolver.ResolveNavigationSource(model, "peoPle")); - Assert.Equal(Strings.UriParserMetadata_MultipleMatchingNavigationSourcesFound("peoPle"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriParserMetadata_MultipleMatchingNavigationSourcesFound, "peoPle"), exception.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/OpenTypeUnqualifiedExtensionTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/OpenTypeUnqualifiedExtensionTests.cs index 06e0c832ca..df10ecabef 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/OpenTypeUnqualifiedExtensionTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/OpenTypeUnqualifiedExtensionTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -22,7 +23,7 @@ public void OpenTypeUnqualifiedFunctionInPathTest() "People(1)/FindPencil(pid=2)", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil2P), - Strings.OpenNavigationPropertiesNotSupportedOnOpenTypes("FindPencil")); + Error.Format(SRResources.OpenNavigationPropertiesNotSupportedOnOpenTypes, "FindPencil")); } [Fact] @@ -44,7 +45,7 @@ public void OpenTypeUnqualifiedFunctionWithNoParameterWithParenthesisInPathTest( "People(1)/FindPencil()", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil1P), - Strings.OpenNavigationPropertiesNotSupportedOnOpenTypes("FindPencil")); + Error.Format(SRResources.OpenNavigationPropertiesNotSupportedOnOpenTypes, "FindPencil")); } [Fact] @@ -66,7 +67,7 @@ public void OpenTypeUnqualifiedActionWithParenthesisOnComplexTypeInPathTest() "People(1)/Addr/ChangeZip()", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(ChangeZip), - Strings.OpenNavigationPropertiesNotSupportedOnOpenTypes("ChangeZip")); + Error.Format(SRResources.OpenNavigationPropertiesNotSupportedOnOpenTypes, "ChangeZip")); } [Fact] @@ -75,7 +76,7 @@ public void OpenTypeUnqualifiedOperationWithParenthesisNonexistInPath() this.TestCaseUnqualifiedNotExist( "People(1)/Addr/ChangeZipEE()", parser => parser.ParsePath(), - Strings.OpenNavigationPropertiesNotSupportedOnOpenTypes("ChangeZipEE")); + Error.Format(SRResources.OpenNavigationPropertiesNotSupportedOnOpenTypes, "ChangeZipEE")); } [Fact] @@ -84,7 +85,7 @@ public void OpenTypeUnqualifiedOperationConflictsInPath() this.TestCaseUnqualifiedConflict( "People(1)/FindPencilsCon", parser => parser.ParsePath(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } [Fact] @@ -93,7 +94,7 @@ public void OpenTypeUnqualifiedOperationWithParenthesisConflictsInPath() this.TestCaseUnqualifiedConflict( "People(1)/FindPencilsCon()", parser => parser.ParsePath(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } [Fact] @@ -104,7 +105,7 @@ public void OpenTypeUnqualifiedFunctionInQueryTest() "People?$orderby=FindPencil(pid=2)/Id", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PencilId).Source.ShouldBeSingleResourceFunctionCallNode("TestNS.FindPencil"), - Strings.MetadataBinder_UnknownFunction("FindPencil")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "FindPencil")); } [Fact] @@ -126,7 +127,7 @@ public void OpenTypeUnqualifiedFunctionWithNoParameterWithParenthesisInQueryTest "People?$orderby=FindPencil()/Id", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PencilId).Source.ShouldBeSingleResourceFunctionCallNode("TestNS.FindPencil"), - Strings.MetadataBinder_UnknownFunction("FindPencil")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "FindPencil")); } [Fact] @@ -148,7 +149,7 @@ public void OpenTypeUnqualifiedFunctionWithParenthesisOnComplexTypeInQueryTest() "People?$orderby=Addr/GetZip()", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValueFunctionCallQueryNode("TestNS.GetZip").Source.ShouldBeSingleComplexNode(AddrProperty), - Strings.FunctionCallBinder_UriFunctionMustHaveHaveNullParent("GetZip")); + Error.Format(SRResources.FunctionCallBinder_UriFunctionMustHaveHaveNullParent, "GetZip")); } [Fact] @@ -157,7 +158,7 @@ public void OpenTypeUnqualifiedOperationWithParenthesisNonexistInOrderBy() this.TestCaseUnqualifiedNotExist( "People?$orderby=FindPencilEE()/Id", parser => parser.ParseOrderBy(), - Strings.MetadataBinder_UnknownFunction("FindPencilEE")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "FindPencilEE")); } [Fact] @@ -167,7 +168,7 @@ public void OpenTypeUnqualifiedOperationConflictsInOrderby() this.TestCaseUnqualifiedConflict( "People?$orderby=FindPencilsCon", parser => parser.ParseOrderBy(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } [Fact] @@ -177,7 +178,7 @@ public void OpenTypeUnqualifiedOperationWithParenthesisConflictsInOrderby() this.TestCaseUnqualifiedConflict( "People?$orderby=FindPencilsCon()", parser => parser.ParseOrderBy(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } private void TestUnqualified( diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/UnqualifiedODataUriResolverTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/UnqualifiedODataUriResolverTests.cs index 26c004a5b4..441c2503b3 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/UnqualifiedODataUriResolverTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Metadata/UnqualifiedODataUriResolverTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; using Xunit; @@ -23,7 +24,7 @@ public void UnqualifiedFunctionInPathTest() "People(1)/FindPencil(pid=2)", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil2P), - Strings.RequestUriProcessor_ResourceNotFound("FindPencil")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "FindPencil")); } [Fact] @@ -34,7 +35,7 @@ public void UnqualifiedFunctionWithNoParameterInPathTest() "People(1)/FindPencil", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(FindPencil1P), - Strings.RequestUriProcessor_ResourceNotFound("FindPencil")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "FindPencil")); } [Fact] @@ -45,7 +46,7 @@ public void UnqualifiedActionOnComplexTypeInPathTest() "People(1)/Addr/ChangeZip", parser => parser.ParsePath(), path => path.LastSegment.ShouldBeOperationSegment(ChangeZip), - Strings.RequestUriProcessor_ResourceNotFound("ChangeZip")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "ChangeZip")); } [Fact] @@ -54,7 +55,7 @@ public void UnqualifiedOperationNonexistInPath() this.TestCaseUnqualifiedNotExist( "People(1)/Addr/ChangeZipEE", parser => parser.ParsePath(), - Strings.RequestUriProcessor_ResourceNotFound("ChangeZipEE")); + Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "ChangeZipEE")); } [Fact] @@ -63,7 +64,7 @@ public void UnqualifiedOperationConflictsInPath() this.TestCaseUnqualifiedConflict( "People(1)/FindPencilsCon", parser => parser.ParsePath(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } [Fact] @@ -74,7 +75,7 @@ public void UnqualifiedFunctionInQueryTest() "People?$orderby=FindPencil(pid=2)/Id", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PencilId).Source.ShouldBeSingleResourceFunctionCallNode("TestNS.FindPencil"), - Strings.MetadataBinder_UnknownFunction("FindPencil")); + Error.Format(SRResources.MetadataBinder_UnknownFunction, "FindPencil")); } [Fact] @@ -85,7 +86,7 @@ public void UnqualifiedFunctionWithNoParameterInQueryTest() "People?$orderby=FindPencil/Id", parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValuePropertyAccessQueryNode(PencilId).Source.ShouldBeSingleResourceFunctionCallNode("TestNS.FindPencil"), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "FindPencil")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "FindPencil")); } [Fact] @@ -97,7 +98,7 @@ public void UnqualifiedFunctionOnComplexTypeInQueryTest() parser => parser.ParseOrderBy(), clause => clause.Expression.ShouldBeSingleValueFunctionCallQueryNode("TestNS.GetZip").Source.ShouldBeSingleComplexNode(AddrProperty), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Address", "GetZip")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Address", "GetZip")); } [Fact] @@ -106,7 +107,7 @@ public void UnqualifiedOperationNonexistInOrderBy() this.TestCaseUnqualifiedNotExist( "People?$orderby=FindPencilEE/Id", parser => parser.ParseOrderBy(), - Strings.MetadataBinder_PropertyNotDeclared("TestNS.Person", "FindPencilEE")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "TestNS.Person", "FindPencilEE")); } [Fact] @@ -116,7 +117,7 @@ public void UnqualifiedOperationConflictsInOrderby() this.TestCaseUnqualifiedConflict( "People?$orderby=FindPencilsCon", parser => parser.ParseOrderBy(), - Strings.FunctionOverloadResolver_NoSingleMatchFound("FindPencilsCon", "")); + Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "FindPencilsCon", "")); } [Fact] @@ -127,7 +128,7 @@ public void Parse_MatchedCountOfKeys() "PetSet(KeY1=1, KeY2='aStr')", parser => parser.ParsePath(), _ => { /*no-op*/ }, - Strings.BadRequest_KeyMismatch(PetType.FullTypeName()), + Error.Format(SRResources.BadRequest_KeyMismatch, PetType.FullTypeName()), Model, parser => parser.Resolver = new UnqualifiedODataUriResolver() {EnableCaseInsensitive = true}); } @@ -141,7 +142,7 @@ public void CannotParse_UnmatchedCountOfKeysUsingUnqualifiedResolver() Resolver = new UnqualifiedODataUriResolver() {EnableCaseInsensitive = false} }; Action action = () => parser.ParsePath(); - action.Throws(Strings.BadRequest_KeyMismatch("TestNS.Pet")); + action.Throws(Error.Format(SRResources.BadRequest_KeyMismatch, "TestNS.Pet")); } [Fact] @@ -150,7 +151,7 @@ public void CannotParse_UnmatchedCountOfKeysUsingODataUriResolver() Uri uriUnmatchedKeysCount = new Uri("PetSet(key1=1, key2='aStr', nonExistingKey='bStr')", UriKind.Relative); ODataUriParser parser = new ODataUriParser(Model, uriUnmatchedKeysCount); Action action = () => parser.ParsePath(); - action.Throws(Strings.BadRequest_KeyMismatch("TestNS.Pet")); + action.Throws(Error.Format(SRResources.BadRequest_KeyMismatch, "TestNS.Pet")); } private void TestUnqualified( diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataQueryOptionParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataQueryOptionParserTests.cs index 38aa89fc11..f548a8dd8b 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataQueryOptionParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataQueryOptionParserTests.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -72,15 +73,15 @@ public void QueryOptionWithEmptyValueShouldWork() Assert.Null(uriParser.ParseOrderBy()); Assert.Null(uriParser.ParseCompute()); Action action = () => uriParser.ParseTop(); - action.Throws(Strings.SyntacticTree_InvalidTopQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidTopQueryOptionValue, "")); action = () => uriParser.ParseSkip(); - action.Throws(Strings.SyntacticTree_InvalidSkipQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidSkipQueryOptionValue, "")); action = () => uriParser.ParseIndex(); - action.Throws(Strings.SyntacticTree_InvalidIndexQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidIndexQueryOptionValue, "")); action = () => uriParser.ParseCount(); - action.Throws(Strings.ODataUriParser_InvalidCount("")); + action.Throws(Error.Format(SRResources.ODataUriParser_InvalidCount, "")); action = () => uriParser.ParseSearch(); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(0, "")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 0, "")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataUriParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataUriParserTests.cs index bcdfb4e046..4766b4a5bd 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataUriParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/ODataUriParserTests.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Vocabularies; @@ -15,7 +16,6 @@ using Microsoft.OData.UriParser; using Microsoft.OData.UriParser.Validation; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser { @@ -65,15 +65,15 @@ public void EmptyValueQueryOptionShouldWork(string relativeUriString, bool enabl Assert.Empty(results.SelectedItems); Assert.Null(uriParser.ParseOrderBy()); Action action = () => uriParser.ParseTop(); - action.Throws(Strings.SyntacticTree_InvalidTopQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidTopQueryOptionValue, "")); action = () => uriParser.ParseSkip(); - action.Throws(Strings.SyntacticTree_InvalidSkipQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidSkipQueryOptionValue, "")); action = () => uriParser.ParseIndex(); - action.Throws(Strings.SyntacticTree_InvalidIndexQueryOptionValue("")); + action.Throws(Error.Format(SRResources.SyntacticTree_InvalidIndexQueryOptionValue, "")); action = () => uriParser.ParseCount(); - action.Throws(Strings.ODataUriParser_InvalidCount("")); + action.Throws(Error.Format(SRResources.ODataUriParser_InvalidCount, "")); action = () => uriParser.ParseSearch(); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(0, "")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 0, "")); Assert.Empty(uriParser.ParseSkipToken()); Assert.Empty(uriParser.ParseDeltaToken()); } @@ -112,7 +112,7 @@ public void ParseAnnotationInFilterForEntityTypeShouldThrow() path.LastSegment.ShouldBeEntitySetSegment(HardCodedTestModel.GetPeopleSet()); Action action = () => uriParser.ParseFilter(); action.Throws( - ODataErrorStrings.MetadataBinder_PropertyNotDeclared("Fully.Qualified.Namespace.Person", "@my.annotation")); + Error.Format(SRResources.MetadataBinder_PropertyNotDeclared, "Fully.Qualified.Namespace.Person", "@my.annotation")); } [Fact] @@ -134,7 +134,7 @@ public void DupilicateNonODataQueryOptionShouldWork() new Uri(FullUri, "?$filter=UserName eq 'Tom'&nonODataQuery=foo&$select=Emails&nonODataQuery=bar")); var nonODataqueryOptions = uriParserProcessingDupCustomQuery.CustomQueryOptions; - action.Throws(Strings.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce("$filter")); + action.Throws(Error.Format(SRResources.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, "$filter")); Assert.Equal(2, nonODataqueryOptions.Count); Assert.True(nonODataqueryOptions[0].Key.Equals("nonODataQuery") && nonODataqueryOptions[1].Key.Equals("nonODataQuery")); @@ -185,14 +185,14 @@ public void ServiceRootMustBeAbsoluteUri() public void MaxExpandDepthCannotBeNegative() { Action setNegative = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri).Settings.MaximumExpansionDepth = -1; - setNegative.Throws(ODataErrorStrings.UriParser_NegativeLimit); + setNegative.Throws(SRResources.UriParser_NegativeLimit); } [Fact] public void MaxExpandCountCannotBeNegative() { Action setNegative = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri).Settings.MaximumExpansionCount = -1; - setNegative.Throws(ODataErrorStrings.UriParser_NegativeLimit); + setNegative.Throws(SRResources.UriParser_NegativeLimit); } #endregion @@ -213,7 +213,7 @@ public void FilterLimitIsRespectedForFilter(string fullUriString, bool enableNoD ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(fullUriString)) { Settings = { FilterLimit = 0 } }; parser.EnableNoDollarQueryOptions = enableNoDollarQueryOptions; Action parseWithLimit = () => parser.ParseFilter(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parseWithLimit.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Theory] @@ -225,14 +225,14 @@ public void FilterLimitWithInterestingTreeStructures(string fullUriString, bool ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(fullUriString)) { Settings = { FilterLimit = 5 } }; parser.EnableNoDollarQueryOptions = enableNoDollarQueryOptions; Action parseWithLimit = () => parser.ParseFilter(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parseWithLimit.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] public void NegativeFilterLimitThrows() { Action negativeLimit = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri) { Settings = { FilterLimit = -98798 } }; - negativeLimit.Throws(ODataErrorStrings.UriParser_NegativeLimit); + negativeLimit.Throws(SRResources.UriParser_NegativeLimit); } [Fact] @@ -251,7 +251,7 @@ public void OrderByLimitIsRespectedForOrderby(string fullUriString, bool enableN ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(fullUriString)) { Settings = { OrderByLimit = 0 } }; parser.EnableNoDollarQueryOptions = enableNoDollarQueryOptions; Action parseWithLimit = () => parser.ParseOrderBy(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parseWithLimit.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Theory] @@ -263,14 +263,14 @@ public void OrderByLimitWithInterestingTreeStructures(string fullUriString, bool ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(fullUriString)) { Settings = { OrderByLimit = 5 } }; parser.EnableNoDollarQueryOptions = enableNoDollarQueryOptions; Action parseWithLimit = () => parser.ParseOrderBy(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parseWithLimit.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] public void OrderByLimitCannotBeNegative() { Action parseWithNegativeLimit = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri) { Settings = { OrderByLimit = -9879 } }; - parseWithNegativeLimit.Throws(ODataErrorStrings.UriParser_NegativeLimit); + parseWithNegativeLimit.Throws(SRResources.UriParser_NegativeLimit); } [Fact] @@ -285,14 +285,14 @@ public void PathLimitIsRespectedForPath() { ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://gobbldygook/", UriKind.Absolute), new Uri("http://gobbldygook/path/to/something", UriKind.Absolute)) { Settings = { PathLimit = 0 } }; Action parseWithLimit = () => parser.ParsePath(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryPathParser_TooManySegments); + parseWithLimit.Throws(SRResources.UriQueryPathParser_TooManySegments); } [Fact] public void PathLimitCannotBeNegative() { Action parseWithNegativeLimit = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri) { Settings = { PathLimit = -8768 } }; - parseWithNegativeLimit.Throws(ODataErrorStrings.UriParser_NegativeLimit); + parseWithNegativeLimit.Throws(SRResources.UriParser_NegativeLimit); } [Fact] @@ -311,14 +311,14 @@ public void SelectExpandLimitIsRespectedForSelectExpand(string fullUriString, bo ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(fullUriString)) { Settings = { SelectExpandLimit = 0 } }; parser.EnableNoDollarQueryOptions = enableNoDollarQueryOptions; Action parseWithLimit = () => parser.ParseSelectAndExpand(); - parseWithLimit.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + parseWithLimit.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] public void NegativeSelectExpandLimitIsRespected() { Action parseWithNegativeLimit = () => new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri) { Settings = { SelectExpandLimit = -87657 } }; - parseWithNegativeLimit.Throws(ODataErrorStrings.UriParser_NegativeLimit); + parseWithNegativeLimit.Throws(SRResources.UriParser_NegativeLimit); } #endregion @@ -377,7 +377,7 @@ public void ParseSelectExpandForContainment(string fullUriString, bool enableNoD public void AbsoluteUriInConstructorShouldThrow() { Action action = () => new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://host/People(1)")); - action.Throws(Strings.UriParser_RelativeUriMustBeRelative); + action.Throws(SRResources.UriParser_RelativeUriMustBeRelative); } [Fact] @@ -429,7 +429,7 @@ public void CompositeAlternateKeyShouldFailOnlyWithPartialAlternateKey() Resolver = new AlternateKeysODataUriResolver(HardCodedTestModel.TestModel) }.ParsePath(); - action.Throws(ODataErrorStrings.BadRequest_KeyOrAlternateKeyMismatch(HardCodedTestModel.GetPersonType().FullTypeName())); + action.Throws(Error.Format(SRResources.BadRequest_KeyOrAlternateKeyMismatch, HardCodedTestModel.GetPersonType().FullTypeName())); } [Fact] @@ -441,7 +441,7 @@ public void CompositeAlternateKeyShouldFailOnlyWithInvalidAlternateKey() Resolver = new AlternateKeysODataUriResolver(HardCodedTestModel.TestModel) }.ParsePath(); - action.Throws(ODataErrorStrings.BadRequest_KeyOrAlternateKeyMismatch(HardCodedTestModel.GetPersonType().FullTypeName())); + action.Throws(Error.Format(SRResources.BadRequest_KeyOrAlternateKeyMismatch, HardCodedTestModel.GetPersonType().FullTypeName())); } [Fact] @@ -453,7 +453,7 @@ public void AlternateKeyShouldFailWithDefaultUriResolver() Resolver = new ODataUriResolver() }.ParsePath(); - action.Throws(ODataErrorStrings.BadRequest_KeyMismatch(HardCodedTestModel.GetPersonType().FullTypeName())); + action.Throws(Error.Format(SRResources.BadRequest_KeyMismatch, HardCodedTestModel.GetPersonType().FullTypeName())); } [Fact] @@ -524,7 +524,7 @@ public void ParseSelectODataControlInformationShouldFail(string relativeUriStrin { var parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri(relativeUriString, UriKind.Relative)); Action action = () => parser.ParseSelectAndExpand(); - action.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid(term)); + action.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, term)); } [Fact] @@ -624,7 +624,7 @@ public void ParseShouldFailWithDuplicateQueryOptions(string relativeUriString, b if (shouldThrow) { - action.Throws(Strings.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce( + action.Throws(Error.Format(SRResources.QueryOptionUtils_QueryParameterMustBeSpecifiedOnce, enableNoDollarQueryOptions ? string.Format(CultureInfo.InvariantCulture, "${0}/{0}", queryOptionName) : queryOptionName)); } else @@ -930,7 +930,7 @@ public void ParseBadComputeWithMissingAs() Uri url = new Uri("http://host/Paintings?$compute=nonsense"); ODataUriParser parser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, url); Action action = () => parser.ParseCompute(); - action.Throws(ODataErrorStrings.UriQueryExpressionParser_AsExpected(8, "nonsense")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_AsExpected, 8, "nonsense")); } [Fact] @@ -1385,7 +1385,7 @@ public void ParseEscapeFunctionUrlThrowsWithoutEscapeFunction() // Assert var odataException = Assert.Throws(test); - Assert.Equal(ODataErrorStrings.RequestUriProcessor_ResourceNotFound("root:"), odataException.Message); + Assert.Equal(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "root:"), odataException.Message); } [Fact] @@ -1401,7 +1401,7 @@ public void ParseEscapeFunctionUrlThrowsInvalidEscapeFunction() // Assert var odataException = Assert.Throws(test); - Assert.Equal(ODataErrorStrings.RequestUriProcessor_NoBoundEscapeFunctionSupported("NS.OneDrive"), odataException.Message); + Assert.Equal(Error.Format(SRResources.RequestUriProcessor_NoBoundEscapeFunctionSupported, "NS.OneDrive"), odataException.Message); } internal static IEdmModel GetEdmModelWithEscapeFunction(bool escape, bool multipleParameter = false) @@ -1551,7 +1551,7 @@ public void ParseEscapeFunctionUrlWithoutEndingDelimiterThrowsWithoutNonComposab // Assert var odataException = Assert.Throws(test); - Assert.Equal(ODataErrorStrings.RequestUriProcessor_NoBoundEscapeFunctionSupported("Collection(NS.Order)"), odataException.Message); + Assert.Equal(Error.Format(SRResources.RequestUriProcessor_NoBoundEscapeFunctionSupported, "Collection(NS.Order)"), odataException.Message); } [Theory] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralParserTests.cs index 2b70ee0a8d..802f16a6e4 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralParserTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -143,7 +144,7 @@ public void AddCustomUriLiteralParser_GeneralParsers_CannotAddToGeneraldIfSameIn Action addCustomUriLiteralParser = () => CustomUriLiteralParsers.AddCustomUriLiteralParser(customBooleanUriTypePraser); - addCustomUriLiteralParser.Throws(Strings.UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists); + addCustomUriLiteralParser.Throws(SRResources .UriCustomTypeParsers_AddCustomUriTypeParserAlreadyExists); } finally { @@ -212,7 +213,7 @@ public void AddCustomUriLiteralParser_RegisterToEdmType_CannotAddIfAlreadyRegist Action addCustomUriLiteralParser = () => CustomUriLiteralParsers.AddCustomUriLiteralParser(booleanTypeReference, customBooleanUriTypePraser); - addCustomUriLiteralParser.Throws(Strings.UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists(booleanTypeReference.FullName())); + addCustomUriLiteralParser.Throws(Error.Format(SRResources.UriCustomTypeParsers_AddCustomUriTypeParserEdmTypeExists, booleanTypeReference.FullName())); } finally { diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralPrefixesTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralPrefixesTests.cs index bc61e71268..34a00358a0 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralPrefixesTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/CustomUriLiteralPrefixesTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -60,7 +61,7 @@ public void CustomUriLiteralPrefix_Add_InvalidLiteralNameThrows(string literalPr Action addCustomUriLiteralPrefix = () => CustomUriLiteralPrefixes.AddCustomLiteralPrefix(literalPrefix, EdmCoreModel.Instance.GetBoolean(false)); - addCustomUriLiteralPrefix.Throws(Strings.UriParserHelper_InvalidPrefixLiteral(literalPrefix)); + addCustomUriLiteralPrefix.Throws(Error.Format(SRResources.UriParserHelper_InvalidPrefixLiteral, literalPrefix)); } [Theory] @@ -93,7 +94,7 @@ public void CustomUriLiteralPrefix_CannotAddExistingPrefixNameWithExistingEdmTyp Action addCustomUriLiteralPrefix = () => CustomUriLiteralPrefixes.AddCustomLiteralPrefix(LITERAL_PREFIX, booleanTypeReference); - addCustomUriLiteralPrefix.Throws(Strings.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists(LITERAL_PREFIX)); + addCustomUriLiteralPrefix.Throws(Error.Format(SRResources.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists, LITERAL_PREFIX)); } finally { @@ -117,7 +118,7 @@ public void CustomUriLiteralPrefix_CannotAddExistingPrefixNameWithDifferentEdmTy Action addCustomUriLiteralPrefix = () => CustomUriLiteralPrefixes.AddCustomLiteralPrefix(LITERAL_PREFIX, intTypeReference); - addCustomUriLiteralPrefix.Throws(Strings.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists(LITERAL_PREFIX)); + addCustomUriLiteralPrefix.Throws(Error.Format(SRResources.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists, LITERAL_PREFIX)); } finally { @@ -224,7 +225,7 @@ public void CustomUriLiteralPrefix_Remove_InvalidLiteralNameThrows(string litera Action addCustomUriLiteralPrefix = () => CustomUriLiteralPrefixes.RemoveCustomLiteralPrefix(literalPrefix); - addCustomUriLiteralPrefix.Throws(Strings.UriParserHelper_InvalidPrefixLiteral(literalPrefix)); + addCustomUriLiteralPrefix.Throws(Error.Format(SRResources.UriParserHelper_InvalidPrefixLiteral, literalPrefix)); } [Theory] @@ -321,7 +322,7 @@ public void CustomUriLiteralPrefix_CannotParseTypeWithWrongLiteralPrefix() } catch (ODataException e) { - if (!String.Equals(e.Message, Strings.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists( + if (!String.Equals(e.Message, Error.Format(SRResources.CustomUriTypePrefixLiterals_AddCustomUriTypePrefixLiteralAlreadyExists, CustomUriLiteralParserUnitTests.BOOLEAN_LITERAL_PREFIX), StringComparison.Ordinal)) { // unexpected exception, re-throw. diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ExpandDepthAndCountValidatorTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ExpandDepthAndCountValidatorTests.cs index 91442aad7d..71939c6951 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ExpandDepthAndCountValidatorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ExpandDepthAndCountValidatorTests.cs @@ -5,9 +5,9 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -42,7 +42,7 @@ public ExpandDepthAndCountValidatorTests() [Fact] public void ValidatorShouldThrowOnTreeThatIsTooDeep() { - ValidatorShouldThrow(this.treeWithDepth2, ODataErrorStrings.UriParser_ExpandDepthExceeded(2, 1), maxDepth: 1); + ValidatorShouldThrow(this.treeWithDepth2, Error.Format(SRResources.UriParser_ExpandDepthExceeded, 2, 1), maxDepth: 1); } [Fact] @@ -66,13 +66,13 @@ public void ValidatorNotShouldThrowOnEmptyTreeIfMaxCountIsZero() [Fact] public void ValidatorShouldFailIfDepthExceedsCount() { - ValidatorShouldThrow(this.treeWithDepth2, ODataErrorStrings.UriParser_ExpandCountExceeded(2, 1), maxCount: 1); + ValidatorShouldThrow(this.treeWithDepth2, Error.Format(SRResources.UriParser_ExpandCountExceeded, 2, 1), maxCount: 1); } [Fact] public void ValidatorShouldFailIfNumberOfExpandItemsExceedsSetting() { - ValidatorShouldThrow(this.treeWithWidth2, ODataErrorStrings.UriParser_ExpandCountExceeded(2, 1), maxCount: 1); + ValidatorShouldThrow(this.treeWithWidth2, Error.Format(SRResources.UriParser_ExpandCountExceeded, 2, 1), maxCount: 1); } [Fact] @@ -84,7 +84,7 @@ public void ValidatorShouldNotFailIfNumberOfExpandItemsMatchesSetting() [Fact] public void ValidatorShouldFailIfNumberOfExpandItemsExceedsSettingWhichWithRefOption() { - ValidatorShouldThrow(this.treeWithWidth2AndWithRefOption , ODataErrorStrings.UriParser_ExpandCountExceeded(2, 1), maxCount: 1); + ValidatorShouldThrow(this.treeWithWidth2AndWithRefOption , Error.Format(SRResources.UriParser_ExpandCountExceeded, 2, 1), maxCount: 1); } [Fact] @@ -102,19 +102,19 @@ public void ValidatorShouldNotCountRepeatedParentNodesTowardsLimitMoreThanOnce() [Fact] public void ValidatorShouldCountParentNodesTowardsLimit() { - ValidatorShouldThrow(this.treeWithDepthAndWidth2WithRepeatedParent, ODataErrorStrings.UriParser_ExpandCountExceeded(3, 2), maxCount: 2); + ValidatorShouldThrow(this.treeWithDepthAndWidth2WithRepeatedParent, Error.Format(SRResources.UriParser_ExpandCountExceeded, 3, 2), maxCount: 2); } [Fact] public void ValidatorShouldFailOnBigComplexTreeIfDepthExceedsLimit() { - ValidatorShouldThrow(this.bigComplexTree, ODataErrorStrings.UriParser_ExpandDepthExceeded(3, 2), maxDepth: 2); + ValidatorShouldThrow(this.bigComplexTree, Error.Format(SRResources.UriParser_ExpandDepthExceeded, 3, 2), maxDepth: 2); } [Fact] public void ValidatorShouldFailOnBigComplexTreeIfCountExceedsLimit() { - ValidatorShouldThrow(this.bigComplexTree, ODataErrorStrings.UriParser_ExpandCountExceeded(6, 5), maxCount: 5); + ValidatorShouldThrow(this.bigComplexTree, Error.Format(SRResources.UriParser_ExpandCountExceeded, 6, 5), maxCount: 5); } [Fact] @@ -133,14 +133,14 @@ public void ValidatorShouldNotFailOnBigComplexTreeIfCountMatchesLimit() public void ValidatorShouldFailImmediatelyIfTheCountLimitIsExceeded() { // note that size is 2 but the error message only says it found 1, since it stopped at that point. - ValidatorShouldThrow(this.treeWithWidth2, ODataErrorStrings.UriParser_ExpandCountExceeded(1, 0), maxCount: 0); + ValidatorShouldThrow(this.treeWithWidth2, Error.Format(SRResources.UriParser_ExpandCountExceeded, 1, 0), maxCount: 0); } [Fact] public void ValidatorShouldFailImmediatelyIfTheDepthLimitIsExceeded() { // note that size is 2 but the error message only says it found 1, since it stopped at that point. - ValidatorShouldThrow(this.treeWithDepth2, ODataErrorStrings.UriParser_ExpandDepthExceeded(1, 0), maxDepth: 0); + ValidatorShouldThrow(this.treeWithDepth2, Error.Format(SRResources.UriParser_ExpandDepthExceeded, 1, 0), maxDepth: 0); } private static void ValidatorShouldThrow(SelectExpandClause selectExpandClause, string expectedMessage, int maxDepth = 100, int maxCount = 100) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionCallParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionCallParserTests.cs index defd7fe4b9..cadd95b4db 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionCallParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionCallParserTests.cs @@ -6,9 +6,9 @@ using System; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -93,8 +93,8 @@ public void ArgsMustBeDelimitedByParens() FunctionCallParser tokenizerWithoutOpeningParen = GetFunctionCallParser("stuff, stuff)"); Action createWithoutClosingParen = () => tokenizerWithoutClosingParen.ParseArgumentListOrEntityKeyList(); Action createWithoutOpeningParen = () => tokenizerWithoutOpeningParen.ParseArgumentListOrEntityKeyList(); - createWithoutClosingParen.Throws(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(13, "(stuff, stuff")); - createWithoutOpeningParen.Throws(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(0, "stuff, stuff)")); + createWithoutClosingParen.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, 13, "(stuff, stuff")); + createWithoutOpeningParen.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 0, "stuff, stuff)")); } [Fact] @@ -133,7 +133,7 @@ public void FunctionCallWithOnlyOpeningParenthesis() FunctionCallParser tokenizer = GetFunctionCallParser("func("); QueryToken result; Action parse = () => tokenizer.TryParseIdentifierAsFunction(null, out result); - parse.Throws(ODataErrorStrings.UriQueryExpressionParser_ExpressionExpected(5, "func(")); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 5, "func(")); } private static FunctionCallParser GetFunctionCallParser(string expression) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionOverloadResolverTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionOverloadResolverTests.cs index d52df55fff..e699c100c8 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionOverloadResolverTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionOverloadResolverTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -28,7 +28,7 @@ public void ModelWithMultipleOverloadedActionsShouldThrow() IEdmOperationImport function; Action test = () => FunctionOverloadResolver.ResolveOperationImportFromList("Foo", parameters, model, out function, DefaultUriResolver); - test.Throws(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationImportOverloads("Foo")); + test.Throws(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationImportOverloads, "Foo")); } [Fact] @@ -39,7 +39,7 @@ public void ActionWithParametersInURLShouldThrowError() IEdmOperation function; Action test = () => FunctionOverloadResolver.ResolveOperationFromList("Fully.Qualified.Namespace.Move", parameters, HardCodedTestModel.GetPersonType(), model, out function, DefaultUriResolver); - test.Throws(ODataErrorStrings.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates("Fully.Qualified.Namespace.Move")); + test.Throws(Error.Format(SRResources.RequestUriProcessor_SegmentDoesNotSupportKeyPredicates, "Fully.Qualified.Namespace.Move")); } [Fact] @@ -50,7 +50,7 @@ public void ActionWithMultipleOverloadsForTheSameBindingParameter() IEdmOperationImport function; Action resolve = () => FunctionOverloadResolver.ResolveOperationImportFromList("Action", parameters, model, out function, DefaultUriResolver); - resolve.Throws(ODataErrorStrings.FunctionOverloadResolver_MultipleActionImportOverloads("Action")); + resolve.Throws(Error.Format(SRResources.FunctionOverloadResolver_MultipleActionImportOverloads, "Action")); } [Fact] @@ -61,7 +61,7 @@ public void OperationOverloadsWithSameNameWithoutBindingType() IEdmOperation operation; Action resolve = () => FunctionOverloadResolver.ResolveOperationFromList("Test.Action", parameters, null, model, out operation, DefaultUriResolver); - resolve.Throws(ODataErrorStrings.FunctionOverloadResolver_MultipleActionOverloads("Test.Action")); + resolve.Throws(Error.Format(SRResources.FunctionOverloadResolver_MultipleActionOverloads, "Test.Action")); } [Fact] @@ -210,7 +210,7 @@ public void OverloadServiceOperationSuccessfullyResolved() // Raise exception if more than one match. parameters = new string[] { "Parameter1", "Parameter4" }; Action resolve = () => FunctionOverloadResolver.ResolveOperationImportFromList("FunctionImport", parameters, model, out functionImport, DefaultUriResolver); - resolve.Throws(ODataErrorStrings.FunctionOverloadResolver_MultipleOperationImportOverloads("FunctionImport")); + resolve.Throws(Error.Format(SRResources.FunctionOverloadResolver_MultipleOperationImportOverloads, "FunctionImport")); } [Fact] @@ -311,7 +311,7 @@ public void OverloadBoundFunctionsSuccessfullyResolved() // Raise exception if more than one match. parameters = new string[] { "Parameter1", "Parameter4" }; Action resolve = () => Assert.True(FunctionOverloadResolver.ResolveOperationFromList("Fully.Qualified.Namespace.Function", parameters, int32TypeReference.Definition, model, out function, DefaultUriResolver)); - resolve.Throws(ODataErrorStrings.FunctionOverloadResolver_NoSingleMatchFound("Fully.Qualified.Namespace.Function", string.Join(",", parameters))); + resolve.Throws(Error.Format(SRResources.FunctionOverloadResolver_NoSingleMatchFound, "Fully.Qualified.Namespace.Function", string.Join(",", parameters))); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionParameterParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionParameterParserTests.cs index 8708fe1a5b..399d464a4c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionParameterParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/FunctionParameterParserTests.cs @@ -12,7 +12,7 @@ using Microsoft.OData.Edm; using Microsoft.Spatial; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -182,7 +182,7 @@ public void TypedNullFunctionParameterParsingShouldThrow() var result = TryParseOperationParameters("CanMoveToAddress", "address=null'Fully.Qualified.Namespace.Address'", null, out parsedParameters); Assert.True(result); }; - parse.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(12, "address=null'Fully.Qualified.Namespace.Address'")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 12, "address=null'Fully.Qualified.Namespace.Address'")); } [Fact] @@ -190,7 +190,7 @@ public void FunctionParameterParserShouldThrowIfParameterValueCannotBeParsed() { ICollection parsedParameters; Action parse = () => TryParseFunctionParameters("fakeFunc", "a='foo'", null, out parsedParameters); - parse.Throws(Strings.ODataParameterWriterCore_ParameterNameNotFoundInOperation("a", "IsAddressGood")); + parse.Throws(Error.Format(SRResources.ODataParameterWriterCore_ParameterNameNotFoundInOperation, "a", "IsAddressGood")); } [Fact] @@ -198,7 +198,7 @@ public void FunctionParameterParserShouldThrowIfSecondParameterIsPositional() { ICollection parsedParameters; Action parse = () => TryParseFunctionParameters("fakeFunc", "a=1,2", null, out parsedParameters); - parse.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(5, "a=1,2")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 5, "a=1,2")); } [Fact] @@ -277,7 +277,7 @@ public void FunctionParameterParserShouldFailIfAnExtraClosingParenthesisIsFoundI ICollection splitParameters; ODataUriParserConfiguration configuration = new ODataUriParserConfiguration(HardCodedTestModel.TestModel) { ParameterAliasValueAccessor = null }; Action parse = () => FunctionParameterParser.TrySplitOperationParameters(/*"fakeFunc", */ "a=1)", configuration, out splitParameters); - parse.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError(4, "a=1)")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, 4, "a=1)")); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/IdentifierTokenizerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/IdentifierTokenizerTests.cs index dfa96e78c3..948ea6d7fd 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/IdentifierTokenizerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/IdentifierTokenizerTests.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -95,7 +95,7 @@ public void CannotCallStarMemberAccessWithANonStarToken() var tokenizer = this.GetIdentifierTokenizerWithRealFunctionParser("stuff"); RangeVariableToken rangeVariableToken = new RangeVariableToken(ExpressionConstants.It); Action createWithNonStarToken = () => tokenizer.ParseStarMemberAccess(rangeVariableToken); - createWithNonStarToken.Throws(ODataErrorStrings.UriQueryExpressionParser_CannotCreateStarTokenFromNonStar("stuff")); + createWithNonStarToken.Throws(Error.Format(SRResources.UriQueryExpressionParser_CannotCreateStarTokenFromNonStar, "stuff")); } // Helpers diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTests.cs index 71e2dad08a..1b3de7371d 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTests.cs @@ -7,12 +7,12 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Tests.ScenarioTests.UriBuilder; using Microsoft.OData.UriParser; using Microsoft.Spatial; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -51,13 +51,13 @@ public void RequestUriProcessorExtractSegmentIdentifierErrorTest() string queryPortion; Action emptyString = () => ODataPathParser.ExtractSegmentIdentifierAndParenthesisExpression(string.Empty, out actualIdentifier, out queryPortion); - emptyString.Throws(ErrorStrings.RequestUriProcessor_EmptySegmentInRequestUrl); + emptyString.Throws(SRResources.RequestUriProcessor_EmptySegmentInRequestUrl); Action noIdentifier = () => ODataPathParser.ExtractSegmentIdentifierAndParenthesisExpression("()", out actualIdentifier, out queryPortion); - noIdentifier.Throws(ErrorStrings.RequestUriProcessor_EmptySegmentInRequestUrl); + noIdentifier.Throws(SRResources.RequestUriProcessor_EmptySegmentInRequestUrl); Action noEndParen = () => ODataPathParser.ExtractSegmentIdentifierAndParenthesisExpression("foo(", out actualIdentifier, out queryPortion); - noEndParen.Throws(ErrorStrings.RequestUriProcessor_SyntaxError); + noEndParen.Throws(SRResources.RequestUriProcessor_SyntaxError); } #region $ref cases @@ -72,84 +72,84 @@ public void EntityReferenceFollowingEntityCollectionShouldWork() public void EntityReferenceToNonexistentPropertyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "foo", "$ref" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_ResourceNotFound("foo")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "foo")); } [Fact] public void EntityReferenceToOpenPropertyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Paintings(1)", "foo", "$ref" }); - parsePath.Throws(ErrorStrings.PathParser_EntityReferenceNotSupported("foo")); + parsePath.Throws(Error.Format(SRResources.PathParser_EntityReferenceNotSupported, "foo")); } [Fact] public void EntityReferenceToPrimitivePropertyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "Name", "$ref" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("Name", UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "Name", UriQueryConstants.RefSegment)); } [Fact] public void FurtherCompositionAfterEntityReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "$ref", "MyPeople" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void FurtherCompositionAfterEntityReferenceWithKeyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "MyPeople(2)", "$ref", "MyDog" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void FurtherCompositionAfterEntityCollectionReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "MyPeople", "$ref", "1" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void KeyAfterEntityReferenceWithKeyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "MyPeople(5)", "$ref", "1" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void KeyAfterEntityReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "$ref", "5" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void EntityReferenceAfterEntityReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "$ref", "MyPeople", "$ref" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void AnythingAfterCountAfterEntityReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "MyDog", "MyPeople", "$ref", "$count", "foo" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void EntityReferenceForOpenPropertyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Paintings(1)", "foo", "MyDog", "$ref" }); - parsePath.Throws(ErrorStrings.PathParser_EntityReferenceNotSupported("MyDog")); + parsePath.Throws(Error.Format(SRResources.PathParser_EntityReferenceNotSupported, "MyDog")); } [Fact] public void EntityReferenceForActionShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "Fully.Qualified.Namespace.Walk", "$ref" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.Walk")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.Walk")); } [Fact] @@ -163,14 +163,14 @@ public void EntityReferenceForKeyShouldWork() public void CountAfterEntityReferenceShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "MyPeople", "$ref", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } [Fact] public void CountAfterEntityReferenceWithKeyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "MyPeople(5)", "$ref", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment(UriQueryConstants.RefSegment)); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, UriQueryConstants.RefSegment)); } #endregion @@ -178,14 +178,14 @@ public void CountAfterEntityReferenceWithKeyShouldFail() public void ParenthesesAfterCollectionPropertyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "Nicknames()" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_SyntaxError); + parsePath.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] public void ParenthesesAfterAnythingThatIsASingleResultShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "Color()" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_SyntaxError); + parsePath.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -210,7 +210,7 @@ public void NavigationInSingletonShouldWork() public void SingletonWithKeyShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Boss(1)" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_SyntaxError); + parsePath.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -405,7 +405,7 @@ public void TestOverflowIntArgumentOnShortParameter() { // short.MaxValue + 1 = 32768 Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "Fully.Qualified.Namespace.IsOlderThanShort(age=32768)" }); - parsePath.Throws(ErrorStrings.MetadataBinder_CannotConvertToType("Edm.Int32", "Edm.Int16")); + parsePath.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Int32", "Edm.Int16")); } [Fact] @@ -423,7 +423,7 @@ public void TestSingleArgumentOnSingleParameter() public void TestDoubleArgumentOnSingleParameter() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "Fully.Qualified.Namespace.IsOlderThanSingle(age=123.45678987)" }); - parsePath.Throws(ErrorStrings.MetadataBinder_CannotConvertToType("Edm.Double", "Edm.Single")); + parsePath.Throws(Error.Format(SRResources.MetadataBinder_CannotConvertToType, "Edm.Double", "Edm.Single")); } #endregion @@ -440,14 +440,14 @@ public void ActionShouldWork(string actionSegment) public void ActionBoundToPrimitiveTypeShouldThrow() { Action bindToPrimitiveType = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "Color", "ChangeOwner" }); - bindToPrimitiveType.Throws(ErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("Color", "ChangeOwner")); + bindToPrimitiveType.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "Color", "ChangeOwner")); } [Fact] public void CannotCallFunctionInOpenTypeSpace() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Paintings(0)", "OpenProperty", "Fully.Qualified.Namespace.FindMyOwner(dogsName='fido')" }); - parsePath.Throws(ErrorStrings.FunctionCallBinder_CallingFunctionOnOpenProperty("Fully.Qualified.Namespace.FindMyOwner")); + parsePath.Throws(Error.Format(SRResources.FunctionCallBinder_CallingFunctionOnOpenProperty, "Fully.Qualified.Namespace.FindMyOwner")); } [Fact] @@ -523,7 +523,7 @@ public void ParseEnumAsFunctionParameterShouldWork() public void ParseCountAfterSinglePrimitiveShouldFail() { Action parse = () => this.testSubject.ParsePath(new[] { "Lions(ID1=1,ID2=2)", "AngerLevel", "$count" }); - parse.Throws(Strings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("AngerLevel", "$count")); + parse.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "AngerLevel", "$count")); } [Fact] @@ -705,7 +705,7 @@ public void ParseCountAfterBoundFunctionReturnsCollectionOfEnumShouldWork() public void ParseCountAfterUnboundFunctionReturnsSinglePrimitiveShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "GetSomeNumber", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment("GetSomeNumber", "$count")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ValueSegmentAfterScalarPropertySegment, "GetSomeNumber", "$count")); } [Fact] @@ -747,7 +747,7 @@ public void ParseCountAfterUnboundFunctionReturnsSingleDerivedEntityShouldFail() public void ParseCountAfterBoundFunctionReturnsSinglePrimitiveShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "Fully.Qualified.Namespace.HasJob", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.HasJob")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.HasJob")); } [Fact] @@ -776,14 +776,14 @@ public void ParseCountAfterNonComposableFunctionShouldFail() { var point = GeographyPoint.Create(1, 2); Action parsePath = () => this.testSubject.ParsePath(new[] { "People(1)", "Fully.Qualified.Namespace.GetNearbyPriorAddresses(currentLocation=geography'" + SpatialHelpers.WriteSpatial(point) + "',limit=null)", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.GetNearbyPriorAddresses")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.GetNearbyPriorAddresses")); } [Fact] public void ParseCountAfterActionShouldFail() { Action parsePath = () => this.testSubject.ParsePath(new[] { "Dogs(1)", "Fully.Qualified.Namespace.Walk", "$count" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_MustBeLeafSegment("Fully.Qualified.Namespace.Walk")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "Fully.Qualified.Namespace.Walk")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTypeCastTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTypeCastTests.cs index ecd7f09cdf..db6513db3c 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTypeCastTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/ODataPathParserTypeCastTests.cs @@ -8,12 +8,12 @@ using System.Collections.Generic; using System.Linq; using System.Xml.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; using Microsoft.OData.UriParser; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -27,7 +27,7 @@ public void ParseTypeCastOnSingletonWithoutAliasSettingThrows() ODataPathParser pathParser = new ODataPathParser(new ODataUriParserConfiguration(edmModel)); Action parsePath = () => pathParser.ParsePath(new[] { "Me", "MyAlias.VipCustomer" }); - parsePath.Throws(ErrorStrings.RequestUriProcessor_ResourceNotFound("MyAlias.VipCustomer")); + parsePath.Throws(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "MyAlias.VipCustomer")); } [Theory] @@ -101,7 +101,7 @@ public void ParseTypeCastOnSingletonWithDerivedTypeConstraintAnnotationWorks(boo // verify the negative type cast: ~/Me/NS.NormalCustomer Action parsePath = () => pathParser.ParsePath(new[] { "Me", "NS.NormalCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "singleton", "Me")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "singleton", "Me")); } [Theory] @@ -127,12 +127,12 @@ public void ParseTypeCastOnSingletonWithDerivedTypeConstraintButEmptyCollectionA // verify the negative type cast: ~/Me/NS.VipCustomer Action parsePath = () => pathParser.ParsePath(new[] { "Me", "NS.VipCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.VipCustomer", "singleton", "Me")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.VipCustomer", "singleton", "Me")); // verify the negative type cast: ~/Me/NS.NormalCustomer pathParser = new ODataPathParser(new ODataUriParserConfiguration(edmModel)); parsePath = () => pathParser.ParsePath(new[] { "Me", "NS.NormalCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "singleton", "Me")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "singleton", "Me")); } private static IEdmModel GetSingletonEdmModel(string annotation, bool inline = true) @@ -223,7 +223,7 @@ public void ParseTypeCastOnEntitySetWithDerivedTypeConstraintAnnotationWorks(boo // verify the negative type cast: ~/Customers/NS.NormalCustomer Action parsePath = () => pathParser.ParsePath(new[] { segment, "NS.NormalCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "entity set", "Customers")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "entity set", "Customers")); index++; } @@ -325,7 +325,7 @@ public void ParseTypeCastOnPropertyWithDerivedTypeConstraintAnnotationWorks(bool // verify the negative type cast Action parsePath = () => pathParser.ParsePath(new[] { "Customers(1)", segment, "NS.CnAddress" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.CnAddress", "property", segment)); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.CnAddress", "property", segment)); index++; } } @@ -440,7 +440,7 @@ public void ParseTypeCastOnNavigationPropertyWithDerivedTypeConstraintAnnotation // verify the negative type cast Action parsePath = () => pathParser.ParsePath(new[] { "Customers(1)", segment, "NS.NormalCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation property", segment)); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation property", segment)); index++; } } @@ -473,7 +473,7 @@ public void ParseTypeCastOnNavigationPropertyWithKeySegmentWithDerivedTypeConstr // verify the negative type cast Action parsePath = () => pathParser.ParsePath(new[] { "Customers(1)", "SubCustomers(1)", "NS.NormalCustomer" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "navigation property", "SubCustomers")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "navigation property", "SubCustomers")); } private static IEdmModel GetNavigationPropertyEdmModel(string annotation, bool inline = true) @@ -570,7 +570,7 @@ public void ParseTypeCastOnTypeDefinitionPropertyWithDerivedTypeConstraintAnnota // verify the negative type cast Action parsePath = () => pathParser.ParsePath(new[] { "Customers(1)", "Data", "Edm.Double" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("Edm.Double", "type definition", "Data")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "Edm.Double", "type definition", "Data")); } private static IEdmModel GetTypeDefinitionEdmModel(string annotation, bool inline = true) @@ -656,7 +656,7 @@ public void ParseBoundOperationWithDerivedTypeConstraintAnnotationWorks(bool inL // verify the negative type cast: ~/Customers(1)/NS.NormalCustomer/NS.Image() Action parsePath = () => pathParser.ParsePath(new[] { "Customers", "NS.NormalCustomer", "NS.Image()" }); - parsePath.Throws(ErrorStrings.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint("NS.NormalCustomer", "operation", "Image")); + parsePath.Throws(Error.Format(SRResources.PathParser_TypeCastOnlyAllowedInDerivedTypeConstraint, "NS.NormalCustomer", "operation", "Image")); } private static IEdmModel GetOperationEdmModel(string annotation, bool inline = true) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SearchParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SearchParserTests.cs index 9889295c9f..9d2c9a76f1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SearchParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SearchParserTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -112,28 +113,28 @@ public void SearchCombinedTest() public void SearchUnMatchedParenthesisTest() { Action action = ()=>searchParser.ParseSearch("(A BC DEF"); - action.Throws(Strings.UriQueryExpressionParser_CloseParenOrOperatorExpected(9,"(A BC DEF")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, 9,"(A BC DEF")); } [Fact] public void SearchOperandMissingTest() { Action action = () => searchParser.ParseSearch("A AND"); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(5, "A AND")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 5, "A AND")); } [Fact] public void SearchOperandMissingInParenthesisTest() { Action action = () => searchParser.ParseSearch("(A AND)"); - action.Throws(Strings.UriQueryExpressionParser_ExpressionExpected(6, "(A AND)")); + action.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 6, "(A AND)")); } [Fact] public void SearchEmptyPhrase() { Action action = () => searchParser.ParseSearch("A \"\""); - action.Throws(Strings.ExpressionToken_IdentifierExpected(2)); + action.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 2)); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SegmentKeyHandlerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SegmentKeyHandlerTests.cs index 1e550922a7..3de70ac040 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SegmentKeyHandlerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SegmentKeyHandlerTests.cs @@ -7,10 +7,10 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -122,7 +122,7 @@ public void KeyCannotBeImplicitIfNotSpecifiedByReferentialIntegrityConstraint() "10", DefaultUriResolver, out keySegment); - implicitKeyWithOutRefIntegrityConstraint.Throws(ODataErrorStrings.BadRequest_KeyCountMismatch(HardCodedTestModel.GetLionType().FullTypeName())); + implicitKeyWithOutRefIntegrityConstraint.Throws(Error.Format(SRResources.BadRequest_KeyCountMismatch, HardCodedTestModel.GetLionType().FullTypeName())); } } } \ No newline at end of file diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandOptionParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandOptionParserTests.cs index 8cff06ff0b..e74ad28809 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandOptionParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandOptionParserTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Microsoft.OData.UriParser.Aggregation; using Xunit; @@ -223,7 +224,7 @@ public void InvalidTopTextInSelectShouldThrowInTop() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidTopOption("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "foo"), exception.Message); } [Fact] @@ -234,7 +235,7 @@ public void NegativeValueTopInSelectShouldThrowInTop() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidTopOption("-3"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "-3"), exception.Message); } [Fact] @@ -245,7 +246,7 @@ public void InvalidSkipTextInSelectShouldThrowInSkip() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidSkipOption("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, "foo"), exception.Message); } [Fact] @@ -256,7 +257,7 @@ public void NegativeValueSkipInSelectShouldThrowInSkip() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidSkipOption("-4"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, "-4"), exception.Message); } [Fact] @@ -267,7 +268,7 @@ public void WithoutTextInRoundBracketInSelectShouldThrow() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriParser_MissingSelectOption("Property"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriParser_MissingSelectOption, "Property"), exception.Message); } [Fact] @@ -278,7 +279,7 @@ public void MissingRoundBracketInSelectShouldThrowInSelect() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.ExpressionLexer_SyntaxError(13, "($select=prop"), exception.Message); + Assert.Equal(Error.Format(SRResources.ExpressionLexer_SyntaxError, 13, "($select=prop"), exception.Message); } private SelectTermToken ParseSelectOptions(string optionsText, int maxDepth = 100) @@ -657,7 +658,7 @@ public void InvalidTopTextInExpandShouldThrowInTop() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidTopOption("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "foo"), exception.Message); } [Fact] @@ -668,7 +669,7 @@ public void NegativeTopValueInExpandShouldThrowInTop() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidTopOption("-3"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidTopOption, "-3"), exception.Message); } [Fact] @@ -679,7 +680,7 @@ public void InvalidSkipTextInExpandShouldThrowInSkip() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidSkipOption("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, "foo"), exception.Message); } [Fact] @@ -690,7 +691,7 @@ public void NegativeSkipValueInExpandShouldThrowInSkip() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidSkipOption("-4"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidSkipOption, "-4"), exception.Message); } [Fact] @@ -701,7 +702,7 @@ public void InvalidLevelTextInExpandShouldThrowInLevels() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidLevelsOption("foo"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidLevelsOption, "foo"), exception.Message); } [Fact] @@ -712,7 +713,7 @@ public void NegativeLevelValueInExpandShouldThrowInLevels() // Assert ODataException exception = Assert.Throws(test); - Assert.Equal(Strings.UriSelectParser_InvalidLevelsOption("-5"), exception.Message); + Assert.Equal(Error.Format(SRResources.UriSelectParser_InvalidLevelsOption, "-5"), exception.Message); } // TODO: Probably missing more simple test cases diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandParserTests.cs index 7439d94024..34be59d2fb 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandParserTests.cs @@ -9,7 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -66,7 +66,7 @@ public void EmptySelectTermShouldThrow() Action test = () => parser.ParseSelect(); // Assert - test.Throws(ODataErrorStrings.ExpressionToken_IdentifierExpected("4")); + test.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "4")); } [Fact] @@ -79,7 +79,7 @@ public void MaxRecursionDepthIsEnforcedInSelect() Action test = () => parser.ParseSelect(); // Assert - test.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -92,7 +92,7 @@ public void SemicolonOnlyAllowedInParensInSelect() Action test = () => parser.ParseSelect(); // Assert - test.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter(";", 3, "one;two")); + test.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, ";", 3, "one;two")); } [Fact] @@ -105,7 +105,7 @@ public void WhitespaceInMiddleOfSegmentShouldThrowInSelect() Action test = () => parser.ParseSelect(); // Assert - test.Throws(Strings.UriSelectParser_TermIsNotValid("what happens here/foo")); + test.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "what happens here/foo")); } #endregion @@ -151,7 +151,7 @@ public void EmptyExpandTermShouldThrow() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.ExpressionToken_IdentifierExpected("4")); + test.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "4")); } [Fact] @@ -181,7 +181,7 @@ public void NestedOptionsWithoutClosingParenthesisShouldThrow() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.ExpressionLexer_UnbalancedBracketExpression); + test.Throws(SRResources.ExpressionLexer_UnbalancedBracketExpression); } [Fact] @@ -194,7 +194,7 @@ public void NestedOptionsWithExtraCloseParenShouldThrow() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.UriSelectParser_TermIsNotValid("one($filter=true)), two")); + test.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "one($filter=true)), two")); } [Fact] @@ -207,7 +207,7 @@ public void OpenCloseParensAfterNavPropShouldThrow() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.UriParser_MissingExpandOption("NavProp")); + test.Throws(Error.Format(SRResources.UriParser_MissingExpandOption, "NavProp")); } [Fact] @@ -220,7 +220,7 @@ public void MaxRecursionDepthIsEnforcedInExpand() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -233,7 +233,7 @@ public void SemicolonOnlyAllowedInParensInExpand() Action test = () => parser.ParseExpand(); // Assert - test.Throws(ODataErrorStrings.ExpressionLexer_InvalidCharacter(";", 3, "one;two")); + test.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, ";", 3, "one;two")); } [Fact] @@ -246,7 +246,7 @@ public void WhitespaceInMiddleOfSegmentShouldThrowInExpand() Action test = () => parser.ParseExpand(); // Assert - test.Throws(Strings.UriSelectParser_TermIsNotValid("what happens here/foo")); + test.Throws(Error.Format(SRResources.UriSelectParser_TermIsNotValid, "what happens here/foo")); } [Fact] @@ -666,7 +666,7 @@ public void ParseStarInvalidWithOptions() Action test = () => this.StarExpandTesting("*($select=*)", "Person"); // Assert - test.Throws(Strings.UriExpandParser_TermIsNotValidForStar("($select=*)")); + test.Throws(Error.Format(SRResources.UriExpandParser_TermIsNotValidForStar, "($select=*)")); } [Fact] @@ -676,7 +676,7 @@ public void ParseStarRefWithInvalidOptions() Action test = () => this.StarExpandTesting("*/$ref($levels=2)", "Person"); // Assert - test.Throws(Strings.UriExpandParser_TermIsNotValidForStarRef("($levels=2)")); + test.Throws(Error.Format(SRResources.UriExpandParser_TermIsNotValidForStarRef, "($levels=2)")); } [Fact] @@ -686,7 +686,7 @@ public void ParseMultipleStarInExpand() Action test = () => this.StarExpandTesting("*, Friend, */$ref", "Person"); // Assert - test.Throws(Strings.UriExpandParser_TermWithMultipleStarNotAllowed("*, Friend, */$ref")); + test.Throws(Error.Format(SRResources.UriExpandParser_TermWithMultipleStarNotAllowed, "*, Friend, */$ref")); } private ExpandToken StarExpandTesting(string expand, string typeName, IEdmModel model = null) @@ -735,7 +735,7 @@ public void ParentEntityTypeIsNullForExpandStar() Action test = () => expandParser.ParseExpand(); // Assert - test.Throws(Strings.UriExpandParser_ParentStructuredTypeIsNull("")); + test.Throws(Error.Format(SRResources.UriExpandParser_ParentStructuredTypeIsNull, "")); } #endregion @@ -746,11 +746,11 @@ public void PathLimitTest() // Arrange & Act & Assert this.LimitationTest("d1/d2", null); Action test = () => this.LimitationTest("d1/d2/d3", null); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); this.LimitationTest(null, "d1/d2"); test = () => this.LimitationTest(null,"d1/d2/d3"); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -759,7 +759,7 @@ public void FilterLimitTest() // Arrange & Act & Assert this.LimitationTest(null, "d1($filter=a or b and c)"); Action test = () => this.LimitationTest(null, "d1($filter=(a or b) and c)"); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -768,7 +768,7 @@ public void OrderByLimitTest() // Arrange & Act & Assert this.LimitationTest(null, "d1($orderby=a or b and c)"); Action test = () => this.LimitationTest(null, "d1($orderby=(a or b) and c)"); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -777,7 +777,7 @@ public void SearchLimitTest() // Arrange & Act & Assert this.LimitationTest(null, "d1($search=a OR b AND c)"); Action test = () => this.LimitationTest(null, "d1($search=(a OR b) AND c)"); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } [Fact] @@ -786,7 +786,7 @@ public void ExpandLimitTest() // Arrange & Act & Assert this.LimitationTest(null, "d1($expand=d2($expand=d3($expand=d4($expand=d5))))"); Action test = () => this.LimitationTest(null, "d1($expand=d2($expand=d3($expand=d4($expand=d5($expand=d6)))))"); - test.Throws(Strings.UriQueryExpressionParser_TooDeep); + test.Throws(SRResources.UriQueryExpressionParser_TooDeep); } private void LimitationTest(string select, string expand) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandTermParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandTermParserTests.cs index 538605cb2e..3df0880e35 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandTermParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/SelectExpandTermParserTests.cs @@ -5,9 +5,9 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -54,21 +54,21 @@ public void TermWithManySlashesCreatesManyNonRootSegmentTokensInSelect() public void ATermWithJustSpaceAndSlashesShouldThrowInSelect() { Action parse = () => ParseSelectTerm(" / // /"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected(1)); // TODO: better error message + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 1)); // TODO: better error message } [Fact] public void JustOneSlashShouldThrowInSelect() { Action parse = () => ParseSelectTerm("/"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected("0")); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "0")); } [Fact] public void StarThenSlashShouldThrowInSelect() { Action parse = () => ParseSelectTerm("*/"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected("0")); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "0")); } [Fact] @@ -89,7 +89,7 @@ public void SpaceAroundStarIsOkInSelect() public void StarCannotBeInMiddleOfPathInSelect() { Action parse = () => ParseSelectTerm("foo/*/bar"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected("4")); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "4")); } [Fact] @@ -137,7 +137,7 @@ public void ContainerQualifiedWildcardIsAllowedInSelect() public void DoubleTrailingSlashShouldFailInSelect() { Action parse = () => ParseSelectTerm("navprop//"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected(8)); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 8)); } [Fact] @@ -186,21 +186,21 @@ public void TermWithManySlashesCreatesManyNonRootSegmentTokensInExpand() public void ATermWithJustSpaceAndSlashesShouldThrowInExpand() { Action parse = () => this.ParseExpandTerm(" / // /"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected(1)); // TODO: better error message + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 1)); // TODO: better error message } [Fact] public void JustOneSlashShouldThrowInExpand() { Action parse = () => this.ParseExpandTerm("/"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected("0")); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "0")); } [Fact] public void StarThenSlashShouldThrowInExpand() { Action parse = () => this.ParseExpandTerm("*/"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected("2")); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, "2")); } [Fact] @@ -221,7 +221,7 @@ public void SpaceAroundStarIsOkInExpand() public void StarCannotBeInMiddleOfPathInExpand() { Action parse = () => this.ParseExpandTerm("foo/*/bar"); - parse.Throws(Strings.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); + parse.Throws(SRResources.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); } [Fact] @@ -235,14 +235,14 @@ public void StarWithRefIsOkInExpand() public void PropertyAfterStarWithRefIsOkInExpand() { Action parse = () => this.ParseExpandTerm("*/$ref/prop"); - parse.Throws(Strings.ExpressionToken_NoPropAllowedAfterRef); + parse.Throws(SRResources.ExpressionToken_NoPropAllowedAfterRef); } [Fact] public void StarAfterNavPropIsOkInExpand() { Action parse = () => this.ParseExpandTerm("navprop/*"); - parse.Throws(Strings.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); + parse.Throws(SRResources.ExpressionToken_NoSegmentAllowedBeforeStarInExpand); } [Fact] @@ -275,7 +275,7 @@ public void WeirdFailureCasesInExpand() public void ContainerQualifiedWildcardNotAllowedInExpand() { Action parseWithContainerQualfiedWildcard = () => this.ParseExpandTerm("container.qualified.*"); - parseWithContainerQualfiedWildcard.Throws(ODataErrorStrings.ExpressionLexer_SyntaxError("21", "container.qualified.*")); + parseWithContainerQualfiedWildcard.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, "21", "container.qualified.*")); } [Fact] @@ -289,7 +289,7 @@ public void TrailingSlashShouldBeIgnoredInExpand() public void DoubleTrailingSlashShouldFailInExpand() { Action parse = () => this.ParseExpandTerm("navprop//"); - parse.Throws(Strings.ExpressionToken_IdentifierExpected(8)); + parse.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 8)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriPathParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriPathParserTests.cs index d1a7966dee..529a7480f7 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriPathParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriPathParserTests.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -200,7 +201,7 @@ public void ParsePathRequiresBaseUriToMatch() var absoluteUri = new Uri("http://www.example.com/EntitySet/"); Action enumerate = () => this.pathParser.ParsePathIntoSegments(absoluteUri, this.baseUri); - enumerate.Throws(Strings.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri(absoluteUri, baseUri)); + enumerate.Throws(Error.Format(SRResources.UriQueryPathParser_RequestUriDoesNotHaveTheCorrectBaseUri, absoluteUri, baseUri)); } [Fact] @@ -208,7 +209,7 @@ public void ParsePathThrowsIfDepthLimitIsReached() { this.pathParser = new UriPathParser(new ODataUriParserSettings() { PathLimit = 2}); Action enumerate = () => this.pathParser.ParsePathIntoSegments(new Uri(this.baseUri.AbsoluteUri + "One/Two/Three"), this.baseUri); - enumerate.Throws(Strings.UriQueryPathParser_TooManySegments); + enumerate.Throws(SRResources.UriQueryPathParser_TooManySegments); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriQueryExpressionParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriQueryExpressionParserTests.cs index 047bf0c651..2b4713d235 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriQueryExpressionParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriQueryExpressionParserTests.cs @@ -10,7 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.UriParser.Aggregation; using Xunit; -using ErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -23,7 +23,7 @@ public void AnyAllSyntacticParsingShouldCheckSeperatorTokenIsColon() { // Repro for: Syntactic parsing for Any/All allows an arbitrary token between range variable and expression Action parse = () => this.testSubject.ParseFilter("Things/any(a,true)"); - parse.Throws(ErrorStrings.ExpressionLexer_SyntaxError("13", "Things/any(a,true)")); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, "13", "Things/any(a,true)")); } [Fact] @@ -31,7 +31,7 @@ public void AnyAllSyntacticParsingShouldNotAllowImplicitRangeVariableToBeRedefin { // Repro for: Syntactic parser fails to block $it as a range variable name Action parse = () => this.testSubject.ParseFilter("Things/any($it:true)"); - parse.Throws(ErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared("$it")); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_RangeVariableAlreadyDeclared, "$it")); } [Fact] @@ -39,7 +39,7 @@ public void AnyAllSyntacticParsingShouldNotAllowAnyRangeVariableToBeRedefined() { // Repro for: Semantic binding fails with useless error message when a range variable is redefined within a nested any/all Action parse = () => this.testSubject.ParseFilter("Things/any(o:o/Things/any(o:true))"); - parse.Throws(ErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared("o")); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_RangeVariableAlreadyDeclared, "o")); } [Fact] @@ -132,7 +132,7 @@ public void ParseApplyWithInvalidTransformationIdentifierThrows() { string apply = "invalid(UnitPrice with sum as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected("aggregate|filter|groupby|compute|expand", 0,apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, "aggregate|filter|groupby|compute|expand", 0,apply)); } [Fact] @@ -140,7 +140,7 @@ public void ParseApplyWithTrailingNotSlashThrows() { string apply = "aggregate(UnitPrice with sum as TotalPrice),"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.ExpressionLexer_SyntaxError(apply.Length, apply)); + parse.Throws(Error.Format(SRResources.ExpressionLexer_SyntaxError, apply.Length, apply)); } [Fact] @@ -216,7 +216,7 @@ public void ParseApplyWithSingleCountExpressionCannotHaveWithKeyWord() string apply = "aggregate($count with sum as Count)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_AsExpected(17, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_AsExpected, 17, apply)); } [Fact] @@ -243,7 +243,7 @@ public void ParseApplyWithAggregateMissingOpenParenThrows() { string apply = "aggregate UnitPrice with sum as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_OpenParenExpected(10, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 10, apply)); } [Fact] @@ -251,7 +251,7 @@ public void ParseApplyWithAggregateMissingCloseParenThrows() { string apply = "aggregate(UnitPrice with sum as TotalPrice"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(apply.Length, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, apply.Length, apply)); } [Fact] @@ -259,7 +259,7 @@ public void ParseApplyWithAggregateMissingStatementThrows() { string apply = "aggregate()"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_ExpressionExpected(apply.Length - 1, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, apply.Length - 1, apply)); } [Fact] @@ -267,7 +267,7 @@ public void ParseApplyWithAggregateAfterGroupByMissingStatementThrows() { string apply = "groupby((UnitPrice))/aggregate()"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_ExpressionExpected(apply.Length - 1, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, apply.Length - 1, apply)); } [Fact] @@ -275,7 +275,7 @@ public void ParseApplyWithAggregateExpressionMissingWithThrows() { string apply = "aggregate(UnitPrice sum as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_WithExpected(20, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_WithExpected, 20, apply)); } [Fact] @@ -283,7 +283,7 @@ public void ParseApplyWithAggregateExpressionWithInvalidAggregateExpressionWithT { string apply = "aggregate(UnitPrice mul with sum as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_WithExpected(29, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_WithExpected, 29, apply)); } [Fact] @@ -291,7 +291,7 @@ public void ParseApplyWithAggregateExpressionWithInvalidVerbThrows() { string apply = "aggregate(UnitPrice with invalid as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_UnrecognizedWithMethod("invalid", 25, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_UnrecognizedWithMethod, "invalid", 25, apply)); } [Fact] @@ -299,7 +299,7 @@ public void ParseApplyWithAggregateExpressionMissingAsThrows() { string apply = "aggregate(UnitPrice with sum TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_AsExpected(29, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_AsExpected, 29, apply)); } [Fact] @@ -307,7 +307,7 @@ public void ParseApplyWithAggregateExpressionMissingAliasThrows() { string apply = "aggregate(UnitPrice with sum as)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(apply.Length, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, apply.Length, apply)); } private static void VerifyGroupByTokenProperties(IEnumerable expectedEndPathIdentifiers, GroupByToken actual) @@ -392,7 +392,7 @@ public void ParseApplyWithGroupByMissingOpenParenThrows() { string apply = "groupby (UnitPrice))"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_OpenParenExpected(9, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 9, apply)); } [Fact] @@ -400,7 +400,7 @@ public void ParseApplyWithGroupByMissingCloseParenThrows() { string apply = "groupby((UnitPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(apply.Length, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, apply.Length, apply)); } [Fact] @@ -408,7 +408,7 @@ public void ParseApplyWithGroupByAndAggregateMissingCloseParenThrows() { string apply = "groupBy((UnitPrice), aggregate(UnitPrice with sum as TotalPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected("aggregate|filter|groupby|compute|expand", 0, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, "aggregate|filter|groupby|compute|expand", 0, apply)); } [Fact] @@ -416,7 +416,7 @@ public void ParseApplyWithGroupByMissingGroupingThrows() { string apply = "groupby()"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_OpenParenExpected(8, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 8, apply)); } [Fact] @@ -424,7 +424,7 @@ public void ParseApplyWithGroupByMissingGroupingParensThrows() { string apply = "groupby(UnitPrice)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_OpenParenExpected(8, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 8, apply)); } [Fact] @@ -432,7 +432,7 @@ public void ParseApplyWithGroupByWithEmptyGroupingThrows() { string apply = "groupby(())"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_ExpressionExpected(9, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 9, apply)); } [Fact] @@ -440,7 +440,7 @@ public void ParseApplyWithGroupByWithChildGroupThrows() { string apply = "groupby((UnitPrice), groupby((UnitPrice)))"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected("aggregate", 21, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_KeywordOrIdentifierExpected, "aggregate", 21, apply)); } @@ -476,7 +476,7 @@ public void ParseApplyWithFilterMissingOpenParenThrows() { string apply = "filter UnitPrice eq 5)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_OpenParenExpected(7, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_OpenParenExpected, 7, apply)); } [Fact] @@ -484,7 +484,7 @@ public void ParseApplyWithFilterMissingCloseParenThrows() { string apply = "filter(UnitPrice eq 5"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_CloseParenOrOperatorExpected(apply.Length, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrOperatorExpected, apply.Length, apply)); } [Fact] @@ -492,7 +492,7 @@ public void ParseApplyWithFilterMissingExpressionThrows() { string apply = "filter()"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_ExpressionExpected(7, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, 7, apply)); } [Fact] @@ -500,7 +500,7 @@ public void ParseApplyWithFilterInvalidExpressionThrows() { string apply = "filter(UnitPrice eq)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_ExpressionExpected(apply.Length - 1, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_ExpressionExpected, apply.Length - 1, apply)); } @@ -706,7 +706,7 @@ public void ParseApplyWithOnlyExpandThrows() { string apply = "expand(Sales)"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(apply.Length - 1, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_InnerMostExpandRequireFilter, apply.Length - 1, apply)); } [Fact] @@ -773,7 +773,7 @@ public void ParseApplyWithNestedExpandOnlyShowThrowOnInnerMost() { string apply = "expand(Sales, expand(Customers))"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(apply.Length - 2, apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_InnerMostExpandRequireFilter, apply.Length - 2, apply)); } @@ -782,7 +782,7 @@ public void ParseApplyWithMultipleNestedExpandsOnlyThrowsOnFirstLeaf() { string apply = "expand(Sales, expand(Customers), expand(Cashiers))"; Action parse = () => this.testSubject.ParseApply(apply); - parse.Throws(ErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(apply.IndexOf(")"), apply)); + parse.Throws(Error.Format(SRResources.UriQueryExpressionParser_InnerMostExpandRequireFilter, apply.IndexOf(")"), apply)); } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriTemplateParserTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriTemplateParserTests.cs index 0a404508d7..d143a23e5f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriTemplateParserTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/Parsers/UriTemplateParserTests.cs @@ -10,6 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -73,7 +74,7 @@ public void ParseKeyTemplateWithNonTemplateParserShouldThrow() { var uriParser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://host"), new Uri("http://host/People({1})")); Action action = () => uriParser.ParsePath(); - action.Throws(Strings.RequestUriProcessor_SyntaxError); + action.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -103,7 +104,7 @@ public void ParseKeyTemplateAsSegmentTemplateWithNonTemplateParserShouldThrow() }; Action action = () => uriParser.ParsePath(); - action.Throws(Strings.RequestUriProcessor_SyntaxError); + action.Throws(SRResources.RequestUriProcessor_SyntaxError); } [Fact] @@ -205,7 +206,7 @@ public void ParseParameterTemplateWithNonTemplateParserShouldThrow() { var uriParser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("http://host"), new Uri("http://host/People(1)/Fully.Qualified.Namespace.HasHat(onCat={why555})")); Action action = () => uriParser.ParsePath(); - action.Throws(Strings.ExpressionLexer_ExpectedLiteralToken("{why555}")); + action.Throws(Error.Format(SRResources.ExpressionLexer_ExpectedLiteralToken, "{why555}")); } [Fact] @@ -271,7 +272,7 @@ public void EntityReferenceCannotAppearAfterAPathTemplateSegment() }; Action action = () => uriParser.ParsePath(); - action.Throws(Strings.RequestUriProcessor_MustBeLeafSegment("{some}")); + action.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "{some}")); } [Fact] @@ -283,7 +284,7 @@ public void PathTemplateSegmentShouldBeLastSegment() }; Action action = () => uriParser.ParsePath(); - action.Throws(Strings.RequestUriProcessor_MustBeLeafSegment("{some}")); + action.Throws(Error.Format(SRResources.RequestUriProcessor_MustBeLeafSegment, "{some}")); } [Fact] @@ -295,7 +296,7 @@ public void PathTemplateSegmentShouldNotBeFirstSegment() }; Action action = () => uriParser.ParsePath(); - action.Throws(Strings.RequestUriProcessor_ResourceNotFound("{some}")); + action.Throws(Error.Format(SRResources.RequestUriProcessor_ResourceNotFound, "{some}")); } #endregion @@ -371,13 +372,13 @@ public void ErrorParameterTemplateInputShouldThrow() { var errorCases = new[] { - new {Input = "{" , Error = Strings.ExpressionLexer_UnbalancedBracketExpression}, - new {Input = "}" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 6, "onCat=}")}, - new {Input = "{}1" , Error = Strings.ExpressionLexer_SyntaxError(9, "onCat={}1")}, - new {Input = "}{" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 6, "onCat=}{")}, - new {Input = "{{}" , Error = Strings.ExpressionLexer_UnbalancedBracketExpression}, // Thrown by ODataPathParser::TryBindingParametersAndMatchingOperation - new {Input = "{}}" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 8, "onCat={}}")}, - new {Input = "{#}" , Error = Strings.RequestUriProcessor_SyntaxError}, + new {Input = "{" , Error = SRResources.ExpressionLexer_UnbalancedBracketExpression}, + new {Input = "}" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 6, "onCat=}")}, + new {Input = "{}1" , Error = Error.Format(SRResources.ExpressionLexer_SyntaxError, 9, "onCat={}1")}, + new {Input = "}{" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 6, "onCat=}{")}, + new {Input = "{{}" , Error = SRResources.ExpressionLexer_UnbalancedBracketExpression}, // Thrown by ODataPathParser::TryBindingParametersAndMatchingOperation + new {Input = "{}}" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 8, "onCat={}}")}, + new {Input = "{#}" , Error = SRResources.RequestUriProcessor_SyntaxError}, }; foreach (var errorCase in errorCases) @@ -397,13 +398,13 @@ public void ErrorKeyTemplateInputShouldThrow() { var errorCases = new[] { - new {Input = "{" , Error = Strings.ExpressionLexer_UnbalancedBracketExpression}, - new {Input = "}" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 1, "(})")}, - new {Input = "{}1" , Error = Strings.UriQueryExpressionParser_CloseParenOrCommaExpected(3, "({}1)")}, //Strings.BadRequest_KeyCountMismatch("Fully.Qualified.Namespace.Person")}, - new {Input = "}{" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 1, "(}{)")}, - new {Input = "{{}" , Error = Strings.ExpressionLexer_UnbalancedBracketExpression}, // Thrown by ODataPathParser::TryBindKeyFromParentheses - new {Input = "{}}" , Error = Strings.ExpressionLexer_InvalidCharacter("}", 3, "({}})")}, - new {Input = "{#}" , Error = Strings.RequestUriProcessor_SyntaxError}, + new {Input = "{" , Error = SRResources.ExpressionLexer_UnbalancedBracketExpression}, + new {Input = "}" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 1, "(})")}, + new {Input = "{}1" , Error = Error.Format(SRResources.UriQueryExpressionParser_CloseParenOrCommaExpected, 3, "({}1)")}, //Strings.BadRequest_KeyCountMismatch("Fully.Qualified.Namespace.Person")}, + new {Input = "}{" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 1, "(}{)")}, + new {Input = "{{}" , Error = SRResources.ExpressionLexer_UnbalancedBracketExpression}, // Thrown by ODataPathParser::TryBindKeyFromParentheses + new {Input = "{}}" , Error = Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "}", 3, "({}})")}, + new {Input = "{#}" , Error = SRResources.RequestUriProcessor_SyntaxError}, }; foreach (var errorCase in errorCases) diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SearchLexerTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SearchLexerTests.cs index bfde5f3e90..76b7a3c407 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SearchLexerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SearchLexerTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; @@ -96,22 +97,22 @@ public void InvalidCharWithOutQuoteTest() ValidateTokenKind(lexer, ExpressionTokenKind.End); Action action = () => new SearchLexer("b\\\"cd a3").NextToken(); - action.Throws(Strings.ExpressionLexer_InvalidCharacter("\\", 1, "b\\\"cd a3")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "\\", 1, "b\\\"cd a3")); action = () => new SearchLexer("bcd za3").NextToken(); - action.Throws(Strings.ExpressionLexer_InvalidCharacter("3", 6, "bcd za3")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "3", 6, "bcd za3")); action = () => new SearchLexer("\" za\"\\").NextToken(); - action.Throws(Strings.ExpressionLexer_InvalidCharacter("\\", 5, "\" za\"\\")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidCharacter, "\\", 5, "\" za\"\\")); } [Fact] public void InvalidEscapeTest() { Action action = () => new SearchLexer("\"t a\\A\"").NextToken(); - action.Throws(Strings.ExpressionLexer_InvalidEscapeSequence("A", 5, "\"t a\\A\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidEscapeSequence, "A", 5, "\"t a\\A\"")); action = () => new SearchLexer("\"a\\A t\""); - action.Throws(Strings.ExpressionLexer_InvalidEscapeSequence("A", 3, "\"a\\A t\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidEscapeSequence, "A", 3, "\"a\\A t\"")); action = () => new SearchLexer("\"\\Aa t\""); - action.Throws(Strings.ExpressionLexer_InvalidEscapeSequence("A", 2, "\"\\Aa t\"")); + action.Throws(Error.Format(SRResources.ExpressionLexer_InvalidEscapeSequence, "A", 2, "\"\\Aa t\"")); } [Fact] @@ -126,9 +127,9 @@ public void EmptyPhraseInputTest() { ExpressionLexer lexer = new SearchLexer("A \"\""); Action action = () => lexer.NextToken(); - action.Throws(Strings.ExpressionToken_IdentifierExpected((2))); + action.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 2)); action = () => new SearchLexer("\"\" A"); - action.Throws(Strings.ExpressionToken_IdentifierExpected((0))); + action.Throws(Error.Format(SRResources.ExpressionToken_IdentifierExpected, 0)); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SegmentAssertions.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SegmentAssertions.cs index 0bcf0175f0..3cd6260e4e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SegmentAssertions.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SegmentAssertions.cs @@ -10,6 +10,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Vocabularies; +using Microsoft.OData.Core; using Xunit; namespace Microsoft.OData.Tests.UriParser diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/BatchReferenceSegmentTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/BatchReferenceSegmentTests.cs index e0afdd09f4..502abc8d2f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/BatchReferenceSegmentTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/BatchReferenceSegmentTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -36,10 +36,10 @@ public void ContentIdMustBeDollarNumber() Action createWitnInvalidContentId2 = () => new BatchReferenceSegment("1$2", type, HardCodedTestModel.GetPeopleSet()); Action createWitnInvalidContentId3 = () => new BatchReferenceSegment("$", type, HardCodedTestModel.GetPeopleSet()); Action createWitnInvalidContentId4 = () => new BatchReferenceSegment("$0a1", type, HardCodedTestModel.GetPeopleSet()); - createWitnInvalidContentId1.Throws(ODataErrorStrings.BatchReferenceSegment_InvalidContentID("stuff")); - createWitnInvalidContentId2.Throws(ODataErrorStrings.BatchReferenceSegment_InvalidContentID("1$2")); - createWitnInvalidContentId3.Throws(ODataErrorStrings.BatchReferenceSegment_InvalidContentID("$")); - createWitnInvalidContentId4.Throws(ODataErrorStrings.BatchReferenceSegment_InvalidContentID("$0a1")); + createWitnInvalidContentId1.Throws(Error.Format(SRResources.BatchReferenceSegment_InvalidContentID, "stuff")); + createWitnInvalidContentId2.Throws(Error.Format(SRResources.BatchReferenceSegment_InvalidContentID, "1$2")); + createWitnInvalidContentId3.Throws(Error.Format(SRResources.BatchReferenceSegment_InvalidContentID, "$")); + createWitnInvalidContentId4.Throws(Error.Format(SRResources.BatchReferenceSegment_InvalidContentID, "$0a1")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionFunctionCallNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionFunctionCallNodeTests.cs index 8893a016bb..f7e491bc06 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionFunctionCallNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionFunctionCallNodeTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.Edm; using Microsoft.Test.OData.Utils.Metadata; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -83,7 +83,7 @@ public void KindIsSetCorrectly() public void ItemTypeMustBePrimitiveOrComplex() { Action createWithEntityCollectionType = () => new CollectionFunctionCallNode("stuff", new List() { HardCodedTestModel.GetFunctionForHasJob() }, new QueryNode[] { new ConstantNode(1) }, new EdmCollectionTypeReference(new EdmCollectionType(ModelBuildingHelpers.BuildValidEntityType().ToTypeReference())), null); - createWithEntityCollectionType.Throws(ODataErrorStrings.Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); + createWithEntityCollectionType.Throws(SRResources.Nodes_CollectionFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionNavigationNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionNavigationNodeTests.cs index b2a4fad921..d0e89bf159 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionNavigationNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionNavigationNodeTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -82,7 +82,7 @@ public void CollectionNavigationNodeConstructorRequiresManyMultiplicity() var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson(); Action create = () => new CollectionNavigationNode(source, HardCodedTestModel.GetPersonMyDogNavProp(), new EdmPathExpression("MyDog")); - create.Throws(ODataErrorStrings.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity); + create.Throws(SRResources.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionPropertyAccessNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionPropertyAccessNodeTests.cs index a82de24ac0..a484dca678 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionPropertyAccessNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionPropertyAccessNodeTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -65,14 +66,14 @@ public void CollectionPropertyAccessNodesCanUseGeometry() public void CollectionPropertyAccessCannotTakeANavigationProperty() { Action create = () => new CollectionPropertyAccessNode(new ConstantNode(null), HardCodedTestModel.GetDogMyPeopleNavProp()); - create.Throws(Strings.Nodes_PropertyAccessShouldBeNonEntityProperty("MyPeople")); + create.Throws(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, "MyPeople")); } [Fact] public void CollectionPropertyAccessCannotTakeANonCollectionProperty() { Action create = () => new CollectionPropertyAccessNode(new ConstantNode(null), HardCodedTestModel.GetDogColorProp()); - create.Throws(Strings.Nodes_PropertyAccessTypeMustBeCollection("Color")); + create.Throws(Error.Format(SRResources.Nodes_PropertyAccessTypeMustBeCollection, "Color")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionResourceFunctionCallNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionResourceFunctionCallNodeTests.cs index 47392430b5..f1cac4ebae 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionResourceFunctionCallNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/CollectionResourceFunctionCallNodeTests.cs @@ -11,7 +11,7 @@ using Microsoft.OData.Edm; using Microsoft.Test.OData.Utils.Metadata; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -84,7 +84,7 @@ public void KindIsSingleEntityFunction() public void ItemTypeMustBeAnEntityType() { Action createWithPrimitiveCollectionType = () => new CollectionResourceFunctionCallNode("stuff", new List() { HardCodedTestModel.GetFunctionForHasJob() }, new QueryNode[] { new ConstantNode(1) }, new EdmCollectionTypeReference(new EdmCollectionType(EdmCoreModel.Instance.GetString(true))), HardCodedTestModel.GetPeopleSet(), null); - createWithPrimitiveCollectionType.Throws(ODataErrorStrings.Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity); + createWithPrimitiveCollectionType.Throws(SRResources.Nodes_EntityCollectionFunctionCallNode_ItemTypeMustBeAnEntity); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/KeySegmentTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/KeySegmentTests.cs index 47cb991938..f62840a6d8 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/KeySegmentTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/KeySegmentTests.cs @@ -9,6 +9,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -54,7 +55,7 @@ public void SetIsCopiedFromPreviousSegment() public void SetAndTypeMustMakeSenseTogether() { Action create = () => new KeySegment(Key, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogsSet()); - create.Throws(Strings.PathParser_TypeMustBeRelatedToSet(HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogType(), "KeySegments")); + create.Throws(Error.Format(SRResources.PathParser_TypeMustBeRelatedToSet, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogType(), "KeySegments")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/NonResourceRangeVariableTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/NonResourceRangeVariableTests.cs index 03dc1f6119..b3dedd0b6e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/NonResourceRangeVariableTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/NonResourceRangeVariableTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -43,7 +44,7 @@ public void DissallowEntityType() { var entityTypeRef = HardCodedTestModel.GetPersonTypeReference(); Action ctor = () => new NonResourceRangeVariable("abc", entityTypeRef, null); - ctor.Throws(Strings.Nodes_NonentityParameterQueryNodeWithEntityType(entityTypeRef.FullName())); + ctor.Throws(Error.Format(SRResources.Nodes_NonentityParameterQueryNodeWithEntityType, entityTypeRef.FullName())); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataExpandPathTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataExpandPathTests.cs index 717c1c018a..6562477415 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataExpandPathTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataExpandPathTests.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -21,14 +21,14 @@ public class ODataExpandPathTests public void ExpandPathShouldNotAllowCountSegment() { Action createWithCountSegment = () => new ODataExpandPath(CountSegment.Instance, this.navigationSegment); - createWithCountSegment.Throws(ODataErrorStrings.ODataExpandPath_InvalidExpandPathSegment("CountSegment")); + createWithCountSegment.Throws(Error.Format(SRResources.ODataExpandPath_InvalidExpandPathSegment, "CountSegment")); } [Fact] public void ExpandPathShouldNotAllowValueSegment() { Action createWithValueSegment = () => new ODataExpandPath(new ValueSegment(HardCodedTestModel.GetPersonType()), this.navigationSegment); - createWithValueSegment.Throws(ODataErrorStrings.ODataExpandPath_InvalidExpandPathSegment("ValueSegment")); + createWithValueSegment.Throws(Error.Format(SRResources.ODataExpandPath_InvalidExpandPathSegment, "ValueSegment")); } // This test is not relevant since we are now supporting type segments as the last segment in $expand @@ -43,7 +43,7 @@ public void ExpandPathShouldNotAllowValueSegment() public void ExpandPathShouldNotAllowMultipleNavigations() { Action createWithTypeSegmentLast = () => new ODataExpandPath(this.navigationSegment, this.navigationSegment); - createWithTypeSegmentLast.Throws(ODataErrorStrings.ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty); + createWithTypeSegmentLast.Throws(SRResources.ODataExpandPath_OnlyLastSegmentCanBeNavigationProperty); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataPathExtensionsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataPathExtensionsTests.cs index 61f9e3fe9a..44a67fc60f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataPathExtensionsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataPathExtensionsTests.cs @@ -6,12 +6,12 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Metadata; using Microsoft.OData.UriParser; using Xunit; using Helpers = Microsoft.OData.Tests.UriParser.ModelBuildingHelpers; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -80,7 +80,7 @@ public void PathExtensionsToExpandPathWithNonNavigationPropertyThrows() ); Action expandPathAction = () => path.ToExpandPath(); - expandPathAction.Throws(ODataErrorStrings.ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment); + expandPathAction.Throws(SRResources.ODataExpandPath_LastSegmentMustBeNavigationPropertyOrTypeSegment); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataSelectPathTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataSelectPathTests.cs index f9425e4191..948d220552 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataSelectPathTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ODataSelectPathTests.cs @@ -6,9 +6,9 @@ using System; using System.Collections.Generic; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -18,14 +18,14 @@ public class ODataSelectPathTests public void SelectPathShouldNotAllowCountSegment() { Action buildWithCountSegment = () => new ODataSelectPath(CountSegment.Instance); - buildWithCountSegment.Throws(ODataErrorStrings.ODataSelectPath_InvalidSelectPathSegmentType("CountSegment")); + buildWithCountSegment.Throws(Error.Format(SRResources.ODataSelectPath_InvalidSelectPathSegmentType, "CountSegment")); } [Fact] public void SelectPathShouldNotAllowValueSegment() { Action buildWithCountSegment = () => new ODataSelectPath(new ValueSegment(ModelBuildingHelpers.BuildValidEntityType())); - buildWithCountSegment.Throws(ODataErrorStrings.ODataSelectPath_InvalidSelectPathSegmentType("ValueSegment")); + buildWithCountSegment.Throws(Error.Format(SRResources.ODataSelectPath_InvalidSelectPathSegmentType, "ValueSegment")); } [Fact] @@ -40,7 +40,7 @@ public void SelectPathShouldnotEndInTypeSegment() { List typeSegments = new List() { new TypeSegment(HardCodedTestModel.GetPersonType(), null) }; Action createWithTypeAsLastSegment = () => new ODataSelectPath(typeSegments); - createWithTypeAsLastSegment.Throws(ODataErrorStrings.ODataSelectPath_CannotOnlyHaveTypeSegment); + createWithTypeAsLastSegment.Throws(SRResources.ODataSelectPath_CannotOnlyHaveTypeSegment); } [Fact] @@ -48,7 +48,7 @@ public void NavPropCanOnlyBeLastSegment() { List typeSegments = new List() { new TypeSegment(HardCodedTestModel.GetPersonType(), null), new NavigationPropertySegment(HardCodedTestModel.GetPersonMyDogNavProp(), null), new PropertySegment(HardCodedTestModel.GetDogColorProp()) }; Action createWithInteriorNavProp = () => new ODataSelectPath(typeSegments); - createWithInteriorNavProp.Throws(ODataErrorStrings.ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment); + createWithInteriorNavProp.Throws(SRResources.ODataSelectPath_NavPropSegmentCanOnlyBeLastSegment); } [Fact] @@ -56,7 +56,7 @@ public void OperationCanOnlyBeLastSegment() { List typeSegments = new List() { new TypeSegment(HardCodedTestModel.GetPersonType(), null), new OperationSegment(HardCodedTestModel.GetFunctionForGetCoolPeople(), HardCodedTestModel.GetPeopleSet()), new PropertySegment(HardCodedTestModel.GetDogColorProp()) }; Action createWithInteriorNavProp = () => new ODataSelectPath(typeSegments); - createWithInteriorNavProp.Throws(ODataErrorStrings.ODataSelectPath_OperationSegmentCanOnlyBeLastSegment); + createWithInteriorNavProp.Throws(SRResources.ODataSelectPath_OperationSegmentCanOnlyBeLastSegment); } [Fact] @@ -64,7 +64,7 @@ public void OperationImportCanOnlyBeLastSegment() { List typeSegments = new List() { new OperationImportSegment(HardCodedTestModel.GetFunctionImportForGetCoolestPerson(), HardCodedTestModel.GetPeopleSet())}; Action createWithInteriorNavProp = () => new ODataSelectPath(typeSegments); - createWithInteriorNavProp.Throws(ODataErrorStrings.ODataSelectPath_InvalidSelectPathSegmentType(typeof(OperationImportSegment).Name)); + createWithInteriorNavProp.Throws(Error.Format(SRResources.ODataSelectPath_InvalidSelectPathSegmentType, typeof(OperationImportSegment).Name)); } } } \ No newline at end of file diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValueFunctionCallNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValueFunctionCallNodeTests.cs index e0d58ecf37..bbfb15ce23 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValueFunctionCallNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValueFunctionCallNodeTests.cs @@ -6,11 +6,11 @@ using System; using System.Linq; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; using Microsoft.Test.OData.Utils.Metadata; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -73,14 +73,14 @@ public void TypeReferenceIsSetCorrectly() public void TypeReferenceShouldNotBeCollection() { Action createWithCollectionReturnType = () => new SingleValueFunctionCallNode("stuff", null, new EdmCollectionType(EdmCoreModel.Instance.GetInt32(true)).ToTypeReference().AsCollection()); - createWithCollectionReturnType.Throws(ODataErrorStrings.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); + createWithCollectionReturnType.Throws(SRResources.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); } [Fact] public void TypeReferenceShouldNotBeEntity() { Action createWithCollectionReturnType = () => new SingleValueFunctionCallNode("stuff", null, ModelBuildingHelpers.BuildValidEntityType().ToTypeReference().AsEntity()); - createWithCollectionReturnType.Throws(ODataErrorStrings.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); + createWithCollectionReturnType.Throws(SRResources.Nodes_SingleValueFunctionCallNode_ItemTypeMustBePrimitiveOrComplexOrEnum); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValuePropertyAccessNodeTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValuePropertyAccessNodeTests.cs index a0520eb5a5..893f7c6019 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValuePropertyAccessNodeTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/SingleValuePropertyAccessNodeTests.cs @@ -5,9 +5,9 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.UriParser; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -65,14 +65,14 @@ public void SingleValuePropertyAccessNodesCanUseGeometry() public void SingleValuePropertyAccessCannotTakeANavigationProperty() { Action create = () => new SingleValuePropertyAccessNode(new ConstantNode(null), HardCodedTestModel.GetPersonMyDogNavProp()); - create.Throws(Strings.Nodes_PropertyAccessShouldBeNonEntityProperty("MyDog")); + create.Throws(Error.Format(SRResources.Nodes_PropertyAccessShouldBeNonEntityProperty, "MyDog")); } [Fact] public void SingleValuePropertyAccessCannotTakeACollectionProperty() { Action create = () => new SingleValuePropertyAccessNode(new ConstantNode(null), HardCodedTestModel.GetDogNicknamesProperty()); - create.Throws(Strings.Nodes_PropertyAccessTypeShouldNotBeCollection("Nicknames")); + create.Throws(Error.Format(SRResources.Nodes_PropertyAccessTypeShouldNotBeCollection, "Nicknames")); } } } diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/TypeSegmentTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/TypeSegmentTests.cs index f92e3c68d6..59865e9bd9 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/TypeSegmentTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/TypeSegmentTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -60,7 +61,7 @@ public void SetIsSetCorrectly() public void TypeMustBeRelatedToSet() { Action create = () => new TypeSegment(HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogsSet()); - create.Throws(Strings.PathParser_TypeMustBeRelatedToSet(HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogType(), "TypeSegments")); + create.Throws(Error.Format(SRResources.PathParser_TypeMustBeRelatedToSet, HardCodedTestModel.GetPersonType(), HardCodedTestModel.GetDogType(), "TypeSegments")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ValueSegmentTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ValueSegmentTests.cs index f928678d3f..d1b2f61cc2 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ValueSegmentTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/SemanticAst/ValueSegmentTests.cs @@ -8,7 +8,7 @@ using Microsoft.OData.UriParser; using Microsoft.OData.Edm; using Xunit; -using ODataErrorStrings = Microsoft.OData.Strings; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.SemanticAst { @@ -32,7 +32,7 @@ public void SingleResultIsTrue() public void CollectionTypeThrows() { Action createWithCollectionType = () => new ValueSegment(ModelBuildingHelpers.BuildValidCollectionType()); - createWithCollectionType.Throws(ODataErrorStrings.PathParser_CannotUseValueOnCollection); + createWithCollectionType.Throws(SRResources.PathParser_CannotUseValueOnCollection); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/UriEdmHelpersTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/UriEdmHelpersTests.cs index e25c7e00bb..4cf41a311e 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/UriEdmHelpersTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UriParser/UriEdmHelpersTests.cs @@ -8,6 +8,7 @@ using Microsoft.OData.Edm; using System; using Xunit; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests.UriParser.Parsers { @@ -27,7 +28,7 @@ public void GetNavigationPropertyFromExpandPathWithMetadataSegmentThrows() ODataPath odataPath = new ODataPath(segment); Action uriParserHelpersAction = () => UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath); uriParserHelpersAction.Throws( - Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath); + SRResources.ExpandItemBinder_TypeSegmentNotFollowedByPath); } [Fact] @@ -37,7 +38,7 @@ public void GetNavigationPropertyFromExpandPathWithTypeSegmentThrows() ODataPath odataPath = new ODataPath(segment); Action uriParserHelpersAction = () => UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath); uriParserHelpersAction.Throws( - Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath); + SRResources.ExpandItemBinder_TypeSegmentNotFollowedByPath); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/UrlValidation/ODataUrlValidatorTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/UrlValidation/ODataUrlValidatorTests.cs index 7d4e001823..690338a2a1 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/UrlValidation/ODataUrlValidatorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/UrlValidation/ODataUrlValidatorTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Xml; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; @@ -72,7 +73,7 @@ public static void MustUseSameModel() parser.Validate(validator, out errors); }; - validate.Throws(Strings.UriValidator_ValidatorMustUseSameModelAsParser); + validate.Throws(SRResources.UriValidator_ValidatorMustUseSameModelAsParser); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationHelper.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationHelper.cs index 9aaa936fdf..70a7d2c97f 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationHelper.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationHelper.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Microsoft.OData.Core; namespace Microsoft.OData.Tests { diff --git a/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationUtilsTests.cs b/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationUtilsTests.cs index e6161cb9bf..f7b152f997 100644 --- a/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationUtilsTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Core.Tests/ValidationUtilsTests.cs @@ -5,6 +5,7 @@ //--------------------------------------------------------------------- using System; +using Microsoft.OData.Core; using Microsoft.OData.Edm; using Xunit; @@ -17,14 +18,14 @@ public class ValidationUtilsTests public void ServiceDocumentElementIsNotNullShouldThrow() { Action test = () => ValidationUtils.ValidateServiceDocumentElement(null, ODataFormat.Json); - test.Throws(Strings.ValidationUtils_WorkspaceResourceMustNotContainNullItem); + test.Throws(SRResources.ValidationUtils_WorkspaceResourceMustNotContainNullItem); } [Fact] public void ServiceDocumentElementHasNullUrlShouldThrow() { Action test = () => ValidationUtils.ValidateServiceDocumentElement(new ODataFunctionImportInfo() { Name = "good" }, ODataFormat.Json); - test.Throws(Strings.ValidationUtils_ResourceMustSpecifyUrl); + test.Throws(SRResources.ValidationUtils_ResourceMustSpecifyUrl); } [Fact] @@ -32,7 +33,7 @@ public void ServiceDocumentElementHasNullNameShouldThrowIfJson() { var uri = new Uri("http://link/foo"); Action test = () => ValidationUtils.ValidateServiceDocumentElement(new ODataFunctionImportInfo() { Url = uri }, ODataFormat.Json); - test.Throws(Strings.ValidationUtils_ResourceMustSpecifyName(uri.OriginalString)); + test.Throws(Error.Format(SRResources.ValidationUtils_ResourceMustSpecifyName, uri.OriginalString)); } [Fact] @@ -58,7 +59,7 @@ public void ValidateComplexTypeIsAssignableTest() test2.DoesNotThrow(); Action test3 = () => ValidationUtils.ValidateComplexTypeIsAssignable(type1, type3); - test3.Throws(Strings.ValidationUtils_IncompatibleType("NS.Type3", "NS.Type1")); + test3.Throws(Error.Format(SRResources.ValidationUtils_IncompatibleType, "NS.Type3", "NS.Type1")); } #endregion } diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderJsonTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderJsonTests.cs index 9dd3531659..f3cc71f366 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderJsonTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderJsonTests.cs @@ -17,7 +17,7 @@ using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Edm.Vocabularies.V1; using Xunit; -using ErrorStrings = Microsoft.OData.Edm.Strings; +using ErrorStrings = Microsoft.OData.Edm.SRResources; namespace Microsoft.OData.Edm.Tests.Csdl { @@ -581,7 +581,7 @@ public void ParsingInvalidJsonWithNoReferencesShouldThrow() Action parseAction = () => Parse(csdl); EdmParseException exception = Assert.Throws(parseAction); - Assert.Equal(ErrorStrings.EdmParseException_ErrorsEncounteredInEdmx(expectedMessage), exception.Message); + Assert.Equal(Error.Format(ErrorStrings.EdmParseException_ErrorsEncounteredInEdmx, expectedMessage), exception.Message); Assert.Single(exception.Errors, e => e.ToString() == expectedMessage); } diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderTests.cs index cca374d845..3d11543d36 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlReaderTests.cs @@ -16,7 +16,7 @@ using Microsoft.OData.Edm.Vocabularies; using Microsoft.OData.Edm.Vocabularies.V1; using Xunit; -using ErrorStrings = Microsoft.OData.Edm.Strings; +using ErrorStrings = Microsoft.OData.Edm.SRResources; namespace Microsoft.OData.Edm.Tests.Csdl { @@ -1057,7 +1057,7 @@ public void ParsingInvalidXmlWithMultipleEntityContainersShouldThrow() "; Action parseAction = () => CsdlReader.Parse(XElement.Parse(EdmxwithMultipleEntityContainers).CreateReader()); var exception = Assert.Throws(parseAction); - Assert.Contains(Strings.CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer, exception.Message); + Assert.Contains(SRResources.CsdlParser_MetadataDocumentCannotHaveMoreThanOneEntityContainer, exception.Message); Assert.Single(exception.Errors); } @@ -1431,7 +1431,7 @@ private void RunInvalidTest(Func parse) Action parseAction = () => parse(this.invalidReader); EdmParseException exception = Assert.Throws(parseAction); - Assert.Equal(ErrorStrings.EdmParseException_ErrorsEncounteredInEdmx(ErrorMessage), exception.Message); + Assert.Equal(Error.Format(ErrorStrings.EdmParseException_ErrorsEncounteredInEdmx, ErrorMessage), exception.Message); Assert.Single(exception.Errors, e => e.ToString() == ErrorMessage); } diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.TargetPath.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.TargetPath.cs index 6b4aed0a55..95234e66bc 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.TargetPath.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.TargetPath.cs @@ -126,7 +126,7 @@ public void WriteInlineAnnotationForTargetPathThrows() Action action = () => annotation.SetSerializationLocation(model, EdmVocabularyAnnotationSerializationLocation.Inline); InvalidOperationException exception = Assert.Throws(action); - Assert.Equal(Strings.EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation(annotation.TargetString()), exception.Message); + Assert.Equal(Error.Format(SRResources.EdmVocabularyAnnotations_InvalidLocationForTargetPathAnnotation, annotation.TargetString()), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.VocabularyAnnotation.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.VocabularyAnnotation.cs index 8f117f96df..1d9b8b3d2d 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.VocabularyAnnotation.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/CsdlWriterTests.VocabularyAnnotation.cs @@ -137,7 +137,7 @@ public CustomEdmVocabularyAnnotation(IEdmVocabularyAnnotatable target, IEdmTerm this.value = term.GetDefaultValueExpression(); if (this.value == null) { - throw new InvalidOperationException(Strings.EdmVocabularyAnnotations_DidNotFindDefaultValue(term.Type)); + throw new InvalidOperationException(Error.Format(SRResources.EdmVocabularyAnnotations_DidNotFindDefaultValue, term.Type)); } UsesDefault = true; diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Semantics/CsdlSemanticsEntityContainerTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Semantics/CsdlSemanticsEntityContainerTests.cs index 3a7bb3b3d8..6c7aed09c1 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Semantics/CsdlSemanticsEntityContainerTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Semantics/CsdlSemanticsEntityContainerTests.cs @@ -38,7 +38,7 @@ public void EnsureFunctionImportFunctionPropertyIsUnresolvedFunction() Assert.IsType(csdlFunctionImport.Operation); var errors = (csdlFunctionImport.Operation as BadElement).Errors.ToList(); var error = Assert.Single(errors); - Assert.Equal(Strings.Bad_UnresolvedOperation("FQ.NS.GetStuff"), error.ErrorMessage); + Assert.Equal(Error.Format(SRResources.Bad_UnresolvedOperation, "FQ.NS.GetStuff"), error.ErrorMessage); Assert.Equal("Container", csdlFunctionImport.Container.Name); Assert.Equal(testLocation, csdlFunctionImport.Location()); Assert.Equal(EdmContainerElementKind.FunctionImport, csdlFunctionImport.ContainerElementKind); @@ -64,7 +64,7 @@ public void EnsureActionImportActionPropertyIsUnresolvedAction() Assert.IsType(imports[0].Operation); var errors = (imports[0].Operation as BadElement).Errors.ToList(); var error = Assert.Single(errors); - Assert.Equal(Strings.Bad_UnresolvedOperation("FQ.NS.Action"), error.ErrorMessage); + Assert.Equal(Error.Format(SRResources.Bad_UnresolvedOperation, "FQ.NS.Action"), error.ErrorMessage); Assert.Equal("Container", imports[0].Container.Name); Assert.Equal(testLocation, imports[0].Location()); Assert.Equal(EdmContainerElementKind.ActionImport, imports[0].ContainerElementKind); diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.Async.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.Async.cs index 8d6c3cdcce..7089ceee34 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.Async.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.Async.cs @@ -90,7 +90,7 @@ public async Task ValidateIncorrectEdmExpressionThrows_Async() async Task errorTest() => await csdlSchemaWriter.WriteActionImportElementHeaderAsync(actionImport).ConfigureAwait(false); var exception = await Assert.ThrowsAsync(errorTest).ConfigureAwait(false); - Assert.Equal(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(actionImport.Name), exception.Message); + Assert.Equal(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, actionImport.Name), exception.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.cs index b98570e0dd..3325d5de01 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Csdl/Serialization/EdmModelCsdlSchemaWriterTests.cs @@ -93,7 +93,7 @@ public void ValidateIncorrectEdmExpressionThrows() Action errorTest = () => CreateEdmModelCsdlSchemaWriterForErrorTest().WriteActionImportElementHeader(actionImport); var exception = Assert.Throws(errorTest); - Assert.Equal(Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid(actionImport.Name), exception.Message); + Assert.Equal(Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, actionImport.Name), exception.Message); } #endregion diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/ExtensionMethodTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/ExtensionMethodTests.cs index 04db1a1190..a311457915 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/ExtensionMethodTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/ExtensionMethodTests.cs @@ -438,7 +438,7 @@ public void AnyNonBoundOperationWithAnEntitySetPathSpecifiedShouldFailWithError( model, function, EdmErrorCode.OperationCannotHaveEntitySetPathWithUnBoundOperation, - Strings.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation, function.Name)); } [Fact] @@ -453,7 +453,7 @@ public void OperationWithEntitySetPathWithBindingParameterNotFoundShouldFailWith model, function, EdmErrorCode.InvalidPathFirstPathParameterNotMatchingFirstParameterName, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName("EntitySetPath", "incorrectBindingParameterName/path2", "incorrectBindingParameterName", "bindingParameter")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathWithFirstPathParameterNotMatchingFirstParameterName, "EntitySetPath", "incorrectBindingParameterName/path2", "incorrectBindingParameterName", "bindingParameter")); } [Fact] @@ -467,7 +467,7 @@ public void EdmPathExpressionWithZeroSegmentsShouldFailWithError() model, function, EdmErrorCode.OperationWithInvalidEntitySetPathMissingCompletePath, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName("EntitySetPath")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName, "EntitySetPath")); } [Fact] @@ -485,7 +485,7 @@ public void EdmPathExpressionWithBindingParameterNotAnEntityShouldError() model, function, EdmErrorCode.InvalidPathWithNonEntityBindingParameter, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter("EntitySetPath", "complexParam/People", "complexParam")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter, "EntitySetPath", "complexParam/People", "complexParam")); } [Fact] @@ -502,7 +502,7 @@ public void EdmPathExpressionWithCollectionBindingParameterNotAnEntityShouldErro model, function, EdmErrorCode.InvalidPathWithNonEntityBindingParameter, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter("EntitySetPath", "collectionComplexParam/People", "collectionComplexParam")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathWithNonEntityBindingParameter, "EntitySetPath", "collectionComplexParam/People", "collectionComplexParam")); } [Fact] @@ -519,7 +519,7 @@ public void EdmPathExpressionWithUnknownNavigationPropertyShouldError() model, function, EdmErrorCode.InvalidPathUnknownNavigationProperty, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty("EntitySetPath", "bindingEntity/People", "People")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty, "EntitySetPath", "bindingEntity/People", "People")); } [Fact] @@ -536,7 +536,7 @@ public void EdmPathExpressionWithUnknownTypeCastSegmentShouldError() model, function, EdmErrorCode.InvalidPathUnknownTypeCastSegment, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment("EntitySetPath", "bindingEntity/unknown.EntityType", "unknown.EntityType")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment, "EntitySetPath", "bindingEntity/unknown.EntityType", "unknown.EntityType")); } [Fact] @@ -556,7 +556,7 @@ public void EdmPathExpressionWithInvalidComplexTypeCaseForTypeCastSegmentShouldE model, function, EdmErrorCode.InvalidPathTypeCastSegmentMustBeEntityType, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType("EntitySetPath", "bindingEntity/ds.s.complexType", "ds.s.complexType")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathTypeCastSegmentMustBeEntityType, "EntitySetPath", "bindingEntity/ds.s.complexType", "ds.s.complexType")); } [Fact] @@ -576,7 +576,7 @@ public void EdmPathExpressionWithInvalidNonInheritedTypeCastSegmentShouldError() model, function, EdmErrorCode.InvalidPathInvalidTypeCastSegment, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment("EntitySetPath", "bindingEntity/ds.s.otherEntityType", entityType.FullName(), otherEntityType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathInvalidTypeCastSegment, "EntitySetPath", "bindingEntity/ds.s.otherEntityType", entityType.FullName(), otherEntityType.FullName())); } [Fact] @@ -658,7 +658,7 @@ public void ValidateEntitySetPathNavPropertyTypeCastUnknownNavPropertyReturnsUnk testModelContainer.Model, function, EdmErrorCode.InvalidPathUnknownNavigationProperty, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty("EntitySetPath", "bindingEntity/Bunk.T1/UnknownNav", "UnknownNav")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownNavigationProperty, "EntitySetPath", "bindingEntity/Bunk.T1/UnknownNav", "UnknownNav")); } [Fact] @@ -673,7 +673,7 @@ public void ValidateEntitySetPathNavPropertyUnknownTypeCastShouldError() testModelContainer.Model, function, EdmErrorCode.InvalidPathUnknownTypeCastSegment, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment("EntitySetPath", "bindingEntity/Nav1/Bunk.T1Foo", "Bunk.T1Foo")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment, "EntitySetPath", "bindingEntity/Nav1/Bunk.T1Foo", "Bunk.T1Foo")); } internal class OperationOperationEntitySetPathMustBeValidValidTestModel diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/TargetHelperTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/TargetHelperTests.cs index cd6ceead56..3efaf02b51 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/TargetHelperTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ExtensionMethods/TargetHelperTests.cs @@ -141,7 +141,7 @@ public void GetTargetSegmentsForInValidTypeCastThrows() Action action = () => edmModel.GetTargetSegments(targetPath.Split('/'), true).ToList(); InvalidOperationException exception = Assert.Throws(action); - Assert.Equal(Strings.TypeCast_HierarchyNotFollowed(sampleModel.EntitySet, sampleModel.City), exception.Message); + Assert.Equal(Error.Format(SRResources.TypeCast_HierarchyNotFollowed, sampleModel.EntitySet, sampleModel.City), exception.Message); } [Fact] @@ -153,7 +153,7 @@ public void GetTargetSegmentsForTwoTypeCastThrows() Action action = () => edmModel.GetTargetSegments(targetPath.Split('/'), true).ToList(); InvalidOperationException exception = Assert.Throws(action); - Assert.Equal(Strings.TypeCast_HierarchyNotFollowed(sampleModel.VipCustomer, sampleModel.City), exception.Message); + Assert.Equal(Error.Format(SRResources.TypeCast_HierarchyNotFollowed, sampleModel.VipCustomer, sampleModel.City), exception.Message); } } diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisActionsFunctionsRelationshipChangesAcceptanceTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisActionsFunctionsRelationshipChangesAcceptanceTests.cs index 4063ddfeb0..734b63d156 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisActionsFunctionsRelationshipChangesAcceptanceTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisActionsFunctionsRelationshipChangesAcceptanceTests.cs @@ -355,7 +355,7 @@ public void ValidateEntitySetPathExpressionCannotHaveValueWhenActionNonBound() var errorsList = errors.ToList(); var error = Assert.Single(errorsList); Assert.Equal(EdmErrorCode.InvalidEntitySetPath, error.ErrorCode); - Assert.Equal(Strings.CsdlParser_InvalidEntitySetPathWithUnboundAction(CsdlConstants.Element_Action, "Add"), error.ErrorMessage); + Assert.Equal(Error.Format(SRResources.CsdlParser_InvalidEntitySetPathWithUnboundAction, CsdlConstants.Element_Action, "Add"), error.ErrorMessage); } [Fact] @@ -395,7 +395,7 @@ public void ValidateActionImportMissingActionAttributeShouldReturnError() Action test = () => CsdlReader.Parse(XElement.Parse(errorDocument).CreateReader()); var exception = Assert.Throws(test); - Assert.Contains(Strings.XmlParser_MissingAttribute("Action", "ActionImport"), exception.Message); + Assert.Contains(Error.Format(SRResources.XmlParser_MissingAttribute, "Action", "ActionImport"), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisRelationshipChangesAcceptanceTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisRelationshipChangesAcceptanceTests.cs index 054e573eb9..fa7e6528b6 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisRelationshipChangesAcceptanceTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/ScenarioTests/OasisRelationshipChangesAcceptanceTests.cs @@ -12,7 +12,6 @@ using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Validation; using Xunit; -using ErrorStrings = Microsoft.OData.Edm.Strings; namespace Microsoft.OData.Edm.Tests.ScenarioTests { @@ -229,7 +228,7 @@ public void ValidationShouldFailIfABindingToANonExistentPropertyIsFound() this.ValidateBindingWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedNavigationPropertyPath, - ErrorStrings.Bad_UnresolvedNavigationPropertyPath("NonExistent", "Test.EntityType")); + Error.Format(SRResources.Bad_UnresolvedNavigationPropertyPath, "NonExistent", "Test.EntityType")); } [Fact] @@ -238,7 +237,7 @@ public void ValidationShouldFailIfABindingToANonExistentSetIsFound() this.ValidateBindingWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedEntitySet, - ErrorStrings.Bad_UnresolvedEntitySet("NonExistent")); + Error.Format(SRResources.Bad_UnresolvedEntitySet, "NonExistent")); } [Fact] @@ -247,7 +246,7 @@ public void ValidationShouldFailIfADerivedPropertyIsUsedWithoutATypeCast() this.ValidateBindingWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedNavigationPropertyPath, - ErrorStrings.Bad_UnresolvedNavigationPropertyPath("DerivedNavigation", "Test.EntityType")); + Error.Format(SRResources.Bad_UnresolvedNavigationPropertyPath, "DerivedNavigation", "Test.EntityType")); } [Fact] @@ -256,7 +255,7 @@ public void ValidationShouldFailIfATypeCastIsFollowedByANonExistentProperty() this.ValidateBindingWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedNavigationPropertyPath, - ErrorStrings.Bad_UnresolvedNavigationPropertyPath("Test.DerivedEntityType/NonExistent", "Test.EntityType")); + Error.Format(SRResources.Bad_UnresolvedNavigationPropertyPath, "Test.DerivedEntityType/NonExistent", "Test.EntityType")); } [Fact] @@ -265,7 +264,7 @@ public void ParsingShouldFailIfABindingIsMissingTarget() this.ParseBindingWithExpectedErrors( @"", EdmErrorCode.MissingAttribute, - ErrorStrings.XmlParser_MissingAttribute("Target", "NavigationPropertyBinding")); + Error.Format(SRResources.XmlParser_MissingAttribute, "Target", "NavigationPropertyBinding")); } [Fact] @@ -274,7 +273,7 @@ public void ParsingShouldFailIfABindingIsMissingPath() this.ParseBindingWithExpectedErrors( @"", EdmErrorCode.MissingAttribute, - ErrorStrings.XmlParser_MissingAttribute("Path", "NavigationPropertyBinding")); + Error.Format(SRResources.XmlParser_MissingAttribute, "Path", "NavigationPropertyBinding")); } [Fact] @@ -283,8 +282,8 @@ public void ParsingShouldFailIfABindingHasExtraAttributes() this.ParseBindingWithExpectedErrors( @"", EdmErrorCode.UnexpectedXmlAttribute, - ErrorStrings.XmlParser_UnexpectedAttribute("Something"), - ErrorStrings.XmlParser_UnexpectedAttribute("Foo")); + Error.Format(SRResources.XmlParser_UnexpectedAttribute, "Something"), + Error.Format(SRResources.XmlParser_UnexpectedAttribute, "Foo")); } [Fact] @@ -304,7 +303,7 @@ public void ParsingShouldFailIfAConstraintIsMissingProperty() this.ParseReferentialConstraintWithExpectedErrors( @"", EdmErrorCode.MissingAttribute, - ErrorStrings.XmlParser_MissingAttribute("Property", "ReferentialConstraint")); + Error.Format(SRResources.XmlParser_MissingAttribute, "Property", "ReferentialConstraint")); } [Fact] @@ -313,7 +312,7 @@ public void ParsingShouldFailIfAConstraintIsMissingReferencedProperty() this.ParseReferentialConstraintWithExpectedErrors( @"", EdmErrorCode.MissingAttribute, - ErrorStrings.XmlParser_MissingAttribute("ReferencedProperty", "ReferentialConstraint")); + Error.Format(SRResources.XmlParser_MissingAttribute, "ReferencedProperty", "ReferentialConstraint")); } [Fact] @@ -323,8 +322,8 @@ public void ParsingShouldFailIfAConstraintHasExtraAttributes() @" ", EdmErrorCode.UnexpectedXmlAttribute, - ErrorStrings.XmlParser_UnexpectedAttribute("Something"), - ErrorStrings.XmlParser_UnexpectedAttribute("Foo")); + Error.Format(SRResources.XmlParser_UnexpectedAttribute, "Something"), + Error.Format(SRResources.XmlParser_UnexpectedAttribute, "Foo")); } [Fact] @@ -344,7 +343,7 @@ public void ValidationShouldFailIfAConstraintOnANonExistentPropertyIsFound() this.ValidateReferentialConstraintWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedProperty, - ErrorStrings.Bad_UnresolvedProperty("NonExistent") + Error.Format(SRResources.Bad_UnresolvedProperty, "NonExistent") ); } @@ -354,7 +353,7 @@ public void ValidationShouldFailIfAConstraintOnANonExistentReferencedPropertyIsF this.ValidateReferentialConstraintWithExpectedErrors( @"", EdmErrorCode.BadUnresolvedProperty, - ErrorStrings.Bad_UnresolvedProperty("NonExistent")); + Error.Format(SRResources.Bad_UnresolvedProperty, "NonExistent")); } [Fact] @@ -366,7 +365,7 @@ public void ParsingShouldFailIfANavigationHasMultipleOnDeleteElements() ", EdmErrorCode.UnexpectedXmlElement, - ErrorStrings.XmlParser_UnusedElement("OnDelete")); + Error.Format(SRResources.XmlParser_UnusedElement, "OnDelete")); } [Fact] @@ -377,7 +376,7 @@ public void ParsingShouldFailIfANavigationHasAnInvalidOnDeleteAction() ", EdmErrorCode.InvalidOnDelete, - ErrorStrings.CsdlParser_InvalidDeleteAction("Foo")); + Error.Format(SRResources.CsdlParser_InvalidDeleteAction, "Foo")); } [Fact] @@ -386,7 +385,7 @@ public void ParsingShouldFailIfANavigationIsMissingType() this.ParseNavigationExpectedErrors( @"", EdmErrorCode.MissingAttribute, - ErrorStrings.XmlParser_MissingAttribute("Type", "NavigationProperty")); + Error.Format(SRResources.XmlParser_MissingAttribute, "Type", "NavigationProperty")); } [Fact] @@ -400,7 +399,7 @@ public void ParsingShouldFailIfNavigationTypeIsEmpty() { this.ParseNavigationExpectedErrors(@"", EdmErrorCode.InvalidTypeName, - ErrorStrings.CsdlParser_InvalidTypeName("")); + Error.Format(SRResources.CsdlParser_InvalidTypeName, "")); } [Fact] @@ -408,7 +407,7 @@ public void ParsingShouldFailIfNavigationNullableIsEmpty() { this.ParseNavigationExpectedErrors(@"", EdmErrorCode.InvalidBoolean, - ErrorStrings.ValueParser_InvalidBoolean("")); + Error.Format(SRResources.ValueParser_InvalidBoolean, "")); } [Fact] @@ -416,7 +415,7 @@ public void ParsingShouldFailIfNavigationNullableIsNotTrueOrFalse() { this.ParseNavigationExpectedErrors(@"", EdmErrorCode.InvalidBoolean, - ErrorStrings.ValueParser_InvalidBoolean("foo")); + Error.Format(SRResources.ValueParser_InvalidBoolean, "foo")); } [Fact] @@ -424,7 +423,7 @@ public void ValidationShouldFailIfNavigationNullableIsSpecifiedOnCollection() { this.ValidateNavigationWithExpectedErrors(@"", EdmErrorCode.NavigationPropertyWithCollectionTypeCannotHaveNullableAttribute, - ErrorStrings.CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType); + SRResources.CsdlParser_CannotSpecifyNullableAttributeForNavigationPropertyWithCollectionType); } [Fact] @@ -432,7 +431,7 @@ public void ValidationShouldFailIfNavigationTypeIsAPrimitiveType() { this.ValidateNavigationWithExpectedErrors(@"", EdmErrorCode.BadUnresolvedEntityType, - ErrorStrings.Bad_UnresolvedEntityType("Edm.Int32")); + Error.Format(SRResources.Bad_UnresolvedEntityType, "Edm.Int32")); } [Fact] @@ -440,7 +439,7 @@ public void ValidationShouldFailIfNavigationTypeIsPrimitiveCollectionType() { this.ValidateNavigationWithExpectedErrors(@"", EdmErrorCode.BadUnresolvedEntityType, - ErrorStrings.Bad_UnresolvedEntityType("Edm.Int32")); + Error.Format(SRResources.Bad_UnresolvedEntityType, "Edm.Int32")); } [Fact] @@ -448,7 +447,7 @@ public void ValidationShouldFailIfNavigationTypeDoesNotExist() { this.ValidateNavigationWithExpectedErrors(@"", EdmErrorCode.BadUnresolvedEntityType, - ErrorStrings.Bad_UnresolvedEntityType("Fake.Nonexistent")); + Error.Format(SRResources.Bad_UnresolvedEntityType, "Fake.Nonexistent")); } [Fact] @@ -456,7 +455,7 @@ public void ValidationShouldFailIfNavigationTypeIsACollectionButElementTypeDoesN { this.ValidateNavigationWithExpectedErrors(@"", EdmErrorCode.BadUnresolvedEntityType, - ErrorStrings.Bad_UnresolvedEntityType("Fake.Nonexistent")); + Error.Format(SRResources.Bad_UnresolvedEntityType, "Fake.Nonexistent")); } [Fact] @@ -470,7 +469,7 @@ public void ValidationShouldFailIfNavigationParterIsSpecifiedButCannotBeFound() }, new[] { - ErrorStrings.Bad_UnresolvedNavigationPropertyPath("Nonexistent", "Test.EntityType"), + Error.Format(SRResources.Bad_UnresolvedNavigationPropertyPath, "Nonexistent", "Test.EntityType"), string.Format("Cannot resolve partner path for navigation property '{0}'.", "Navigation") }); } @@ -483,7 +482,7 @@ public void ValidationShouldFailIfEnumMemberIsSpecifiedButCannotBeFound() Assert.False(model.Validate(out errors)); var error = Assert.Single(errors); Assert.Equal(EdmErrorCode.BadUnresolvedEnumMember, error.ErrorCode); - Assert.Equal(ErrorStrings.Bad_UnresolvedEnumMember("Blue"), error.ErrorMessage); + Assert.Equal(Error.Format(SRResources.Bad_UnresolvedEnumMember, "Blue"), error.ErrorMessage); } [Fact] @@ -501,7 +500,7 @@ public void ValidationShouldFailIfEnumMemberIsSpecifiedButCannotBeFoundTheMember Assert.False(model.Validate(out errors)); Assert.Equal(2, errors.Count()); Assert.Contains(errors, e => e.ErrorCode == EdmErrorCode.InvalidEnumMemberPath && - e.ErrorMessage == ErrorStrings.CsdlParser_InvalidEnumMemberPath("TestNS2.Color/UnknownMember")); + e.ErrorMessage == Error.Format(SRResources.CsdlParser_InvalidEnumMemberPath, "TestNS2.Color/UnknownMember")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/DateAndTimeOfDayTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/DateAndTimeOfDayTests.cs index 4884f6a5fc..2d2acb0c00 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/DateAndTimeOfDayTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/DateAndTimeOfDayTests.cs @@ -20,7 +20,7 @@ public void TestDateCtor() Action test = () => new Date(-2013, 8, 12); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidDateParameters(-2013, 8, 12), exception.Message); + Assert.Equal(Error.Format(SRResources.Date_InvalidDateParameters, -2013, 8, 12), exception.Message); } [Fact] @@ -54,7 +54,7 @@ public void TestDateAddYearsInvalidResults() Action test = () => date.AddYears(-5000); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -63,7 +63,7 @@ public void TestDateAddYearsInvalidParameters() Date date = new Date(2013, 8, 12); Action test = () => date.AddYears(12000); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -80,7 +80,7 @@ public void TestDateAddMonthsInvalidResults() Date date = new Date(1, 1, 1); Action test = () => date.AddMonths(-5000); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -89,7 +89,7 @@ public void TestDateAddMonthsInvalidParameters() Date date = new Date(1, 1, 1); Action test = () => date.AddMonths(120001); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -106,7 +106,7 @@ public void TestDateAddDaysInvalidResults() Date date = new Date(1, 1, 1); Action test = () => date.AddDays(-2); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -115,7 +115,7 @@ public void TestDateAddDaysInvalidParameters() Date date = new Date(1, 1, 1); Action test = () => date.AddDays(999999999); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); + Assert.Equal(SRResources.Date_InvalidAddedOrSubtractedResults + " (Parameter 'value')", exception.Message); } [Fact] @@ -187,7 +187,7 @@ public void TestParseDateFailure() { Action test = () => Date.Parse(tuple.Item1, CultureInfo.InvariantCulture); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidParsingString(tuple.Item1), exception.Message); + Assert.Equal(Error.Format(SRResources.Date_InvalidParsingString, tuple.Item1), exception.Message); } #endregion @@ -271,7 +271,7 @@ public void TestDateCompareToInvalidTarget() Action test = () => date.CompareTo(now); var exception = Assert.Throws(test); - Assert.Equal(Strings.Date_InvalidCompareToTarget(now), exception.Message); + Assert.Equal(Error.Format(SRResources.Date_InvalidCompareToTarget, now), exception.Message); } [Fact] @@ -359,7 +359,7 @@ public void TestTimeOfDayCtorInvalid() { Action test = () => new TimeOfDay(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4); var exception = Assert.Throws(test); - Assert.Equal(Strings.TimeOfDay_InvalidTimeOfDayParameters(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4), exception.Message); + Assert.Equal(Error.Format(SRResources.TimeOfDay_InvalidTimeOfDayParameters, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4), exception.Message); } } @@ -371,7 +371,7 @@ public void TestTimeOfDayTicksCtorInvalid() { Action test = () => new TimeOfDay(value); var exception = Assert.Throws(test); - Assert.Equal(Strings.TimeOfDay_TicksOutOfRange(value), exception.Message); + Assert.Equal(Error.Format(SRResources.TimeOfDay_TicksOutOfRange, value), exception.Message); } } @@ -462,7 +462,7 @@ public void TestTimeSpanToTimeOfDayException() TimeSpan timeSpan = new TimeSpan(value); Action test = () => { TimeOfDay timeOfDay = timeSpan; }; var exception = Assert.Throws(test); - Assert.Equal(Strings.TimeOfDay_ConvertErrorFromTimeSpan(timeSpan), exception.Message); + Assert.Equal(Error.Format(SRResources.TimeOfDay_ConvertErrorFromTimeSpan, timeSpan), exception.Message); } } @@ -628,7 +628,7 @@ public void TestParseTimeOfDayFailure() { Action test = () => TimeOfDay.Parse(tuple.Item1); var exception = Assert.Throws(test); - Assert.Equal(Strings.TimeOfDay_InvalidParsingString(tuple.Item1), exception.Message); + Assert.Equal(Error.Format(SRResources.TimeOfDay_InvalidParsingString, tuple.Item1), exception.Message); } #endregion @@ -650,7 +650,7 @@ public void TestTimeOfDayCompareToInvalidTarget() DateTimeOffset now = DateTimeOffset.Now; Action test = () => time.CompareTo(now); var exception = Assert.Throws(test); - Assert.Equal(Strings.TimeOfDay_InvalidCompareToTarget(now), exception.Message); + Assert.Equal(Error.Format(SRResources.TimeOfDay_InvalidCompareToTarget, now), exception.Message); } [Fact] public void TestTimeOfDayOperator() diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmReferentialConstraintTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmReferentialConstraintTests.cs index 9fe0cc25c4..b9bf56d238 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmReferentialConstraintTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmReferentialConstraintTests.cs @@ -81,7 +81,7 @@ public void CreateReferentialConstraintShouldFailIfTooFewPropertiesAreGiven() Action createWithTooFewProperties = () => EdmReferentialConstraint.Create(new[] { this.otherTypeProperty1 }, this.typeWithTwoKeys.Key()); var exception = Assert.Throws(createWithTooFewProperties); - Assert.Equal(Strings.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType(2, 1), exception.Message); + Assert.Equal(Error.Format(SRResources.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType, 2, 1), exception.Message); } [Fact] @@ -89,7 +89,7 @@ public void CreateReferentialConstraintShouldFailIfTooManyPropertiesAreGiven() { Action createWithTooManyProperties = () => EdmReferentialConstraint.Create(new[] { this.otherTypeProperty1, this.otherTypeProperty2 }, this.typeWithOneKey.Key()); var exception = Assert.Throws(createWithTooManyProperties); - Assert.Equal(Strings.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType(1, 2), exception.Message); + Assert.Equal(Error.Format(SRResources.Constructable_DependentPropertyCountMustMatchNumberOfPropertiesOnPrincipalType, 1, 2), exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmTargetPathTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmTargetPathTests.cs index ec54f11ce7..2d2ebea98c 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmTargetPathTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Schema/EdmTargetPathTests.cs @@ -43,7 +43,7 @@ public void InitializeEdmTargetPath_FirstSegmentIsNotContainer() Action action = () => new EdmTargetPath(customer, nameProperty); InvalidOperationException exception = Assert.Throws(action); - Assert.Equal(Strings.TargetPath_FirstSegmentMustBeIEdmEntityContainer, exception.Message); + Assert.Equal(SRResources.TargetPath_FirstSegmentMustBeIEdmEntityContainer, exception.Message); } [Fact] @@ -57,7 +57,7 @@ public void InitializeEdmTargetPath_SecondSegmentIsNotContainerElement() Action action = () => new EdmTargetPath(container,customer); InvalidOperationException exception = Assert.Throws(action); - Assert.Equal(Strings.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement, exception.Message); + Assert.Equal(SRResources.TargetPath_SecondSegmentMustBeIEdmEntityContainerElement, exception.Message); } [Fact] @@ -71,7 +71,7 @@ public void InitializeEdmTargetPath_WithNullElement() Action action = () => new EdmTargetPath(container, null, customer); ArgumentException exception = Assert.Throws(action); - Assert.Equal(Strings.TargetPath_SegmentsMustNotContainNullSegment, exception.Message); + Assert.Equal(SRResources.TargetPath_SegmentsMustNotContainNullSegment, exception.Message); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/DuplicateOperationValidatorTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/DuplicateOperationValidatorTests.cs index 11c31672f4..813667638d 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/DuplicateOperationValidatorTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/DuplicateOperationValidatorTests.cs @@ -45,7 +45,7 @@ public void DuplicateBoundFunctionOverloadsSameParameterNamesShouldError() EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames, "n.s.GetStuff")); } [Fact] @@ -59,7 +59,7 @@ public void DuplicateUnBoundFunctionOverloadsSameParameterNamesShouldError() EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames, "n.s.GetStuff")); } [Fact] @@ -89,7 +89,7 @@ public void DuplicateFunctionsUnBoundFunctionsWithSameNameWhereBindingTypeDiffer EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, "n.s.GetStuff")); } [Fact] @@ -105,7 +105,7 @@ public void DuplicateFunctionsBoundFunctionsWithDifferentBindingParameterNameBut EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, "n.s.GetStuff")); } [Fact] @@ -119,7 +119,7 @@ public void DuplicateFunctionsUnBoundFunctionsWithDifferentBindingParameterNameB EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes, "n.s.GetStuff")); } [Fact] @@ -178,7 +178,7 @@ public void EnsureUnBoundFunctionWithDifferentOrderedParameterNamesShouldError() EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterNames, "n.s.GetStuff")); } [Fact] @@ -196,7 +196,7 @@ public void EnsureBoundFunctionWithDifferentOrderedParameterNamesShouldError() EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterNames, "n.s.GetStuff")); } [Fact] @@ -214,7 +214,7 @@ public void EnsureBoundFunctionWithDifferentSameOrderedParameterTypesShouldError EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, "n.s.GetStuff")); } [Fact] @@ -230,7 +230,7 @@ public void EnsureUnBoundFunctionWithDifferentSameOrderedParameterTypesShouldErr EdmModel model = new EdmModel(); model.AddElement(edmFunction); model.AddElement(edmFunction2); - ValidateError(model, EdmErrorCode.DuplicateFunctions, Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes("n.s.GetStuff")); + ValidateError(model, EdmErrorCode.DuplicateFunctions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundFunctionsParameterTypes, "n.s.GetStuff")); } [Fact] @@ -290,7 +290,7 @@ public void EnsureBoundActionWithSameBindingParameterTypesShouldError() EdmModel model = new EdmModel(); model.AddElement(edmAction); model.AddElement(edmAction2); - ValidateError(model, EdmErrorCode.DuplicateActions, Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundActions("n.s.DoStuff")); + ValidateError(model, EdmErrorCode.DuplicateActions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundActions, "n.s.DoStuff")); } [Fact] @@ -306,7 +306,7 @@ public void EnsureNonBoundActionWithSameNameShouldError() EdmModel model = new EdmModel(); model.AddElement(edmAction); model.AddElement(edmAction2); - ValidateError(model, EdmErrorCode.DuplicateActions, Strings.EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions("n.s.DoStuff")); + ValidateError(model, EdmErrorCode.DuplicateActions, Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateUnBoundActions, "n.s.DoStuff")); } [Fact] diff --git a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs index 3076adae3e..7389f8fcce 100644 --- a/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs +++ b/test/FunctionalTests/Microsoft.OData.Edm.Tests/Validation/ValidationRulesTests.cs @@ -31,7 +31,7 @@ public void OperationImportCannotImportBoundOperationTestShouldIndicateError() ValidationRules.OperationImportCannotImportBoundOperation, functionImport, EdmErrorCode.OperationImportCannotImportBoundOperation, - Strings.EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation("function1", "func")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportCannotImportBoundOperation, "function1", "func")); } [Fact] @@ -46,7 +46,7 @@ public void FunctionOverloadsWithDifferentReturnTypesAreInvalid() ValidationRules.UnBoundFunctionOverloadsMustHaveIdenticalReturnTypes, model, EdmErrorCode.UnboundFunctionOverloadHasIncorrectReturnType, - Strings.EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_UnboundFunctionOverloadHasIncorrectReturnType, "GetStuff")); } [Fact] @@ -61,7 +61,7 @@ public void UrlEscapeOnUnboundFunctionAreInvalid() model, edmFunction, EdmErrorCode.UrlEscapeFunctionMustBeBoundFunction, - Strings.EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_UrlEscapeFunctionMustBoundFunction, "GetStuff")); } [Fact] @@ -76,7 +76,7 @@ public void UrlEscapeOnFunctionWithNonStringParameterAreInvalid() model, edmFunction, EdmErrorCode.UrlEscapeFunctionMustHaveOnlyOneEdmStringParameter, - Strings.EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_UrlEscapeFunctionMustHaveOneStringParameter, "GetStuff")); } [Fact] @@ -102,7 +102,7 @@ public void EntityTypeComposableEscapeFunctionMoreThanOneAreInvalid() model, entityType, EdmErrorCode.EntityComposableBoundEscapeFunctionMustBeLessOne, - Strings.EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne("NS.Entity", "GetStuff1,GetStuff2")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityComposableBoundEscapeFunctionMustBeLessOne, "NS.Entity", "GetStuff1,GetStuff2")); } [Fact] @@ -128,7 +128,7 @@ public void EntityTypeNoncomposableEscapeFunctionMoreThanOneAreInvalid() model, entityType, EdmErrorCode.EntityNoncomposableBoundEscapeFunctionMustBeLessOne, - Strings.EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne("NS.Entity", "GetStuff1,GetStuff2")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntityNoncomposableBoundEscapeFunctionMustBeLessOne, "NS.Entity", "GetStuff1,GetStuff2")); } [Fact] @@ -165,7 +165,7 @@ public void EntitySetAndOperationImportWithSameNameShouldError() ValidationRules.EntityContainerDuplicateEntityContainerMemberName, container, EdmErrorCode.DuplicateEntityContainerMemberName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName("Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, "Set")); } [Fact] @@ -179,7 +179,7 @@ public void OperationImportAndEntitySetWithSameNameShouldError() ValidationRules.EntityContainerDuplicateEntityContainerMemberName, container, EdmErrorCode.DuplicateEntityContainerMemberName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName("Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, "Set")); } [Fact] @@ -194,7 +194,7 @@ public void OperationImportsWithSameNameAndSameOperationShouldError() ValidationRules.EntityContainerDuplicateEntityContainerMemberName, container, EdmErrorCode.DuplicateEntityContainerMemberName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName("Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, "Set")); } [Fact] @@ -231,7 +231,7 @@ public void OperationReturnTypeWithCollectionOfAbstractTypeShouldError(EdmTypeKi ValidationRules.OperationReturnTypeCannotBeCollectionOfAbstractType, function, EdmErrorCode.OperationWithCollectionOfAbstractReturnTypeInvalid, - Strings.EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType(collectionType.FullName(), function.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationReturnTypeCannotBeCollectionOfAbstractType, collectionType.FullName(), function.FullName())); } [Fact] @@ -245,7 +245,7 @@ public void EntitySetsWithSameNameShouldError() ValidationRules.EntityContainerDuplicateEntityContainerMemberName, container, EdmErrorCode.DuplicateEntityContainerMemberName, - Strings.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName("Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DuplicateEntityContainerMemberName, "Set")); } [Fact] @@ -258,7 +258,7 @@ public void EntitySetsWithEdmEntityTypeShouldError() ValidationRules.EntitySetTypeCannotBeEdmEntityType, entitySet, EdmErrorCode.EntityTypeOfEntitySetCannotBeEdmEntityType, - Strings.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet(entitySet.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfEntitySet, entitySet.Name)); } #endregion @@ -280,7 +280,7 @@ public void OperationImportEntitySetReferencesEntitySetNotOnFunctionImportContai model, edmFunctionImport, EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, "GetStuff")); } [Fact] @@ -310,14 +310,14 @@ public void OperationImportEntitySetReferenceSingletonShouldError() ValidationRules.OperationImportEntitySetExpressionIsInvalid, edmFunctionImport, EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, "GetStuff")); var edmActionImport = new EdmActionImport(defaultContainer, "UpdateStuff", edmAction, new EdmPathExpression("Schema.EntityContainer/Singleton")); ValidateError( ValidationRules.OperationImportEntitySetExpressionIsInvalid, edmActionImport, EdmErrorCode.OperationImportEntitySetExpressionIsInvalid, - Strings.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid("UpdateStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportEntitySetExpressionIsInvalid, "UpdateStuff")); } [Fact] @@ -375,7 +375,7 @@ public void OperationImportInvalidEntitySetWithNonEntityNonCollectionReturnType( ValidationRules.OperationImportEntityTypeDoesNotMatchEntitySet, edmFunctionImport, EdmErrorCode.OperationImportSpecifiesEntitySetButDoesNotReturnEntityType, - Strings.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType, "GetStuff")); } [Fact] @@ -388,7 +388,7 @@ public void OperationImportInvalidEntitySetWithNonEntityCollectionReturnType() ValidationRules.OperationImportEntityTypeDoesNotMatchEntitySet, edmFunctionImport, EdmErrorCode.OperationImportSpecifiesEntitySetButDoesNotReturnEntityType, - Strings.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType("GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationImportSpecifiesEntitySetButNotEntityType, "GetStuff")); } [Fact] @@ -416,7 +416,7 @@ public void ShortIntegrationTestEnsuresTryGetRelativeEntitySetInvoked() model, function, EdmErrorCode.OperationCannotHaveEntitySetPathWithUnBoundOperation, - Strings.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationCannotHaveEntitySetPathWithUnBoundOperation, function.Name)); } [Fact] @@ -431,7 +431,7 @@ public void ShortIntegrationTestEnsuresTryGetRelativeEntitySetInvoked2() model, function, EdmErrorCode.OperationWithInvalidEntitySetPathMissingCompletePath, - Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName("EntitySetPath")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidEntitySetPathMissingBindingParameterName, "EntitySetPath")); } #endregion @@ -447,7 +447,7 @@ public void OperationWithEntitySetPathWithNonEntityReturnTypeMustFail() model, function, EdmErrorCode.OperationWithEntitySetPathReturnTypeInvalid, - Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid, function.Name)); } [Fact] @@ -462,7 +462,7 @@ public void OperationWithEntitySetPathWithNonEntityCollectionReturnTypeMustFail( model, function, EdmErrorCode.OperationWithEntitySetPathReturnTypeInvalid, - Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid, function.Name)); } [Fact] @@ -478,7 +478,7 @@ public void ValidateEntitySetPathResolvedTypeFailsWithNotAssignableToReturnTypeE testModelContainer.Model, function, EdmErrorCode.OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, - Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable(function.Name, testModelContainer.T3.FullName(), testModelContainer.T2.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathAndReturnTypeTypeNotAssignable, function.Name, testModelContainer.T3.FullName(), testModelContainer.T2.FullName())); } [Fact] @@ -494,7 +494,7 @@ public void ValidateNonEntityReturnTypeInvalid() testModelContainer.Model, function, EdmErrorCode.OperationWithEntitySetPathReturnTypeInvalid, - Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathReturnTypeInvalid, function.Name)); } [Fact] @@ -525,7 +525,7 @@ public void ValidateEntitySetPathInvalidAsResolvesToEntityTypeWhenReturnTypeIsCo testModelContainer.Model, function, EdmErrorCode.OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, - Strings.EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_OperationWithEntitySetPathResolvesToCollectionEntityTypeMismatchesEntityTypeReturnType, function.Name)); } [Fact] @@ -595,7 +595,7 @@ public void FunctionImportIncludedInServiceDocumentHasParametersShouldError() model, functionImport, EdmErrorCode.FunctionImportWithParameterShouldNotBeIncludedInServiceDocument, - Strings.EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument("OtherName")); + Error.Format(SRResources.EdmModel_Validator_Semantic_FunctionImportWithParameterShouldNotBeIncludedInServiceDocument, "OtherName")); } [Fact] @@ -635,7 +635,7 @@ public void FunctionOverloadsWithSameBindingTypesAndSameNameWithDifferentReturnT ValidationRules.ModelBoundFunctionOverloadsMustHaveSameReturnType, model, EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, - Strings.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType("GetStuff", edmFunction.ReturnType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType, "GetStuff", edmFunction.ReturnType.FullName())); } [Fact] @@ -682,8 +682,8 @@ public void FunctionOverloadsWithSameBindingTypesAndSameNameWithDifferentReturnT ValidationRules.ModelBoundFunctionOverloadsMustHaveSameReturnType, model, model, - new Tuple(EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, Strings.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType("GetStuff", edmFunction.ReturnType.FullName())), - new Tuple(EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, Strings.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType("GetStuff", edmFunction.ReturnType.FullName()))); + new Tuple(EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, Error.Format(SRResources.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType, "GetStuff", edmFunction.ReturnType.FullName())), + new Tuple(EdmErrorCode.BoundFunctionOverloadsMustHaveSameReturnType, Error.Format(SRResources.EdmModel_Validator_Semantic_BoundFunctionOverloadsMustHaveSameReturnType, "GetStuff", edmFunction.ReturnType.FullName()))); } #endregion @@ -723,7 +723,7 @@ public void DuplicateFunctionsDuplicateFunctionErrorShouldOccur() ValidationRules.ModelDuplicateSchemaElementName, model, EdmErrorCode.DuplicateFunctions, - Strings.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes("n.s.GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_ModelDuplicateBoundFunctionParameterTypes, "n.s.GetStuff")); } // TODO: Need to add tests where a function or action conflict with an existing Type, should fail. @@ -742,7 +742,7 @@ public void FunctionWithSameNameAsEntityTypeShouldError() ValidationRules.ModelDuplicateSchemaElementName, model, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined("n.s.GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined, "n.s.GetStuff")); } // TODO: Need to add tests where a function or action conflict with an existing Type, in a referenced schema, should fail. @@ -764,7 +764,7 @@ public void FunctionWithSameNameAsEntityTypeInOtherModelShouldError() ValidationRules.ModelDuplicateSchemaElementName, model, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined("n.s.GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined, "n.s.GetStuff")); } /// @@ -791,7 +791,7 @@ public void SameFunctionsShouldInWithOneInReferencedModelShouldRaiseError() ValidationRules.ModelDuplicateSchemaElementName, model, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined("n.s.GetStuff")); + Error.Format(SRResources.EdmModel_Validator_Semantic_SchemaElementNameAlreadyDefined, "n.s.GetStuff")); } #endregion @@ -808,7 +808,7 @@ public void ComplexTypedPropertyWithSameTypeAsDeclaringTypeShouldError() ValidationRules.RecursiveComplexTypedPropertyMustBeOptional, nestedProp, EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, - Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional("nested")); + Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, "nested")); } [Fact] @@ -823,7 +823,7 @@ public void ComplexTypedPropertyWithSameBaseTypeAsDeclaringTypeShouldError() ValidationRules.RecursiveComplexTypedPropertyMustBeOptional, nestedBaseProp, EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, - Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional("nested")); + Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, "nested")); } [Fact] @@ -857,7 +857,7 @@ public void ComplexTypedPropertyWithSameInheritedBaseTypeAsDeclaringTypeShouldEr ValidationRules.RecursiveComplexTypedPropertyMustBeOptional, nestedBaseProp, EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, - Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional("nested")); + Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, "nested")); } [Fact] @@ -874,7 +874,7 @@ public void ComplexTypedPropertyWithSameSecondInheritedBaseTypeAsDeclaringTypeSh ValidationRules.RecursiveComplexTypedPropertyMustBeOptional, nestedBaseProp, EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, - Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional("nested")); + Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, "nested")); } [Fact] @@ -921,7 +921,7 @@ public void MultipleComplexTypedPropertiesWithSameTypeAsDeclaringTypeShouldAllEr foreach (var error in errors) { Assert.Equal(EdmErrorCode.RecursiveComplexTypedPropertyMustBeOptional, error.ErrorCode); - Assert.Equal(Strings.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional("nested" + currentIndex), error.ErrorMessage); + Assert.Equal(Error.Format(SRResources.EdmModel_Validator_Semantic_RecursiveComplexTypedPropertyMustBeOptional, "nested" + currentIndex), error.ErrorMessage); currentIndex++; } } @@ -964,7 +964,7 @@ public void NavigationPropertyWrongMultiplicityForDependent() ValidationRules.NavigationPropertyDependentEndMultiplicity, navProp, EdmErrorCode.InvalidMultiplicityOfDependentEnd, - Strings.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany("nav2")); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidMultiplicityOfDependentEndMustBeMany, "nav2")); } [Fact] @@ -1003,7 +1003,7 @@ public void NavigationPropertyTypeMismatchOnReferentialConstraint() ValidationRules.NavigationPropertyTypeMismatchRelationshipConstraint, navProp, EdmErrorCode.TypeMismatchRelationshipConstraint, - Strings.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint("foreignKey", "ns.type2", "Id1", "type1")); + Error.Format(SRResources.EdmModel_Validator_Semantic_TypeMismatchRelationshipConstraint, "foreignKey", "ns.type2", "Id1", "type1")); } [Fact] @@ -1021,7 +1021,7 @@ public void OperationWithDuplicateParameterNameShouldError() model, function, EdmErrorCode.AlreadyDefined, - Strings.EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate("param1")); + Error.Format(SRResources.EdmModel_Validator_Semantic_ParameterNameAlreadyDefinedDuplicate, "param1")); } [Fact] @@ -1039,7 +1039,7 @@ public void OperationWithOptionalParametersBeforeRequiredShouldError() model, function, EdmErrorCode.RequiredParametersMustPrecedeOptional, - Strings.EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional("param2")); + Error.Format(SRResources.EdmModel_Validator_Semantic_RequiredParametersMustPrecedeOptional, "param2")); } [Fact] @@ -1055,7 +1055,7 @@ public void BoundOperationWithoutParameterShouldError() model, function, EdmErrorCode.BoundOperationMustHaveParameters, - Strings.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters, function.Name)); } [Fact] @@ -1072,7 +1072,7 @@ public void BoundOperationWithOnlyOptionalParametersShouldError() model, function, EdmErrorCode.BoundOperationMustHaveParameters, - Strings.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters(function.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_BoundOperationMustHaveParameters, function.Name)); } [Fact] @@ -1097,7 +1097,7 @@ public void TestInterfaceSingletonTypeOfCollectionOfEntityTypeModel() model, singleton, EdmErrorCode.SingletonTypeMustBeEntityType, - Strings.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType("Collection(NS.Entity)", "Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType, "Collection(NS.Entity)", "Set")); } [Fact] @@ -1121,7 +1121,7 @@ public void TestInterfaceSingletonTypeOfComplexType() model, singleton, EdmErrorCode.SingletonTypeMustBeEntityType, - Strings.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType("NS.ComplexType", "Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_SingletonTypeMustBeEntityType, "NS.ComplexType", "Set")); } [Fact] @@ -1140,7 +1140,7 @@ public void TestInterfaceSingletonTypeOfEdmEntityTypeType() model, singleton, EdmErrorCode.EntityTypeOfSingletonCannotBeEdmEntityType, - Strings.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton("Singleton")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmEntityTypeCannotBeTypeOfSingleton, "Singleton")); } [Fact] @@ -1164,7 +1164,7 @@ public void TestInterfaceEntitySetTypeOfCollectionOfComplexTypeModel() model, entitySet, EdmErrorCode.EntitySetTypeMustBeCollectionOfEntityType, - Strings.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType("Collection(NS.ComplexType)", "Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType, "Collection(NS.ComplexType)", "Set")); } [Fact] @@ -1188,7 +1188,7 @@ public void TestInterfaceEntitySetTypeOfComplexTypeModel() model, entitySet, EdmErrorCode.EntitySetTypeMustBeCollectionOfEntityType, - Strings.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType("NS.ComplexType", "Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType, "NS.ComplexType", "Set")); } [Fact] @@ -1213,7 +1213,7 @@ public void TestInterfaceEntitySetTypeOfNonCollectionModelModel() model, entitySet, EdmErrorCode.EntitySetTypeMustBeCollectionOfEntityType, - Strings.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType("NS.Entity", "Set")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EntitySetTypeMustBeCollectionOfEntityType, "NS.Entity", "Set")); } [Fact] @@ -1225,7 +1225,7 @@ public void TestInterfaceEntityTypeBaseTypeOfEdmEntityType() ValidationRules.StructuredTypeBaseTypeCannotBeAbstractType, entity, EdmErrorCode.EntityTypeBaseTypeCannotBeEdmEntityType, - Strings.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType("Edm.EntityType", "entity", "NS.MyEntity")); + Error.Format(SRResources.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType, "Edm.EntityType", "entity", "NS.MyEntity")); } [Fact] @@ -1237,7 +1237,7 @@ public void TestInterfaceComplexTypeBaseTypeOfEdmEntityType() ValidationRules.StructuredTypeBaseTypeCannotBeAbstractType, complex, EdmErrorCode.ComplexTypeBaseTypeCannotBeEdmComplexType, - Strings.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType("Edm.ComplexType", "complex", "NS.MyComplex")); + Error.Format(SRResources.EdmModel_Validator_Semantic_StructuredTypeBaseTypeCannotBeAbstractType, "Edm.ComplexType", "complex", "NS.MyComplex")); } [Fact] @@ -1249,7 +1249,7 @@ public void TestInterfaceTypeDefinitionUnderlyingTypeOfEdmPrimitiveType() ValidationRules.TypeDefinitionUnderlyingTypeCannotBeEdmPrimitiveType, typeDefinition, EdmErrorCode.TypeDefinitionUnderlyingTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType("type definition", typeDefinition.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType, "type definition", typeDefinition.FullName())); } [Fact] @@ -1261,7 +1261,7 @@ public void TestInterfaceEnumUnderlyingTypeOfEdmPrimitiveType() ValidationRules.EnumUnderlyingTypeCannotBeEdmPrimitiveType, enumType, EdmErrorCode.TypeDefinitionUnderlyingTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType("enumeration", enumType.FullName())); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsUnderlyingType, "enumeration", enumType.FullName())); } [Fact] @@ -1274,7 +1274,7 @@ public void TestInterfaceEntityTypeKeytypeOfEdmPrimitiveType() ValidationRules.EntityTypeKeyTypeCannotBeEdmPrimitiveType, entity, EdmErrorCode.KeyPropertyTypeCannotBeEdmPrimitiveType, - Strings.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey("Id", "NS.Entity")); + Error.Format(SRResources.EdmModel_Validator_Semantic_EdmPrimitiveTypeCannotBeUsedAsTypeOfKey, "Id", "NS.Entity")); } [Fact] @@ -1289,7 +1289,7 @@ public void TestInterfaceEntityTypeCannotDefineDuplicateKey() ValidationRules.EntityTypeInvalidKeyKeyDefinedInAncestor, entity, EdmErrorCode.InvalidKey, - Strings.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass(entity.Name, entity.BaseEntityType().Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass, entity.Name, entity.BaseEntityType().Name)); } [Fact] @@ -1305,7 +1305,7 @@ public void TestInterfaceEntityTypeCannotDefineDuplicateIndirectKey() ValidationRules.EntityTypeInvalidKeyKeyDefinedInAncestor, entity, EdmErrorCode.InvalidKey, - Strings.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass(entity.Name, baseEntity.Name)); + Error.Format(SRResources.EdmModel_Validator_Semantic_InvalidKeyKeyDefinedInBaseClass, entity.Name, baseEntity.Name)); } [Theory] @@ -1332,7 +1332,7 @@ public void TestInterfaceEdmPropertyTypeOfEdmPrimitiveType(EdmTypeKind typeKind) ValidationRules.PropertyTypeCannotBeCollectionOfAbstractType, property, EdmErrorCode.PropertyTypeCannotBeCollectionOfAbstractType, - Strings.EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType(property.Type.FullName(), "Property")); + Error.Format(SRResources.EdmModel_Validator_Semantic_PropertyTypeCannotBeCollectionOfAbstractType, property.Type.FullName(), "Property")); } [Fact] @@ -1348,7 +1348,7 @@ public void TestInterfaceDeclaringTypeOfEntitySetCannotHavePathTypeProperty() ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, entitySet, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "entity set", "Entities")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "entity set", "Entities")); } [Fact] @@ -1364,7 +1364,7 @@ public void TestInterfaceDeclaringTypeOfSingletonCannotHavePathTypeProperty() ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, singleton, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "singleton", "MyEntity")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "singleton", "MyEntity")); } [Fact] @@ -1383,7 +1383,7 @@ public void TestInterfaceComplexTypeOfDeclaringTypeOfEntitySetCannotHavePathType ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, entitySet, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "entity set", "Entities")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "entity set", "Entities")); } [Fact] @@ -1402,7 +1402,7 @@ public void TestInterfaceBaseDeclaringTypeOfEntitySetCannotHavePathTypeProperty( ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, entitySet, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Derived", "entity set", "Deriveds")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Derived", "entity set", "Deriveds")); } [Fact] @@ -1424,7 +1424,7 @@ public void TestInterfaceBaseComplexTypeOfDeclaringTypeOfEntitySetCannotHavePath ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, entitySet, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "entity set", "Entities")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "entity set", "Entities")); } [Fact] @@ -1448,7 +1448,7 @@ public void TestInterfaceTypeOfNavigationPropertyCannotHavePathTypeProperty() ValidationRules.NavigationPropertyTypeCannotHavePathTypeProperty, navigationProperty, EdmErrorCode.TypeOfNavigationPropertyCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty("Collection(NS.OtherEntity)", "NavigationProperty", "NS.Entity")); + Error.Format(SRResources.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty, "Collection(NS.OtherEntity)", "NavigationProperty", "NS.Entity")); } [Fact] @@ -1472,7 +1472,7 @@ public void TestInterfaceTypeOfNavigationPropertyOnComplexCannotHavePathTypeProp ValidationRules.NavigationPropertyTypeCannotHavePathTypeProperty, navigationProperty, EdmErrorCode.TypeOfNavigationPropertyCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty("NS.OtherEntity", "NavigationProperty", "NS.Complex")); + Error.Format(SRResources.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty, "NS.OtherEntity", "NavigationProperty", "NS.Complex")); } [Fact] @@ -1505,7 +1505,7 @@ public void TestInterfaceTypeOfNavigationPropertyOnComplexRecursiveCannotHavePat ValidationRules.NavigationPropertyTypeCannotHavePathTypeProperty, navigationProperty, EdmErrorCode.TypeOfNavigationPropertyCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty("NS.Entity", "NavigationProperty", "NS.Entity")); + Error.Format(SRResources.EdmModel_Validator_Semantic_TypeOfNavigationPropertyCannotHavePathProperty, "NS.Entity", "NavigationProperty", "NS.Entity")); } [Fact] @@ -1532,7 +1532,7 @@ public void TestInterfaceTypeOfDeclaringTypeOfEntitySetRecursiveCannotHavePathTy ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, entitySet, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "entity set", "Entities")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "entity set", "Entities")); } [Fact] @@ -1559,7 +1559,7 @@ public void TestInterfaceTypeOfDeclaringTypeOfSingletonRecursiveCannotHavePathTy ValidationRules.NavigationSourceDeclaringTypeCannotHavePathTypeProperty, singleton, EdmErrorCode.DeclaringTypeOfNavigationSourceCannotHavePathProperty, - Strings.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty("NS.Entity", "singleton", "Me")); + Error.Format(SRResources.EdmModel_Validator_Semantic_DeclaringTypeOfNavigationSourceCannotHavePathProperty, "NS.Entity", "singleton", "Me")); } [Fact] @@ -1579,7 +1579,7 @@ public void TargetOfAnAnnotationIsNotAllowedInAppliesToOfTheTermShouldError() ValidationRules.VocabularyAnnotationTargetAllowedApplyToElement, annotation, EdmErrorCode.AnnotationApplyToNotAllowedAnnotatable, - Strings.EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable("NS.Entity", + Error.Format(SRResources.EdmModel_Validator_Semantic_VocabularyAnnotationApplyToNotAllowedAnnotatable, "NS.Entity", "EntitySet Singleton ActionImport FunctionImport", "Org.OData.Core.V1.ResourcePath")); } diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/GeoJsonObjectReaderTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/GeoJsonObjectReaderTests.cs index f0bf1045c5..13f7adc69b 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/GeoJsonObjectReaderTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/GeoJsonObjectReaderTests.cs @@ -40,28 +40,28 @@ public GeoJsonObjectReaderTests() public void ErrorOnCoordinatesArrayElementPrimitiveNotDouble_MultipleDimension() { var coordinates = new object[] {new object[] {new object[] {1.0, 2.0}, new object[] {3.0, "stingVal"}}}; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, coordinates), Strings.GeoJsonReader_ExpectedNumeric); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, coordinates), SRResources.GeoJsonReader_ExpectedNumeric); } [Fact] public void ErrorOnCoordinatesArrayElementPrimitiveNotDouble_SingleDimension() { var coordinates = new object[] {1.0, true}; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, coordinates), Strings.GeoJsonReader_ExpectedNumeric); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, coordinates), SRResources.GeoJsonReader_ExpectedNumeric); } [Fact] public void ErrorOnCoordinatesArrayElementPrimitiveIsObject() { var coordinates = new object[] {new Dictionary() {{"prop", "value"}}, 1.0}; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, coordinates), Strings.GeoJsonReader_ExpectedNumeric); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, coordinates), SRResources.GeoJsonReader_ExpectedNumeric); } [Fact] public void ErrorOnCoordinatesArrayElementArrayIsObject() { var coordinates = new object[] { new Dictionary() { { "prop", "value" } }, 1.0 }; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, coordinates), Strings.GeoJsonReader_ExpectedArray); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, coordinates), SRResources.GeoJsonReader_ExpectedArray); } [Fact] @@ -72,13 +72,13 @@ public void ErrorOnCoordinatesNotArray() {"type", "Point"}, {"coordinates", 1.0} }; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Strings.GeoJsonReader_ExpectedArray); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), SRResources.GeoJsonReader_ExpectedArray); } [Fact] public void ErrorOnInvalidCrs_CrsValueNotAnObject() { - TestInvalidCrs("badCRSValue", Strings.JsonReaderExtensions_CannotReadValueAsJsonObject("badCRSValue")); + TestInvalidCrs("badCRSValue", Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsJsonObject, "badCRSValue")); } [Fact] @@ -96,7 +96,7 @@ public void ErrorOnInvalidCrs_PropertiesValueNotAnObject() } }; - TestInvalidCrs(crsMembers, Strings.JsonReaderExtensions_CannotReadValueAsJsonObject("badPropertiesValue")); + TestInvalidCrs(crsMembers, Error.Format(SRResources.JsonReaderExtensions_CannotReadValueAsJsonObject, "badPropertiesValue")); } [Fact] @@ -116,7 +116,7 @@ public void ErrorOnInvalidCrs_EmptyProperties() } }; - TestInvalidCrs(crsMembers, Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.CrsNameMemberName)); + TestInvalidCrs(crsMembers, Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.CrsNameMemberName)); } [Fact] @@ -148,7 +148,7 @@ public void ErrorOnInvalidCrs_InvalidType() } }; - TestInvalidCrs(crsMembers, Strings.GeoJsonReader_InvalidCrsType("foo")); + TestInvalidCrs(crsMembers, Error.Format(SRResources.GeoJsonReader_InvalidCrsType, "foo")); } [Fact] @@ -162,14 +162,14 @@ public void ErrorOnInvalidCrs_MissingProperties() }, }; - TestInvalidCrs(crsMembers, Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.CrsPropertiesMemberName)); + TestInvalidCrs(crsMembers, Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.CrsPropertiesMemberName)); } [Fact] public void ErrorOnInvalidCrs_MissingType() { var crsMembers = new Dictionary(); - TestInvalidCrs(crsMembers, Strings.GeoJsonReader_MissingRequiredMember(GeoJsonConstants.TypeMemberName)); + TestInvalidCrs(crsMembers, Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, GeoJsonConstants.TypeMemberName)); } [Fact] @@ -190,27 +190,27 @@ public void ErrorOnInvalidCrs_NullName() public void ErrorOnInvalidGeoJSONTypeName_NotAString() { var input = new Dictionary(){{"type", 55}}; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Strings.JsonReaderExtensions_CannotReadPropertyValueAsString(55, "type")); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Error.Format(SRResources.JsonReaderExtensions_CannotReadPropertyValueAsString, 55, "type")); } [Fact] public void ErrorOnInvalidGeoJSONTypeName_Null() { var input = new Dictionary() { { "type", null } }; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Strings.GeoJsonReader_InvalidTypeName(String.Empty)); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Error.Format(SRResources.GeoJsonReader_InvalidTypeName, String.Empty)); } [Fact] public void ErrorOnInvalidGeoJSONTypeName_UnknownType() { - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Unknown, null), Strings.GeoJsonReader_InvalidTypeName("Unknown")); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Unknown, null), Error.Format(SRResources.GeoJsonReader_InvalidTypeName, "Unknown")); } [Fact] public void ErrorOnInvalidGeoJSONTypeName_WrongCasing() { var input = new Dictionary() { { "type", "point" } }; - SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Strings.GeoJsonReader_InvalidTypeName("point")); + SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(input), Error.Format(SRResources.GeoJsonReader_InvalidTypeName, "point")); } [Fact] @@ -223,7 +223,7 @@ public void ErrorOnMissingCoordinatesMember() // This error should occur regardless of if the pipeline is geography or geometry, so just pick one. var isGeography = true; - SpatialTestUtils.VerifyExceptionThrown(() => SendToPipeline(members, pipeline, isGeography), Strings.GeoJsonReader_MissingRequiredMember("coordinates")); + SpatialTestUtils.VerifyExceptionThrown(() => SendToPipeline(members, pipeline, isGeography), Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, "coordinates")); } [Fact] @@ -236,7 +236,7 @@ public void ErrorOnMissingTypeMember() // This error should occur regardless of if the pipeline is geography or geometry, so just pick one. var isGeography = true; - SpatialTestUtils.VerifyExceptionThrown(() => SendToPipeline(properties, pipeline, isGeography), Strings.GeoJsonReader_MissingRequiredMember("type")); + SpatialTestUtils.VerifyExceptionThrown(() => SendToPipeline(properties, pipeline, isGeography), Error.Format(SRResources.GeoJsonReader_MissingRequiredMember, "type")); } [Fact] @@ -244,7 +244,7 @@ public void ErrorOnNullArrayElement_X() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, new List {null, 75}), - Strings.GeoJsonReader_InvalidNullElement); + SRResources.GeoJsonReader_InvalidNullElement); } [Fact] @@ -252,7 +252,7 @@ public void ErrorOnNullArrayElement_Y() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, new List {32.4, null}), - Strings.GeoJsonReader_InvalidNullElement); + SRResources.GeoJsonReader_InvalidNullElement); } [Fact] @@ -260,7 +260,7 @@ public void ErrorOnPositionLessThan2Elements_MultipleDimensions() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, new List {new List {new List {127.3, -88}, new List {22}}}), - Strings.GeoJsonReader_InvalidPosition); + SRResources.GeoJsonReader_InvalidPosition); } [Fact] @@ -268,7 +268,7 @@ public void ErrorOnPositionLessThan2Elements_SingleDimension() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, new List {1.1}), - Strings.GeoJsonReader_InvalidPosition); + SRResources.GeoJsonReader_InvalidPosition); } [Fact] @@ -276,7 +276,7 @@ public void ErrorOnPositionMoreThan4Elements_MultipleDimensions() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Polygon, new List {new List {new List {127.3, -88}}, new List {new List {22, 88, -121.5, 91.2, 10, 102}}}), - Strings.GeoJsonReader_InvalidPosition); + SRResources.GeoJsonReader_InvalidPosition); } [Fact] @@ -284,7 +284,7 @@ public void ErrorOnPositionMoreThan4Elements_SingleDimension() { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(SpatialType.Point, new List {1.1, 5, -32, 99.11, 6}), - Strings.GeoJsonReader_InvalidPosition); + SRResources.GeoJsonReader_InvalidPosition); } [Fact] @@ -964,21 +964,21 @@ private static void SendToPipeline(IDictionary members, SpatialP private static void TestCrsWithInvalidName(string name) { var crsMembers = CreateCrsMembersWithName(name); - TestInvalidCrs(crsMembers, Strings.GeoJsonReader_InvalidCrsName(name)); + TestInvalidCrs(crsMembers, Error.Format(SRResources.GeoJsonReader_InvalidCrsName, name)); } private static void TestErrorOnUnexpectedArray(SpatialType spatialType, List coordinates) { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(spatialType, coordinates), - Strings.GeoJsonReader_ExpectedNumeric); + SRResources.GeoJsonReader_ExpectedNumeric); } private static void TestErrorOnUnexpectedNumeric(SpatialType spatialType, List coordinates) { SpatialTestUtils.VerifyExceptionThrown(() => ExecuteSendToPipeline(spatialType, coordinates), - Strings.GeoJsonReader_ExpectedArray); + SRResources.GeoJsonReader_ExpectedArray); } private static void TestInvalidCrs(object crsMembers, string error) diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyBuilderImplementationTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyBuilderImplementationTests.cs index 6cf730e82b..0b3691b84e 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyBuilderImplementationTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyBuilderImplementationTests.cs @@ -226,7 +226,7 @@ public void BuilderAccessBeforeEnd() var ex = SpatialTestUtils.RunCatching(() => g = this.builder.ConstructedGeography); Assert.NotNull(ex); - Assert.Equal(ex.Message, Strings.SpatialBuilder_CannotCreateBeforeDrawn); + Assert.Equal(ex.Message, SRResources.SpatialBuilder_CannotCreateBeforeDrawn); this.builder.BeginGeography(SpatialType.Collection); // c2 this.builder.BeginGeography(SpatialType.Point); @@ -236,14 +236,14 @@ public void BuilderAccessBeforeEnd() ex = SpatialTestUtils.RunCatching(() => g = this.builder.ConstructedGeography); Assert.NotNull(ex); - Assert.Equal(ex.Message, Strings.SpatialBuilder_CannotCreateBeforeDrawn); + Assert.Equal(ex.Message, SRResources.SpatialBuilder_CannotCreateBeforeDrawn); this.builder.EndGeography(); // c2 this.builder.BeginGeography(SpatialType.Point); this.builder.EndGeography(); ex = SpatialTestUtils.RunCatching(() => g = this.builder.ConstructedGeography); Assert.NotNull(ex); - Assert.Equal(ex.Message, Strings.SpatialBuilder_CannotCreateBeforeDrawn); + Assert.Equal(ex.Message, SRResources.SpatialBuilder_CannotCreateBeforeDrawn); this.builder.EndGeography(); this.builder.ConstructedGeography.VerifyAsCollection( diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyPointTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyPointTests.cs index c5df03dffd..8a5fbd3ba7 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyPointTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/GeographyPointTests.cs @@ -38,11 +38,11 @@ public void EmptyPoint() double coord; NotSupportedException ex = SpatialTestUtils.RunCatching(() => coord = p.Latitude); Assert.NotNull(ex); - Assert.Equal(Strings.Point_AccessCoordinateWhenEmpty, ex.Message); + Assert.Equal(SRResources.Point_AccessCoordinateWhenEmpty, ex.Message); ex = SpatialTestUtils.RunCatching(() => coord = p.Longitude); Assert.NotNull(ex); - Assert.Equal(Strings.Point_AccessCoordinateWhenEmpty, ex.Message); + Assert.Equal(SRResources.Point_AccessCoordinateWhenEmpty, ex.Message); Assert.False(p.Z.HasValue); Assert.False(p.M.HasValue); diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/GmlReaderTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/GmlReaderTests.cs index 6dbf9ab6ac..a2ad332aa6 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/GmlReaderTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/GmlReaderTests.cs @@ -67,7 +67,7 @@ public void ReadGmlEmptyLinearRing() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_EmptyRingsNotAllowed); + SRResources.GmlReader_EmptyRingsNotAllowed); } [Fact] @@ -81,7 +81,7 @@ 3 7 4 5 SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_UnexpectedElement("MyWeirdElement")); + Error.Format(SRResources.GmlReader_UnexpectedElement, "MyWeirdElement")); } [Fact] @@ -95,7 +95,7 @@ 3 7 4 5 SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidSpatialType("Surface")); + Error.Format(SRResources.GmlReader_InvalidSpatialType, "Surface")); } [Fact] @@ -106,7 +106,7 @@ public void ReadXmlNotOnElement() reader.ReadStartElement(); SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_ExpectReaderAtElement); + SRResources.GmlReader_ExpectReaderAtElement); } [Fact] @@ -116,7 +116,7 @@ public void ReadGmlInvalidSrsName() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidSrsName(GmlConstants.SrsPrefix)); + Error.Format(SRResources.GmlReader_InvalidSrsName, GmlConstants.SrsPrefix)); } [Fact] @@ -127,7 +127,7 @@ public void ReadGmlInvalidTopLevelAttribute() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidAttribute("foo", "gml:Polygon")); + Error.Format(SRResources.GmlReader_InvalidAttribute, "foo", "gml:Polygon")); } [Fact] @@ -138,7 +138,7 @@ public void ReadGmlInvalidAttribute() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidAttribute("srsDimension", "pos")); + Error.Format(SRResources.GmlReader_InvalidAttribute, "srsDimension", "pos")); } [Fact] @@ -149,7 +149,7 @@ public void ReadGmlUnexpectedSrsName() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidAttribute("srsName", "pos")); + Error.Format(SRResources.GmlReader_InvalidAttribute, "srsName", "pos")); } [Fact] @@ -161,7 +161,7 @@ public void ReadGmlUnexpectedSrsNameWhitespace() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_InvalidAttribute("srsName", "pos")); + Error.Format(SRResources.GmlReader_InvalidAttribute, "srsName", "pos")); } [Fact] @@ -196,7 +196,7 @@ public void ReadGmlPosSingleNumber() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_PosNeedTwoNumbers); + SRResources.GmlReader_PosNeedTwoNumbers); } [Fact] @@ -206,7 +206,7 @@ public void ReadGmlPosListSingleNumber() SpatialTestUtils.VerifyExceptionThrown( () => new GmlReader(new SpatialToPositionPipeline()).ReadGeography(reader), - Strings.GmlReader_PosListNeedsEvenCount); + SRResources.GmlReader_PosListNeedsEvenCount); } [Fact] @@ -585,7 +585,7 @@ public void ResetReader() var target = new SpatialToPositionPipeline(); var gmlReader = new GmlReader(target); - SpatialTestUtils.VerifyExceptionThrown(() => gmlReader.ReadGeography(invalidReader), Strings.GmlReader_PosNeedTwoNumbers); + SpatialTestUtils.VerifyExceptionThrown(() => gmlReader.ReadGeography(invalidReader), SRResources.GmlReader_PosNeedTwoNumbers); gmlReader.Reset(); gmlReader.ReadGeography(validReader); Assert.Equal(CoordinateSystem.Geography(1234), target.CoordinateSystem); diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialPipelineTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialPipelineTests.cs index d19a3757bd..8afe5993d2 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialPipelineTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialPipelineTests.cs @@ -66,20 +66,20 @@ public void InvalidPointTest() var pipeline = SpatialImplementation.CurrentImplementation.CreateBuilder(); pipeline.GeographyPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeography); pipeline.GeographyPipeline.BeginGeography(SpatialType.Point); - SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeographyPipeline.BeginFigure(new GeographyPosition(double.NaN, 122, null, null)), Strings.InvalidPointCoordinate(double.NaN, "latitude")); + SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeographyPipeline.BeginFigure(new GeographyPosition(double.NaN, 122, null, null)), Error.Format(SRResources.InvalidPointCoordinate, double.NaN, "latitude")); pipeline.GeographyPipeline.Reset(); pipeline.GeographyPipeline.BeginGeography(SpatialType.Point); - SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeographyPipeline.BeginFigure(new GeographyPosition(47, double.NegativeInfinity, null, null)), Strings.InvalidPointCoordinate(double.NegativeInfinity, "longitude")); + SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeographyPipeline.BeginFigure(new GeographyPosition(47, double.NegativeInfinity, null, null)), Error.Format(SRResources.InvalidPointCoordinate, double.NegativeInfinity, "longitude")); pipeline.GeographyPipeline.Reset(); pipeline.GeometryPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeometry); pipeline.GeometryPipeline.BeginGeometry(SpatialType.Point); - SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeometryPipeline.BeginFigure(new GeometryPosition(double.PositiveInfinity, 122, null, null)), Strings.InvalidPointCoordinate(double.PositiveInfinity, "x")); + SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeometryPipeline.BeginFigure(new GeometryPosition(double.PositiveInfinity, 122, null, null)), Error.Format(SRResources.InvalidPointCoordinate, double.PositiveInfinity, "x")); pipeline.GeometryPipeline.Reset(); pipeline.GeometryPipeline.BeginGeometry(SpatialType.Point); - SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeometryPipeline.BeginFigure(new GeometryPosition(123, double.NaN, null, null)), Strings.InvalidPointCoordinate(double.NaN, "y")); + SpatialTestUtils.VerifyExceptionThrown(() => pipeline.GeometryPipeline.BeginFigure(new GeometryPosition(123, double.NaN, null, null)), Error.Format(SRResources.InvalidPointCoordinate, double.NaN, "y")); pipeline.GeometryPipeline.Reset(); } diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorImplementationTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorImplementationTests.cs index 0880af18a2..07ec7b4046 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorImplementationTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorImplementationTests.cs @@ -23,7 +23,7 @@ public void ValidateLatitude_Geography() var ex = SpatialTestUtils.RunCatching(() => v.BeginFigure(new GeographyPosition(-91, 0, 0, 0))); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidLatitudeCoordinate(-91), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidLatitudeCoordinate, -91), ex.Message); v.Reset(); v.SetCoordinateSystem(NonDefaultGeographicCoords); @@ -31,7 +31,7 @@ public void ValidateLatitude_Geography() ex = SpatialTestUtils.RunCatching(() => v.BeginFigure(new GeographyPosition(91, 0, 0, 0))); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidLatitudeCoordinate(91), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidLatitudeCoordinate, 91), ex.Message); } [Fact] @@ -43,7 +43,7 @@ public void ValidateLongitude_Geography() var ex = SpatialTestUtils.RunCatching(() => v.BeginFigure(new GeographyPosition(0, -15070, 0, 0))); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidLongitudeCoordinate(-15070), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidLongitudeCoordinate, -15070), ex.Message); v.Reset(); v.SetCoordinateSystem(NonDefaultGeographicCoords); @@ -51,7 +51,7 @@ public void ValidateLongitude_Geography() ex = SpatialTestUtils.RunCatching(() => v.BeginFigure(new GeographyPosition(0, 15070, 0, 0))); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidLongitudeCoordinate(15070), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidLongitudeCoordinate, 15070), ex.Message); } [Fact] @@ -65,7 +65,7 @@ public void ValidatePolygonRing_LessThanFour_Geography() v.LineTo(new GeographyPosition(20, 30, 40, 50)); var ex = SpatialTestUtils.RunCatching(v.EndFigure); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidPolygonPoints, ex.Message); + Assert.Equal(SRResources.Validator_InvalidPolygonPoints, ex.Message); } [Fact] @@ -80,7 +80,7 @@ public void ValidatePolygonRing_NotARing_Geography() v.LineTo(new GeographyPosition(20, 50, 40, 50)); var ex = SpatialTestUtils.RunCatching(v.EndFigure); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidPolygonPoints, ex.Message); + Assert.Equal(SRResources.Validator_InvalidPolygonPoints, ex.Message); } [Fact] @@ -126,7 +126,7 @@ public void ValidateNoFullGlobe_Geometry() GeometryPipeline v = new SpatialValidatorImplementation(); var ex = SpatialTestUtils.RunCatching(() => v.BeginGeometry(SpatialType.FullGlobe)); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidType(SpatialType.FullGlobe), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidType, SpatialType.FullGlobe), ex.Message); } [Fact] @@ -140,7 +140,7 @@ public void ValidatePolygonRing_LessThanFour_Geometry() v.LineTo(new GeometryPosition(20, 30, 40, 50)); var ex = SpatialTestUtils.RunCatching(v.EndFigure); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidPolygonPoints, ex.Message); + Assert.Equal(SRResources.Validator_InvalidPolygonPoints, ex.Message); } [Fact] @@ -155,7 +155,7 @@ public void ValidatePolygonRing_NotARing_Geometry() v.LineTo(new GeometryPosition(20, 50, 40, 50)); var ex = SpatialTestUtils.RunCatching(v.EndFigure); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidPolygonPoints, ex.Message); + Assert.Equal(SRResources.Validator_InvalidPolygonPoints, ex.Message); } [Fact] @@ -180,7 +180,7 @@ public void ValidateFullGlobe_Geometry() var ex = SpatialTestUtils.RunCatching(() => v.BeginGeometry(SpatialType.FullGlobe)); Assert.NotNull(ex); - Assert.Equal(Strings.Validator_InvalidType(SpatialType.FullGlobe), ex.Message); + Assert.Equal(Error.Format(SRResources.Validator_InvalidType, SpatialType.FullGlobe), ex.Message); } } } \ No newline at end of file diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorTests.cs index df37e69844..f9cb178717 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/SpatialValidatorTests.cs @@ -449,7 +449,7 @@ public void InvalidPointTest() validator.BeginGeo(SpatialType.Point); SpatialTestUtils.VerifyExceptionThrown( () => validator.BeginFigure(10, 20, double.NaN, 40), - Strings.Validator_InvalidPointCoordinate(10, 20, double.NaN, 40)); + Error.Format(SRResources.Validator_InvalidPointCoordinate, 10, 20, double.NaN, 40)); } } @@ -467,7 +467,7 @@ public void MaxGeometryDepth() SpatialTestUtils.VerifyExceptionThrown( () => validator.BeginGeo(SpatialType.Point), - Strings.Validator_NestingOverflow(28)); + Error.Format(SRResources.Validator_NestingOverflow, 28)); } } @@ -481,7 +481,7 @@ public void CoordinateSystemReset() validator.BeginGeo(SpatialType.MultiPoint); SpatialTestUtils.VerifyExceptionThrown( () => validator.SetCoordinateSystem(CoordinateSystem.DefaultGeography.EpsgId), - Strings.Validator_SridMismatch); + SRResources.Validator_SridMismatch); } } @@ -493,7 +493,7 @@ public void UnexpectedGeometry() validator1.GeographyPipeline.BeginGeography(SpatialType.Point); SpatialTestUtils.VerifyExceptionThrown( () => validator1.GeometryPipeline.BeginGeometry(SpatialType.Point), - Strings.Validator_UnexpectedCall("SetCoordinateSystem", "BeginPoint")); + Error.Format(SRResources.Validator_UnexpectedCall, "SetCoordinateSystem", "BeginPoint")); var validator2 = new SpatialValidatorImplementation(); validator2.GeographyPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeography); @@ -502,14 +502,14 @@ public void UnexpectedGeometry() validator2.GeographyPipeline.EndFigure(); SpatialTestUtils.VerifyExceptionThrown( () => validator2.GeometryPipeline.EndGeometry(), - Strings.Validator_UnexpectedCall("SetCoordinateSystem", "End")); + Error.Format(SRResources.Validator_UnexpectedCall, "SetCoordinateSystem", "End")); var validator3 = new SpatialValidatorImplementation(); validator3.GeometryPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeometry); validator3.GeometryPipeline.BeginGeometry(SpatialType.Point); SpatialTestUtils.VerifyExceptionThrown( () => validator3.GeographyPipeline.BeginGeography(SpatialType.Point), - Strings.Validator_UnexpectedCall("SetCoordinateSystem", "BeginPoint")); + Error.Format(SRResources.Validator_UnexpectedCall, "SetCoordinateSystem", "BeginPoint")); var validator4 = new SpatialValidatorImplementation(); validator4.GeometryPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeometry); @@ -518,7 +518,7 @@ public void UnexpectedGeometry() validator4.GeometryPipeline.EndFigure(); SpatialTestUtils.VerifyExceptionThrown( () => validator4.GeographyPipeline.EndGeography(), - Strings.Validator_UnexpectedCall("SetCoordinateSystem", "End")); + Error.Format(SRResources.Validator_UnexpectedCall, "SetCoordinateSystem", "End")); var validator5 = new SpatialValidatorImplementation(); validator5.GeographyPipeline.SetCoordinateSystem(CoordinateSystem.DefaultGeography); @@ -526,7 +526,7 @@ public void UnexpectedGeometry() SpatialTestUtils.VerifyExceptionThrown( () => validator5.GeometryPipeline.BeginFigure(new GeometryPosition(333, 3333333, 333, 333)), - Strings.Validator_UnexpectedCall("SetCoordinateSystem", "BeginFigure")); + Error.Format(SRResources.Validator_UnexpectedCall, "SetCoordinateSystem", "BeginFigure")); } private static void RunStateValidatorTest(Func setup, params String[] validTransitions) diff --git a/test/FunctionalTests/Microsoft.Spatial.Tests/WellKnownTextSqlFormatterTests.cs b/test/FunctionalTests/Microsoft.Spatial.Tests/WellKnownTextSqlFormatterTests.cs index 11bcc62fba..4d1c71b645 100644 --- a/test/FunctionalTests/Microsoft.Spatial.Tests/WellKnownTextSqlFormatterTests.cs +++ b/test/FunctionalTests/Microsoft.Spatial.Tests/WellKnownTextSqlFormatterTests.cs @@ -303,7 +303,7 @@ private void TestErrorOn3DValueIn2DOnlyMode(string wktValue) Exception ex = SpatialTestUtils.RunCatching(() => readGeography(wktValue)); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_TooManyDimensions, ex.Message); + Assert.Equal(SRResources.WellKnownText_TooManyDimensions, ex.Message); } [Fact] @@ -315,11 +315,11 @@ public void ReadUnknownTagTest() Exception ex = SpatialTestUtils.RunCatching(() => readGeography("SRID=1234;FOO(10 20)")); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_UnknownTaggedText("FOO"), ex.Message); + Assert.Equal(Error.Format(SRResources.WellKnownText_UnknownTaggedText, "FOO"), ex.Message); ex = SpatialTestUtils.RunCatching(() => readGeography("FOO")); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_UnknownTaggedText("FOO"), ex.Message); + Assert.Equal(Error.Format(SRResources.WellKnownText_UnknownTaggedText, "FOO"), ex.Message); } [Fact] @@ -331,7 +331,7 @@ public void ReadUnexpectedCharacter() Exception ex = SpatialTestUtils.RunCatching(() => readGeography("POINT:10 20")); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_UnexpectedCharacter(":"), ex.Message); + Assert.Equal(Error.Format(SRResources.WellKnownText_UnexpectedCharacter, ":"), ex.Message); } [Fact] @@ -343,7 +343,7 @@ public void ReadEmptyString() Exception ex = SpatialTestUtils.RunCatching(() => readGeography("")); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_UnknownTaggedText(""), ex.Message); + Assert.Equal(Error.Format(SRResources.WellKnownText_UnknownTaggedText, ""), ex.Message); } [Fact] @@ -355,7 +355,7 @@ public void ReadUnexpectedToken() Exception ex = SpatialTestUtils.RunCatching(() => readGeography("POINT(10,20)")); Assert.NotNull(ex); - Assert.Equal(Strings.WellKnownText_UnexpectedToken("Number", "", "Type:[7] Text:[,]"), ex.Message); + Assert.Equal(Error.Format(SRResources.WellKnownText_UnexpectedToken, "Number", "", "Type:[7] Text:[,]"), ex.Message); } [Fact]