diff --git a/sln/WebApiOData.Performance.Official.sln b/sln/WebApiOData.Performance.Official.sln index 45fbebb9eb..e398bbde78 100644 --- a/sln/WebApiOData.Performance.Official.sln +++ b/sln/WebApiOData.Performance.Official.sln @@ -36,6 +36,7 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {07010717-A406-417E-B0C8-612DEF0AD8ED} SolutionGuid = {B42AD778-88E0-4927-B2B7-1DB0C895F973} EndGlobalSection EndGlobal diff --git a/src/Microsoft.AspNet.OData.Shared/Common/SRResources1.Designer.cs b/src/Microsoft.AspNet.OData.Shared/Common/SRResources1.Designer.cs new file mode 100644 index 0000000000..3b493b6bbc --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Common/SRResources1.Designer.cs @@ -0,0 +1,2664 @@ +//------------------------------------------------------------------------------ +// +// 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.AspNet.OData.Properties { + 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", "16.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.AspNet.OData.Properties.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 HttpActionContext.ActionDescriptor is null.. + /// + internal static string ActionContextMustHaveDescriptor { + get { + return ResourceManager.GetString("ActionContextMustHaveDescriptor", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HttpActionContext.Request is null.. + /// + internal static string ActionContextMustHaveRequest { + get { + return ResourceManager.GetString("ActionContextMustHaveRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HttpActionExecutedContext.ActionContext is null.. + /// + internal static string ActionExecutedContextMustHaveActionContext { + get { + return ResourceManager.GetString("ActionExecutedContextMustHaveActionContext", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HttpExecutedActionContext.Request is null.. + /// + internal static string ActionExecutedContextMustHaveRequest { + get { + return ResourceManager.GetString("ActionExecutedContextMustHaveRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The action '{0}' is not bound to the collection of entity. Only actions that are bound to entities can have action links.. + /// + internal static string ActionNotBoundToCollectionOfEntity { + get { + return ResourceManager.GetString("ActionNotBoundToCollectionOfEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The action '{0}' is not bound to an entity. Only actions that are bound to entities can have action links.. + /// + internal static string ActionNotBoundToEntity { + get { + return ResourceManager.GetString("ActionNotBoundToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} type of aggregation is not supported.. + /// + internal static string AggregateKindNotSupported { + get { + return ResourceManager.GetString("AggregateKindNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Aggregation method '{0}' is not supported.. + /// + internal static string AggregationMethodNotSupported { + get { + return ResourceManager.GetString("AggregationMethodNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Aggregation '{0}' not supported for property '{1}' of type '{2}'.. + /// + internal static string AggregationNotSupportedForType { + get { + return ResourceManager.GetString("AggregationNotSupportedForType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name of Annotation property '{0}' was already used as the declared property name of open type '{1}'.. + /// + internal static string AnnotationPropertyNameAlreadyUsedAsDeclaredPropertyName { + get { + return ResourceManager.GetString("AnnotationPropertyNameAlreadyUsedAsDeclaredPropertyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $apply query options not supported for LINQ to SQL providers. + /// + internal static string ApplyQueryOptionNotSupportedForLinq2SQL { + get { + return ResourceManager.GetString("ApplyQueryOptionNotSupportedForLinq2SQL", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The query option is not bound to any CLR type. '{0}' is only supported with a query option bound to a CLR type.. + /// + internal static string ApplyToOnUntypedQueryOption { + get { + return ResourceManager.GetString("ApplyToOnUntypedQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The argument must be of type '{0}'.. + /// + internal static string ArgumentMustBeOfType { + get { + return ResourceManager.GetString("ArgumentMustBeOfType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The base type for the derived type constraint set is not specified. . + /// + internal static string BaseTypeNotSpecified { + get { + return ResourceManager.GetString("BaseTypeNotSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The batch request must have '{0}' or '{1}' as the media type.. + /// + internal static string BatchRequestInvalidMediaType { + get { + return ResourceManager.GetString("BatchRequestInvalidMediaType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The batch request must have a boundary specification in the "Content-Type" header.. + /// + internal static string BatchRequestMissingBoundary { + get { + return ResourceManager.GetString("BatchRequestMissingBoundary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'Content' property on the batch request cannot be null.. + /// + internal static string BatchRequestMissingContent { + get { + return ResourceManager.GetString("BatchRequestMissingContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The batch request must have a "Content-Type" header.. + /// + internal static string BatchRequestMissingContentType { + get { + return ResourceManager.GetString("BatchRequestMissingContentType", 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 BinaryOperatorNotSupported { + get { + return ResourceManager.GetString("BinaryOperatorNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' returned a null value. The input stream contains collection items which cannot be added if the instance is null.. + /// + internal static string CannotAddToNullCollection { + get { + return ResourceManager.GetString("CannotAddToNullCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot apply {0} of '{1}' to {2} of '{3}'.. + /// + internal static string CannotApplyETagOfT { + get { + return ResourceManager.GetString("CannotApplyETagOfT", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot apply {0} of '{1}' to {2} of '{3}'.. + /// + internal static string CannotApplyODataQueryOptionsOfT { + get { + return ResourceManager.GetString("CannotApplyODataQueryOptionsOfT", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot automatically bind the navigation property '{0}' on type '{1}' for the entity set or singleton '{2}' because there are two or more matching target entity sets or singletons. The matching entity sets or singletons are: {3}.. + /// + internal static string CannotAutoCreateMultipleCandidates { + get { + return ResourceManager.GetString("CannotAutoCreateMultipleCandidates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot cast $filter of type '{0}' to type '{1}'.. + /// + internal static string CannotCastFilter { + get { + return ResourceManager.GetString("CannotCastFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot Create an instance for the property '{0}'.. + /// + internal static string CannotCreateInstanceForProperty { + get { + return ResourceManager.GetString("CannotCreateInstanceForProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot define keys on type '{0}' deriving from '{1}'. The base type in the entity inheritance hierarchy already contains keys.. + /// + internal static string CannotDefineKeysOnDerivedTypes { + get { + return ResourceManager.GetString("CannotDefineKeysOnDerivedTypes", 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.. + /// + internal static string CannotDeserializeUnknownProperty { + get { + return ResourceManager.GetString("CannotDeserializeUnknownProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find parser designed to handle '{0}' query options payload. + /// + internal static string CannotFindParserForRequestMediaType { + get { + return ResourceManager.GetString("CannotFindParserForRequestMediaType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot Get the Enum Clr member using '{0}'.. + /// + internal static string CannotGetEnumClrMember { + get { + return ResourceManager.GetString("CannotGetEnumClrMember", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot determine the Edm type for the CLR type '{0}' because the derived type '{1}' is configured as entity type and another derived type '{2}' is configured as complex type.. + /// + internal static string CannotInferEdmType { + get { + return ResourceManager.GetString("CannotInferEdmType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An instance of the abstract resource type '{0}' was found. Abstract resource types cannot be instantiated.. + /// + internal static string CannotInstantiateAbstractResourceType { + get { + return ResourceManager.GetString("CannotInstantiateAbstractResourceType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to parse query options payload.. + /// + internal static string CannotParseQueryOptionsPayload { + get { + return ResourceManager.GetString("CannotParseQueryOptionsPayload", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot apply PATCH to navigation property '{0}' on entity type '{1}'.. + /// + internal static string CannotPatchNavigationProperties { + get { + return ResourceManager.GetString("CannotPatchNavigationProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' does not recognize the node with type '{1}'.. + /// + internal static string CannotRecognizeNodeType { + get { + return ResourceManager.GetString("CannotRecognizeNodeType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' cannot be configured as a complex type because the derived type '{1}' is already configured as an entity type.. + /// + internal static string CannotReconfigEntityTypeAsComplexType { + get { + return ResourceManager.GetString("CannotReconfigEntityTypeAsComplexType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot redefine property '{0}' already defined on the base type '{1}'.. + /// + internal static string CannotRedefineBaseTypeProperty { + get { + return ResourceManager.GetString("CannotRedefineBaseTypeProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot re-enable dependency injection for HTTP routes.. + /// + internal static string CannotReEnableDependencyInjection { + get { + return ResourceManager.GetString("CannotReEnableDependencyInjection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot serialize a null '{0}'.. + /// + internal static string CannotSerializerNull { + get { + return ResourceManager.GetString("CannotSerializerNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Annotation dictionary property '{0}' of type '{1}' cannot be set. The Annotation property dictionary must have a setter.. + /// + internal static string CannotSetAnnotationPropertyDictionary { + get { + return ResourceManager.GetString("CannotSetAnnotationPropertyDictionary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dynamic dictionary property '{0}' of type '{1}' cannot be set. The dynamic property dictionary must have a setter.. + /// + internal static string CannotSetDynamicPropertyDictionary { + get { + return ResourceManager.GetString("CannotSetDynamicPropertyDictionary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} cannot write an object of type '{1}'.. + /// + internal static string CannotWriteType { + get { + return ResourceManager.GetString("CannotWriteType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find EdmType corresponding to {0}. + /// + internal static string CantFindEdmType { + get { + return ResourceManager.GetString("CantFindEdmType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given model does not contain the type '{0}'.. + /// + internal static string ClrTypeNotInModel { + get { + return ResourceManager.GetString("ClrTypeNotInModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' of navigation property '{1}' on structural type '{2}' does not have a key defined.. + /// + internal static string CollectionNavigationPropertyEntityTypeDoesntHaveKeyDefined { + get { + return ResourceManager.GetString("CollectionNavigationPropertyEntityTypeDoesntHaveKeyDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the parameter '{1}' does not have an Add method. Consider using a collection type that does have an Add method - for example IList<T> or ICollection<T>.. + /// + internal static string CollectionParameterShouldHaveAddMethod { + get { + return ResourceManager.GetString("CollectionParameterShouldHaveAddMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CollectionProperties must implement IEnumerable<>. The property '{0}' declared on '{1}' does not implement IEnumerable<>.. + /// + internal static string CollectionPropertiesMustReturnIEnumerable { + get { + return ResourceManager.GetString("CollectionPropertiesMustReturnIEnumerable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the property '{1}' on type '{2}' does not have an Add method. Consider using a collection type that does have an Add method - for example IList<T> or ICollection<T>.. + /// + internal static string CollectionShouldHaveAddMethod { + get { + return ResourceManager.GetString("CollectionShouldHaveAddMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the property '{1}' on type '{2}' does not have a Clear method. Consider using a collection type that does have a Clear method, such as IList<T> or ICollection<T>.. + /// + internal static string CollectionShouldHaveClearMethod { + get { + return ResourceManager.GetString("CollectionShouldHaveClearMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type {0} already added as derived type constraint. + /// + internal static string ConstraintAlreadyExists { + get { + return ResourceManager.GetString("ConstraintAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot compare an enum of type '{0}' to an expression of type '{1}'.. + /// + internal static string ConvertToEnumFailed { + get { + return ResourceManager.GetString("ConvertToEnumFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not support CreateODataValue.. + /// + internal static string CreateODataValueNotSupported { + get { + return ResourceManager.GetString("CreateODataValueNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The actual entity type '{0}' is not assignable to the expected type '{1}'.. + /// + internal static string DeltaEntityTypeNotAssignable { + get { + return ResourceManager.GetString("DeltaEntityTypeNotAssignable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find nested resource name '{0}' in parent resource type '{1}'. + /// + internal static string DeltaNestedResourceNameNotFound { + get { + return ResourceManager.GetString("DeltaNestedResourceNameNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot use Delta of type '{0}' on an entity of type '{1}'.. + /// + internal static string DeltaTypeMismatch { + get { + return ResourceManager.GetString("DeltaTypeMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dependent property type '{0}' is not same as the principal property type '{1}. The dependent and principal properties must have must have same types in the same order.. + /// + internal static string DependentAndPrincipalTypeNotMatch { + get { + return ResourceManager.GetString("DependentAndPrincipalTypeNotMatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' does not support Read.. + /// + internal static string DeserializerDoesNotSupportRead { + get { + return ResourceManager.GetString("DeserializerDoesNotSupportRead", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' does not support ReadInline.. + /// + internal static string DoesNotSupportReadInLine { + get { + return ResourceManager.GetString("DoesNotSupportReadInLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate Annotation property name '{0}' found in open type '{1}'. Each Annotation property name must be unique.. + /// + internal static string DuplicateAnnotationPropertyNameFound { + get { + return ResourceManager.GetString("DuplicateAnnotationPropertyNameFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate dynamic property name '{0}' found in open type '{1}'. Each dynamic property name must be unique.. + /// + internal static string DuplicateDynamicPropertyNameFound { + get { + return ResourceManager.GetString("DuplicateDynamicPropertyNameFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate key '{0}' found in segment '{1}'.. + /// + internal static string DuplicateKeyInSegment { + get { + return ResourceManager.GetString("DuplicateKeyInSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The dynamic property '{0}' with Edm type '{1}' cannot be serialized.. + /// + internal static string DynamicPropertyCannotBeSerialized { + get { + return ResourceManager.GetString("DynamicPropertyCannotBeSerialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name of dynamic property '{0}' was already used as the declared property name of open type '{1}'.. + /// + internal static string DynamicPropertyNameAlreadyUsedAsDeclaredPropertyName { + get { + return ResourceManager.GetString("DynamicPropertyNameAlreadyUsedAsDeclaredPropertyName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type name of the dynamic resource set '{0}' is required and cannot be empty. Consider using a OData type annotation explicitly.. + /// + internal static string DynamicResourceSetTypeNameIsRequired { + get { + return ResourceManager.GetString("DynamicResourceSetTypeNameIsRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The edit link builder for the entity set '{0}' returned null. An edit link is required for the location header.. + /// + internal static string EditLinkNullForLocationHeader { + get { + return ResourceManager.GetString("EditLinkNullForLocationHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get property '{0}' of a null EDM object of type '{1}'.. + /// + internal static string EdmComplexObjectNullRef { + get { + return ResourceManager.GetString("EdmComplexObjectNullRef", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property 'EdmObject' of {0} cannot be null.. + /// + internal static string EdmObjectNull { + get { + return ResourceManager.GetString("EdmObjectNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM type of the object of type '{0}' is null. The EDM type of an {1} cannot be null.. + /// + internal static string EdmTypeCannotBeNull { + get { + return ResourceManager.GetString("EdmTypeCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a supported EDM type.. + /// + internal static string EdmTypeNotSupported { + get { + return ResourceManager.GetString("EdmTypeNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property 'ElementClrType' of {0} cannot be null.. + /// + internal static string ElementClrTypeNull { + get { + return ResourceManager.GetString("ElementClrTypeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Key template value '{0}' for key segment '{1}' is empty.. + /// + internal static string EmptyKeyTemplate { + get { + return ResourceManager.GetString("EmptyKeyTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter alias '{0}' in segment '{1}' is empty.. + /// + internal static string EmptyParameterAlias { + get { + return ResourceManager.GetString("EmptyParameterAlias", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Uri '{0}' in the parameter is invalid.. + /// + internal static string EntityReferenceMustHasKeySegment { + get { + return ResourceManager.GetString("EntityReferenceMustHasKeySegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' was already configured with a different EntityType ('{1}').. + /// + internal static string EntitySetAlreadyConfiguredDifferentEntityType { + get { + return ResourceManager.GetString("EntitySetAlreadyConfiguredDifferentEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The related entity set could not be found from the OData path. The related entity set is required to serialize the payload.. + /// + internal static string EntitySetMissingDuringSerialization { + get { + return ResourceManager.GetString("EntitySetMissingDuringSerialization", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set name '{0}' was already configured as a singleton.. + /// + internal static string EntitySetNameAlreadyConfiguredAsSingleton { + get { + return ResourceManager.GetString("EntitySetNameAlreadyConfiguredAsSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No EntitySet exists in the EdmModel with entitySetName '{0}'.. + /// + internal static string EntitySetNotFoundForName { + get { + return ResourceManager.GetString("EntitySetNotFoundForName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' is based on type '{1}' that has no keys defined.. + /// + internal static string EntitySetTypeHasNoKeys { + get { + return ResourceManager.GetString("EntitySetTypeHasNoKeys", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity '{0}' does not have a key defined.. + /// + internal static string EntityTypeDoesntHaveKeyDefined { + get { + return ResourceManager.GetString("EntityTypeDoesntHaveKeyDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity type '{0}' does not match the expected entity type '{1}' as set on the query context.. + /// + internal static string EntityTypeMismatch { + get { + return ResourceManager.GetString("EntityTypeMismatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The enum type '{0}' does not exist.. + /// + internal static string EnumTypeDoesNotExist { + get { + return ResourceManager.GetString("EnumTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of enum member '{0}' cannot be converted to a long type.. + /// + internal static string EnumValueCannotBeLong { + get { + return ResourceManager.GetString("EnumValueCannotBeLong", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of left property '{0}.{1}' is '{2}' while the type of right property '{3}.{4}' is '{5}'. The left and right type of the equal expression must be same.. + /// + internal static string EqualExpressionsMustHaveSameTypes { + get { + return ResourceManager.GetString("EqualExpressionsMustHaveSameTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not supported by the ODataErrorSerializer. The type must be ODataError or HttpError.. + /// + internal static string ErrorTypeMustBeODataErrorOrHttpError { + get { + return ResourceManager.GetString("ErrorTypeMustBeODataErrorOrHttpError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ETag is not well-formed.. + /// + internal static string ETagNotWellFormed { + get { + return ResourceManager.GetString("ETagNotWellFormed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $filter in $expand of reference navigation property '{0}' is not expected type '{1}'. + /// + internal static string ExpandFilterExpressionNotLambdaExpression { + get { + return ResourceManager.GetString("ExpandFilterExpressionNotLambdaExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create an EDM model as the action '{0}' on controller '{1}' has a void return type.. + /// + internal static string FailedToBuildEdmModelBecauseReturnTypeIsNull { + get { + return ResourceManager.GetString("FailedToBuildEdmModelBecauseReturnTypeIsNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot create an EDM model as the action '{0}' on controller '{1}' has a return type '{2}' that does not implement IEnumerable<T>.. + /// + internal static string FailedToRetrieveTypeToBuildEdmModel { + get { + return ResourceManager.GetString("FailedToRetrieveTypeToBuildEdmModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reading type '{0}' is not supported by '{1}'.. + /// + internal static string FormatterReadIsNotSupportedForType { + get { + return ResourceManager.GetString("FormatterReadIsNotSupportedForType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function '{0}' is not bound to the collection of entity. Only functions that are bound to entities can have function links.. + /// + internal static string FunctionNotBoundToCollectionOfEntity { + get { + return ResourceManager.GetString("FunctionNotBoundToCollectionOfEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function '{0}' is not bound to an entity. Only functions that are bound to entities can have function links.. + /// + internal static string FunctionNotBoundToEntity { + get { + return ResourceManager.GetString("FunctionNotBoundToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' function cannot be applied to an enumeration-typed argument.. + /// + internal static string FunctionNotSupportedOnEnum { + get { + return ResourceManager.GetString("FunctionNotSupportedOnEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function parameter '{0}' cannot be found.. + /// + internal static string FunctionParameterNotFound { + get { + return ResourceManager.GetString("FunctionParameterNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GetEdmModel cannot be called more than once. Consider using a different instance of the model builder or reusing the model you have built earlier.. + /// + internal static string GetEdmModelCalledMoreThanOnce { + get { + return ResourceManager.GetString("GetEdmModelCalledMoreThanOnce", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of the property '{0}' on type '{1}' is an array. Consider adding a setter for the property.. + /// + internal static string GetOnlyCollectionCannotBeArray { + get { + return ResourceManager.GetString("GetOnlyCollectionCannotBeArray", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To register an action link factory, actions must be bindable to the collection of entity. Action '{0}' does not meet this requirement.. + /// + internal static string HasActionLinkRequiresBindToCollectionOfEntity { + get { + return ResourceManager.GetString("HasActionLinkRequiresBindToCollectionOfEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To register an action link factory, actions must be bindable to a single entity. Action '{0}' does not meet this requirement.. + /// + internal static string HasActionLinkRequiresBindToEntity { + get { + return ResourceManager.GetString("HasActionLinkRequiresBindToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To register a function link factory, functions must be bindable to the collection of entity. Function '{0}' does not meet this requirement.. + /// + internal static string HasFunctionLinkRequiresBindToCollectionOfEntity { + get { + return ResourceManager.GetString("HasFunctionLinkRequiresBindToCollectionOfEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To register a function link factory, functions must be bindable to a single entity. Function '{0}' does not meet this requirement.. + /// + internal static string HasFunctionLinkRequiresBindToEntity { + get { + return ResourceManager.GetString("HasFunctionLinkRequiresBindToEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Id link builder for the entity set '{0}' returned null. An Id link is required for the OData-EntityId header.. + /// + internal static string IdLinkNullForEntityIdHeader { + get { + return ResourceManager.GetString("IdLinkNullForEntityIdHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The instance annotation for '{0}' with Edm type '{1}' cannot be serialized.. + /// + internal static string InstanceAnnotationCannotBeSerialized { + get { + return ResourceManager.GetString("InstanceAnnotationCannotBeSerialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance Annotation name cannot have a '@' as the first character and cannot have a '.' as first or last character.. + /// + internal static string InstanceAnnotationNotContain { + get { + return ResourceManager.GetString("InstanceAnnotationNotContain", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An Instance Annotation name cannot be null or empty.. + /// + internal static string InstanceAnnotationNotEmpty { + get { + return ResourceManager.GetString("InstanceAnnotationNotEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstanceAnnotation Property name cannot be null or empty.. + /// + internal static string InstanceAnnotationPropertyNotEmpty { + get { + return ResourceManager.GetString("InstanceAnnotationPropertyNotEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance Annotation should have a '.' in it and should not be the first or last character, usually in a format Namespace.TermName. + /// + internal static string InstanceAnnotationShouldContain { + get { + return ResourceManager.GetString("InstanceAnnotationShouldContain", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The attribute routing template contains invalid segment '{0}'.. + /// + internal static string InvalidAttributeRoutingTemplateSegment { + get { + return ResourceManager.GetString("InvalidAttributeRoutingTemplateSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The current batch reader state '{0}' is invalid. The expected state is '{1}'.. + /// + internal static string InvalidBatchReaderState { + get { + return ResourceManager.GetString("InvalidBatchReaderState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid bindingParameter type '{0}'. A bindingParameter must be either an EntityType or a Collection of EntityTypes.. + /// + internal static string InvalidBindingParameterType { + get { + return ResourceManager.GetString("InvalidBindingParameterType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value of $id '{0}' is invalid.. + /// + internal static string InvalidDollarId { + get { + return ResourceManager.GetString("InvalidDollarId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is not a valid entity set name.. + /// + internal static string InvalidEntitySetName { + get { + return ResourceManager.GetString("InvalidEntitySetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ETag handler set in the configuration property is of type '{0}', which does not implement IETagHandler.. + /// + internal static string InvalidETagHandler { + get { + return ResourceManager.GetString("InvalidETagHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' should be less than or equal to '{1}'.. + /// + internal static string InvalidExpansionDepthValue { + get { + return ResourceManager.GetString("InvalidExpansionDepthValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The last segment '{0}' of the select or expand query option is not supported.. + /// + internal static string InvalidLastSegmentInSelectExpandPath { + get { + return ResourceManager.GetString("InvalidLastSegmentInSelectExpandPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given OData path template '{0}' is invalid.. + /// + internal static string InvalidODataPathTemplate { + get { + return ResourceManager.GetString("InvalidODataPathTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The path template '{0}' on the action '{1}' in controller '{2}' is not a valid OData path template. {3}. + /// + internal static string InvalidODataRouteOnAction { + get { + return ResourceManager.GetString("InvalidODataRouteOnAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The given untyped value '{0}' in payload is invalid. Consider using a OData type annotation explicitly.. + /// + internal static string InvalidODataUntypedValue { + get { + return ResourceManager.GetString("InvalidODataUntypedValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The URI segment '{0}' is invalid after the segment '{1}'.. + /// + internal static string InvalidPathSegment { + get { + return ResourceManager.GetString("InvalidPathSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' is not supported as Annotation property annotation. Referenced property must be of type '{1}'.. + /// + internal static string InvalidPropertyInfoForAnnotationPropertyAnnotation { + get { + return ResourceManager.GetString("InvalidPropertyInfoForAnnotationPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' is not supported as dynamic property annotation. Referenced property must be of type '{1}'.. + /// + internal static string InvalidPropertyInfoForDynamicPropertyAnnotation { + get { + return ResourceManager.GetString("InvalidPropertyInfoForDynamicPropertyAnnotation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The mapper provider must return a valid '{0}' instance for the given '{1}' IEdmType.. + /// + internal static string InvalidPropertyMapper { + get { + return ResourceManager.GetString("InvalidPropertyMapper", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key mapping for the property '{0}' can't be null or empty.. + /// + internal static string InvalidPropertyMapping { + get { + return ResourceManager.GetString("InvalidPropertyMapping", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A segment '{0}' within the select or expand query option is not supported.. + /// + internal static string InvalidSegmentInSelectExpandPath { + get { + return ResourceManager.GetString("InvalidSegmentInSelectExpandPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The count of single quotes in non-string literal '{0}' must be 0 or 2 in segment '{1}'.. + /// + internal static string InvalidSingleQuoteCountForNonStringLiteral { + get { + return ResourceManager.GetString("InvalidSingleQuoteCountForNonStringLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is not a valid singleton name. The singleton name cannot contain '.'.. + /// + internal static string InvalidSingletonName { + get { + return ResourceManager.GetString("InvalidSingletonName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The time zone info set in the configuration property is of type '{0}'. The time zone info type must be type '{1}'.. + /// + internal static string InvalidTimeZoneInfo { + get { + return ResourceManager.GetString("InvalidTimeZoneInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Key template value '{0}' for key segment '{1}' does not start with '{{' or ends with '}}'.. + /// + internal static string KeyTemplateMustBeInCurlyBraces { + get { + return ResourceManager.GetString("KeyTemplateMustBeInCurlyBraces", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Key property '{0}' of type '{1}' is null. Key properties cannot have null values.. + /// + internal static string KeyValueCannotBeNull { + get { + return ResourceManager.GetString("KeyValueCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LambdaExpression must have exactly one parameter.. + /// + internal static string LambdaExpressionMustHaveExactlyOneParameter { + get { + return ResourceManager.GetString("LambdaExpressionMustHaveExactlyOneParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The LambdaExpression must have exactly two parameters.. + /// + internal static string LambdaExpressionMustHaveExactlyTwoParameters { + get { + return ResourceManager.GetString("LambdaExpressionMustHaveExactlyTwoParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The literal '{0}' has a bad format in segment '{1}'.. + /// + internal static string LiteralHasABadFormat { + get { + return ResourceManager.GetString("LiteralHasABadFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change multiplicity of the collection navigation property '{0}'.. + /// + internal static string ManyNavigationPropertiesCannotBeChanged { + get { + return ResourceManager.GetString("ManyNavigationPropertiesCannotBeChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on the type '{1}' is being configured as a Many-to-Many navigation property. Many to Many navigation properties must be collections.. + /// + internal static string ManyToManyNavigationPropertyMustReturnCollection { + get { + return ResourceManager.GetString("ManyToManyNavigationPropertyMustReturnCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided mapping does not contain a resource for the resource type '{0}'.. + /// + internal static string MappingDoesNotContainResourceType { + get { + return ResourceManager.GetString("MappingDoesNotContainResourceType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Any/All nesting limit of '{0}' has been exceeded. '{1}' can be configured on ODataQuerySettings or EnableQueryAttribute.. + /// + internal static string MaxAnyAllExpressionLimitExceeded { + get { + return ResourceManager.GetString("MaxAnyAllExpressionLimitExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request includes a $expand path which is too deep. The maximum depth allowed is {0}. To increase the limit, set the '{1}' property on EnableQueryAttribute or ODataValidationSettings, or set the 'MaxDepth' property in ExpandAttribute.. + /// + internal static string MaxExpandDepthExceeded { + get { + return ResourceManager.GetString("MaxExpandDepthExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The node count limit of '{0}' has been exceeded. To increase the limit, set the '{1}' property on EnableQueryAttribute or ODataValidationSettings.. + /// + internal static string MaxNodeLimitExceeded { + get { + return ResourceManager.GetString("MaxNodeLimitExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MemberExpressions must be bound to the LambdaExpression parameter.. + /// + internal static string MemberExpressionsMustBeBoundToLambdaParameter { + get { + return ResourceManager.GetString("MemberExpressionsMustBeBoundToLambdaParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Member '{0}.{1}' is not a property.. + /// + internal static string MemberExpressionsMustBeProperties { + get { + return ResourceManager.GetString("MemberExpressionsMustBeProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing the value of the parameter '{0}' in the function '{1}' calling.. + /// + internal static string MissingConvertNode { + get { + return ResourceManager.GetString("MissingConvertNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the services container for the non-OData route. This can occur when using OData components on the non-OData route and is usually a configuration issue. Call EnableDependencyInjection() to enable OData components on non-OData routes. This may also occur when a request was mistakenly handled by the ASP.NET Core routing layer instead of the OData routing layer, for instance the URL does not include the OData route prefix configured via a call to MapODataServiceRoute().. + /// + internal static string MissingNonODataContainer { + get { + return ResourceManager.GetString("MissingNonODataContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the services container for route '{0}'. This should not happen and represents a bug.. + /// + internal static string MissingODataContainer { + get { + return ResourceManager.GetString("MissingODataContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find '{0}'. The OData services have not been configured. Are you missing a call to AddOData()?. + /// + internal static string MissingODataServices { + get { + return ResourceManager.GetString("MissingODataServices", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The binding context cannot have a null ModelMetadata.. + /// + internal static string ModelBinderUtil_ModelMetadataCannotBeNull { + get { + return ResourceManager.GetString("ModelBinderUtil_ModelMetadataCannotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The binding value '{0}' cannot be bound to the enum type '{1}'.. + /// + internal static string ModelBinderUtil_ValueCannotBeEnum { + get { + return ResourceManager.GetString("ModelBinderUtil_ValueCannotBeEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM model is missing on the read context. The model is required on the read context to deserialize the payload.. + /// + internal static string ModelMissingFromReadContext { + get { + return ResourceManager.GetString("ModelMissingFromReadContext", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found more than one Annotation property container in type '{0}'. Each open type must have at most one Annotation property container.. + /// + internal static string MoreThanOneAnnotationPropertyContainerFound { + get { + return ResourceManager.GetString("MoreThanOneAnnotationPropertyContainerFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found more than one dynamic property container in type '{0}'. Each open type must have at most one dynamic property container.. + /// + internal static string MoreThanOneDynamicPropertyContainerFound { + get { + return ResourceManager.GetString("MoreThanOneDynamicPropertyContainerFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one Operation called '{0}' was found. Try using the other RemoveOperation override.. + /// + internal static string MoreThanOneOperationFound { + get { + return ResourceManager.GetString("MoreThanOneOperationFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found more than one action with name '{0}' bound to the same type '{1}'. Each bound action must have a different binding type or name.. + /// + internal static string MoreThanOneOverloadActionBoundToSameTypeFound { + get { + return ResourceManager.GetString("MoreThanOneOverloadActionBoundToSameTypeFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found more than one unbound action with name '{0}'. Each unbound action must have an unique action name.. + /// + internal static string MoreThanOneUnboundActionFound { + get { + return ResourceManager.GetString("MoreThanOneUnboundActionFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The member '{0}' on type '{1}' contains multiple instances of the attribute '{2}'.. + /// + internal static string MultipleAttributesFound { + get { + return ResourceManager.GetString("MultipleAttributesFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to More than one matching CLR type found for the EDM type {0}.\nThe matching CLR types are {1}.. + /// + internal static string MultipleMatchingClrTypesForEdmType { + get { + return ResourceManager.GetString("MultipleMatchingClrTypesForEdmType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' property on '{1}' must be a Collection property.. + /// + internal static string MustBeCollectionProperty { + get { + return ResourceManager.GetString("MustBeCollectionProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be a Complex property.. + /// + internal static string MustBeComplexProperty { + get { + return ResourceManager.GetString("MustBeComplexProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be a System.DateTime property.. + /// + internal static string MustBeDateTimeProperty { + get { + return ResourceManager.GetString("MustBeDateTimeProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be an Enum property.. + /// + internal static string MustBeEnumProperty { + get { + return ResourceManager.GetString("MustBeEnumProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be a Navigation property.. + /// + internal static string MustBeNavigationProperty { + get { + return ResourceManager.GetString("MustBeNavigationProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be a Primitive property.. + /// + internal static string MustBePrimitiveProperty { + get { + return ResourceManager.GetString("MustBePrimitiveProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' must be a primitive type.. + /// + internal static string MustBePrimitiveType { + get { + return ResourceManager.GetString("MustBePrimitiveType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' on type '{1}' must be a System.TimeSpan property.. + /// + internal static string MustBeTimeSpanProperty { + get { + return ResourceManager.GetString("MustBeTimeSpanProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The multiplicity of the '{0}' property must be '{1}'.. + /// + internal static string MustHaveMatchingMultiplicity { + get { + return ResourceManager.GetString("MustHaveMatchingMultiplicity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property binding path '{0}' is not valid. The last segment must be the navigation property '{1}'.. + /// + internal static string NavigationPropertyBindingPathIsNotValid { + get { + return ResourceManager.GetString("NavigationPropertyBindingPathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the binding type cast segment '{1}' is not a part of the type '{2}' hierarchy.. + /// + internal static string NavigationPropertyBindingPathNotInHierarchy { + get { + return ResourceManager.GetString("NavigationPropertyBindingPathNotInHierarchy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The navigation property binding path segment '{0}' of member type '{1}' is not supported.. + /// + internal static string NavigationPropertyBindingPathNotSupported { + get { + return ResourceManager.GetString("NavigationPropertyBindingPathNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The declaring entity type '{0}' of the given navigation property is not a part of the entity type '{1}' hierarchy of the entity set or singleton '{2}'.. + /// + internal static string NavigationPropertyNotInHierarchy { + get { + return ResourceManager.GetString("NavigationPropertyNotInHierarchy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The related entity set or singleton cannot be found from the OData path. The related entity set or singleton is required to deserialize the payload.. + /// + internal static string NavigationSourceMissingDuringDeserialization { + get { + return ResourceManager.GetString("NavigationSourceMissingDuringDeserialization", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The related entity set or singleton cannot be found from the OData path. The related entity set or singleton is required to serialize the payload.. + /// + internal static string NavigationSourceMissingDuringSerialization { + get { + return ResourceManager.GetString("NavigationSourceMissingDuringSerialization", 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 NavigationSourceTypeHasNoKeys { + get { + return ResourceManager.GetString("NavigationSourceTypeHasNoKeys", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is a nested collection type. Nested collection types are not allowed.. + /// + internal static string NestedCollectionsNotSupported { + get { + return ResourceManager.GetString("NestedCollectionsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find nested property '{0}' on the resource type '{1}'.. + /// + internal static string NestedPropertyNotfound { + get { + return ResourceManager.GetString("NestedPropertyNotfound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No CLR Type specified for this configuration.. + /// + internal static string NoClrTypeSpecified { + get { + return ResourceManager.GetString("NoClrTypeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No key name was found at {0} in segment '{1}'.. + /// + internal static string NoKeyNameFoundInSegment { + get { + return ResourceManager.GetString("NoKeyNameFoundInSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No IEdmType could be found for '{0}'.. + /// + internal static string NoMatchingIEdmTypeFound { + get { + return ResourceManager.GetString("NoMatchingIEdmTypeFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No HTTP resource was found that matches the request URI '{0}'.. + /// + internal static string NoMatchingResource { + get { + return ResourceManager.GetString("NoMatchingResource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A non-null request URI must be provided to determine if a '{0}' matches a given request or response message.. + /// + internal static string NonNullUriRequiredForMediaTypeMapping { + get { + return ResourceManager.GetString("NonNullUriRequiredForMediaTypeMapping", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No non-OData HTTP route registered.. + /// + internal static string NoNonODataHttpRouteRegistered { + get { + return ResourceManager.GetString("NoNonODataHttpRouteRegistered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The requested resource is not a collection. Query options $filter, $orderby, $count, $skip, and $top can be applied only on collections.. + /// + internal static string NonSelectExpandOnSingleEntity { + get { + return ResourceManager.GetString("NonSelectExpandOnSingleEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No routing convention was found to select an action for the OData path with template '{0}'.. + /// + internal static string NoRoutingHandlerToSelectAction { + get { + return ResourceManager.GetString("NoRoutingHandlerToSelectAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a subclass of {1}. Cannot add this derived type constraint.. + /// + internal static string NotADerivedType { + get { + return ResourceManager.GetString("NotADerivedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Arithmetic operator '{0}' is not allowed. To allow it, set the '{1}' property on EnableQueryAttribute or QueryValidationSettings.. + /// + internal static string NotAllowedArithmeticOperator { + get { + return ResourceManager.GetString("NotAllowedArithmeticOperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Function '{0}' is not allowed. To allow it, set the '{1}' property on EnableQueryAttribute or QueryValidationSettings.. + /// + internal static string NotAllowedFunction { + get { + return ResourceManager.GetString("NotAllowedFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Logical operator '{0}' is not allowed. To allow it, set the '{1}' property on EnableQueryAttribute or QueryValidationSettings.. + /// + internal static string NotAllowedLogicalOperator { + get { + return ResourceManager.GetString("NotAllowedLogicalOperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Order by '{0}' is not allowed. To allow it, set the '{1}' property on EnableQueryAttribute or QueryValidationSettings.. + /// + internal static string NotAllowedOrderByProperty { + get { + return ResourceManager.GetString("NotAllowedOrderByProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Query option '{0}' is not allowed. To allow it, set the '{1}' property on EnableQueryAttribute or QueryValidationSettings.. + /// + internal static string NotAllowedQueryOption { + get { + return ResourceManager.GetString("NotAllowedQueryOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The entity set '{0}' cannot be used for $count.. + /// + internal static string NotCountableEntitySetUsedForCount { + get { + return ResourceManager.GetString("NotCountableEntitySetUsedForCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used for $count.. + /// + internal static string NotCountablePropertyUsedForCount { + get { + return ResourceManager.GetString("NotCountablePropertyUsedForCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used in the $expand query option.. + /// + internal static string NotExpandablePropertyUsedInExpand { + get { + return ResourceManager.GetString("NotExpandablePropertyUsedInExpand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used in the $filter query option.. + /// + internal static string NotFilterablePropertyUsedInFilter { + get { + return ResourceManager.GetString("NotFilterablePropertyUsedInFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used for navigation.. + /// + internal static string NotNavigablePropertyUsedInNavigation { + get { + return ResourceManager.GetString("NotNavigablePropertyUsedInNavigation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used in the $select query option.. + /// + internal static string NotSelectablePropertyUsedInSelect { + get { + return ResourceManager.GetString("NotSelectablePropertyUsedInSelect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' cannot be used in the $orderby query option.. + /// + internal static string NotSortablePropertyUsedInOrderBy { + get { + return ResourceManager.GetString("NotSortablePropertyUsedInOrderBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Transformation kind {0} is not supported.. + /// + internal static string NotSupportedTransformationKind { + get { + return ResourceManager.GetString("NotSupportedTransformationKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No value for key '{0}' was found at {1} in segment '{2}'.. + /// + internal static string NoValueLiteralFoundInSegment { + get { + return ResourceManager.GetString("NoValueLiteralFoundInSegment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container built by the container builder must not be null.. + /// + internal static string NullContainer { + get { + return ResourceManager.GetString("NullContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container builder created by the container builder factory must not be null.. + /// + internal static string NullContainerBuilder { + get { + return ResourceManager.GetString("NullContainerBuilder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collections cannot contain null elements.. + /// + internal static string NullElementInCollection { + get { + return ResourceManager.GetString("NullElementInCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ETag handler set in the configuration property must not be null.. + /// + internal static string NullETagHandler { + get { + return ResourceManager.GetString("NullETagHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type verification failed. Expected non-nullable type '{0}' but received a null value.. + /// + internal static string NullOnNonNullableFunctionParameter { + get { + return ResourceManager.GetString("NullOnNonNullableFunctionParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.. + /// + internal static string Object_NotYetInitialized { + get { + return ResourceManager.GetString("Object_NotYetInitialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown function '{0}'.. + /// + internal static string ODataFunctionNotSupported { + get { + return ResourceManager.GetString("ODataFunctionNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation cannot be completed because no ODataPath is available for the request.. + /// + internal static string ODataPathMissing { + get { + return ResourceManager.GetString("ODataPathMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request URI '{0}' does not contain OData path '{1}'.. + /// + internal static string ODataPathNotFound { + get { + return ResourceManager.GetString("ODataPathNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid EntitySetPath detected. '{0}' is not a valid entity set path for operation '{1}'.. + /// + internal static string OperationHasInvalidEntitySetPath { + get { + return ResourceManager.GetString("OperationHasInvalidEntitySetPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation import segment must be a function import segment.. + /// + internal static string OperationImportSegmentMustBeFunction { + get { + return ResourceManager.GetString("OperationImportSegmentMustBeFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The operation segment must be a function segment.. + /// + internal static string OperationSegmentMustBeFunction { + get { + return ResourceManager.GetString("OperationSegmentMustBeFunction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only ordering by properties is supported for non-primitive collections. Expressions are not supported.. + /// + internal static string OrderByClauseNotSupported { + get { + return ResourceManager.GetString("OrderByClauseNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple '$it' nodes are not supported in '$orderby'.. + /// + internal static string OrderByDuplicateIt { + get { + return ResourceManager.GetString("OrderByDuplicateIt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Duplicate property named '{0}' is not supported in '$orderby'.. + /// + internal static string OrderByDuplicateProperty { + get { + return ResourceManager.GetString("OrderByDuplicateProperty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The number of clauses in $orderby query option exceeded the maximum number allowed. The maximum number of $orderby clauses allowed is {0}.. + /// + internal static string OrderByNodeCountExceeded { + get { + return ResourceManager.GetString("OrderByNodeCountExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter alias '{0}' in segment '{1}' does not start with '{{' or ends with '}}'.. + /// + internal static string ParameterAliasMustBeInCurlyBraces { + get { + return ResourceManager.GetString("ParameterAliasMustBeInCurlyBraces", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the parameter '{1}' must be a collection.. + /// + internal static string ParameterTypeIsNotCollection { + get { + return ResourceManager.GetString("ParameterTypeIsNotCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot define property '{0}' in the base type '{1}' as the derived type '{2}' already defines it.. + /// + internal static string PropertyAlreadyDefinedInDerivedType { + get { + return ResourceManager.GetString("PropertyAlreadyDefinedInDerivedType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property '{0}' does not belong to the type '{1}'.. + /// + internal static string PropertyDoesNotBelongToType { + get { + return ResourceManager.GetString("PropertyDoesNotBelongToType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of the property '{1}' on type '{2}' must be a collection.. + /// + internal static string PropertyIsNotCollection { + get { + return ResourceManager.GetString("PropertyIsNotCollection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a boolean.. + /// + internal static string PropertyMustBeBoolean { + get { + return ResourceManager.GetString("PropertyMustBeBoolean", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a DateTimeOffset or Date.. + /// + internal static string PropertyMustBeDateTimeOffsetOrDate { + get { + return ResourceManager.GetString("PropertyMustBeDateTimeOffsetOrDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value with type '{0}' must have type '{1}'.. + /// + internal static string PropertyMustBeEnum { + get { + return ResourceManager.GetString("PropertyMustBeEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a string.. + /// + internal static string PropertyMustBeString { + get { + return ResourceManager.GetString("PropertyMustBeString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a string with a length of 1.. + /// + internal static string PropertyMustBeStringLengthOne { + get { + return ResourceManager.GetString("PropertyMustBeStringLengthOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a string with a maximum length of 1.. + /// + internal static string PropertyMustBeStringMaxLengthOne { + get { + return ResourceManager.GetString("PropertyMustBeStringMaxLengthOne", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value must be a Edm.TimeOfDay.. + /// + internal static string PropertyMustBeTimeOfDay { + get { + return ResourceManager.GetString("PropertyMustBeTimeOfDay", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The PropertyInfo provided must have public 'get' and 'set' accessor methods.. + /// + internal static string PropertyMustHavePublicGetterAndSetter { + get { + return ResourceManager.GetString("PropertyMustHavePublicGetterAndSetter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM instance of type '{0}' is missing the property '{1}'.. + /// + internal static string PropertyNotFound { + get { + return ResourceManager.GetString("PropertyNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property or path {0} isn't available in the current context. It was removed in earlier transformation.. + /// + internal static string PropertyOrPathWasRemovedFromContext { + get { + return ResourceManager.GetString("PropertyOrPathWasRemovedFromContext", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Property should be of Type {0}.. + /// + internal static string PropertyTypeShouldBeOfType { + get { + return ResourceManager.GetString("PropertyTypeShouldBeOfType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value for OData query '{0}' cannot be empty.. + /// + internal static string QueryCannotBeEmpty { + get { + return ResourceManager.GetString("QueryCannotBeEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A model is required for querying. Consider implementing the EnableQueryAttribute.GetModel method never to return a null value.. + /// + internal static string QueryGetModelMustNotReturnNull { + get { + return ResourceManager.GetString("QueryGetModelMustNotReturnNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Queries can not be applied to a response content of type '{0}'. The response content must be an ObjectContent.. + /// + internal static string QueryingRequiresObjectContent { + get { + return ResourceManager.GetString("QueryingRequiresObjectContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Binding OData QueryNode of kind {0} is not supported by {1}.. + /// + internal static string QueryNodeBindingNotSupported { + get { + return ResourceManager.GetString("QueryNodeBindingNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validating OData QueryNode of kind {0} is not supported by {1}.. + /// + internal static string QueryNodeValidationNotSupported { + get { + return ResourceManager.GetString("QueryNodeValidationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The same system query option, irrespective of casing or whether or not it is prefixed with a $, must not be specified more than once for any resource.. + /// + internal static string QueryOptionsMustNotBeRepeated { + get { + return ResourceManager.GetString("QueryOptionsMustNotBeRepeated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Query options in request body not in expected format: {0}. A series of field-value pairs that meet the defined syntax rules expected.. + /// + internal static string QueryOptionsNotInExpectedFormat { + get { + return ResourceManager.GetString("QueryOptionsNotInExpectedFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The query parameter '{0}' is not supported.. + /// + internal static string QueryParameterNotSupported { + get { + return ResourceManager.GetString("QueryParameterNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The OData formatter requires an attached request in order to deserialize. Controller classes must derive from ODataController or be marked with ODataFormattingAttribute. Custom parameter bindings must call GetPerRequestFormatterInstance on each formatter and use these per-request instances.. + /// + internal static string ReadFromStreamAsyncMustHaveRequest { + get { + return ResourceManager.GetString("ReadFromStreamAsyncMustHaveRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rebinding is not supported.. + /// + internal static string RebindingNotSupported { + get { + return ResourceManager.GetString("RebindingNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found unexpected parameter '{0}'.. + /// + internal static string ReferenceNavigationPropertyExpandFilterVisitorUnexpectedParameter { + get { + return ResourceManager.GetString("ReferenceNavigationPropertyExpandFilterVisitorUnexpectedParameter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The '{0}' property '{1}' is already configured to have a relationship with '{2}' property '{3}' in the referential constraint.. + /// + internal static string ReferentialConstraintAlreadyConfigured { + get { + return ResourceManager.GetString("ReferentialConstraintAlreadyConfigured", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Referential constraint for navigation property '{0}' on type '{1}' is not supported. Only required or optional navigation properties support referential constraint.. + /// + internal static string ReferentialConstraintOnManyNavigationPropertyNotSupported { + get { + return ResourceManager.GetString("ReferentialConstraintOnManyNavigationPropertyNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property type '{0}' of the referential constraint is not valid. The referential constraint property type must be primitive type.. + /// + internal static string ReferentialConstraintPropertyTypeNotValid { + get { + return ResourceManager.GetString("ReferentialConstraintPropertyTypeNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A request container already exists on the request.. + /// + internal static string RequestContainerAlreadyExists { + get { + return ResourceManager.GetString("RequestContainerAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request message does not contain an HttpConfiguration object.. + /// + internal static string RequestMustContainConfiguration { + get { + return ResourceManager.GetString("RequestMustContainConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request must have an associated EDM model. Consider using the extension method HttpConfiguration.MapODataServiceRoute to register a route that parses the OData URI and attaches the model information.. + /// + internal static string RequestMustHaveModel { + get { + return ResourceManager.GetString("RequestMustHaveModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request must have an associated OData route name. Consider using the extension request.ODataProperties().RouteName to set a route name.. + /// + internal static string RequestMustHaveODataRouteName { + get { + return ResourceManager.GetString("RequestMustHaveODataRouteName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The last segment of the request URI '{0}' was not recognized as an OData action.. + /// + internal static string RequestNotActionInvocation { + get { + return ResourceManager.GetString("RequestNotActionInvocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request URI '{0}' too short to contain OData path '{1}'.. + /// + internal static string RequestUriTooShortForODataPath { + get { + return ResourceManager.GetString("RequestUriTooShortForODataPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the resource type '{0}' in the model.. + /// + internal static string ResourceTypeNotInModel { + get { + return ResourceManager.GetString("ResourceTypeNotInModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM type '{0}' is already declared as an entity type. Use the method 'ReturnsCollectionFromEntitySet' if the return type is an entity collection.. + /// + internal static string ReturnEntityCollectionWithoutEntitySet { + get { + return ResourceManager.GetString("ReturnEntityCollectionWithoutEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM type '{0}' is already declared as an entity type. Use the method 'ReturnsFromEntitySet' if the return type is an entity.. + /// + internal static string ReturnEntityWithoutEntitySet { + get { + return ResourceManager.GetString("ReturnEntityWithoutEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return type of operation is not specified.. + /// + internal static string ReturnTypeOfOperationNotSpecified { + get { + return ResourceManager.GetString("ReturnTypeOfOperationNotSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'RootElementName' property is required on '{0}'.. + /// + internal static string RootElementNameMissing { + get { + return ResourceManager.GetString("RootElementNameMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The OData route prefix '{0}' on the controller '{1}' starts with a '/'. Route prefixes cannot start with a '/'.. + /// + internal static string RoutePrefixStartsWithSlash { + get { + return ResourceManager.GetString("RoutePrefixStartsWithSlash", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 'select' and 'expand' cannot be both null or empty.. + /// + internal static string SelectExpandEmptyOrNull { + get { + return ResourceManager.GetString("SelectExpandEmptyOrNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to $select does not support selections of type '{0}'.. + /// + internal static string SelectionTypeNotSupported { + get { + return ResourceManager.GetString("SelectionTypeNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' is not a structured type. Only structured types support $select and $expand.. + /// + internal static string SelectNonStructured { + get { + return ResourceManager.GetString("SelectNonStructured", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The action '{0}' on controller '{1}' returned a {2} containing more than one element. {2} must have zero or one elements.. + /// + internal static string SingleResultHasMoreThanOneEntity { + get { + return ResourceManager.GetString("SingleResultHasMoreThanOneEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The singleton '{0}' was already configured with a different EntityType ('{1}').. + /// + internal static string SingletonAlreadyConfiguredDifferentEntityType { + get { + return ResourceManager.GetString("SingletonAlreadyConfiguredDifferentEntityType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The singleton name '{0}' was already configured as an entity set.. + /// + internal static string SingletonNameAlreadyConfiguredAsEntitySet { + get { + return ResourceManager.GetString("SingletonNameAlreadyConfiguredAsEntitySet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to parse the skiptoken value. Skiptoken value should always be server generated.. + /// + internal static string SkipTokenParseError { + get { + return ResourceManager.GetString("SkipTokenParseError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The limit of '{0}' for {1} query has been exceeded. The value from the incoming request is '{2}'.. + /// + internal static string SkipTopLimitExceeded { + get { + return ResourceManager.GetString("SkipTopLimitExceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find the target entity type for the navigation property '{0}' on entity type '{1}'.. + /// + internal static string TargetEntityTypeMissing { + get { + return ResourceManager.GetString("TargetEntityTypeMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' of kind '{1}' is not implemented.. + /// + internal static string TargetKindNotImplemented { + get { + return ResourceManager.GetString("TargetKindNotImplemented", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be configured as a ComplexType. It was previously configured as an EntityType.. + /// + internal static string TypeCannotBeComplexWasEntity { + get { + return ResourceManager.GetString("TypeCannotBeComplexWasEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' cannot be deserialized using the ODataMediaTypeFormatter.. + /// + internal static string TypeCannotBeDeserialized { + get { + return ResourceManager.GetString("TypeCannotBeDeserialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be configured as an EntityType. It was previously configured as a ComplexType.. + /// + internal static string TypeCannotBeEntityWasComplex { + get { + return ResourceManager.GetString("TypeCannotBeEntityWasComplex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' cannot be configured as an enum type.. + /// + internal static string TypeCannotBeEnum { + get { + return ResourceManager.GetString("TypeCannotBeEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' cannot be serialized using the ODataMediaTypeFormatter.. + /// + internal static string TypeCannotBeSerialized { + get { + return ResourceManager.GetString("TypeCannotBeSerialized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' does not inherit from '{1}'.. + /// + internal static string TypeDoesNotInheritFromBaseType { + get { + return ResourceManager.GetString("TypeDoesNotInheritFromBaseType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not an entity type. Only entity types are supported.. + /// + internal static string TypeMustBeEntity { + get { + return ResourceManager.GetString("TypeMustBeEntity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' must be an enum or Nullable<T> where T is an enum type.. + /// + internal static string TypeMustBeEnumOrNullableEnum { + get { + return ResourceManager.GetString("TypeMustBeEnumOrNullableEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a resource set type. Only resource set are supported.. + /// + internal static string TypeMustBeResourceSet { + get { + return ResourceManager.GetString("TypeMustBeResourceSet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of dynamic property '{1}' is not supported.. + /// + internal static string TypeOfDynamicPropertyNotSupported { + get { + return ResourceManager.GetString("TypeOfDynamicPropertyNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type '{0}' of instance annotation '{1}' is not supported.. + /// + internal static string TypeOfInstanceAnnotationNotSupported { + get { + return ResourceManager.GetString("TypeOfInstanceAnnotationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMediaTypeFormatter was unable to determine the base URI for the request. The request must be processed by an OData route for the OData formatter to serialize the response.. + /// + internal static string UnableToDetermineBaseUrl { + get { + return ResourceManager.GetString("UnableToDetermineBaseUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ODataMediaTypeFormatter must be able to determine the metadata URL for a request in order to serialize the response.. + /// + internal static string UnableToDetermineMetadataUrl { + get { + return ResourceManager.GetString("UnableToDetermineMetadataUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validating OData UnaryOperatorNode of kind {0} is not supported by {1}.. + /// + internal static string UnaryNodeValidationNotSupported { + get { + return ResourceManager.GetString("UnaryNodeValidationNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The element type '{0}' of the given collection type '{1}' is not of the type '{2}'.. + /// + internal static string UnexpectedElementType { + get { + return ResourceManager.GetString("UnexpectedElementType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found an unresolved path segment '{0}' in the OData path template '{1}'.. + /// + internal static string UnresolvedPathSegmentInTemplate { + get { + return ResourceManager.GetString("UnresolvedPathSegmentInTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The EDM type '{0}' of kind '{1}' is not supported.. + /// + internal static string UnsupportedEdmType { + get { + return ResourceManager.GetString("UnsupportedEdmType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found unsupported EdmTypeKind '{0}' in list of available types.. + /// + internal static string UnsupportedEdmTypeKind { + get { + return ResourceManager.GetString("UnsupportedEdmTypeKind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported Expression NodeType.. + /// + internal static string UnsupportedExpressionNodeType { + get { + return ResourceManager.GetString("UnsupportedExpressionNodeType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsupported Expression NodeType '{0}'.. + /// + internal static string UnsupportedExpressionNodeTypeWithName { + get { + return ResourceManager.GetString("UnsupportedExpressionNodeTypeWithName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A path within the select or expand query option is not supported.. + /// + internal static string UnsupportedSelectExpandPath { + get { + return ResourceManager.GetString("UnsupportedSelectExpandPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unterminated string literal at {0} in segment '{1}'.. + /// + internal static string UnterminatedStringLiteral { + get { + return ResourceManager.GetString("UnterminatedStringLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The function '{0}' is already bound to another method.. + /// + internal static string UriFunctionClrBinderAlreadyBound { + get { + return ResourceManager.GetString("UriFunctionClrBinderAlreadyBound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The query specified in the URI is not valid. {0}. + /// + internal static string UriQueryStringInvalid { + get { + return ResourceManager.GetString("UriQueryStringInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The property 'Url' of {0} cannot be null.. + /// + internal static string UrlHelperNull { + get { + return ResourceManager.GetString("UrlHelperNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value '{0}' is invalid. {1}. + /// + internal static string ValueIsInvalid { + get { + return ResourceManager.GetString("ValueIsInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not support WriteObjectInline.. + /// + internal static string WriteObjectInlineNotSupported { + get { + return ResourceManager.GetString("WriteObjectInlineNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not support WriteObject.. + /// + internal static string WriteObjectNotSupported { + get { + return ResourceManager.GetString("WriteObjectNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The OData formatter does not support writing client requests. This formatter instance must have an associated request.. + /// + internal static string WriteToStreamAsyncMustHaveRequest { + get { + return ResourceManager.GetString("WriteToStreamAsyncMustHaveRequest", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs b/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs index c2cc1b0e04..da0fd4be23 100644 --- a/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs @@ -387,7 +387,7 @@ private object OnActionExecuted( IWebApiActionDescriptor actionDescriptor, IWebApiRequestMessage request, Func modelFunction, - Func createQueryOptionFunction, + Func createQueryOptionFunction, Action createResponseAction, Action createErrorAction) { @@ -466,9 +466,9 @@ private object OnActionExecuted( /// /// The original queryable instance from the response message. /// - /// The instance constructed based on the incoming request. + /// The instance constructed based on the incoming request. /// - public virtual IQueryable ApplyQuery(IQueryable queryable, ODataQueryOptions queryOptions) + public virtual IQueryable ApplyQuery(IQueryable queryable, IODataQueryOptions queryOptions) { if (queryable == null) { @@ -487,10 +487,10 @@ public virtual IQueryable ApplyQuery(IQueryable queryable, ODataQueryOptions que /// /// The original entity from the response message. /// - /// The instance constructed based on the incoming request. + /// The instance constructed based on the incoming request. /// /// The new entity after the $select and $expand query has been applied to. - public virtual object ApplyQuery(object entity, ODataQueryOptions queryOptions) + public virtual object ApplyQuery(object entity, IODataQueryOptions queryOptions) { if (entity == null) { @@ -588,12 +588,12 @@ private object ExecuteQuery( IWebApiActionDescriptor actionDescriptor, Func modelFunction, IWebApiRequestMessage request, - Func createQueryOptionFunction) + Func createQueryOptionFunction) { ODataQueryContext queryContext = GetODataQueryContext(responseValue, singleResultCollection, actionDescriptor, modelFunction, request.Context.Path); // Create and validate the query options. - ODataQueryOptions queryOptions = createQueryOptionFunction(queryContext); + IODataQueryOptions queryOptions = createQueryOptionFunction(queryContext); // apply the query IEnumerable enumerable = responseValue as IEnumerable; @@ -718,7 +718,7 @@ internal static object SingleOrDefault( /// Validate the select and expand options. /// /// The query options. - internal static void ValidateSelectExpandOnly(ODataQueryOptions queryOptions) + internal static void ValidateSelectExpandOnly(IODataQueryOptions queryOptions) { if (queryOptions.Filter != null || queryOptions.Count != null || queryOptions.OrderBy != null || queryOptions.Skip != null || queryOptions.Top != null) diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs index f98cfce09c..a5882b85b6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs @@ -229,9 +229,9 @@ internal ExpandedReferenceSelectItem CurrentExpandedSelectItem internal SelectItem CurrentSelectItem { get; set; } /// - /// Gets or sets the . + /// Gets or sets the . /// - public ODataQueryOptions QueryOptions { get; internal set; } + public IODataQueryOptions QueryOptions { get; internal set; } /// /// Gets or sets the relative path to the resouce being serialized diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptions.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptions.cs new file mode 100644 index 0000000000..15d8c040ed --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptions.cs @@ -0,0 +1,151 @@ +using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Query.Validators; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +namespace Microsoft.AspNet.OData.Query +{ + /// + /// This defines a composite OData query options that can be used to perform query composition. + /// Currently this only supports $filter, $orderby, $top, $skip, and $count. + /// + [ODataQueryParameterBinding] + [NonValidatingParameterBinding] + public interface IODataQueryOptions + { + /// + /// Gets the given + /// + ODataQueryContext Context { get; } + /// + /// Gets the raw string of all the OData query options + /// + ODataRawQueryOptions RawValues { get; } + /// + /// Gets the . + /// + SelectExpandQueryOption SelectExpand { get; } + /// + /// Gets the . + /// + ApplyQueryOption Apply { get; } + /// + /// Gets the . + /// + FilterQueryOption Filter { get; } + /// + /// Gets the . + /// + OrderByQueryOption OrderBy { get; } + /// + /// Gets the . + /// + SkipQueryOption Skip { get; } + + /// + /// Gets the . + /// + SkipTokenQueryOption SkipToken { get; } + + /// + /// Gets the . + /// + TopQueryOption Top { get; } + + /// + /// Gets the . + /// + CountQueryOption Count { get; } + + /// + /// Gets or sets the query validator. + /// + ODataQueryValidator Validator { get; set; } + + /// + /// Gets the from IfMatch header. + /// + ETag IfMatch { get; } + + /// + /// Gets the from IfNoneMatch header. + /// + ETag IfNoneMatch { get; } + + /// + /// Apply the individual query to the given IQueryable in the right order. + /// + /// The original . + /// The new after the query has been applied to. + IQueryable ApplyTo(IQueryable query); + + /// + /// Apply the individual query to the given IQueryable in the right order. + /// + /// The original . + /// The query parameters that are already applied in queries. + /// The new after the query has been applied to. + IQueryable ApplyTo(IQueryable query, AllowedQueryOptions ignoreQueryOptions); + + /// + /// Apply the individual query to the given IQueryable in the right order. + /// + /// The original . + /// The settings to use in query composition. + /// The query parameters that are already applied in queries. + /// The new after the query has been applied to. + IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions); + + /// + /// Apply the individual query to the given IQueryable in the right order. + /// + /// The original . + /// The settings to use in query composition. + /// The new after the query has been applied to. + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple conversion function and cannot be split up.")] + IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings); + + /// + /// Apply the individual query to the given IQueryable in the right order. + /// + /// The original entity. + /// The that contains all the query application related settings. + /// The query parameters that are already applied in queries. + /// The new entity after the $select and $expand query has been applied to. + /// Only $select and $expand query options can be applied on single entities. This method throws if the query contains any other + /// query options. + object ApplyTo(object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions); + + /// + /// Applies the query to the given entity using the given . + /// + /// The original entity. + /// The that contains all the query application related settings. + /// The new entity after the $select and $expand query has been applied to. + /// Only $select and $expand query options can be applied on single entities. This method throws if the query contains any other + /// query options. + object ApplyTo(object entity, ODataQuerySettings querySettings); + + /// + /// Generates the Stable OrderBy query option based on the existing OrderBy and other query options. + /// + /// An order by query option that ensures stable ordering of the results. + OrderByQueryOption GenerateStableOrder(); + + /// + /// Check if the given query option is the supported query option. + /// + /// The name of the query option. + /// Returns true if the query option is the supported query option. + [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Need lower case string here.")] + bool IsSupportedQueryOption(string queryOptionName); + + /// + /// Validate all OData queries, including $skip, $top, $orderby and $filter, based on the given . + /// It throws an ODataException if validation failed. + /// + /// The instance which contains all the validation settings. + void Validate(ODataValidationSettings validationSettings); + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptionsOfTEntity.cs new file mode 100644 index 0000000000..c9cdc835bb --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IODataQueryOptionsOfTEntity.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNet.OData.Formatter; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.AspNet.OData.Query +{ + /// + /// This defines a composite OData query options that can be used to perform query composition. + /// Currently this only supports $filter, $orderby, $top, $skip. + /// + [ODataQueryParameterBinding] + public interface IODataQueryOptions + : IODataQueryOptions + { + /// + /// Gets the from IfMatch header. + /// + new ETag IfMatch { get; } + + /// + /// Gets the from IfNoneMatch header. + /// + new ETag IfNoneMatch { get; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs index 0406ca70e6..f44d9b2ef1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs @@ -3,10 +3,10 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Routing.Conventions; -using Microsoft.OData.UriParser; +using Microsoft.AspNet.OData.Query; using Microsoft.OData.UriParser.Aggregation; +using Microsoft.OData.UriParser; using ODataPath = Microsoft.AspNet.OData.Routing.ODataPath; namespace Microsoft.AspNet.OData.Interfaces @@ -63,9 +63,9 @@ internal interface IWebApiContext SelectExpandClause ProcessedSelectExpandClause { get; set; } /// - /// Gets or sets the of the request. + /// Gets or sets the of the request. /// - ODataQueryOptions QueryOptions { get; set; } + IODataQueryOptions QueryOptions { get; set; } /// /// Gets or sets the total count for the OData response. diff --git a/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems b/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems index 6b48eccf27..e8cefb77e0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems +++ b/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems @@ -72,6 +72,8 @@ + + diff --git a/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs index 3aa5cfd598..fb28613161 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics.Contracts; using System.Linq; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; namespace Microsoft.AspNet.OData @@ -18,7 +19,8 @@ internal static Type GetEntityClrTypeFromParameterType(Type parameterType) Contract.Assert(parameterType != null); if (parameterType.IsGenericType && - parameterType.GetGenericTypeDefinition() == typeof(ODataQueryOptions<>)) + (parameterType.GetGenericTypeDefinition() == typeof(ODataQueryOptions<>) || + parameterType.GetGenericTypeDefinition() == typeof(IODataQueryOptions<>))) { return parameterType.GetGenericArguments().Single(); } diff --git a/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs b/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs index 3042610b49..63a84ef69c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs @@ -11,6 +11,7 @@ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; using Microsoft.AspNet.OData.Formatter.Serialization; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.OData; using Microsoft.OData.Edm; @@ -184,7 +185,7 @@ public override IQueryable ApplyTo(IQueryable query, SkipTokenQueryOption skipTo } ODataQuerySettings querySettings = skipTokenQueryOption.QuerySettings; - ODataQueryOptions queryOptions = skipTokenQueryOption.QueryOptions; + IODataQueryOptions queryOptions = skipTokenQueryOption.QueryOptions; IList orderByNodes = null; if (queryOptions != null) diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs index 13da5b7cfb..683c3d549c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs @@ -30,6 +30,7 @@ namespace Microsoft.AspNet.OData.Query [ODataQueryParameterBinding] [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Relies on many ODataLib classes.")] public partial class ODataQueryOptions + : IODataQueryOptions { private static readonly MethodInfo _limitResultsGenericMethod = typeof(ODataQueryOptions).GetMethods(BindingFlags.Public | BindingFlags.Static) .Single(mi => mi.Name == "LimitResults" && mi.ContainsGenericParameters && mi.GetParameters().Length == 4); @@ -51,7 +52,7 @@ public partial class ODataQueryOptions private OrderByQueryOption _stableOrderBy; /// - /// Initializes a new instance of the class based on the incoming request and some metadata information from + /// Initializes a new instance of the class based on the incoming request and some metadata information from /// the . /// /// The which contains the and some type information. diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs index 57b2fa5440..60077aeb5b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs @@ -5,6 +5,7 @@ using System.Net.Http.Headers; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Interfaces; namespace Microsoft.AspNet.OData.Query { @@ -13,7 +14,9 @@ namespace Microsoft.AspNet.OData.Query /// Currently this only supports $filter, $orderby, $top, $skip. /// [ODataQueryParameterBinding] - public partial class ODataQueryOptions : ODataQueryOptions + public partial class ODataQueryOptions + : ODataQueryOptions + , IODataQueryOptions { /// /// Gets the from IfMatch header. diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs index cd08e2c96c..654b4a7772 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.OData.Common; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query.Validators; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; @@ -74,7 +75,7 @@ public SkipTokenQueryOption(string rawValue, ODataQueryContext context, ODataQue /// /// Gets or sets the QueryOptions /// - public ODataQueryOptions QueryOptions { get; private set; } + public IODataQueryOptions QueryOptions { get; private set; } /// /// Apply the $skiptoken query to the given IQueryable. @@ -83,7 +84,7 @@ public SkipTokenQueryOption(string rawValue, ODataQueryContext context, ODataQue /// The query settings to use while applying this query option. /// Information about the other query options. /// The new after the skiptoken query has been applied to. - public virtual IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) + public virtual IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) { QuerySettings = querySettings; QueryOptions = queryOptions; @@ -97,7 +98,7 @@ public virtual IQueryable ApplyTo(IQueryable query, ODataQuerySettings /// The query settings to use while applying this query option. /// Information about the other query options. /// The new after the skiptoken query has been applied to. - public virtual IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) + public virtual IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) { QuerySettings = querySettings; QueryOptions = queryOptions; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs index ce907a7388..ba9ba3edc3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; using Microsoft.AspNet.OData.Common; using Microsoft.Extensions.DependencyInjection; using Microsoft.OData; @@ -17,7 +18,7 @@ public class ODataQueryValidator /// /// The OData query to validate. /// The validation settings. - public virtual void Validate(ODataQueryOptions options, ODataValidationSettings validationSettings) + public virtual void Validate(IODataQueryOptions options, ODataValidationSettings validationSettings) { if (options == null) { @@ -62,13 +63,16 @@ public virtual void Validate(ODataQueryOptions options, ODataValidationSettings options.Filter.Validate(validationSettings); } - if (options.Count != null || options.InternalRequest.IsCountRequest()) + if (options is ODataQueryOptions _options) { - ValidateQueryOptionAllowed(AllowedQueryOptions.Count, validationSettings.AllowedQueryOptions); - - if (options.Count != null) + if (_options.Count != null || _options.InternalRequest.IsCountRequest()) { - options.Count.Validate(validationSettings); + ValidateQueryOptionAllowed(AllowedQueryOptions.Count, validationSettings.AllowedQueryOptions); + + if (_options.Count != null) + { + _options.Count.Validate(validationSettings); + } } } diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs index 16c84d23c5..faebf18834 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs @@ -17,7 +17,8 @@ namespace Microsoft.AspNet.OData.Adapters /// /// Adapter class to convert Asp.Net WebApi OData properties to OData WebApi. /// - internal class WebApiContext : IWebApiContext + internal class WebApiContext + : IWebApiContext { /// /// The inner context wrapped by this instance. @@ -100,9 +101,9 @@ public SelectExpandClause ProcessedSelectExpandClause } /// - /// Gets or sets the parsed OData of the request. + /// Gets or sets the parsed OData of the request. /// - public ODataQueryOptions QueryOptions + public IODataQueryOptions QueryOptions { get { return this.innerContext.QueryOptions; } set { this.innerContext.QueryOptions = value; } @@ -134,5 +135,7 @@ public Func TotalCountFunc get { return this.innerContext.TotalCountFunc; } set { this.innerContext.TotalCountFunc = value; } } + + } } diff --git a/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs b/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs index c40d51a4ab..e931f9da03 100644 --- a/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs @@ -143,7 +143,7 @@ private ODataQueryOptions CreateAndValidateQueryOptions(HttpRequestMessage reque /// [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Response disposed after being sent.")] - public virtual void ValidateQuery(HttpRequestMessage request, ODataQueryOptions queryOptions) + public virtual void ValidateQuery(HttpRequestMessage request, IODataQueryOptions queryOptions) { if (request == null) { diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs index b4db1f5ab7..5ab886f27d 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs @@ -9,6 +9,7 @@ using System.Net.Http.Headers; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Routing; using Microsoft.AspNet.OData.Routing.Conventions; @@ -90,7 +91,7 @@ internal int PageSize /// will use this information (if any) while writing the response for /// this request. /// - internal ODataQueryOptions QueryOptions + internal IODataQueryOptions QueryOptions { get { diff --git a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj index a48aa75afc..e0387f992d 100644 --- a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj +++ b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj @@ -60,6 +60,12 @@ Properties\CommonAssemblyInfo.cs + + Properties\SRResources1.Designer.cs + True + True + SRResources.resx + diff --git a/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs index f3c165ed9e..621306bb14 100644 --- a/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.OData /// /// An attribute to disable WebApi model validation for a particular type. /// - [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)] internal sealed partial class NonValidatingParameterBindingAttribute : ParameterBindingAttribute { public override HttpParameterBinding GetBinding(HttpParameterDescriptor parameter) diff --git a/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs index 559d05fe54..4149e320c1 100644 --- a/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.OData /// /// A to bind parameters of type to the OData query from the incoming request. /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] public sealed partial class ODataQueryParameterBindingAttribute : ParameterBindingAttribute { /// diff --git a/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs index 682fe44c8d..718541e094 100644 --- a/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; using System.Net.Http; using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs index 7b013021ec..31d289b9d1 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs @@ -93,15 +93,14 @@ public SelectExpandClause ProcessedSelectExpandClause } /// - /// Gets or sets the parsed of the request. + /// Gets or sets the parsed of the request. /// - public ODataQueryOptions QueryOptions + public IODataQueryOptions QueryOptions { get { // since we wanted to avoid a breaking change by modifying the interface, we cast to check if it is our ODataFeature class before we access the internal property. To be cleaned up with 8.x. - ODataFeature feature = this.innerFeature as ODataFeature; - if (feature != null) + if (this.innerFeature is ODataFeature feature) { return feature.QueryOptions; } @@ -110,8 +109,7 @@ public ODataQueryOptions QueryOptions } set { - ODataFeature feature = this.innerFeature as ODataFeature; - if (feature != null) + if (this.innerFeature is ODataFeature feature) { feature.QueryOptions = value; } @@ -135,8 +133,7 @@ public int PageSize get { // since we wanted to avoid a breaking change by modifying the interface, we cast to check if it is our ODataFeature class before we access the internal property. - ODataFeature feature = this.innerFeature as ODataFeature; - if (feature != null) + if (this.innerFeature is ODataFeature feature) { return feature.PageSize; } @@ -145,8 +142,7 @@ public int PageSize } set { - ODataFeature feature = this.innerFeature as ODataFeature; - if (feature != null) + if (this.innerFeature is ODataFeature feature) { feature.PageSize = value; } diff --git a/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs b/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs index c96e862503..83bfe0b0dc 100644 --- a/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs @@ -12,6 +12,7 @@ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Routing; using Microsoft.AspNetCore.Http; @@ -274,13 +275,14 @@ public override void OnActionExecuted(ActionExecutedContext actionExecutedContex } /// - /// Create and validate a new instance of from a query and context. + /// Create and validate a new instance of from a query and context. /// /// The incoming request. /// The query context. /// - private ODataQueryOptions CreateAndValidateQueryOptions(HttpRequest request, ODataQueryContext queryContext) + private IODataQueryOptions CreateAndValidateQueryOptions(HttpRequest request, ODataQueryContext queryContext) { + RequestQueryData requestQueryData = request.HttpContext.Items[nameof(RequestQueryData)] as RequestQueryData; if (requestQueryData.QueryValidationRunBeforeActionExecution) @@ -288,7 +290,7 @@ private ODataQueryOptions CreateAndValidateQueryOptions(HttpRequest request, ODa return requestQueryData.ProcessedQueryOptions; } - ODataQueryOptions queryOptions = new ODataQueryOptions(queryContext, request); + IODataQueryOptions queryOptions = new ODataQueryOptions(queryContext, request); ValidateQuery(request, queryOptions); @@ -355,11 +357,11 @@ private static BadRequestObjectResult CreateBadRequestResult(string message, Exc /// /// The incoming request. /// - /// The instance constructed based on the incoming request. + /// The instance constructed based on the incoming request. /// [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Response disposed after being sent.")] - public virtual void ValidateQuery(HttpRequest request, ODataQueryOptions queryOptions) + public virtual void ValidateQuery(HttpRequest request, IODataQueryOptions queryOptions) { if (request == null) { @@ -433,7 +435,7 @@ private class RequestQueryData /// Stores the processed query options to be used later if OnActionExecuting was able to verify the query. /// This is because ValidateQuery internally modifies query options (expands are prime example of this). /// - public ODataQueryOptions ProcessedQueryOptions { get; set; } + public IODataQueryOptions ProcessedQueryOptions { get; set; } } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs b/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs index a72736d1fb..989e67fc13 100644 --- a/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNet.OData /// /// This is essentially a . /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] internal sealed partial class NonValidatingParameterBindingAttribute : ModelBinderAttribute, IPropertyValidationFilter { /// diff --git a/src/Microsoft.AspNetCore.OData/ODataFeature.cs b/src/Microsoft.AspNetCore.OData/ODataFeature.cs index 225389920b..c5f74e62f1 100644 --- a/src/Microsoft.AspNetCore.OData/ODataFeature.cs +++ b/src/Microsoft.AspNetCore.OData/ODataFeature.cs @@ -145,9 +145,9 @@ public long? TotalCount public IDictionary RoutingConventionsStore { get; set; } = new Dictionary(); /// - /// Gets or sets the parsed of the request. + /// Gets or sets the parsed of the request. /// - internal ODataQueryOptions QueryOptions { get; set; } + internal IODataQueryOptions QueryOptions { get; set; } /// /// Page size to be used by skiptoken implementation for the top-level resource for the request. diff --git a/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs index 7654037921..29a4448ba2 100644 --- a/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -19,9 +20,9 @@ namespace Microsoft.AspNet.OData { /// - /// A to bind parameters of type to the OData query from the incoming request. + /// A to bind parameters of type to the OData query from the incoming request. /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)] public sealed partial class ODataQueryParameterBindingAttribute : ModelBinderAttribute { /// @@ -88,20 +89,20 @@ public Task BindModelAsync(ModelBindingContext bindingContext) IEdmModel model = userModel != EdmCoreModel.Instance ? userModel : actionDescriptor.GetEdmModel(request, entityClrType); ODataQueryContext entitySetContext = new ODataQueryContext(model, entityClrType, request.ODataFeature().Path); - Func createODataQueryOptions; + Func createODataQueryOptions; object constructorAsObject = null; if (actionDescriptor.Properties.TryGetValue(CreateODataQueryOptionsCtorKey, out constructorAsObject)) { - createODataQueryOptions = (Func)constructorAsObject; + createODataQueryOptions = (Func)constructorAsObject; } else { - createODataQueryOptions = (Func) - Delegate.CreateDelegate(typeof(Func), + createODataQueryOptions = (Func) + Delegate.CreateDelegate(typeof(Func), _createODataQueryOptions.MakeGenericMethod(entityClrType)); }; - ODataQueryOptions parameterValue = createODataQueryOptions(entitySetContext, request); + IODataQueryOptions parameterValue = createODataQueryOptions(entitySetContext, request); bindingContext.Result = ModelBindingResult.Success(parameterValue); } @@ -114,12 +115,17 @@ public static bool IsODataQueryOptions(Type parameterType) { return false; } - return ((parameterType == typeof(ODataQueryOptions)) || + + bool isODataParameter = ((parameterType == typeof(ODataQueryOptions) || + parameterType == typeof(IODataQueryOptions)) || (parameterType.IsGenericType && - parameterType.GetGenericTypeDefinition() == typeof(ODataQueryOptions<>))); + (parameterType.GetGenericTypeDefinition() == typeof(ODataQueryOptions<>) || + parameterType.GetGenericTypeDefinition() == typeof(IODataQueryOptions<>)))); + + return isODataParameter; } - public static ODataQueryOptions CreateODataQueryOptions(ODataQueryContext context, HttpRequest request) + public static IODataQueryOptions CreateODataQueryOptions(ODataQueryContext context, HttpRequest request) { return new ODataQueryOptions(context, request); } diff --git a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs index bb23365a9a..c637a8a1eb 100644 --- a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs +++ b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; using System.Diagnostics.Contracts; using Microsoft.AspNet.OData.Adapters; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNetCore.Http; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs index b08648058a..3c0aebd999 100644 --- a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs @@ -2,8 +2,11 @@ // Licensed under the MIT License. See License.txt in the project root for license information. using Microsoft.AspNet.OData.Common; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; using Microsoft.OData.Edm; +using System; namespace Microsoft.AspNet.OData.Query { @@ -11,7 +14,8 @@ namespace Microsoft.AspNet.OData.Query /// This defines a composite OData query options that can be used to perform query composition. /// Currently this only supports $filter, $orderby, $top, $skip. /// - public partial class ODataQueryOptions : ODataQueryOptions + public partial class ODataQueryOptions + : ODataQueryOptions { /// /// Initializes a new instance of the class based on the incoming request and some metadata information from diff --git a/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs b/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs index 0d48649c55..d2e8e7c935 100644 --- a/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.OData.Common; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; @@ -13,7 +14,7 @@ namespace Microsoft.AspNet.OData.Query /// /// An implementation of that applies an action filter to /// any action with an or return type - /// that doesn't bind a parameter of type . + /// that doesn't bind a parameter of type . /// public class QueryFilterProvider : IFilterProvider { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs index 89dc179b3c..41c65c3642 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs @@ -27,9 +27,9 @@ public DerivedQueryableAttribute() } #if NETCORE - public override void ValidateQuery(Microsoft.AspNetCore.Http.HttpRequest request, ODataQueryOptions queryOptions) + public override void ValidateQuery(Microsoft.AspNetCore.Http.HttpRequest request, IODataQueryOptions queryOptions) #else - public override void ValidateQuery(System.Net.Http.HttpRequestMessage request, ODataQueryOptions queryOptions) + public override void ValidateQuery(System.Net.Http.HttpRequestMessage request, IODataQueryOptions queryOptions) #endif { // Skip validation. diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs index c0186a74d4..dd115aecee 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs @@ -12,9 +12,11 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Formatter; using Microsoft.AspNet.OData.Formatter.Serialization; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Routing; using Microsoft.AspNet.OData.Routing.Conventions; @@ -813,14 +815,17 @@ public async Task RequestProperty_HasCorrectContextUrl() } } - [Fact] - public async Task ODataCollectionSerializer_SerializeIQueryableOfIEdmEntityObject() + + [Theory] + [InlineData(typeof(Class.CollectionSerializerCustomersController))] + [InlineData(typeof(Interface.CollectionSerializerCustomersController))] + public async Task ODataCollectionSerializer_SerializeIQueryableOfIEdmEntityObject(Type controller) { // Arrange ODataConventionModelBuilder builder = ODataConventionModelBuilderFactory.Create(); builder.EntitySet("CollectionSerializerCustomers"); IEdmModel model = builder.GetEdmModel(); - var controllers = new[] { typeof(CollectionSerializerCustomersController) }; + var controllers = new[] { controller }; var server = TestServerFactory.Create(controllers, (config) => { config.MapODataServiceRoute("odata", null, model); @@ -1224,29 +1229,6 @@ private static void AssertMultipleKey(string key1, Date key2, Guid key3) Assert.Equal(new Guid("46538EC2-E497-4DFE-A039-1C22F0999D6C"), key3); } - public class CollectionSerializerCustomer - { - public int ID { get; set; } - public string Name { get; set; } - } - - public class CollectionSerializerCustomersController : TestODataController - { - public ITestActionResult Get(ODataQueryOptions options) - { - IQueryable customers = new[] - { - new CollectionSerializerCustomer{ID = 1, Name = "Name 1"}, - new CollectionSerializerCustomer{ID = 2, Name = "Name 2"}, - new CollectionSerializerCustomer{ID = 3, Name = "Name 3"}, - }.AsQueryable(); - - IQueryable appliedCustomers = options.ApplyTo(customers) as IQueryable; - - return Ok(appliedCustomers); - } - } - private static void AddDataServiceVersionHeaders(HttpRequestMessage request) { request.Headers.Add("OData-Version", "4.0"); @@ -1279,7 +1261,7 @@ private static HttpClient CreateClient(IEdmModel model = null, var controllers = new[] { typeof(MainEntityController), typeof(PeopleController), typeof(EnumCustomersController), - typeof(CollectionSerializerCustomersController), typeof(PresidentController) + typeof(Class.CollectionSerializerCustomersController), typeof(PresidentController) }; var server = TestServerFactory.CreateWithFormatters(controllers, null, (config) => @@ -1325,7 +1307,7 @@ private static HttpClient CreateClient(IEdmModel model = null, var controllers = new[] { typeof(MainEntityController), typeof(PeopleController), typeof(EnumCustomersController), - typeof(CollectionSerializerCustomersController), typeof(PresidentController) + typeof(Class.CollectionSerializerCustomersController), typeof(PresidentController) }; var server = TestServerFactory.CreateWithFormatters(controllers, null, (config) => diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomer.cs new file mode 100644 index 0000000000..38d03edab2 --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomer.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.AspNet.OData.Test.Formatter +{ + public class CollectionSerializerCustomer + { + public int ID { get; set; } + public string Name { get; set; } + } +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomerControllerInterface.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomerControllerInterface.cs new file mode 100644 index 0000000000..e6943544df --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomerControllerInterface.cs @@ -0,0 +1,23 @@ +using System.Linq; +using Microsoft.AspNet.OData.Test.Abstraction; +using Microsoft.AspNet.OData.Query; + +namespace Microsoft.AspNet.OData.Test.Formatter.Interface +{ + public class CollectionSerializerCustomersController : TestODataController + { + public ITestActionResult Get(IODataQueryOptions options) + { + IQueryable customers = new[] + { + new CollectionSerializerCustomer{ID = 1, Name = "Name 1"}, + new CollectionSerializerCustomer{ID = 2, Name = "Name 2"}, + new CollectionSerializerCustomer{ID = 3, Name = "Name 3"}, + }.AsQueryable(); + + IQueryable appliedCustomers = options.ApplyTo(customers) as IQueryable; + + return Ok(appliedCustomers); + } + } +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomersControllerClass.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomersControllerClass.cs new file mode 100644 index 0000000000..2cac6f5b96 --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/SUT/CollectionSerializerCustomersControllerClass.cs @@ -0,0 +1,24 @@ +using System.Linq; +using Microsoft.AspNet.OData.Test.Abstraction; +using Microsoft.AspNet.OData.Query; + +namespace Microsoft.AspNet.OData.Test.Formatter.Class +{ + public class CollectionSerializerCustomersController : TestODataController + { + public ITestActionResult Get(ODataQueryOptions options) + { + IQueryable customers = new[] + { + new CollectionSerializerCustomer{ID = 1, Name = "Name 1"}, + new CollectionSerializerCustomer{ID = 2, Name = "Name 2"}, + new CollectionSerializerCustomer{ID = 3, Name = "Name 3"}, + }.AsQueryable(); + + IQueryable appliedCustomers = options.ApplyTo(customers) as IQueryable; + + return Ok(appliedCustomers); + } + } +} + diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems index 062494493b..68b2e31c82 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems @@ -223,6 +223,9 @@ + + + diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs index 78f8e560af..a83adda3b4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.AspNet.OData.Test.Abstraction; @@ -1268,7 +1269,7 @@ public void ClausesAfterApplyTo_Returns_Correct_Queryable(string filter, List customers = CustomerApplyTestData; // Act @@ -1312,7 +1313,7 @@ public void ClausesWithGroupedOutReferences_Throw_ODataException(string clause) var configuration = RoutingConfigurationFactory.CreateWithRootContainer("OData"); var request = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + clause, configuration, "OData"); - var options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); IEnumerable customers = CustomerApplyTestData; @@ -1344,7 +1345,7 @@ public void StableSortingAndPagingApplyTo_Returns_Correct_Queryable(string filte var configuration = RoutingConfigurationFactory.CreateWithRootContainer("OData"); var request = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + filter, configuration, "OData"); - var options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); IEnumerable customers = CustomerApplyTestData; // Act diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs index ef5cb8de39..13f4925a12 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Net.Http; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Routing; @@ -23,7 +24,7 @@ public void Filter_Works_QueryOptionCaseInsensitive() const string filter = "$FiLtEr=name eQ 'nba'"; // Act - ODataQueryOptions queryOptions = GetQueryOptions(filter); + IODataQueryOptions queryOptions = GetQueryOptions(filter); // Assert Assert.NotNull(queryOptions.Filter); @@ -39,7 +40,7 @@ public void OrderBy_Works_QueryOptionCaseInsensitive() const string orderBy = "$oRdeRby=naMe"; // Act - ODataQueryOptions queryOptions = GetQueryOptions(orderBy); + IODataQueryOptions queryOptions = GetQueryOptions(orderBy); // Assert Assert.NotNull(queryOptions.OrderBy); @@ -55,7 +56,7 @@ public void Select_Works_QueryOptionCaseInsensitive() const string select = "$SeLecT=naMe"; // Act - ODataQueryOptions queryOptions = GetQueryOptions(select); + IODataQueryOptions queryOptions = GetQueryOptions(select); // Assert Assert.NotNull(queryOptions.SelectExpand); @@ -74,7 +75,7 @@ public void Expand_Works_QueryOptionCaseInsensitive() const string expand = "$ExPAnd=ProdUCts"; // Act - ODataQueryOptions queryOptions = GetQueryOptions(expand); + IODataQueryOptions queryOptions = GetQueryOptions(expand); // Assert Assert.NotNull(queryOptions.SelectExpand); @@ -86,7 +87,7 @@ public void Expand_Works_QueryOptionCaseInsensitive() Assert.Equal("Products", segment.NavigationProperty.Name); } - private static ODataQueryOptions GetQueryOptions(string queryOption) + private static IODataQueryOptions GetQueryOptions(string queryOption) { string uri = "Http://localhost/RoutingCustomers?" + queryOption; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs index 78d5411520..b60899a2f6 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs @@ -14,6 +14,7 @@ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Builder.TestModels; using Microsoft.AspNet.OData.Test.Common; @@ -39,6 +40,7 @@ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Builder.TestModels; using Microsoft.AspNet.OData.Test.Common; @@ -249,7 +251,7 @@ public void CanExtractQueryOptionsCorrectly() ); // Act - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); // Assert Assert.Equal("Filter", queryOptions.RawValues.Filter); @@ -285,7 +287,7 @@ public void CanExtractQueryOptionsWithExtraSpacesCorrectly(string clause) ); // Act - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); // Assert Assert.Equal("Filter", queryOptions.RawValues.Filter); @@ -315,7 +317,7 @@ public void ApplyTo_Throws_With_Null_Queryable() "http://server/service/Customers/?$filter=Filter&$select=Select&$orderby=OrderBy&$expand=Expand&$top=10&$skip=20&$count=true&$skiptoken=SkipToken&$deltatoken=DeltaToken" ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => queryOptions.ApplyTo(null), "query"); @@ -332,7 +334,7 @@ public void ApplyTo_With_QuerySettings_Throws_With_Null_Queryable() "http://server/service/Customers/?$filter=Filter&$select=Select&$orderby=OrderBy&$expand=Expand&$top=10&$skip=20&$count=true&$skiptoken=SkipToken&$deltatoken=DeltaToken" ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => queryOptions.ApplyTo(null, new ODataQuerySettings()), "query"); @@ -349,7 +351,7 @@ public void ApplyTo_Throws_With_Null_QuerySettings() "http://server/service/Customers/?$filter=Filter&$select=Select&$orderby=OrderBy&$expand=Expand&$top=10&$skip=20&$count=true&$skiptoken=SkipToken&$deltatoken=DeltaToken" ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); // Act & Assert ExceptionAssert.ThrowsArgumentNull(() => queryOptions.ApplyTo(new Customer[0].AsQueryable(), null), "querySettings"); @@ -368,7 +370,8 @@ public void ApplyTo_Adds_Missing_Keys_To_OrderBy(string oDataQuery, bool ensureS "http://server/service/Customers?" + oDataQuery ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + ODataQuerySettings querySettings = new ODataQuerySettings { EnsureStableOrdering = ensureStableOrdering, @@ -397,7 +400,8 @@ public void ApplyTo_Adds_Missing_NonKey_Properties_To_OrderBy(string oDataQuery, "http://server/service/Customers?" + oDataQuery ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + ODataQuerySettings querySettings = new ODataQuerySettings { EnsureStableOrdering = ensureStableOrdering @@ -426,7 +430,7 @@ public void ApplyTo_Does_Not_Replace_Original_OrderBy_With_Missing_Keys() ); // Act - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); OrderByQueryOption originalOption = queryOptions.OrderBy; ODataQuerySettings querySettings = new ODataQuerySettings(); @@ -463,7 +467,7 @@ public void ContextPropertyGetter() HttpMethod.Get, "http://server/service/Customers" ); - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); var entityType = queryOptions.Context.ElementClrType; Assert.NotNull(entityType); Assert.Equal(typeof(Customer).FullName, entityType.Namespace + "." + entityType.Name); @@ -498,7 +502,7 @@ public void QueryTest(string queryName, string queryValue) } else { - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); if (queryName == "$filter") { @@ -534,7 +538,7 @@ public void MissingQueryReturnsOriginalList() var message = RequestFactory.Create(HttpMethod.Get, uri); // Act - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); // Assert: everything is null Assert.Null(queryOptions.RawValues.OrderBy); @@ -553,7 +557,7 @@ public void OrderbyWithUnknownPropertyThrows() "http://server/service/Customers?$orderby=UnknownProperty" ); - var option = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions option = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ExceptionAssert.Throws(() => { option.ApplyTo(new List().AsQueryable()); @@ -570,7 +574,7 @@ public void CannotConvertBadTopQueryThrows() "http://server/service/Customers?$top=NotANumber" ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ExceptionAssert.Throws(() => options.ApplyTo(Customers), "Invalid value 'NotANumber' for $top query option found. " + @@ -598,7 +602,7 @@ public void CannotConvertBadSkipQueryThrows() "http://server/service/Customers?$skip=NotANumber" ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ExceptionAssert.Throws(() => options.ApplyTo(Customers), "Invalid value 'NotANumber' for $skip query option found. " + @@ -638,7 +642,7 @@ public void ApplyTo_Picks_DefaultOrder(string oDataQuery, Type elementType, stri "http://server/service/entityset?" + oDataQuery ); - var options = new ODataQueryOptions(new ODataQueryContext(model, elementType), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, elementType), message); IQueryable finalQuery = options.ApplyTo(query); string queryExpression = ExpressionStringBuilder.ToString(finalQuery.Expression); @@ -659,7 +663,7 @@ public void ApplyTo_DoesnotPickDefaultOrder_IfSkipAndTopAreNotPresent(string oDa "http://server/service/Customers?" + oDataQuery ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); IQueryable finalQuery = options.ApplyTo(Customers); string queryExpression = finalQuery.Expression.ToString(); @@ -680,7 +684,7 @@ public void ApplyTo_DoesnotPickDefaultOrder_IfOrderByIsPresent(string oDataQuery "http://server/service/Customers?" + oDataQuery ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); IQueryable finalQuery = options.ApplyTo(Customers); string queryExpression = ExpressionStringBuilder.ToString(finalQuery.Expression); @@ -703,7 +707,7 @@ public void ApplyTo_Builds_Default_OrderBy_With_Keys(string oDataQuery, bool ens "http://server/service/Customers?" + oDataQuery ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ODataQuerySettings querySettings = new ODataQuerySettings { EnsureStableOrdering = ensureStableOrdering @@ -731,7 +735,7 @@ public void ApplyTo_Builds_Default_OrderBy_No_Keys(string oDataQuery, bool ensur "http://server/service/Customers?" + oDataQuery ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ODataQuerySettings querySettings = new ODataQuerySettings { EnsureStableOrdering = ensureStableOrdering @@ -755,7 +759,7 @@ public void Validate_ThrowsValidationErrors_ForOrderBy() "http://server/service/Customers?$orderby=CustomerId,Name" ); - var options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); + IODataQueryOptions options = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), message); ODataValidationSettings validationSettings = new ODataValidationSettings { MaxOrderByNodeCount = 1 }; // Act & Assert @@ -811,7 +815,7 @@ public void CanTurnOffAllValidation() ); ODataQueryContext context = ValidationTestHelper.CreateCustomerContext(false); - ODataQueryOptions option = new ODataQueryOptions(context, message); + IODataQueryOptions option = new ODataQueryOptions(context, message); ODataValidationSettings settings = new ODataValidationSettings() { AllowedQueryOptions = AllowedQueryOptions.OrderBy @@ -877,7 +881,7 @@ public void Querying_Primitive_Collections(IQueryable queryable, string query, o { var request = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + query); ODataQueryContext context = new ODataQueryContext(EdmCoreModel.Instance, queryable.ElementType); - ODataQueryOptions options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); queryable = options.ApplyTo(queryable); @@ -913,7 +917,7 @@ public void ODataQueryOptions_IgnoresUnknownOperatorStartingWithDollar() { var request = RequestFactory.Create(HttpMethod.Get, "http://localhost/?$filter=$it eq 6&$unknown=value"); ODataQueryContext context = new ODataQueryContext(EdmCoreModel.Instance, typeof(int)); - ODataQueryOptions options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); var queryable = options.ApplyTo(Enumerable.Range(0, 10).AsQueryable()); @@ -928,7 +932,7 @@ public void ApplyTo_Entity_ThrowsArgumentNull_Entity() var message = RequestFactory.Create(); ODataQueryContext context = new ODataQueryContext(EdmCoreModel.Instance, typeof(int)); - ODataQueryOptions queryOptions = new ODataQueryOptions(context, message); + IODataQueryOptions queryOptions = new ODataQueryOptions(context, message); ExceptionAssert.ThrowsArgumentNull( () => queryOptions.ApplyTo(entity: null, querySettings: new ODataQuerySettings()), @@ -959,7 +963,7 @@ public void ApplyTo_Entity_ThrowsArgumentNull_QuerySettings() var message = RequestFactory.Create(); ODataQueryContext context = new ODataQueryContext(EdmCoreModel.Instance, typeof(int)); - ODataQueryOptions queryOptions = new ODataQueryOptions(context, message); + IODataQueryOptions queryOptions = new ODataQueryOptions(context, message); ExceptionAssert.ThrowsArgumentNull( () => queryOptions.ApplyTo(entity: 42, querySettings: null), @@ -978,7 +982,7 @@ public void ApplyTo_Entity_ThrowsInvalidOperation_IfNonSelectExpand(string param model.Model.SetAnnotationValue(model.Customer, new ClrTypeAnnotation(typeof(Customer))); var request = RequestFactory.Create(HttpMethod.Get, "http://localhost?" + parameter); ODataQueryContext context = new ODataQueryContext(model.Model, typeof(Customer)); - ODataQueryOptions queryOptions = new ODataQueryOptions(context, request); + IODataQueryOptions queryOptions = new ODataQueryOptions(context, request); ExceptionAssert.Throws( () => queryOptions.ApplyTo(42, new ODataQuerySettings()), @@ -995,7 +999,7 @@ public void ApplyTo_Entity_DoesnotApply_IfSetApplied(string queryOption, Allowed var builder = ODataConventionModelBuilderFactory.Create(); builder.EntitySet("Customers"); ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); Customer customer = new Customer { CustomerId = 1, @@ -1027,7 +1031,7 @@ public void ApplyTo_DoesnotApply_IfSetApplied(string queryOption, AllowedQueryOp var builder = ODataConventionModelBuilderFactory.Create(); builder.EntitySet("Customers"); ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions options = new ODataQueryOptions(context, request); + IODataQueryOptions options = new ODataQueryOptions(context, request); IQueryable customers = Enumerable.Range(1, 10).Select( i => new Customer @@ -1076,7 +1080,7 @@ public void ODataQueryOptions_WithUnTypedContext_CanBeBuilt() "http://localhost/?$filter=Id eq 42&$orderby=Id&$skip=42&$top=42&$count=true&$select=Id&$expand=Orders"); // Act - ODataQueryOptions queryOptions = new ODataQueryOptions(context, request); + IODataQueryOptions queryOptions = new ODataQueryOptions(context, request); // Assert Assert.NotNull(queryOptions.Filter); @@ -1173,7 +1177,7 @@ public void DuplicateUnsupportedQueryParametersIgnored() request.EnableHttpDependencyInjectionSupport(); #endif // Act - var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); + IODataQueryOptions queryOptions = new ODataQueryOptions(new ODataQueryContext(model, typeof(Customer)), request); // Assert Assert.Equal("10", queryOptions.RawValues.Top); diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs index ad3c244455..64c2b2b841 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs @@ -7,6 +7,7 @@ using System.Net.Http.Headers; using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Common; @@ -60,7 +61,7 @@ public void Ctor_SuccedsIfEntityTypesMatch() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); Assert.Equal("10", query.Top.RawValue); } @@ -100,7 +101,7 @@ public void GetIfMatchOrNoneMatch_ReturnsETag_SetETagHeaderValue(string header) ODataQueryContext context = new ODataQueryContext(model, typeof(Customer)); // Act - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ETag result = header.Equals("IfMatch") ? query.IfMatch : query.IfNoneMatch; dynamic dynamicResult = result; @@ -124,7 +125,7 @@ public void GetIfMatchOrNoneMatch_ETagIsNull_IfETagHeaderValueNotSet(string head ODataQueryContext context = new ODataQueryContext(model, typeof(Customer)); // Act - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ETag result = header.Equals("IfMatch") ? query.IfMatch : query.IfNoneMatch; // Assert @@ -141,7 +142,7 @@ public void ApplyTo_ThrowsArgument_If_QueryTypeDoesnotMatch() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.ThrowsArgument( () => query.ApplyTo(Enumerable.Empty().AsQueryable()), @@ -159,7 +160,7 @@ public void ApplyTo_Succeeds_If_QueryTypeDerivesFromOptionsType() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.DoesNotThrow( () => query.ApplyTo(Enumerable.Empty().AsQueryable())); @@ -175,7 +176,7 @@ public void ApplyTo_Succeeds_If_QueryTypeMatchesOptionsType() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.DoesNotThrow( () => query.ApplyTo(Enumerable.Empty().AsQueryable())); @@ -191,7 +192,7 @@ public void ApplyTo_WithQuerySettings_ThrowsArgument_If_QueryTypeDoesnotMatch() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.ThrowsArgument( () => query.ApplyTo(Enumerable.Empty().AsQueryable(), new ODataQuerySettings()), @@ -209,7 +210,7 @@ public void ApplyTo_WithQuerySettings_Succeeds_If_QueryTypeDerivesFromOptionsTyp ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.DoesNotThrow( () => query.ApplyTo(Enumerable.Empty().AsQueryable(), new ODataQuerySettings())); @@ -225,7 +226,7 @@ public void ApplyTo_WithQuerySettings_Succeeds_If_QueryTypeMatchesOptionsType() ODataQueryContext context = new ODataQueryContext(builder.GetEdmModel(), typeof(Customer)); - ODataQueryOptions query = new ODataQueryOptions(context, request); + IODataQueryOptions query = new ODataQueryOptions(context, request); ExceptionAssert.DoesNotThrow( () => query.ApplyTo(Enumerable.Empty().AsQueryable(), new ODataQuerySettings())); diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs index 5c34fb2258..2561d2b276 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Net.Http; using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Common; @@ -682,7 +683,7 @@ public void ProcessLevelsCorrectly_WithAutoExpand(string url) model, model.FindDeclaredType("Microsoft.AspNet.OData.Test.Common.Models.AutoExpandCustomer")); var request = RequestFactory.Create(HttpMethod.Get, url); - var queryOption = new ODataQueryOptions(context, request); + ODataQueryOptions queryOption = new ODataQueryOptions(context, request); queryOption.AddAutoSelectExpandProperties(); var selectExpand = queryOption.SelectExpand; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs index c7f0a879f7..62691e1f39 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; +using Microsoft.AspNet.OData.Interfaces; using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Query.Validators; using Microsoft.AspNet.OData.Test.Abstraction; @@ -114,7 +115,7 @@ public void AllowedQueryOptions_SucceedIfAllowed(AllowedQueryOptions allow, stri { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?$" + query); - ODataQueryOptions option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); ODataValidationSettings settings = new ODataValidationSettings() { AllowedQueryOptions = allow, @@ -132,7 +133,7 @@ public void AllowedQueryOptions_ThrowIfNotAllowed(AllowedQueryOptions exclude, s { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + query); - var option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); var expectedMessage = string.Format( "Query option '{0}' is not allowed. " + "To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.", @@ -153,7 +154,7 @@ public void AllowedQueryOptions_ThrowIfNoneAllowed(AllowedQueryOptions unused, s { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + query); - var option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); var expectedMessage = string.Format( "Query option '{0}' is not allowed. " + "To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.", @@ -174,7 +175,7 @@ public void SupportedQueryOptions_SucceedIfGroupAllowed(AllowedQueryOptions unus { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?$" + query); - ODataQueryOptions option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); ODataValidationSettings settings = new ODataValidationSettings() { AllowedQueryOptions = AllowedQueryOptions.Supported, @@ -192,7 +193,7 @@ public void SupportedQueryOptions_ThrowIfGroupNotAllowed(AllowedQueryOptions unu { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + query); - var option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); var expectedMessage = string.Format( "Query option '{0}' is not allowed. " + "To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.", @@ -213,7 +214,7 @@ public void UnsupportedQueryOptions_SucceedIfGroupAllowed(AllowedQueryOptions un { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?$" + query); - ODataQueryOptions option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); ODataValidationSettings settings = new ODataValidationSettings() { AllowedQueryOptions = AllowedQueryOptions.All & ~AllowedQueryOptions.Supported, @@ -231,7 +232,7 @@ public void UnsupportedQueryOptions_ThrowIfGroupNotAllowed(AllowedQueryOptions u { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?" + query); - var option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); var expectedMessage = string.Format( "Query option '{0}' is not allowed. " + "To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.", @@ -251,7 +252,7 @@ public void Validate_ValidatesSelectExpandQueryOption_IfItIsNotNull() { // Arrange var message = RequestFactory.Create(HttpMethod.Get, "http://localhost/?$expand=Contacts/Contacts"); - ODataQueryOptions option = new ODataQueryOptions(_context, message); + IODataQueryOptions option = new ODataQueryOptions(_context, message); Mock selectExpandValidator = new Mock(new DefaultQuerySettings()); option.SelectExpand.Validator = selectExpandValidator.Object; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCSDL.xml b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCsdl.xml similarity index 99% rename from test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCSDL.xml rename to test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCsdl.xml index 4457b9fa98..c824e16dce 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCSDL.xml +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources/ProductsCsdl.xml @@ -70,4 +70,4 @@ - \ No newline at end of file + diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl index f8daaa30ac..769883fcb2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl @@ -431,11 +431,11 @@ public class Microsoft.AspNet.OData.EnableQueryAttribute : System.Web.Http.Filte int MaxTop { public get; public set; } int PageSize { public get; public set; } - public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, ODataQueryOptions queryOptions) - public virtual object ApplyQuery (object entity, ODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, IODataQueryOptions queryOptions) + public virtual object ApplyQuery (object entity, IODataQueryOptions queryOptions) public virtual Microsoft.OData.Edm.IEdmModel GetModel (System.Type elementClrType, System.Net.Http.HttpRequestMessage request, System.Web.Http.Controllers.HttpActionDescriptor actionDescriptor) public virtual void OnActionExecuted (System.Web.Http.Filters.HttpActionExecutedContext actionExecutedContext) - public virtual void ValidateQuery (System.Net.Http.HttpRequestMessage request, ODataQueryOptions queryOptions) + public virtual void ValidateQuery (System.Net.Http.HttpRequestMessage request, IODataQueryOptions queryOptions) } public class Microsoft.AspNet.OData.ETagMessageHandler : System.Net.Http.DelegatingHandler, IDisposable { @@ -2354,9 +2354,48 @@ public enum Microsoft.AspNet.OData.Query.SelectExpandType : int { Disabled = 2 } +<<<<<<< HEAD +[ +NonValidatingParameterBindingAttribute(), +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions { + ApplyQueryOption Apply { public abstract get; } + ODataQueryContext Context { public abstract get; } + CountQueryOption Count { public abstract get; } + FilterQueryOption Filter { public abstract get; } + ETag IfMatch { public abstract get; } + ETag IfNoneMatch { public abstract get; } + OrderByQueryOption OrderBy { public abstract get; } + ODataRawQueryOptions RawValues { public abstract get; } + SelectExpandQueryOption SelectExpand { public abstract get; } + SkipQueryOption Skip { public abstract get; } + SkipTokenQueryOption SkipToken { public abstract get; } + TopQueryOption Top { public abstract get; } + ODataQueryValidator Validator { public abstract get; public abstract set; } + + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) + object ApplyTo (object entity, ODataQuerySettings querySettings) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + OrderByQueryOption GenerateStableOrder () + bool IsSupportedQueryOption (string queryOptionName) + void Validate (ODataValidationSettings validationSettings) +} + +[ +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions`1 : IODataQueryOptions { + ETag`1 IfMatch { public abstract get; } + ETag`1 IfNoneMatch { public abstract get; } +======= public interface Microsoft.AspNet.OData.Query.IODataQueryOptionsParser { bool CanParse (System.Net.Http.HttpRequestMessage request) System.Threading.Tasks.Task`1[[System.String]] ParseAsync (System.IO.Stream requestStream) +>>>>>>> 5a5c585c139cddc3c63488f03daeb97a4b1ba868 } public interface Microsoft.AspNet.OData.Query.IPropertyMapper { @@ -2478,23 +2517,23 @@ public class Microsoft.AspNet.OData.Query.ModelBoundQuerySettings { [ ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions : IODataQueryOptions { public ODataQueryOptions (ODataQueryContext context, System.Net.Http.HttpRequestMessage request) - ApplyQueryOption Apply { public get; } - ODataQueryContext Context { public get; } - CountQueryOption Count { public get; } - FilterQueryOption Filter { public get; } + ApplyQueryOption Apply { public virtual get; } + ODataQueryContext Context { public virtual get; } + CountQueryOption Count { public virtual get; } + FilterQueryOption Filter { public virtual get; } ETag IfMatch { public virtual get; } ETag IfNoneMatch { public virtual get; } - OrderByQueryOption OrderBy { public get; } - ODataRawQueryOptions RawValues { public get; } + OrderByQueryOption OrderBy { public virtual get; } + ODataRawQueryOptions RawValues { public virtual get; } System.Net.Http.HttpRequestMessage Request { public get; } - SelectExpandQueryOption SelectExpand { public get; } - SkipQueryOption Skip { public get; } - SkipTokenQueryOption SkipToken { public get; } - TopQueryOption Top { public get; } - ODataQueryValidator Validator { public get; public set; } + SelectExpandQueryOption SelectExpand { public virtual get; } + SkipQueryOption Skip { public virtual get; } + SkipTokenQueryOption SkipToken { public virtual get; } + TopQueryOption Top { public virtual get; } + ODataQueryValidator Validator { public virtual get; public virtual set; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) @@ -2504,7 +2543,7 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { public virtual object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) public virtual OrderByQueryOption GenerateStableOrder () internal virtual ETag GetETag (System.Net.Http.Headers.EntityTagHeaderValue etagHeaderValue) - public bool IsSupportedQueryOption (string queryOptionName) + public virtual bool IsSupportedQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName, bool isDollarSignOptional) public static IQueryable`1 LimitResults (IQueryable`1 queryable, int limit, out System.Boolean& resultsLimited) @@ -2515,11 +2554,11 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { [ ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions, IODataQueryOptions`1, IODataQueryOptions { public ODataQueryOptions`1 (ODataQueryContext context, System.Net.Http.HttpRequestMessage request) - ETag`1 IfMatch { public get; } - ETag`1 IfNoneMatch { public get; } + ETag`1 IfMatch { public virtual get; } + ETag`1 IfNoneMatch { public virtual get; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) @@ -2693,13 +2732,13 @@ public class Microsoft.AspNet.OData.Query.SkipTokenQueryOption { public SkipTokenQueryOption (string rawValue, ODataQueryContext context, Microsoft.OData.UriParser.ODataQueryOptionParser queryOptionParser) ODataQueryContext Context { public get; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } ODataQuerySettings QuerySettings { public get; } string RawValue { public get; } SkipTokenQueryValidator Validator { public get; } - public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) - public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) + public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) public void Validate (ODataValidationSettings validationSettings) } @@ -3528,7 +3567,7 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerConte Microsoft.OData.Edm.IEdmNavigationProperty NavigationProperty { public get; } Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public get; public set; } ODataPath Path { public get; public set; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } System.Net.Http.HttpRequestMessage Request { public get; public set; } System.Web.Http.Controllers.HttpRequestContext RequestContext { public get; public set; } string RootElementName { public get; public set; } @@ -3660,7 +3699,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public class Microsoft.AspNet.OData.Query.Validators.ODataQueryValidator { public ODataQueryValidator () - public virtual void Validate (ODataQueryOptions options, ODataValidationSettings validationSettings) + public virtual void Validate (IODataQueryOptions options, ODataValidationSettings validationSettings) } public class Microsoft.AspNet.OData.Query.Validators.OrderByQueryValidator { diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl index cfd6e90c38..c00fb79978 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl @@ -446,13 +446,13 @@ public class Microsoft.AspNet.OData.EnableQueryAttribute : Microsoft.AspNetCore. int MaxTop { public get; public set; } int PageSize { public get; public set; } - public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, ODataQueryOptions queryOptions) - public virtual object ApplyQuery (object entity, ODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, IODataQueryOptions queryOptions) + public virtual object ApplyQuery (object entity, IODataQueryOptions queryOptions) public static Microsoft.AspNetCore.Mvc.SerializableError CreateErrorResponse (string message, params System.Exception exception) public virtual Microsoft.OData.Edm.IEdmModel GetModel (System.Type elementClrType, Microsoft.AspNetCore.Http.HttpRequest request, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor) public virtual void OnActionExecuted (Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext) public virtual void OnActionExecuting (Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext context) - public virtual void ValidateQuery (Microsoft.AspNetCore.Http.HttpRequest request, ODataQueryOptions queryOptions) + public virtual void ValidateQuery (Microsoft.AspNetCore.Http.HttpRequest request, IODataQueryOptions queryOptions) } [ @@ -2520,6 +2520,44 @@ public enum Microsoft.AspNet.OData.Query.SelectExpandType : int { Disabled = 2 } +[ +NonValidatingParameterBindingAttribute(), +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions { + ApplyQueryOption Apply { public abstract get; } + ODataQueryContext Context { public abstract get; } + CountQueryOption Count { public abstract get; } + FilterQueryOption Filter { public abstract get; } + ETag IfMatch { public abstract get; } + ETag IfNoneMatch { public abstract get; } + OrderByQueryOption OrderBy { public abstract get; } + ODataRawQueryOptions RawValues { public abstract get; } + SelectExpandQueryOption SelectExpand { public abstract get; } + SkipQueryOption Skip { public abstract get; } + SkipTokenQueryOption SkipToken { public abstract get; } + TopQueryOption Top { public abstract get; } + ODataQueryValidator Validator { public abstract get; public abstract set; } + + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) + object ApplyTo (object entity, ODataQuerySettings querySettings) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + OrderByQueryOption GenerateStableOrder () + bool IsSupportedQueryOption (string queryOptionName) + void Validate (ODataValidationSettings validationSettings) +} + +[ +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions`1 : IODataQueryOptions { + ETag`1 IfMatch { public abstract get; } + ETag`1 IfNoneMatch { public abstract get; } +} + public interface Microsoft.AspNet.OData.Query.IODataQueryOptionsParser { bool CanParse (Microsoft.AspNetCore.Http.HttpRequest request) System.Threading.Tasks.Task`1[[System.String]] ParseAsync (System.IO.Stream requestStream) @@ -2645,23 +2683,23 @@ public class Microsoft.AspNet.OData.Query.ModelBoundQuerySettings { NonValidatingParameterBindingAttribute(), ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions : IODataQueryOptions { public ODataQueryOptions (ODataQueryContext context, Microsoft.AspNetCore.Http.HttpRequest request) - ApplyQueryOption Apply { public get; } - ODataQueryContext Context { public get; } - CountQueryOption Count { public get; } - FilterQueryOption Filter { public get; } + ApplyQueryOption Apply { public virtual get; } + ODataQueryContext Context { public virtual get; } + CountQueryOption Count { public virtual get; } + FilterQueryOption Filter { public virtual get; } ETag IfMatch { public virtual get; } ETag IfNoneMatch { public virtual get; } - OrderByQueryOption OrderBy { public get; } - ODataRawQueryOptions RawValues { public get; } + OrderByQueryOption OrderBy { public virtual get; } + ODataRawQueryOptions RawValues { public virtual get; } Microsoft.AspNetCore.Http.HttpRequest Request { public get; } - SelectExpandQueryOption SelectExpand { public get; } - SkipQueryOption Skip { public get; } - SkipTokenQueryOption SkipToken { public get; } - TopQueryOption Top { public get; } - ODataQueryValidator Validator { public get; public set; } + SelectExpandQueryOption SelectExpand { public virtual get; } + SkipQueryOption Skip { public virtual get; } + SkipTokenQueryOption SkipToken { public virtual get; } + TopQueryOption Top { public virtual get; } + ODataQueryValidator Validator { public virtual get; public virtual set; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) @@ -2671,7 +2709,7 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { public virtual object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) public virtual OrderByQueryOption GenerateStableOrder () internal virtual ETag GetETag (System.Net.Http.Headers.EntityTagHeaderValue etagHeaderValue) - public bool IsSupportedQueryOption (string queryOptionName) + public virtual bool IsSupportedQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName, bool isDollarSignOptional) public static IQueryable`1 LimitResults (IQueryable`1 queryable, int limit, out System.Boolean& resultsLimited) @@ -2682,11 +2720,11 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { [ ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions, IODataQueryOptions`1, IODataQueryOptions { public ODataQueryOptions`1 (ODataQueryContext context, Microsoft.AspNetCore.Http.HttpRequest request) - ETag`1 IfMatch { public get; } - ETag`1 IfNoneMatch { public get; } + ETag`1 IfMatch { public virtual get; } + ETag`1 IfNoneMatch { public virtual get; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) @@ -2862,13 +2900,13 @@ public class Microsoft.AspNet.OData.Query.SkipTokenQueryOption { public SkipTokenQueryOption (string rawValue, ODataQueryContext context, Microsoft.OData.UriParser.ODataQueryOptionParser queryOptionParser) ODataQueryContext Context { public get; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } ODataQuerySettings QuerySettings { public get; } string RawValue { public get; } SkipTokenQueryValidator Validator { public get; } - public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) - public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) + public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) public void Validate (ODataValidationSettings validationSettings) } @@ -3730,7 +3768,7 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerConte Microsoft.OData.Edm.IEdmNavigationProperty NavigationProperty { public get; } Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public get; public set; } ODataPath Path { public get; public set; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } Microsoft.AspNetCore.Http.HttpRequest Request { public get; public set; } string RootElementName { public get; public set; } Microsoft.OData.UriParser.SelectExpandClause SelectExpandClause { public get; public set; } @@ -3861,7 +3899,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public class Microsoft.AspNet.OData.Query.Validators.ODataQueryValidator { public ODataQueryValidator () - public virtual void Validate (ODataQueryOptions options, ODataValidationSettings validationSettings) + public virtual void Validate (IODataQueryOptions options, ODataValidationSettings validationSettings) } public class Microsoft.AspNet.OData.Query.Validators.OrderByQueryValidator { diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl index f2b3d7047d..78ceb3f902 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl @@ -450,13 +450,13 @@ public class Microsoft.AspNet.OData.EnableQueryAttribute : Microsoft.AspNetCore. int MaxTop { public get; public set; } int PageSize { public get; public set; } - public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, ODataQueryOptions queryOptions) - public virtual object ApplyQuery (object entity, ODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyQuery (System.Linq.IQueryable queryable, IODataQueryOptions queryOptions) + public virtual object ApplyQuery (object entity, IODataQueryOptions queryOptions) public static Microsoft.AspNetCore.Mvc.SerializableError CreateErrorResponse (string message, params System.Exception exception) public virtual Microsoft.OData.Edm.IEdmModel GetModel (System.Type elementClrType, Microsoft.AspNetCore.Http.HttpRequest request, Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor actionDescriptor) public virtual void OnActionExecuted (Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext) public virtual void OnActionExecuting (Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext context) - public virtual void ValidateQuery (Microsoft.AspNetCore.Http.HttpRequest request, ODataQueryOptions queryOptions) + public virtual void ValidateQuery (Microsoft.AspNetCore.Http.HttpRequest request, IODataQueryOptions queryOptions) } [ @@ -2695,6 +2695,44 @@ public enum Microsoft.AspNet.OData.Query.SelectExpandType : int { Disabled = 2 } +[ +NonValidatingParameterBindingAttribute(), +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions { + ApplyQueryOption Apply { public abstract get; } + ODataQueryContext Context { public abstract get; } + CountQueryOption Count { public abstract get; } + FilterQueryOption Filter { public abstract get; } + ETag IfMatch { public abstract get; } + ETag IfNoneMatch { public abstract get; } + OrderByQueryOption OrderBy { public abstract get; } + ODataRawQueryOptions RawValues { public abstract get; } + SelectExpandQueryOption SelectExpand { public abstract get; } + SkipQueryOption Skip { public abstract get; } + SkipTokenQueryOption SkipToken { public abstract get; } + TopQueryOption Top { public abstract get; } + ODataQueryValidator Validator { public abstract get; public abstract set; } + + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) + object ApplyTo (object entity, ODataQuerySettings querySettings) + System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) + OrderByQueryOption GenerateStableOrder () + bool IsSupportedQueryOption (string queryOptionName) + void Validate (ODataValidationSettings validationSettings) +} + +[ +ODataQueryParameterBindingAttribute(), +] +public interface Microsoft.AspNet.OData.Query.IODataQueryOptions`1 : IODataQueryOptions { + ETag`1 IfMatch { public abstract get; } + ETag`1 IfNoneMatch { public abstract get; } +} + public interface Microsoft.AspNet.OData.Query.IODataQueryOptionsParser { bool CanParse (Microsoft.AspNetCore.Http.HttpRequest request) System.Threading.Tasks.Task`1[[System.String]] ParseAsync (System.IO.Stream requestStream) @@ -2820,23 +2858,23 @@ public class Microsoft.AspNet.OData.Query.ModelBoundQuerySettings { NonValidatingParameterBindingAttribute(), ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions : IODataQueryOptions { public ODataQueryOptions (ODataQueryContext context, Microsoft.AspNetCore.Http.HttpRequest request) - ApplyQueryOption Apply { public get; } - ODataQueryContext Context { public get; } - CountQueryOption Count { public get; } - FilterQueryOption Filter { public get; } + ApplyQueryOption Apply { public virtual get; } + ODataQueryContext Context { public virtual get; } + CountQueryOption Count { public virtual get; } + FilterQueryOption Filter { public virtual get; } ETag IfMatch { public virtual get; } ETag IfNoneMatch { public virtual get; } - OrderByQueryOption OrderBy { public get; } - ODataRawQueryOptions RawValues { public get; } + OrderByQueryOption OrderBy { public virtual get; } + ODataRawQueryOptions RawValues { public virtual get; } Microsoft.AspNetCore.Http.HttpRequest Request { public get; } - SelectExpandQueryOption SelectExpand { public get; } - SkipQueryOption Skip { public get; } - SkipTokenQueryOption SkipToken { public get; } - TopQueryOption Top { public get; } - ODataQueryValidator Validator { public get; public set; } + SelectExpandQueryOption SelectExpand { public virtual get; } + SkipQueryOption Skip { public virtual get; } + SkipTokenQueryOption SkipToken { public virtual get; } + TopQueryOption Top { public virtual get; } + ODataQueryValidator Validator { public virtual get; public virtual set; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, AllowedQueryOptions ignoreQueryOptions) @@ -2846,7 +2884,7 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { public virtual object ApplyTo (object entity, ODataQuerySettings querySettings, AllowedQueryOptions ignoreQueryOptions) public virtual OrderByQueryOption GenerateStableOrder () internal virtual ETag GetETag (System.Net.Http.Headers.EntityTagHeaderValue etagHeaderValue) - public bool IsSupportedQueryOption (string queryOptionName) + public virtual bool IsSupportedQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName) public static bool IsSystemQueryOption (string queryOptionName, bool isDollarSignOptional) public static IQueryable`1 LimitResults (IQueryable`1 queryable, int limit, out System.Boolean& resultsLimited) @@ -2857,11 +2895,11 @@ public class Microsoft.AspNet.OData.Query.ODataQueryOptions { [ ODataQueryParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions { +public class Microsoft.AspNet.OData.Query.ODataQueryOptions`1 : ODataQueryOptions, IODataQueryOptions`1, IODataQueryOptions { public ODataQueryOptions`1 (ODataQueryContext context, Microsoft.AspNetCore.Http.HttpRequest request) - ETag`1 IfMatch { public get; } - ETag`1 IfNoneMatch { public get; } + ETag`1 IfMatch { public virtual get; } + ETag`1 IfNoneMatch { public virtual get; } public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query) public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings) @@ -3037,13 +3075,13 @@ public class Microsoft.AspNet.OData.Query.SkipTokenQueryOption { public SkipTokenQueryOption (string rawValue, ODataQueryContext context, Microsoft.OData.UriParser.ODataQueryOptionParser queryOptionParser) ODataQueryContext Context { public get; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } ODataQuerySettings QuerySettings { public get; } string RawValue { public get; } SkipTokenQueryValidator Validator { public get; } - public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) - public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, ODataQueryOptions queryOptions) + public virtual IQueryable`1 ApplyTo (IQueryable`1 query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) + public virtual System.Linq.IQueryable ApplyTo (System.Linq.IQueryable query, ODataQuerySettings querySettings, IODataQueryOptions queryOptions) public void Validate (ODataValidationSettings validationSettings) } @@ -3929,7 +3967,7 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataSerializerConte Microsoft.OData.Edm.IEdmNavigationProperty NavigationProperty { public get; } Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public get; public set; } ODataPath Path { public get; public set; } - ODataQueryOptions QueryOptions { public get; } + IODataQueryOptions QueryOptions { public get; } Microsoft.AspNetCore.Http.HttpRequest Request { public get; public set; } string RootElementName { public get; public set; } Microsoft.OData.UriParser.SelectExpandClause SelectExpandClause { public get; public set; } @@ -4060,7 +4098,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public class Microsoft.AspNet.OData.Query.Validators.ODataQueryValidator { public ODataQueryValidator () - public virtual void Validate (ODataQueryOptions options, ODataValidationSettings validationSettings) + public virtual void Validate (IODataQueryOptions options, ODataValidationSettings validationSettings) } public class Microsoft.AspNet.OData.Query.Validators.OrderByQueryValidator {