Пример #1
0
        /// <summary>
        /// Apply the given configuration to the resource set.
        /// </summary>
        /// <param name="configuration">data service configuration instance.</param>
        public void ApplyConfiguration(DataServiceConfiguration configuration)
        {
#if DEBUG
            Debug.Assert(!this.isReadOnly, "Can only apply the configuration once.");
#endif

            // Set entity set rights
            this.rights = configuration.GetResourceSetRights(this.resourceSet);

            // Set page size
            this.pageSize = configuration.GetResourceSetPageSize(this.resourceSet);
            if (this.pageSize < 0)
            {
                throw new DataServiceException(500, Strings.DataService_SDP_PageSizeMustbeNonNegative(this.pageSize, this.Name));
            }

            // Add QueryInterceptors
            this.readAuthorizationMethods = configuration.GetReadAuthorizationMethods(this.resourceSet);

            // Add ChangeInterceptors
            this.writeAuthorizationMethods = configuration.GetWriteAuthorizationMethods(this.resourceSet);

#if DEBUG
            this.isReadOnly = true;
#endif
        }
Пример #2
0
 private void ApplyConfiguration(DataServiceConfiguration configuration)
 {
     this.rights   = configuration.GetResourceSetRights(this.resourceSet);
     this.pageSize = configuration.GetResourceSetPageSize(this.resourceSet);
     if (this.pageSize < 0)
     {
         throw new DataServiceException(500, System.Data.Services.Strings.DataService_SDP_PageSizeMustbeNonNegative(this.pageSize, this.Name));
     }
     this.readAuthorizationMethods  = configuration.GetReadAuthorizationMethods(this.resourceSet);
     this.writeAuthorizationMethods = configuration.GetWriteAuthorizationMethods(this.resourceSet);
 }
        /// <summary>
        /// Apply the given configuration to the resource set.
        /// </summary>
        /// <param name="configuration">data service configuration instance.</param>
        public void ApplyConfiguration(DataServiceConfiguration configuration)
        {
#if DEBUG
            Debug.Assert(!this.isReadOnly, "Can only apply the configuration once.");
#endif

            // Set entity set rights
            this.rights = configuration.GetResourceSetRights(this.resourceSet);

            // Set page size
            this.pageSize = configuration.GetResourceSetPageSize(this.resourceSet);
            if (this.pageSize < 0)
            {
                throw new DataServiceException(500, Strings.DataService_SDP_PageSizeMustbeNonNegative(this.pageSize, this.Name));
            }

            // Add QueryInterceptors
            this.readAuthorizationMethods = configuration.GetReadAuthorizationMethods(this.resourceSet);

            // Add ChangeInterceptors
            this.writeAuthorizationMethods = configuration.GetWriteAuthorizationMethods(this.resourceSet);

#if DEBUG
            this.isReadOnly = true;
#endif
        }