/// <summary>
 /// Init the <see cref="RevisionsType"/>.
 /// </summary>
 /// <param name="record">The input record.</param>
 public virtual void Initialize(IEdmRecordExpression record)
 {
     Utils.CheckArgumentNull(record, nameof(record));
     Kind        = record.GetEnum <RevisionKind>(nameof(Kind));
     Version     = record.GetString(nameof(Version));
     Description = record.GetString(nameof(Description));
 }
        /// <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");
        }
        /// <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");
        }
Example #4
0
        /// <summary>
        /// Init <see cref="ApiKey"/>.
        /// </summary>
        /// <param name="record">the input record.</param>
        public override void Init(IEdmRecordExpression record)
        {
            // base checked.
            base.Init(record);

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

            // Location.
            Location = record.GetEnum <KeyLocation>("Location");
        }
Example #5
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");
        }
        protected override bool Initialize(IEdmVocabularyAnnotation annotation)
        {
            if (annotation == null ||
                annotation.Value == null ||
                annotation.Value.ExpressionKind != EdmExpressionKind.Record)
            {
                return(false);
            }

            IEdmRecordExpression record = (IEdmRecordExpression)annotation.Value;

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

            // RestrictedProperties
            RestrictedProperties = GetRestrictedProperties(record);

            return(true);
        }