Beispiel #1
0
        /// <summary>
        /// Init the <see cref="DeleteRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Deletable
            Deletable = record.GetBoolean("Deletable");

            // NonDeletableNavigationProperties
            NonDeletableNavigationProperties = record.GetCollectionPropertyPath("NonDeletableNavigationProperties");

            // MaxLevels
            MaxLevels = (int?)record.GetInteger("MaxLevels");

            // FilterSegmentSupported
            FilterSegmentSupported = record.GetBoolean("FilterSegmentSupported");

            // TypecastSegmentSupported
            TypecastSegmentSupported = record.GetBoolean("TypecastSegmentSupported");

            // Permissions
            Permissions = record.GetCollection <PermissionType>("Permissions");

            // CustomHeaders
            CustomHeaders = record.GetCollection <CustomParameter>("CustomHeaders");

            // CustomQueryOptions
            CustomQueryOptions = record.GetCollection <CustomParameter>("CustomQueryOptions");

            // Description
            Description = record.GetString("Description");

            // LongDescription
            LongDescription = record.GetString("LongDescription");
        }
Beispiel #2
0
        /// <summary>
        /// Init the <see cref="SelectSupportType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Supported
            Supported = record.GetBoolean("Supported");

            // Expandable
            InstanceAnnotationsSupported = record.GetBoolean("InstanceAnnotationsSupported");

            // Expandable
            Expandable = record.GetBoolean("Expandable");

            // Filterable
            Filterable = record.GetBoolean("Filterable");

            // Searchable
            Searchable = record.GetBoolean("Searchable");

            // TopSupported
            TopSupported = record.GetBoolean("TopSupported");

            // SkipSupported
            SkipSupported = record.GetBoolean("SkipSupported");

            // ComputeSupported
            ComputeSupported = record.GetBoolean("ComputeSupported");

            // Countable
            Countable = record.GetBoolean("Countable");

            // Sortable
            Sortable = record.GetBoolean("Sortable");
        }
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Filterable
            Filterable = record.GetBoolean("Filterable");

            // RequiresFilter
            RequiresFilter = record.GetBoolean("RequiresFilter");

            // RequiredProperties
            RequiredProperties = record.GetCollectionPropertyPath("RequiredProperties");

            // NonFilterableProperties
            NonFilterableProperties = record.GetCollectionPropertyPath("NonFilterableProperties");

            return(true);
        }
        /// <summary>
        /// Init the <see cref="DeepUpdateSupportType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Supported
            Supported = record.GetBoolean("Supported");

            // NonInsertableNavigationProperties
            ContentIDSupported = record.GetBoolean("ContentIDSupported");
        }
        /// <summary>
        /// Init the <see cref="NavigationPropertyRestriction"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // NavigationProperty
            NavigationProperty = record.GetPropertyPath("NavigationProperty"); // maybe call "GetNavigationPropertyPath

            // Navigability
            Navigability = record.GetEnum <NavigationType>("Navigability");

            // FilterFunctions
            FilterFunctions = record.GetCollection("FilterFunctions");

            // FilterRestrictions
            FilterRestrictions = record.GetRecord <FilterRestrictionsType>("FilterRestrictions");

            // SearchRestrictions
            SearchRestrictions = record.GetRecord <SearchRestrictionsType>("SearchRestrictions");

            // SortRestrictions
            SortRestrictions = record.GetRecord <SortRestrictionsType>("SortRestrictions");

            // TopSupported
            TopSupported = record.GetBoolean("TopSupported");

            // SkipSupported
            SkipSupported = record.GetBoolean("SkipSupported");

            // SelectSupport
            SelectSupport = record.GetRecord <SelectSupportType>("SelectSupport");

            // IndexableByKey
            IndexableByKey = record.GetBoolean("IndexableByKey");

            // InsertRestrictions
            InsertRestrictions = record.GetRecord <InsertRestrictionsType>("InsertRestrictions");

            // DeepInsertSupport
            DeepInsertSupport = record.GetRecord <DeepInsertSupportType>("DeepInsertSupport");

            // UpdateRestrictions
            UpdateRestrictions = record.GetRecord <UpdateRestrictionsType>("UpdateRestrictions");

            // DeepUpdateSupport
            DeepUpdateSupport = record.GetRecord <DeepUpdateSupportType>("DeepUpdateSupport");

            // DeleteRestrictions
            DeleteRestrictions = record.GetRecord <DeleteRestrictionsType>("DeleteRestrictions");

            // IndexableByKey
            OptimisticConcurrencyControl = record.GetBoolean("OptimisticConcurrencyControl");

            // ReadRestrictions
            ReadRestrictions = record.GetRecord <ReadRestrictionsType>("ReadRestrictions");
        }
        /// <summary>
        /// Init the <see cref="SearchRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Searchable
            Searchable = record.GetBoolean("Searchable");

            // read the "UnsupportedExpressions"
            IEdmPropertyConstructor property = record.Properties.FirstOrDefault(e => e.Name == "UnsupportedExpressions");

            if (property != null)
            {
                IEdmEnumMemberExpression value = property.Value as IEdmEnumMemberExpression;
                if (value != null && value.EnumMembers != null)
                {
                    SearchExpressions result;
                    foreach (var v in value.EnumMembers)
                    {
                        if (Enum.TryParse(v.Name, out result))
                        {
                            if (UnsupportedExpressions == null)
                            {
                                UnsupportedExpressions = result;
                            }
                            else
                            {
                                UnsupportedExpressions = UnsupportedExpressions | result;
                            }
                        }
                    }
                }
            }
        }
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Expandable
            Expandable = record.GetBoolean("Expandable");

            // StreamsExpandable
            StreamsExpandable = record.GetBoolean("StreamsExpandable");

            // NonExpandableProperties
            NonExpandableProperties = record.GetCollectionPropertyPath("NonExpandableProperties");

            // MaxLevels
            MaxLevels = record.GetInteger("MaxLevels");
        }
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Sortable
            Sortable = record.GetBoolean("Sortable");

            // AscendingOnlyProperties
            AscendingOnlyProperties = record.GetCollectionPropertyPath("AscendingOnlyProperties");

            // DescendingOnlyProperties
            DescendingOnlyProperties = record.GetCollectionPropertyPath("DescendingOnlyProperties");

            // NonSortablePropeties
            NonSortableProperties = record.GetCollectionPropertyPath("NonSortableProperties");

            return(true);
        }
        /// <summary>
        /// Init the <see cref="CustomParameter"/>
        /// </summary>
        /// <param name="record">The input record.</param>
        public virtual void Init(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Name
            Name = record.GetString("Name");

            // Description
            Description = record.GetString("Description");

            // DocumentationURL
            DocumentationURL = record.GetString("DocumentationURL");

            // Required
            Required = record.GetBoolean("Required");

            // ExampleValues
            ExampleValues = record.GetCollection("ExampleValues", r =>
            {
                IEdmRecordExpression itemRecord = r as IEdmRecordExpression;
                if (itemRecord != null)
                {
                    return(Example.CreateExample(itemRecord));
                }

                return(null);
            });
        }
Beispiel #10
0
        /// <summary>
        /// Init the <see cref="UpdateRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Updatable
            Updatable = record.GetBoolean("Updatable");

            // Upsertable
            Upsertable = record.GetBoolean("Upsertable");

            // DeltaUpdateSupported
            DeltaUpdateSupported = record.GetBoolean("DeltaUpdateSupported");

            // UpdateMethod
            UpdateMethod = record.GetEnum <HttpMethod>("UpdateMethod");

            // FilterSegmentSupported
            FilterSegmentSupported = record.GetBoolean("FilterSegmentSupported");

            // TypecastSegmentSupported
            TypecastSegmentSupported = record.GetBoolean("TypecastSegmentSupported");

            // NonUpdatableNavigationProperties
            NonUpdatableNavigationProperties = record.GetCollectionPropertyPath("NonUpdatableNavigationProperties");

            // MaxLevels
            MaxLevels = record.GetInteger("MaxLevels");

            // Permissions
            Permissions = record.GetCollection <PermissionType>("Permissions");

            // QueryOptions
            QueryOptions = record.GetRecord <ModificationQueryOptionsType>("QueryOptions");

            // CustomHeaders
            CustomHeaders = record.GetCollection <CustomParameter>("CustomHeaders");

            // CustomQueryOptions
            CustomQueryOptions = record.GetCollection <CustomParameter>("CustomQueryOptions");

            // Description
            Description = record.GetString("Description");

            // LongDescription
            LongDescription = record.GetString("LongDescription");
        }
Beispiel #11
0
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Supported
            Supported = record.GetBoolean("Supported");

            // NonInsertableNavigationProperties
            ContentIDSupported = record.GetBoolean("ContentIDSupported");

            return(true);
        }
        /// <summary>
        /// Init the <see cref="FilterRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Filterable
            Filterable = record.GetBoolean("Filterable");

            // RequiresFilter
            RequiresFilter = record.GetBoolean("RequiresFilter");

            // RequiredProperties
            RequiredProperties = record.GetCollectionPropertyPath("RequiredProperties");

            // NonFilterableProperties
            NonFilterableProperties = record.GetCollectionPropertyPath("NonFilterableProperties");

            // MaxLevels
            MaxLevels = record.GetInteger("MaxLevels");

            // FilterExpressionRestrictions
            FilterExpressionRestrictions = record.GetCollection <FilterExpressionRestrictionType>("FilterExpressionRestrictions");
        }
Beispiel #13
0
        /// <summary>
        /// Init the <see cref="NavigationRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Navigability
            Navigability = record.GetEnum <NavigationType>("Navigability");

            // RestrictedProperties
            RestrictedProperties = record.GetCollection <NavigationPropertyRestriction>("RestrictedProperties");

            // Referenceable
            Referenceable = record.GetBoolean("Referenceable");
        }
        /// <summary>
        /// Init the <see cref="CountRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public virtual void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Countable
            Countable = record.GetBoolean("Countable");

            // NonCountableProperties
            NonCountableProperties = record.GetCollectionPropertyPath("NonCountableProperties");

            // NonCountableNavigationProperties
            NonCountableNavigationProperties = record.GetCollectionPropertyPath("NonCountableNavigationProperties");
        }
        /// <summary>
        /// Init the <see cref="CollectionPropertyRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public virtual void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // CollectionProperty
            CollectionProperty = record.GetPropertyPath("CollectionProperty");

            // FilterFunctions
            FilterFunctions = record.GetCollection("FilterFunctions");

            // FilterRestrictions
            FilterRestrictions = record.GetRecord <FilterRestrictionsType>("FilterRestrictions");

            // SearchRestrictions
            SearchRestrictions = record.GetRecord <SearchRestrictionsType>("SearchRestrictions");

            // SortRestrictions
            SortRestrictions = record.GetRecord <SortRestrictionsType>("SortRestrictions");

            // TopSupported
            TopSupported = record.GetBoolean("TopSupported");

            // SkipSupported
            SkipSupported = record.GetBoolean("SkipSupported");

            // SelectSupport
            SelectSupport = record.GetRecord <SelectSupportType>("SelectSupport");

            // Insertable
            Insertable = record.GetBoolean("Insertable");

            // Updatable
            Updatable = record.GetBoolean("Updatable");

            // Deletable
            Deletable = record.GetBoolean("Deletable");
        }
Beispiel #16
0
        /// <summary>
        /// Init the <see cref="SortRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Sortable
            Sortable = record.GetBoolean("Sortable");

            // AscendingOnlyProperties
            AscendingOnlyProperties = record.GetCollectionPropertyPath("AscendingOnlyProperties");

            // DescendingOnlyProperties
            DescendingOnlyProperties = record.GetCollectionPropertyPath("DescendingOnlyProperties");

            // NonSortablePropeties
            NonSortableProperties = record.GetCollectionPropertyPath("NonSortableProperties");
        }
        /// <summary>
        /// Init the <see cref="SearchRestrictionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // FilterSegmentSupported
            FilterSegmentSupported = record.GetBoolean("FilterSegmentSupported");

            // Permissions
            Permissions = record.GetCollection <PermissionType>("Permissions");

            // CustomHeaders
            CustomHeaders = record.GetCollection <CustomParameter>("CustomHeaders");

            // CustomQueryOptions
            CustomQueryOptions = record.GetCollection <CustomParameter>("CustomQueryOptions");
        }
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Deletable
            Deletable = record.GetBoolean("Deletable");

            return(true);
        }
Beispiel #19
0
        /// <summary>
        /// Init the <see cref="CustomParameter"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Name
            Name = record.GetString("Name");

            // Description
            Description = record.GetString("Description");

            // DocumentationURL
            DocumentationURL = record.GetString("DocumentationURL");

            // Required
            Required = record.GetBoolean("Required");

            // ExampleValues
            ExampleValues = record.GetCollection <PrimitiveExampleValue>("ExampleValues");
        }
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Updatable
            Updatable = record.GetBoolean("Updatable");

            // NonUpdatableNavigationProperties
            NonUpdatableNavigationProperties = record.GetCollectionPropertyPath("NonUpdatableNavigationProperties");

            return(true);
        }
Beispiel #21
0
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

            // Searchable
            Searchable = record.GetBoolean("Searchable");

            // read the "UnsupportedExpressions"
            IEdmPropertyConstructor property = record.Properties.FirstOrDefault(e => e.Name == "UnsupportedExpressions");

            if (property != null)
            {
                IEdmEnumMemberExpression value = property.Value as IEdmEnumMemberExpression;
                if (value != null && value.EnumMembers != null)
                {
                    SearchExpressions result;
                    foreach (var v in value.EnumMembers)
                    {
                        if (Enum.TryParse(v.Name, out result))
                        {
                            if (UnsupportedExpressions == null)
                            {
                                UnsupportedExpressions = result;
                            }
                            else
                            {
                                UnsupportedExpressions = UnsupportedExpressions | result;
                            }
                        }
                    }
                }
            }

            return(true);
        }
        /// <summary>
        /// Init the <see cref="ReadRestrictionsBase"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public virtual void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // Readable
            Readable = record.GetBoolean("Readable");

            // Permissions
            Permissions = record.GetCollection <PermissionType>("Permissions");

            // CustomHeaders
            CustomHeaders = record.GetCollection <CustomParameter>("CustomHeaders");

            // CustomQueryOptions
            CustomQueryOptions = record.GetCollection <CustomParameter>("CustomQueryOptions");

            // Description
            Description = record.GetString("Description");

            // LongDescription
            LongDescription = record.GetString("LongDescription");
        }
        /// <summary>
        /// Init the <see cref="ModificationQueryOptionsType"/>.
        /// </summary>
        /// <param name="record">The input record.</param>
        public void Initialize(IEdmRecordExpression record)
        {
            Utils.CheckArgumentNull(record, nameof(record));

            // ExpandSupported
            ExpandSupported = record.GetBoolean("ExpandSupported");

            // SelectSupported
            SelectSupported = record.GetBoolean("SelectSupported");

            // ComputeSupported
            ComputeSupported = record.GetBoolean("ComputeSupported");

            // FilterSupported
            FilterSupported = record.GetBoolean("FilterSupported");

            // SearchSupported
            SearchSupported = record.GetBoolean("SearchSupported");

            // SortSupported
            SortSupported = record.GetBoolean("SortSupported");
        }