diff --git a/src/Microsoft.OData.Client/ClientEdmModel.cs b/src/Microsoft.OData.Client/ClientEdmModel.cs index d9510903b9..d8176f19aa 100644 --- a/src/Microsoft.OData.Client/ClientEdmModel.cs +++ b/src/Microsoft.OData.Client/ClientEdmModel.cs @@ -260,7 +260,7 @@ internal IEdmType GetOrCreateEdmType(Type type) } Debug.Assert(cachedEdmType != null, "cachedEdmType != null"); - this.ValidateComplexTypeHasProperties(type, cachedEdmType); + this.ValidateComplexType(type, cachedEdmType); return cachedEdmType.EdmType; } @@ -334,11 +334,10 @@ private static Type[] GetTypeHierarchy(Type type, out PropertyInfo[] keyProperti /// /// The type in question /// The EdmTypeCacheValue of the type in question. - private void ValidateComplexTypeHasProperties(Type type, EdmTypeCacheValue cachedEdmType) + private void ValidateComplexType(Type type, EdmTypeCacheValue cachedEdmType) { Debug.Assert(cachedEdmType != null, "cachedEdmType != null"); - // Note that if the type is an entity type, it has at least the key properties, thus there is no need to validate it here. if (cachedEdmType.EdmType.TypeKind == EdmTypeKind.Complex) { bool? hasProperties = cachedEdmType.HasProperties; @@ -353,7 +352,7 @@ private void ValidateComplexTypeHasProperties(Type type, EdmTypeCacheValue cache } } - if (hasProperties == false) + if (hasProperties == false && (type == typeof(System.Object) || type.IsGenericType())) { throw c.Error.InvalidOperation(c.Strings.ClientType_NoSettableFields(type.ToString())); } diff --git a/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs index 96bf9904c7..bfe8d789d7 100644 --- a/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/CollectionValueMaterializationPolicy.cs @@ -141,8 +141,8 @@ internal void ApplyCollectionDataValues( Debug.Assert(collectionProperty.Value != null, "Collection should have already been checked for nullness"); Debug.Assert(collectionInstance != null, "collectionInstance != null"); Debug.Assert(WebUtil.IsCLRTypeCollection(collectionInstance.GetType(), this.materializerContext.Model), "collectionInstance must be a CollectionValue"); - Debug.Assert( - ClientTypeUtil.GetImplementationType(collectionInstance.GetType(), typeof(ICollection<>)).GetGenericArguments()[0] == collectionItemType, + Debug.Assert(collectionItemType.IsAssignableFrom( + ClientTypeUtil.GetImplementationType(collectionInstance.GetType(), typeof(ICollection<>)).GetGenericArguments()[0]), "collectionItemType has to match the collectionInstance generic type."); Debug.Assert(!ClientTypeUtil.TypeIsEntity(collectionItemType, this.materializerContext.Model), "CollectionValues cannot contain entities"); Debug.Assert(addValueToBackingICollectionInstance != null, "AddValueToBackingICollectionInstance != null"); @@ -178,8 +178,8 @@ internal void ApplyCollectionDataValues( { Debug.Assert(collectionInstance != null, "collectionInstance != null"); Debug.Assert(WebUtil.IsCLRTypeCollection(collectionInstance.GetType(), this.materializerContext.Model), "collectionInstance must be a CollectionValue"); - Debug.Assert( - ClientTypeUtil.GetImplementationType(collectionInstance.GetType(), typeof(ICollection<>)).GetGenericArguments()[0] == collectionItemType, + Debug.Assert(collectionItemType.IsAssignableFrom( + ClientTypeUtil.GetImplementationType(collectionInstance.GetType(), typeof(ICollection<>)).GetGenericArguments()[0]), "collectionItemType has to match the collectionInstance generic type."); Debug.Assert(!ClientTypeUtil.TypeIsEntity(collectionItemType, this.materializerContext.Model), "CollectionValues cannot contain entities"); Debug.Assert(addValueToBackingICollectionInstance != null, "AddValueToBackingICollectionInstance != null"); diff --git a/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs b/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs index 8905dfc028..a09f0dc9ec 100644 --- a/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs +++ b/src/Microsoft.OData.Client/Materialization/EnumValueMaterializationPolicy.cs @@ -78,13 +78,14 @@ internal static object MaterializeODataEnumValue(Type enumType, ODataEnumValue e { // TODO: Find better way to parse Enum string enumValueStr = enumValue.Value.Trim(); - if (!Enum.IsDefined(enumType, enumValueStr)) + Type underlyingType = Nullable.GetUnderlyingType(enumType) ?? enumType; + if (!Enum.IsDefined(underlyingType, enumValueStr)) { - tmpValue = Enum.Parse(enumType, ClientTypeUtil.GetClientFieldName(enumType, enumValueStr), false); + tmpValue = Enum.Parse(underlyingType, ClientTypeUtil.GetClientFieldName(underlyingType, enumValueStr), false); } else { - tmpValue = Enum.Parse(enumType, enumValueStr, false); + tmpValue = Enum.Parse(underlyingType, enumValueStr, false); } } diff --git a/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs b/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs index cecf2c3557..bf11935af7 100644 --- a/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs +++ b/src/Microsoft.OData.Client/Materialization/ODataCollectionMaterializer.cs @@ -77,7 +77,7 @@ protected override void ReadWithExpectedType(IEdmTypeReference expectedClientTyp collectionICollectionType = typeof(ICollection<>).MakeGenericType(new Type[] { collectionItemType }); } - Type clrCollectionType = WebUtil.GetBackingTypeForCollectionProperty(collectionICollectionType, collectionItemType); + Type clrCollectionType = WebUtil.GetBackingTypeForCollectionProperty(collectionICollectionType); object collectionInstance = this.CollectionValueMaterializationPolicy.CreateCollectionInstance((IEdmCollectionTypeReference)expectedClientType, clrCollectionType); // Enumerator over our collection reader was created, then ApplyDataCollections was refactored to diff --git a/src/Microsoft.OData.Client/Materialization/ODataPropertyMaterializer.cs b/src/Microsoft.OData.Client/Materialization/ODataPropertyMaterializer.cs index 292ca8d345..a528db03a9 100644 --- a/src/Microsoft.OData.Client/Materialization/ODataPropertyMaterializer.cs +++ b/src/Microsoft.OData.Client/Materialization/ODataPropertyMaterializer.cs @@ -60,7 +60,7 @@ protected override void ReadWithExpectedType(IEdmTypeReference expectedClientTyp // We are here for two cases: // (1) Something like Execute>, in which case the underlyingExpectedType is ICollection // (2) Execute with the bool singleValue = false, in which case underlyingExpectedType is T - Type collectionItemType = underlyingExpectedType; + Type collectionItemType = this.ExpectedType; Type collectionICollectionType = ClientTypeUtil.GetImplementationType(underlyingExpectedType, typeof(ICollection<>)); object collectionInstance; diff --git a/src/Microsoft.OData.Client/TypeResolver.cs b/src/Microsoft.OData.Client/TypeResolver.cs index 3a7f45e0fa..9fd6496816 100644 --- a/src/Microsoft.OData.Client/TypeResolver.cs +++ b/src/Microsoft.OData.Client/TypeResolver.cs @@ -165,7 +165,7 @@ internal ClientTypeAnnotation ResolveTypeForMaterialization(Type expectedType, s collectionElementType = this.ResolveTypeForMaterialization(collectionElementType, collectionItemTypeName).ElementType; } - Type clrCollectionType = WebUtil.GetBackingTypeForCollectionProperty(expectedType, collectionElementType); + Type clrCollectionType = WebUtil.GetBackingTypeForCollectionProperty(expectedType); return this.clientEdmModel.GetClientTypeAnnotation(clrCollectionType); } diff --git a/src/Microsoft.OData.Client/WebUtil.cs b/src/Microsoft.OData.Client/WebUtil.cs index 02a0d9eb4c..2f25b90f8b 100644 --- a/src/Microsoft.OData.Client/WebUtil.cs +++ b/src/Microsoft.OData.Client/WebUtil.cs @@ -168,13 +168,11 @@ internal static string GetCollectionItemWireTypeName(string wireTypeName) /// Resolves and creates if necessary a backing type for the . /// /// Type of a collection property as defined by the user - can be just an interface or generic type. - /// Type of items stored in the collection. /// Resolved concrete type that can be instantiated and will back the collection property. Can be the type. - internal static Type GetBackingTypeForCollectionProperty(Type collectionPropertyType, Type collectionItemType) + internal static Type GetBackingTypeForCollectionProperty(Type collectionPropertyType) { Debug.Assert(collectionPropertyType != null, "collectionPropertyType != null"); Debug.Assert(ClientTypeUtil.GetImplementationType(collectionPropertyType, typeof(ICollection<>)) != null, "The type backing a collection has to implement ICollection<> interface."); - Debug.Assert(collectionItemType != null, "collectionItemType != null"); Type collectionBackingType = null; @@ -183,7 +181,7 @@ internal static Type GetBackingTypeForCollectionProperty(Type collectionProperty // Note that we don't check here if the type we created can be assigned to the user's type. This should be done by the caller (if requested) if (collectionPropertyType.IsInterface()) { - collectionBackingType = typeof(ObservableCollection<>).MakeGenericType(collectionItemType); + collectionBackingType = typeof(ObservableCollection<>).MakeGenericType(collectionPropertyType.GetGenericArguments()[0]); } else { diff --git a/src/Microsoft.OData.Core/JsonLight/ODataJsonLightCollectionDeserializer.cs b/src/Microsoft.OData.Core/JsonLight/ODataJsonLightCollectionDeserializer.cs index 0ea8fabd93..f6487f6e8f 100644 --- a/src/Microsoft.OData.Core/JsonLight/ODataJsonLightCollectionDeserializer.cs +++ b/src/Microsoft.OData.Core/JsonLight/ODataJsonLightCollectionDeserializer.cs @@ -184,8 +184,9 @@ internal object ReadCollectionItem(IEdmTypeReference expectedItemTypeReference, expectedItemTypeReference == null || expectedItemTypeReference.IsODataPrimitiveTypeKind() || expectedItemTypeReference.IsODataComplexTypeKind() || + expectedItemTypeReference.IsODataEnumTypeKind() || expectedItemTypeReference.IsODataTypeDefinitionTypeKind(), - "If an expected type is specified, it must be a primitive, complex type or type definition."); + "If an expected type is specified, it must be a primitive, complex type, enum type or type definition."); this.JsonReader.AssertNotBuffering(); object item = this.ReadNonEntityValue( diff --git a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs index 4d66841b00..8d576a4318 100644 --- a/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs +++ b/src/Microsoft.OData.Core/ODataCollectionReaderCore.cs @@ -461,7 +461,7 @@ public Scope(ODataCollectionReaderState state, object item, bool isCollectionEle Debug.Assert( state == ODataCollectionReaderState.Start && item == null || state == ODataCollectionReaderState.CollectionStart && item is ODataCollectionStart || - state == ODataCollectionReaderState.Value && (item == null || item is ODataComplexValue || EdmLibraryExtensions.IsPrimitiveType(item.GetType())) || + state == ODataCollectionReaderState.Value && (item == null || item is ODataComplexValue || EdmLibraryExtensions.IsPrimitiveType(item.GetType()) || item is ODataEnumValue) || state == ODataCollectionReaderState.CollectionEnd && item is ODataCollectionStart || state == ODataCollectionReaderState.Exception && item == null || state == ODataCollectionReaderState.Completed && item == null, diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Microsoft.OData.Client.TDDUnitTests.csproj b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Microsoft.OData.Client.TDDUnitTests.csproj index 6538207fa1..7c955a0e83 100644 --- a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Microsoft.OData.Client.TDDUnitTests.csproj +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Microsoft.OData.Client.TDDUnitTests.csproj @@ -63,7 +63,7 @@ - + @@ -83,6 +83,8 @@ + + diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/ClientAnnotationTests.cs b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/ClientAnnotationTests.cs index 4c9f0daf89..d32b93eb6f 100644 --- a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/ClientAnnotationTests.cs +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/ClientAnnotationTests.cs @@ -1361,7 +1361,7 @@ private void SetResponse(string response) { dsc.Configurations.RequestPipeline.OnMessageCreating = (args) => { - return new AnnotationRequestMessage(args, + return new CustomizedHttpWebRequestMessage(args, response, new Dictionary() { diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/AnnotationRequestMessage.cs b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/CustomizedHttpWebRequestMessage.cs similarity index 75% rename from test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/AnnotationRequestMessage.cs rename to test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/CustomizedHttpWebRequestMessage.cs index 23c616bee1..1807228261 100644 --- a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Annotation/AnnotationRequestMessage.cs +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/CustomizedHttpWebRequestMessage.cs @@ -4,7 +4,7 @@ // //--------------------------------------------------------------------- -namespace Microsoft.OData.Client.TDDUnitTests.Tests.Annotation +namespace Microsoft.OData.Client.TDDUnitTests.Tests { using System.Collections.Generic; using System.IO; @@ -12,17 +12,17 @@ namespace Microsoft.OData.Client.TDDUnitTests.Tests.Annotation using Microsoft.OData.Client; using Microsoft.OData.Core; - public class AnnotationRequestMessage : HttpWebRequestMessage + public class CustomizedHttpWebRequestMessage : HttpWebRequestMessage { public string Response { get; set; } public Dictionary CutomizedHeaders { get; set; } - public AnnotationRequestMessage(DataServiceClientRequestMessageArgs args) + public CustomizedHttpWebRequestMessage(DataServiceClientRequestMessageArgs args) : base(args) { } - public AnnotationRequestMessage(DataServiceClientRequestMessageArgs args, string response, Dictionary headers) + public CustomizedHttpWebRequestMessage(DataServiceClientRequestMessageArgs args, string response, Dictionary headers) : base(args) { this.Response = response; diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTests.cs b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTests.cs new file mode 100644 index 0000000000..da19e4c53f --- /dev/null +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTests.cs @@ -0,0 +1,640 @@ +//--------------------------------------------------------------------- +// +// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. +// +//--------------------------------------------------------------------- + +namespace Microsoft.OData.Client.TDDUnitTests.Tests.Materialization +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public partial class ODataMaterializerTests + { + private const string ServiceUri = "http://localhost/foo/"; + private const string Namespace = "NS"; + + private DefaultContainer dsc; + + [TestInitialize] + public void TestInitialize() + { + this.dsc = new DefaultContainer(new Uri(ServiceUri)); + } + + [TestCleanup] + public void TestCleanup() + { + this.dsc = null; + } + + #region Expected collection of Non-Abstract type, return collection of Non-Abstract type + + [TestMethod] + public void MaterializeColOfNonAbstractComplexByFunctionImport() + { + MaterializeColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfBaseCT().ToList()); + MaterializeColOfNullableBaseComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfNullableBaseCT().ToList()); + MaterializeColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.RColOfDerivedCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfNonAbstractComplexProperty() + { + MaterializeColOfBaseComplex("BaseETs(0)/EColOfBaseCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfBaseCTP).GetValue().ToList()); + MaterializeColOfNullableBaseComplex("BaseETs(0)/EColOfNullableBaseCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfNullableBaseCTP).GetValue().ToList()); + MaterializeColOfDerivedComplex("DerivedETs(0)/EColOfDerviedCTP", () => this.dsc.DerivedETs.ByKey(0).Select(e => e.EColOfDerivedCTP).GetValue().ToList()); + } + + [TestMethod] + public void MaterializeColOfNonAbstractComplexByBoundFunctionContextUriIsColOfBaseComplex() + { + MaterializeColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + MaterializeColOfNullableBaseComplex("Collection(NS.BaseCT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableBaseCT().ToList()); + MaterializeColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfDerivedCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfNonAbstractComplexByBoundFunctionContextUriIsProperty() + { + MaterializeColOfBaseComplex("BaseETs(0)/EColOfBaseCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + MaterializeColOfBaseComplex("BaseETs(0)/EColOfNullableBaseCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableBaseCT().ToList()); + MaterializeColOfDerivedComplex("DerivedETs(0)/EColOfDerviedCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfDerivedCT().ToList()); + } + + private void MaterializeColOfBaseComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.BaseCT)"", + ""value"": + [ + { + ""CP0"":1, + ""CP1"":2 + }, + { + ""CP0"":3 + }, + { + ""CP1"":4 + } + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.BaseCT)", contextUri); + } + + SetResponse(response); + + var cts = func(); + Assert.AreEqual(3, cts.Count); + + Assert.AreEqual(1, cts.ElementAt(0).CP0); + Assert.AreEqual(2, cts.ElementAt(0).CP1); + + Assert.AreEqual(3, cts.ElementAt(1).CP0); + Assert.AreEqual(0, cts.ElementAt(1).CP1); + + Assert.AreEqual(0, cts.ElementAt(2).CP0); + Assert.AreEqual(4, cts.ElementAt(2).CP1); + } + + private void MaterializeColOfNullableBaseComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.BaseCT)"", + ""value"": + [ + { + ""CP0"":1, + ""CP1"":2 + }, + null + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.BaseCT)", contextUri); + } + + SetResponse(response); + + var cts = func(); + Assert.AreEqual(2, cts.Count); + + Assert.AreEqual(1, cts.ElementAt(0).CP0); + Assert.AreEqual(2, cts.ElementAt(0).CP1); + + Assert.IsNull(cts.ElementAt(1)); + } + + private void MaterializeColOfDerivedComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.CT)"", + ""value"": + [ + { + ""CP0"":1, + ""CP1"":2, + ""CP2"":3 + }, + { + ""CP0"":4, + ""CP1"":5 + }, + { + ""CP2"":6 + } + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.CT)", contextUri); + } + + SetResponse(response); + + var cts = func(); + + Assert.AreEqual(3, cts.Count); + Assert.AreEqual(1, cts.ElementAt(0).CP0); + Assert.AreEqual(2, cts.ElementAt(0).CP1); + Assert.AreEqual(3, cts.ElementAt(0).CP2); + + Assert.AreEqual(4, cts.ElementAt(1).CP0); + Assert.AreEqual(5, cts.ElementAt(1).CP1); + Assert.AreEqual(0, cts.ElementAt(1).CP2); + + Assert.AreEqual(0, cts.ElementAt(2).CP0); + Assert.AreEqual(0, cts.ElementAt(2).CP1); + Assert.AreEqual(6, cts.ElementAt(2).CP2); + } + + #endregion + + #region Expected collection of the ancestor type, return the contextUri with collection of ancestor type, but the real object might be sub type + + [TestMethod] + public void MaterializeColOfAncestorComplexByFunctionImport_ReturnSubtype() + { + MaterializeColOfComplex("Collection(NS.AbstractCT)", () => this.dsc.RColOfAbsCT().ToList()); + MaterializeColOfComplex("Collection(NS.AbstractBaseCT)", () => this.dsc.RColOfAbsBaseCT().ToList()); + MaterializeColOfComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfBaseCT().ToList()); + MaterializeColOfNullableComplex("Collection(NS.AbstractCT)", () => this.dsc.RColOfNullableAbsCT().ToList()); + MaterializeColOfNullableComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfNullableBaseCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfAncestorComplexProperty_ReturnSubtype() + { + MaterializeColOfComplex("BaseETs(0)/EColOfAbsCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfAbsCTP).GetValue().ToList()); + MaterializeColOfComplex("BaseETs(0)/EColOfAbsBaseCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfAbsBaseCTP).GetValue().ToList()); + MaterializeColOfComplex("BaseETs(0)/EColOfBaseCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfBaseCTP).GetValue().ToList()); + MaterializeColOfNullableComplex("BaseETs(0)/EColOfNullableAbsCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfNullableAbsCTP).GetValue().ToList()); + MaterializeColOfNullableComplex("BaseETs(0)/EColOfNullableAbsBaseCTP", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfNullableAbsBaseCTP).GetValue().ToList()); + MaterializeColOfNullableComplex("DerivedETs(0)/EColOfNullableBaseCTP", () => this.dsc.DerivedETs.ByKey(0).Select(e => e.EColOfNullableBaseCTP).GetValue().ToList()); + } + + [TestMethod] + public void MaterializeColOfAncestorComplexByBoundFunctionContextUriIsColOfAncestorComplex_ReturnSubtype() + { + MaterializeColOfComplex("Collection(NS.AbstractCT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsCT().ToList()); + MaterializeColOfComplex("Collection(NS.AbstractBaseCT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfComplex("Collection(NS.BaseCT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + MaterializeColOfNullableComplex("Collection(NS.AbstractCT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfNullableAbsCT().ToList()); + MaterializeColOfNullableComplex("Collection(NS.BaseCT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableBaseCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfAncestorComplexByBoundFunctionContextUriIsProperty_ReturnSubtype() + { + MaterializeColOfComplex("BaseETs(0)/EColOfAbsCTP", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsCT().ToList()); + MaterializeColOfComplex("BaseETs(0)/EColOfAbsBaseCTP", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfComplex("DerivedETs(0)/EColOfBaseCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + MaterializeColOfComplex("BaseETs(0)/EColOfNullableAbsCTP", () => this.dsc.BaseETs.ByKey(0).BETRColOfNullableAbsCT().ToList()); + MaterializeColOfComplex("DerivedETs(0)/EColOfNullableBaseCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableBaseCT().ToList()); + } + + private void MaterializeColOfComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.AbstractBaseCT)"", + ""value"": + [ + { + ""@odata.type"":""#NS.BaseCT"", + ""CP0"":1, + ""CP1"":2 + }, + { + ""@odata.type"":""#NS.CT"", + ""CP1"":3, + ""CP2"":4 + } + ] +}"; + + response = response.Replace("Collection(NS.AbstractBaseCT)", contextUri); + if (contextUri == "Collection(NS.BaseCT)") + { + response = response.Replace(@"""@odata.type"":""#NS.BaseCT"",", string.Empty); + } + + SetResponse(response); + + List cts = func(); + Assert.AreEqual(2, cts.Count); + + var e0 = cts.ElementAt(0) as BaseCT; + Assert.IsNotNull(e0); + Assert.AreEqual(1, e0.CP0); + Assert.AreEqual(2, e0.CP1); + + var e1 = cts.ElementAt(1) as CT; + Assert.IsNotNull(e1); + Assert.AreEqual(0, e1.CP0); + Assert.AreEqual(3, e1.CP1); + Assert.AreEqual(4, e1.CP2); + } + + private void MaterializeColOfNullableComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.AbstractBaseCT)"", + ""value"": + [ + { + ""@odata.type"":""#NS.BaseCT"", + ""CP0"":1, + ""CP1"":2 + }, + { + ""@odata.type"":""#NS.CT"", + ""CP1"":3, + ""CP2"":4 + }, + null + ] +}"; + + response = response.Replace("Collection(NS.AbstractBaseCT)", contextUri); + if (contextUri == "Collection(NS.BaseCT)") + { + response = response.Replace(@"""@odata.type"":""#NS.BaseCT"",", string.Empty); + } + + SetResponse(response); + + List cts = func(); + Assert.AreEqual(3, cts.Count); + + var e0 = cts.ElementAt(0) as BaseCT; + Assert.IsNotNull(e0); + Assert.AreEqual(1, e0.CP0); + Assert.AreEqual(2, e0.CP1); + + var e1 = cts.ElementAt(1) as CT; + Assert.IsNotNull(e1); + Assert.AreEqual(0, e1.CP0); + Assert.AreEqual(3, e1.CP1); + Assert.AreEqual(4, e1.CP2); + + Assert.IsNull(cts.ElementAt(2)); + } + + #endregion + + #region Expected collection of the ancestor Type, return the contextUri with collection of sub type + + [TestMethod] + public void MaterializeColOfAncestorComplexByFunctionImportContextUriIsColOfSubtype() + { + MaterializeColOfAncestorTypeFromColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfAbsCT().ToList()); + MaterializeColOfAncestorTypeFromColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.RColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.RColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.RColOfBaseCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfAncestorComplexByBoundFunctionContextUriIsColOfSubtype() + { + MaterializeColOfAncestorTypeFromColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsCT().ToList()); + MaterializeColOfAncestorTypeFromColOfBaseComplex("Collection(NS.BaseCT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("Collection(NS.CT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + } + + [TestMethod] + public void MaterializeColOfAncestorComplexByBoundFunctionContextUriIsPropertyOfColOfSubtype() + { + MaterializeColOfAncestorTypeFromColOfBaseComplex("BaseETs(0)/EColOfBaseCTP", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsCT().ToList()); + MaterializeColOfAncestorTypeFromColOfBaseComplex("BaseETs(0)/EColOfBaseCTP", () => this.dsc.BaseETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("DerivedETs(0)/EColOfDerivedCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfAbsBaseCT().ToList()); + MaterializeColOfAncestorTypeActualColOfDerivedComplex("DerivedETs(0)/EColOfDerivedCTP", () => this.dsc.DerivedETs.ByKey(0).BETRColOfBaseCT().ToList()); + } + + private void MaterializeColOfAncestorTypeFromColOfBaseComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.BaseCT)"", + ""value"": + [ + { + ""CP0"":1, + ""CP1"":2 + }, + { + ""@odata.type"":""#NS.CT"", + ""CP1"":3, + ""CP2"":4 + } + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.BaseCT)", contextUri); + } + + SetResponse(response); + + List cts = func(); + Assert.AreEqual(2, cts.Count); + + BaseCT e0 = cts.ElementAt(0) as BaseCT; + Assert.IsNotNull(e0); + Assert.AreEqual(1, e0.CP0); + Assert.AreEqual(2, e0.CP1); + + CT e1 = cts.ElementAt(1) as CT; + Assert.IsNotNull(e1); + Assert.AreEqual(0, e1.CP0); + Assert.AreEqual(3, e1.CP1); + Assert.AreEqual(4, e1.CP2); + } + + private void MaterializeColOfAncestorTypeActualColOfDerivedComplex(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.CT)"", + ""value"": + [ + { + ""CP0"":1, + ""CP1"":2 + }, + { + ""CP1"":3, + ""CP2"":4 + } + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.CT)", contextUri); + } + + SetResponse(response); + + List cts = func(); + Assert.AreEqual(2, cts.Count); + + CT e0 = cts.ElementAt(0) as CT; + Assert.IsNotNull(e0); + Assert.AreEqual(1, e0.CP0); + Assert.AreEqual(2, e0.CP1); + Assert.AreEqual(0, e0.CP2); + + CT e1 = cts.ElementAt(1) as CT; + Assert.IsNotNull(e1); + Assert.AreEqual(0, e1.CP0); + Assert.AreEqual(3, e1.CP1); + Assert.AreEqual(4, e1.CP2); + } + + #endregion + + #region Expected collection of primitive type, or collection of nullable primitive type. + + [TestMethod] + public void MaterializeColOfPrimitiveByFunctionImport() + { + MaterializeColOfPrimitive("Collection(Edm.Int32)", () => this.dsc.RColOfInt().ToList()); + MaterializeColOfNullablePrimitive("Collection(Edm.Int32)", () => this.dsc.RColOfNullableInt().ToList()); + } + + [TestMethod] + public void MaterializeColOfPrimitiveProperty() + { + MaterializeColOfPrimitive("BaseETs(0)/EColOfInt", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfInt).GetValue().ToList()); + MaterializeColOfNullablePrimitive("BaseETs(0)/EColOfNullableInt", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfNullableInt).GetValue().ToList()); + } + + [TestMethod] + public void MaterializeColOfPrimitiveByBoundFunctionContextUriIsColOfPrimitive() + { + MaterializeColOfPrimitive("Collection(Edm.Int32)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfInt().ToList()); + MaterializeColOfNullablePrimitive("Collection(Edm.Int32)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableInt().ToList()); + } + + [TestMethod] + public void MaterializeColOfPrimitiveByBoundFunctionContextUriIsProperty() + { + MaterializeColOfPrimitive("DerivedETs(0)/EColOfInt", () => this.dsc.DerivedETs.ByKey(0).BETRColOfInt().ToList()); + MaterializeColOfNullablePrimitive("DerivedETs(0)/EColOfNullableInt", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableInt().ToList()); + } + + private void MaterializeColOfPrimitive(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(Edm.Int32)"", + ""value"": + [ + 0, + 1, + 2 + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(Edm.Int32)", contextUri); + } + + SetResponse(response); + + var cts = func(); + Assert.AreEqual(3, cts.Count); + + Assert.AreEqual(0, cts.ElementAt(0)); + Assert.AreEqual(1, cts.ElementAt(1)); + Assert.AreEqual(2, cts.ElementAt(2)); + } + + private void MaterializeColOfNullablePrimitive(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(Edm.Int32)"", + ""value"": + [ + 0, + null, + 2 + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(Edm.Int32)", contextUri); + } + + SetResponse(response); + + var cts = func(); + Assert.AreEqual(3, cts.Count); + + Assert.AreEqual(0, cts.ElementAt(0)); + Assert.IsNull(cts.ElementAt(1)); + Assert.AreEqual(2, cts.ElementAt(2)); + } + + #endregion + + #region Expected collection of enum type, or collection of nullable enum type, or nullable enum + + [TestMethod] + public void MaterializeColOfEnumProperty() + { + MaterializeColOfEnum("BaseETs(0)/EColOfEnum", () => this.dsc.BaseETs.ByKey(0).Select(e => e.EColOfEnum).GetValue().ToList()); + MaterializeColOfNullableEnum("DerivedETs(0)/EColOfNullableEnum", () => this.dsc.DerivedETs.ByKey(0).Select(e => e.EColOfNullableEnum).GetValue().ToList()); + } + + [TestMethod] + public void MaterializeColOfEnumByBoundFunctionContextUriIsColOfEnum() + { + MaterializeColOfEnum("Collection(NS.EnumT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfEnum().ToList()); + MaterializeColOfNullableEnum("Collection(NS.EnumT)", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableEnum().ToList()); + } + + [TestMethod] + public void MaterializeColOfEnumByBoundFunctionContextUriIsProperty() + { + MaterializeColOfEnum("DerivedETs(0)/EColOfEnum", () => this.dsc.DerivedETs.ByKey(0).BETRColOfEnum().ToList()); + MaterializeColOfNullableEnum("DerivedETs(0)/EColOfNullableEnum", () => this.dsc.DerivedETs.ByKey(0).BETRColOfNullableEnum().ToList()); + } + + [TestMethod] + public void MaterializeEnumProperty() + { + MaterializeNullableEnum("BaseETs(0)/ENullableEnum", () => this.dsc.BaseETs.ByKey(0).Select(e => e.ENullableEnum).GetValue()); + } + + [TestMethod] + public void MaterializeEnumByBoundFunctionContextUriIsEnum() + { + MaterializeNullableEnum("NS.EnumT", () => this.dsc.DerivedETs.ByKey(0).BETRNullableEnum().GetValue()); + } + + [TestMethod] + public void MaterializeEnumByBoundFunctionContextUriIsProperty() + { + MaterializeNullableEnum("DerivedETs(0)/ENullableEnum", () => this.dsc.DerivedETs.ByKey(0).BETRNullableEnum().GetValue()); + } + + private void MaterializeColOfEnum(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.EnumT)"", + ""value"": + [ + ""EnumP1"", + ""EnumP2"" + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.EnumT)", contextUri); + } + + SetResponse(response); + + var ets = func(); + Assert.AreEqual(2, ets.Count); + + Assert.AreEqual(EnumT.EnumP1, ets.ElementAt(0)); + Assert.AreEqual(EnumT.EnumP2, ets.ElementAt(1)); + } + + private void MaterializeColOfNullableEnum(string contextUri, Func> func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#Collection(NS.EnumT)"", + ""value"": + [ + ""EnumP1"", + null, + ""EnumP2"" + ] +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("Collection(NS.EnumT)", contextUri); + } + + SetResponse(response); + + var ets = func(); + Assert.AreEqual(3, ets.Count); + + Assert.AreEqual(EnumT.EnumP1, ets.ElementAt(0)); + Assert.IsNull(ets.ElementAt(1)); + Assert.AreEqual(EnumT.EnumP2, ets.ElementAt(2)); + } + + private void MaterializeNullableEnum(string contextUri, Func func) + { + var response = @" +{ + ""@odata.context"":""http://localhost/foo/$metadata#NS.EnumT"", + ""value"": ""EnumP1"" +}"; + if (!string.IsNullOrEmpty(contextUri)) + { + response = response.Replace("NS.EnumT", contextUri); + } + + SetResponse(response); + + var enumP = func(); + Assert.AreEqual(EnumT.EnumP1, enumP); + } + + #endregion + + private void SetResponse(string response) + { + dsc.Configurations.RequestPipeline.OnMessageCreating = (args) => + { + return new CustomizedHttpWebRequestMessage(args, + response, + new Dictionary() + { + {"Content-Type", "application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"}, + }); + }; + } + } +} diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTestsProxy.cs b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTestsProxy.cs new file mode 100644 index 0000000000..3b896d6224 --- /dev/null +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/Client.TDD.Tests/Tests/Materialization/ODataMaterializerTestsProxy.cs @@ -0,0 +1,1635 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +// Generation date: 1/29/2016 11:00:46 AM +namespace Microsoft.OData.Client.TDDUnitTests.Tests.Materialization +{ + /// + /// There are no comments for DefaultContainer in the schema. + /// + public partial class DefaultContainer : global::Microsoft.OData.Client.DataServiceContext + { + /// + /// Initialize a new DefaultContainer object. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public DefaultContainer(global::System.Uri serviceRoot) : + base(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4) + { + this.ResolveName = new global::System.Func(this.ResolveNameFromType); + this.ResolveType = new global::System.Func(this.ResolveTypeFromName); + this.OnContextCreated(); + this.Format.LoadServiceModel = GeneratedEdmModel.GetInstance; + this.Format.UseJson(); + } + partial void OnContextCreated(); + /// + /// Since the namespace configured for this service reference + /// in Visual Studio is different from the one indicated in the + /// server schema, use type-mappers to map between the two. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + new protected global::System.Type ResolveTypeFromName(string typeName) + { + global::System.Type resolvedType = this.DefaultResolveType(typeName, "NS", "Microsoft.OData.Client.TDDUnitTests.Tests.Materialization"); + if ((resolvedType != null)) + { + return resolvedType; + } + return null; + } + /// + /// Since the namespace configured for this service reference + /// in Visual Studio is different from the one indicated in the + /// server schema, use type-mappers to map between the two. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + protected string ResolveNameFromType(global::System.Type clientType) + { + if (clientType.Namespace.Equals("Microsoft.OData.Client.TDDUnitTests.Tests.Materialization", global::System.StringComparison.Ordinal)) + { + return string.Concat("NS.", clientType.Name); + } + return clientType.FullName; + } + /// + /// There are no comments for AbstractETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.DataServiceQuery AbstractETs + { + get + { + if ((this._AbstractETs == null)) + { + this._AbstractETs = base.CreateQuery("AbstractETs"); + } + return this._AbstractETs; + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.DataServiceQuery _AbstractETs; + /// + /// There are no comments for AbstractBaseETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.DataServiceQuery AbstractBaseETs + { + get + { + if ((this._AbstractBaseETs == null)) + { + this._AbstractBaseETs = base.CreateQuery("AbstractBaseETs"); + } + return this._AbstractBaseETs; + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.DataServiceQuery _AbstractBaseETs; + /// + /// There are no comments for BaseETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.DataServiceQuery BaseETs + { + get + { + if ((this._BaseETs == null)) + { + this._BaseETs = base.CreateQuery("BaseETs"); + } + return this._BaseETs; + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.DataServiceQuery _BaseETs; + /// + /// There are no comments for DerivedETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.DataServiceQuery DerivedETs + { + get + { + if ((this._DerivedETs == null)) + { + this._DerivedETs = base.CreateQuery("DerivedETs"); + } + return this._DerivedETs; + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.DataServiceQuery _DerivedETs; + /// + /// There are no comments for AbstractETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public void AddToAbstractETs(AbstractET abstractET) + { + base.AddObject("AbstractETs", abstractET); + } + /// + /// There are no comments for AbstractBaseETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public void AddToAbstractBaseETs(AbstractBaseET abstractBaseET) + { + base.AddObject("AbstractBaseETs", abstractBaseET); + } + /// + /// There are no comments for BaseETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public void AddToBaseETs(BaseET baseET) + { + base.AddObject("BaseETs", baseET); + } + /// + /// There are no comments for DerivedETs in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public void AddToDerivedETs(ET eT) + { + base.AddObject("DerivedETs", eT); + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private abstract class GeneratedEdmModel + { + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private static global::Microsoft.OData.Edm.IEdmModel ParsedModel = LoadModelFromString(); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private const string Edmx = @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public static global::Microsoft.OData.Edm.IEdmModel GetInstance() + { + return ParsedModel; + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private static global::Microsoft.OData.Edm.IEdmModel LoadModelFromString() + { + global::System.Xml.XmlReader reader = CreateXmlReader(Edmx); + try + { + return global::Microsoft.OData.Edm.Csdl.EdmxReader.Parse(reader); + } + finally + { + ((global::System.IDisposable)(reader)).Dispose(); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private static global::System.Xml.XmlReader CreateXmlReader(string edmxToParse) + { + return global::System.Xml.XmlReader.Create(new global::System.IO.StringReader(edmxToParse)); + } + } + /// + /// There are no comments for RColOfAbsCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfAbsCT() + { + return this.CreateFunctionQuery("", "RColOfAbsCT", false); + } + /// + /// There are no comments for RColOfAbsBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfAbsBaseCT() + { + return this.CreateFunctionQuery("", "RColOfAbsBaseCT", true); + } + /// + /// There are no comments for RColOfBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfBaseCT() + { + return this.CreateFunctionQuery("", "RColOfBaseCT", false); + } + /// + /// There are no comments for RColOfDerivedCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfDerivedCT() + { + return this.CreateFunctionQuery("", "RColOfDerivedCT", true); + } + /// + /// There are no comments for RColOfNullableAbsCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfNullableAbsCT() + { + return this.CreateFunctionQuery("", "RColOfNullableAbsCT", false); + } + /// + /// There are no comments for RColOfNullableBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfNullableBaseCT() + { + return this.CreateFunctionQuery("", "RColOfNullableBaseCT", false); + } + /// + /// There are no comments for RColOfNullableInt in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery> RColOfNullableInt() + { + return this.CreateFunctionQuery>("", "RColOfNullableInt", false); + } + /// + /// There are no comments for RColOfInt in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery RColOfInt() + { + return this.CreateFunctionQuery("", "RColOfInt", false); + } + } + /// + /// There are no comments for AbstractCT in the schema. + /// + public abstract partial class AbstractCT : global::System.ComponentModel.INotifyPropertyChanged + { + /// + /// This event is raised when the value of the property is changed + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + /// + /// The value of the property is changed + /// + /// property name + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + protected virtual void OnPropertyChanged(string property) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property)); + } + } + } + /// + /// There are no comments for AbstractBaseCT in the schema. + /// + public abstract partial class AbstractBaseCT : AbstractCT + { + /// + /// There are no comments for Property CP0 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int CP0 + { + get + { + return this._CP0; + } + set + { + this.OnCP0Changing(value); + this._CP0 = value; + this.OnCP0Changed(); + this.OnPropertyChanged("CP0"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _CP0; + partial void OnCP0Changing(int value); + partial void OnCP0Changed(); + } + /// + /// There are no comments for BaseCT in the schema. + /// + public partial class BaseCT : AbstractBaseCT + { + /// + /// Create a new BaseCT object. + /// + /// Initial value of CP0. + /// Initial value of CP1. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public static BaseCT CreateBaseCT(int cP0, int cP1) + { + BaseCT baseCT = new BaseCT(); + baseCT.CP0 = cP0; + baseCT.CP1 = cP1; + return baseCT; + } + /// + /// There are no comments for Property CP1 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int CP1 + { + get + { + return this._CP1; + } + set + { + this.OnCP1Changing(value); + this._CP1 = value; + this.OnCP1Changed(); + this.OnPropertyChanged("CP1"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _CP1; + partial void OnCP1Changing(int value); + partial void OnCP1Changed(); + } + /// + /// There are no comments for CT in the schema. + /// + public partial class CT : BaseCT + { + /// + /// Create a new CT object. + /// + /// Initial value of CP0. + /// Initial value of CP1. + /// Initial value of CP2. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public static CT CreateCT(int cP0, int cP1, int cP2) + { + CT cT = new CT(); + cT.CP0 = cP0; + cT.CP1 = cP1; + cT.CP2 = cP2; + return cT; + } + /// + /// There are no comments for Property CP2 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int CP2 + { + get + { + return this._CP2; + } + set + { + this.OnCP2Changing(value); + this._CP2 = value; + this.OnCP2Changed(); + this.OnPropertyChanged("CP2"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _CP2; + partial void OnCP2Changing(int value); + partial void OnCP2Changed(); + } + /// + /// There are no comments for AbstractETSingle in the schema. + /// + public partial class AbstractETSingle : global::Microsoft.OData.Client.DataServiceQuerySingle + { + /// + /// Initialize a new AbstractETSingle object. + /// + public AbstractETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path) + : base(context, path) { } + + /// + /// Initialize a new AbstractETSingle object. + /// + public AbstractETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable) + : base(context, path, isComposable) { } + + /// + /// Initialize a new AbstractETSingle object. + /// + public AbstractETSingle(global::Microsoft.OData.Client.DataServiceQuerySingle query) + : base(query) { } + + } + /// + /// There are no comments for AbstractET in the schema. + /// + [global::Microsoft.OData.Client.EntityType()] + [global::Microsoft.OData.Client.EntitySet("AbstractETs")] + public abstract partial class AbstractET : global::Microsoft.OData.Client.BaseEntityType, global::System.ComponentModel.INotifyPropertyChanged + { + /// + /// This event is raised when the value of the property is changed + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public event global::System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + /// + /// The value of the property is changed + /// + /// property name + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + protected virtual void OnPropertyChanged(string property) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new global::System.ComponentModel.PropertyChangedEventArgs(property)); + } + } + } + /// + /// There are no comments for AbstractBaseETSingle in the schema. + /// + public partial class AbstractBaseETSingle : global::Microsoft.OData.Client.DataServiceQuerySingle + { + /// + /// Initialize a new AbstractBaseETSingle object. + /// + public AbstractBaseETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path) + : base(context, path) { } + + /// + /// Initialize a new AbstractBaseETSingle object. + /// + public AbstractBaseETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable) + : base(context, path, isComposable) { } + + /// + /// Initialize a new AbstractBaseETSingle object. + /// + public AbstractBaseETSingle(global::Microsoft.OData.Client.DataServiceQuerySingle query) + : base(query) { } + + } + /// + /// There are no comments for AbstractBaseET in the schema. + /// + [global::Microsoft.OData.Client.EntityType()] + [global::Microsoft.OData.Client.EntitySet("AbstractBaseETs")] + public abstract partial class AbstractBaseET : AbstractET + { + /// + /// There are no comments for Property EP0 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int EP0 + { + get + { + return this._EP0; + } + set + { + this.OnEP0Changing(value); + this._EP0 = value; + this.OnEP0Changed(); + this.OnPropertyChanged("EP0"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _EP0; + partial void OnEP0Changing(int value); + partial void OnEP0Changed(); + /// + /// There are no comments for Property EAbsCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT EAbsCTP + { + get + { + return this._EAbsCTP; + } + set + { + this.OnEAbsCTPChanging(value); + this._EAbsCTP = value; + this.OnEAbsCTPChanged(); + this.OnPropertyChanged("EAbsCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT _EAbsCTP; + partial void OnEAbsCTPChanging(global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT value); + partial void OnEAbsCTPChanged(); + /// + /// There are no comments for Property EColOfAbsCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfAbsCTP + { + get + { + return this._EColOfAbsCTP; + } + set + { + this.OnEColOfAbsCTPChanging(value); + this._EColOfAbsCTP = value; + this.OnEColOfAbsCTPChanged(); + this.OnPropertyChanged("EColOfAbsCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfAbsCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfAbsCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfAbsCTPChanged(); + /// + /// There are no comments for Property EColOfNullableAbsCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfNullableAbsCTP + { + get + { + return this._EColOfNullableAbsCTP; + } + set + { + this.OnEColOfNullableAbsCTPChanging(value); + this._EColOfNullableAbsCTP = value; + this.OnEColOfNullableAbsCTPChanged(); + this.OnPropertyChanged("EColOfNullableAbsCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfNullableAbsCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfNullableAbsCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfNullableAbsCTPChanged(); + /// + /// There are no comments for Property EColOfNullableInt in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection> EColOfNullableInt + { + get + { + return this._EColOfNullableInt; + } + set + { + this.OnEColOfNullableIntChanging(value); + this._EColOfNullableInt = value; + this.OnEColOfNullableIntChanged(); + this.OnPropertyChanged("EColOfNullableInt"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection> _EColOfNullableInt = new global::System.Collections.ObjectModel.ObservableCollection>(); + partial void OnEColOfNullableIntChanging(global::System.Collections.ObjectModel.ObservableCollection> value); + partial void OnEColOfNullableIntChanged(); + /// + /// There are no comments for Property EColOfInt in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfInt + { + get + { + return this._EColOfInt; + } + set + { + this.OnEColOfIntChanging(value); + this._EColOfInt = value; + this.OnEColOfIntChanged(); + this.OnPropertyChanged("EColOfInt"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfInt = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfIntChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfIntChanged(); + /// + /// There are no comments for Property ENullableEnum in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Nullable ENullableEnum + { + get + { + return this._ENullableEnum; + } + set + { + this.OnENullableEnumChanging(value); + this._ENullableEnum = value; + this.OnENullableEnumChanged(); + this.OnPropertyChanged("ENullableEnum"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Nullable _ENullableEnum; + partial void OnENullableEnumChanging(global::System.Nullable value); + partial void OnENullableEnumChanged(); + /// + /// There are no comments for Property ENullableAbsCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT ENullableAbsCTP + { + get + { + return this._ENullableAbsCTP; + } + set + { + this.OnENullableAbsCTPChanging(value); + this._ENullableAbsCTP = value; + this.OnENullableAbsCTPChanged(); + this.OnPropertyChanged("ENullableAbsCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT _ENullableAbsCTP; + partial void OnENullableAbsCTPChanging(global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT value); + partial void OnENullableAbsCTPChanged(); + } + /// + /// There are no comments for BaseETSingle in the schema. + /// + public partial class BaseETSingle : global::Microsoft.OData.Client.DataServiceQuerySingle + { + /// + /// Initialize a new BaseETSingle object. + /// + public BaseETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path) + : base(context, path) { } + + /// + /// Initialize a new BaseETSingle object. + /// + public BaseETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable) + : base(context, path, isComposable) { } + + /// + /// Initialize a new BaseETSingle object. + /// + public BaseETSingle(global::Microsoft.OData.Client.DataServiceQuerySingle query) + : base(query) { } + + } + /// + /// There are no comments for BaseET in the schema. + /// + /// + /// EK0 + /// + [global::Microsoft.OData.Client.Key("EK0")] + [global::Microsoft.OData.Client.EntitySet("BaseETs")] + public partial class BaseET : AbstractBaseET + { + /// + /// Create a new BaseET object. + /// + /// Initial value of EP0. + /// Initial value of EAbsCTP. + /// Initial value of EK0. + /// Initial value of EP1. + /// Initial value of EAbsBaseCTP. + /// Initial value of EBaseCTP. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public static BaseET CreateBaseET(int eP0, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT eAbsCTP, + int eK0, + int eP1, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseCT eAbsBaseCTP, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseCT eBaseCTP) + { + BaseET baseET = new BaseET(); + baseET.EP0 = eP0; + if ((eAbsCTP == null)) + { + throw new global::System.ArgumentNullException("eAbsCTP"); + } + baseET.EAbsCTP = eAbsCTP; + baseET.EK0 = eK0; + baseET.EP1 = eP1; + if ((eAbsBaseCTP == null)) + { + throw new global::System.ArgumentNullException("eAbsBaseCTP"); + } + baseET.EAbsBaseCTP = eAbsBaseCTP; + if ((eBaseCTP == null)) + { + throw new global::System.ArgumentNullException("eBaseCTP"); + } + baseET.EBaseCTP = eBaseCTP; + return baseET; + } + /// + /// There are no comments for Property EK0 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int EK0 + { + get + { + return this._EK0; + } + set + { + this.OnEK0Changing(value); + this._EK0 = value; + this.OnEK0Changed(); + this.OnPropertyChanged("EK0"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _EK0; + partial void OnEK0Changing(int value); + partial void OnEK0Changed(); + /// + /// There are no comments for Property EP1 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int EP1 + { + get + { + return this._EP1; + } + set + { + this.OnEP1Changing(value); + this._EP1 = value; + this.OnEP1Changed(); + this.OnPropertyChanged("EP1"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _EP1; + partial void OnEP1Changing(int value); + partial void OnEP1Changed(); + /// + /// There are no comments for Property EAbsBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseCT EAbsBaseCTP + { + get + { + return this._EAbsBaseCTP; + } + set + { + this.OnEAbsBaseCTPChanging(value); + this._EAbsBaseCTP = value; + this.OnEAbsBaseCTPChanged(); + this.OnPropertyChanged("EAbsBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseCT _EAbsBaseCTP; + partial void OnEAbsBaseCTPChanging(global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseCT value); + partial void OnEAbsBaseCTPChanged(); + /// + /// There are no comments for Property EBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseCT EBaseCTP + { + get + { + return this._EBaseCTP; + } + set + { + this.OnEBaseCTPChanging(value); + this._EBaseCTP = value; + this.OnEBaseCTPChanged(); + this.OnPropertyChanged("EBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseCT _EBaseCTP; + partial void OnEBaseCTPChanging(global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseCT value); + partial void OnEBaseCTPChanged(); + /// + /// There are no comments for Property EColOfAbsBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfAbsBaseCTP + { + get + { + return this._EColOfAbsBaseCTP; + } + set + { + this.OnEColOfAbsBaseCTPChanging(value); + this._EColOfAbsBaseCTP = value; + this.OnEColOfAbsBaseCTPChanged(); + this.OnPropertyChanged("EColOfAbsBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfAbsBaseCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfAbsBaseCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfAbsBaseCTPChanged(); + /// + /// There are no comments for Property EColOfBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfBaseCTP + { + get + { + return this._EColOfBaseCTP; + } + set + { + this.OnEColOfBaseCTPChanging(value); + this._EColOfBaseCTP = value; + this.OnEColOfBaseCTPChanged(); + this.OnPropertyChanged("EColOfBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfBaseCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfBaseCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfBaseCTPChanged(); + /// + /// There are no comments for Property EColOfNullableAbsBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfNullableAbsBaseCTP + { + get + { + return this._EColOfNullableAbsBaseCTP; + } + set + { + this.OnEColOfNullableAbsBaseCTPChanging(value); + this._EColOfNullableAbsBaseCTP = value; + this.OnEColOfNullableAbsBaseCTPChanged(); + this.OnPropertyChanged("EColOfNullableAbsBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfNullableAbsBaseCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfNullableAbsBaseCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfNullableAbsBaseCTPChanged(); + /// + /// There are no comments for Property EColOfNullableBaseCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfNullableBaseCTP + { + get + { + return this._EColOfNullableBaseCTP; + } + set + { + this.OnEColOfNullableBaseCTPChanging(value); + this._EColOfNullableBaseCTP = value; + this.OnEColOfNullableBaseCTPChanged(); + this.OnPropertyChanged("EColOfNullableBaseCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfNullableBaseCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfNullableBaseCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfNullableBaseCTPChanged(); + /// + /// There are no comments for Property EColOfEnum in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfEnum + { + get + { + return this._EColOfEnum; + } + set + { + this.OnEColOfEnumChanging(value); + this._EColOfEnum = value; + this.OnEColOfEnumChanged(); + this.OnPropertyChanged("EColOfEnum"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfEnum = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfEnumChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfEnumChanged(); + /// + /// There are no comments for Property ENullablePrimitive in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Nullable ENullablePrimitive + { + get + { + return this._ENullablePrimitive; + } + set + { + this.OnENullablePrimitiveChanging(value); + this._ENullablePrimitive = value; + this.OnENullablePrimitiveChanged(); + this.OnPropertyChanged("ENullablePrimitive"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Nullable _ENullablePrimitive; + partial void OnENullablePrimitiveChanging(global::System.Nullable value); + partial void OnENullablePrimitiveChanged(); + /// + /// There are no comments for BETRColOfAbsCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfAbsCT", false); + } + /// + /// There are no comments for BETRColOfAbsBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsBaseCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfAbsBaseCT", true); + } + /// + /// There are no comments for BETRColOfNullableAbsCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfNullableAbsCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfNullableAbsCT", false); + } + /// + /// There are no comments for BETRColOfEnum in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfEnum() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfEnum", false); + } + } + /// + /// There are no comments for ETSingle in the schema. + /// + public partial class ETSingle : global::Microsoft.OData.Client.DataServiceQuerySingle + { + /// + /// Initialize a new ETSingle object. + /// + public ETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path) + : base(context, path) { } + + /// + /// Initialize a new ETSingle object. + /// + public ETSingle(global::Microsoft.OData.Client.DataServiceContext context, string path, bool isComposable) + : base(context, path, isComposable) { } + + /// + /// Initialize a new ETSingle object. + /// + public ETSingle(global::Microsoft.OData.Client.DataServiceQuerySingle query) + : base(query) { } + + } + /// + /// There are no comments for ET in the schema. + /// + /// + /// EK0 + /// + [global::Microsoft.OData.Client.Key("EK0")] + [global::Microsoft.OData.Client.EntitySet("DerivedETs")] + public partial class ET : BaseET + { + /// + /// Create a new ET object. + /// + /// Initial value of EP0. + /// Initial value of EAbsCTP. + /// Initial value of EK0. + /// Initial value of EP1. + /// Initial value of EAbsBaseCTP. + /// Initial value of EBaseCTP. + /// Initial value of EP2. + /// Initial value of EDerivedCTP. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public static ET CreateET(int eP0, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractCT eAbsCTP, + int eK0, + int eP1, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseCT eAbsBaseCTP, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseCT eBaseCTP, + int eP2, + global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.CT eDerivedCTP) + { + ET eT = new ET(); + eT.EP0 = eP0; + if ((eAbsCTP == null)) + { + throw new global::System.ArgumentNullException("eAbsCTP"); + } + eT.EAbsCTP = eAbsCTP; + eT.EK0 = eK0; + eT.EP1 = eP1; + if ((eAbsBaseCTP == null)) + { + throw new global::System.ArgumentNullException("eAbsBaseCTP"); + } + eT.EAbsBaseCTP = eAbsBaseCTP; + if ((eBaseCTP == null)) + { + throw new global::System.ArgumentNullException("eBaseCTP"); + } + eT.EBaseCTP = eBaseCTP; + eT.EP2 = eP2; + if ((eDerivedCTP == null)) + { + throw new global::System.ArgumentNullException("eDerivedCTP"); + } + eT.EDerivedCTP = eDerivedCTP; + return eT; + } + /// + /// There are no comments for Property EP2 in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public int EP2 + { + get + { + return this._EP2; + } + set + { + this.OnEP2Changing(value); + this._EP2 = value; + this.OnEP2Changed(); + this.OnPropertyChanged("EP2"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private int _EP2; + partial void OnEP2Changing(int value); + partial void OnEP2Changed(); + /// + /// There are no comments for Property EDerivedCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.CT EDerivedCTP + { + get + { + return this._EDerivedCTP; + } + set + { + this.OnEDerivedCTPChanging(value); + this._EDerivedCTP = value; + this.OnEDerivedCTPChanged(); + this.OnPropertyChanged("EDerivedCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.CT _EDerivedCTP; + partial void OnEDerivedCTPChanging(global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.CT value); + partial void OnEDerivedCTPChanged(); + /// + /// There are no comments for Property EColOfDerivedCTP in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection EColOfDerivedCTP + { + get + { + return this._EColOfDerivedCTP; + } + set + { + this.OnEColOfDerivedCTPChanging(value); + this._EColOfDerivedCTP = value; + this.OnEColOfDerivedCTPChanged(); + this.OnPropertyChanged("EColOfDerivedCTP"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection _EColOfDerivedCTP = new global::System.Collections.ObjectModel.ObservableCollection(); + partial void OnEColOfDerivedCTPChanging(global::System.Collections.ObjectModel.ObservableCollection value); + partial void OnEColOfDerivedCTPChanged(); + /// + /// There are no comments for Property EColOfNullableEnum in the schema. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + public global::System.Collections.ObjectModel.ObservableCollection> EColOfNullableEnum + { + get + { + return this._EColOfNullableEnum; + } + set + { + this.OnEColOfNullableEnumChanging(value); + this._EColOfNullableEnum = value; + this.OnEColOfNullableEnumChanged(); + this.OnPropertyChanged("EColOfNullableEnum"); + } + } + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "2.4.0")] + private global::System.Collections.ObjectModel.ObservableCollection> _EColOfNullableEnum = new global::System.Collections.ObjectModel.ObservableCollection>(); + partial void OnEColOfNullableEnumChanging(global::System.Collections.ObjectModel.ObservableCollection> value); + partial void OnEColOfNullableEnumChanged(); + /// + /// There are no comments for BETRColOfBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfBaseCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfBaseCT", false); + } + /// + /// There are no comments for BETRColOfDerivedCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfDerivedCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfDerivedCT", true); + } + /// + /// There are no comments for BETRColOfNullableBaseCT in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfNullableBaseCT() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfNullableBaseCT", false); + } + /// + /// There are no comments for BETRColOfNullableInt in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery> BETRColOfNullableInt() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery>(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfNullableInt", false); + } + /// + /// There are no comments for BETRColOfInt in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery BETRColOfInt() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfInt", false); + } + /// + /// There are no comments for BETRColOfNullableEnum in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuery> BETRColOfNullableEnum() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + return this.Context.CreateFunctionQuery>(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRColOfNullableEnum", false); + } + /// + /// There are no comments for BETRNullableEnum in the schema. + /// + public global::Microsoft.OData.Client.DataServiceQuerySingle> BETRNullableEnum() + { + global::System.Uri requestUri; + Context.TryGetUri(this, out requestUri); + + return this.Context.CreateFunctionQuerySingle>(string.Join("/", global::System.Linq.Enumerable.Select(global::System.Linq.Enumerable.Skip(requestUri.Segments, this.Context.BaseUri.Segments.Length), s => s.Trim('/'))), "NS.BETRNullableEnum", false); + } + } + /// + /// There are no comments for EnumT in the schema. + /// + public enum EnumT + { + EnumP1 = 0, + EnumP2 = 1, + EnumP3 = 2 + } + /// + /// Class containing all extension methods + /// + public static class ExtensionMethods + { + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseETSingle CastToAbstractBaseET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseETSingle(source.Context, query.GetPath(null)); + } + /// + /// Get an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseET as global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle specified by key from an entity set + /// + /// source entity set + /// dictionary with the names and values of keys + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery source, global::System.Collections.Generic.Dictionary keys) + { + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys))); + } + /// + /// Get an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseET as global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle specified by key from an entity set + /// + /// source entity set + /// The value of eK0 + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery source, + int eK0) + { + global::System.Collections.Generic.Dictionary keys = new global::System.Collections.Generic.Dictionary + { + { "EK0", eK0 } + }; + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys))); + } + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle CastToBaseET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle(source.Context, query.GetPath(null)); + } + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle CastToBaseET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseETSingle(source.Context, query.GetPath(null)); + } + /// + /// Get an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ET as global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle specified by key from an entity set + /// + /// source entity set + /// dictionary with the names and values of keys + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery source, global::System.Collections.Generic.Dictionary keys) + { + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys))); + } + /// + /// Get an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ET as global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle specified by key from an entity set + /// + /// source entity set + /// The value of eK0 + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle ByKey(this global::Microsoft.OData.Client.DataServiceQuery source, + int eK0) + { + global::System.Collections.Generic.Dictionary keys = new global::System.Collections.Generic.Dictionary + { + { "EK0", eK0 } + }; + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle(source.Context, source.GetKeyPath(global::Microsoft.OData.Client.Serializer.GetKeyString(source.Context, keys))); + } + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.BaseET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle CastToET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle(source.Context, query.GetPath(null)); + } + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractBaseET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle CastToET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle(source.Context, query.GetPath(null)); + } + /// + /// Cast an entity of type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.AbstractET to its derived type global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ET + /// + /// source entity + public static global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle CastToET(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + global::Microsoft.OData.Client.DataServiceQuerySingle query = source.CastTo(); + return new global::Microsoft.OData.Client.TDDUnitTests.Tests.Materialization.ETSingle(source.Context, query.GetPath(null)); + } + /// + /// There are no comments for BETRColOfAbsCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfAbsCT", false); + } + /// + /// There are no comments for BETRColOfAbsCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfAbsCT", false); + } + /// + /// There are no comments for BETRColOfAbsBaseCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsBaseCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfAbsBaseCT", true); + } + /// + /// There are no comments for BETRColOfAbsBaseCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfAbsBaseCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfAbsBaseCT", true); + } + /// + /// There are no comments for BETRColOfBaseCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfBaseCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfBaseCT", false); + } + /// + /// There are no comments for BETRColOfDerivedCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfDerivedCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfDerivedCT", true); + } + /// + /// There are no comments for BETRColOfNullableAbsCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfNullableAbsCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfNullableAbsCT", false); + } + /// + /// There are no comments for BETRColOfNullableAbsCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfNullableAbsCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfNullableAbsCT", false); + } + /// + /// There are no comments for BETRColOfNullableBaseCT in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfNullableBaseCT(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfNullableBaseCT", false); + } + /// + /// There are no comments for BETRColOfNullableInt in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery> BETRColOfNullableInt(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery>("NS.BETRColOfNullableInt", false); + } + /// + /// There are no comments for BETRColOfInt in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfInt(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfInt", false); + } + /// + /// There are no comments for BETRColOfNullableEnum in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery> BETRColOfNullableEnum(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery>("NS.BETRColOfNullableEnum", false); + } + /// + /// There are no comments for BETRColOfEnum in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfEnum(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfEnum", false); + } + /// + /// There are no comments for BETRColOfEnum in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuery BETRColOfEnum(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuery("NS.BETRColOfEnum", false); + } + /// + /// There are no comments for BETRNullableEnum in the schema. + /// + public static global::Microsoft.OData.Client.DataServiceQuerySingle> BETRNullableEnum(this global::Microsoft.OData.Client.DataServiceQuerySingle source) + { + if (!source.IsComposable) + { + throw new global::System.NotSupportedException("The previous function is not composable."); + } + + return source.CreateFunctionQuerySingle>("NS.BETRNullableEnum", false); + } + } +} diff --git a/test/FunctionalTests/Tests/DataServices/UnitTests/ClientCSharpUnitTests/DataWebClientCSharp/Dev10TypeTestsClient.cs b/test/FunctionalTests/Tests/DataServices/UnitTests/ClientCSharpUnitTests/DataWebClientCSharp/Dev10TypeTestsClient.cs index b5013eee6c..1e2d4a2b8d 100644 --- a/test/FunctionalTests/Tests/DataServices/UnitTests/ClientCSharpUnitTests/DataWebClientCSharp/Dev10TypeTestsClient.cs +++ b/test/FunctionalTests/Tests/DataServices/UnitTests/ClientCSharpUnitTests/DataWebClientCSharp/Dev10TypeTestsClient.cs @@ -24,11 +24,10 @@ public void Dev10Type_ClientPost() { Tuple[] typeList = new Tuple[] { - Tuple.Create(typeof(Dev10TypeDef.EntityWithBigIntProperty), true, "Contains:The complex type 'System.Numerics.BigInteger' has no settable properties."), Tuple.Create(typeof(Dev10TypeDef.EntityWithDynamicComplexProperty), true, "Contains:The type 'AstoriaUnitTests.Tests.UnitTestModule+Dev10TypeTests+ComplexTypeWithDynamicInterface' is not supported by the client library."), Tuple.Create(typeof(Dev10TypeDef.EntityWithDynamicInterface), true, "Contains:The type 'AstoriaUnitTests.Tests.UnitTestModule+Dev10TypeTests+EntityWithDynamicInterface' is not supported by the client library."), Tuple.Create(typeof(Dev10TypeDef.EntityWithDynamicProperties), true, "Contains:The complex type 'System.Object' has no settable properties."), - Tuple.Create(typeof(Dev10TypeDef.EntityWithTupleProperty), true, "Contains:The type 'System.Tuple`2[System.String,System.String]' is not supported by the client library.") + Tuple.Create(typeof(Dev10TypeDef.EntityWithTupleProperty), true, "Contains:The type 'System.Tuple`2[System.String,System.String]' is not supported by the client library.") }; TestUtil.RunCombinations(typeList, (typedef) =>