protected object GetPropertyValue(string propertyName, ResourceType propertyResourceType, object propertyValue, bool openProperty) { if (propertyResourceType.ResourceTypeKind == ResourceTypeKind.Primitive) { return(GetPrimitiveValue(propertyValue)); } if (propertyResourceType.ResourceTypeKind == ResourceTypeKind.ComplexType) { return(this.GetComplexValue(propertyName, propertyValue)); } if (!openProperty) { return(this.GetCollection(propertyName, (CollectionResourceType)propertyResourceType, propertyValue)); } WebUtil.CheckResourceNotCollectionForOpenProperty(propertyResourceType, propertyName); throw DataServiceException.CreateBadRequestError(System.Data.Services.Strings.OpenNavigationPropertiesNotSupportedOnOpenTypes(propertyName)); }