示例#1
0
        /// <summary>Adds service operations based on methods on the data service type.</summary>
        private void LoadServiceOperations()
        {
            // This method is only called for V1 providers, since in case of custom providers,
            // they are suppose to load the metadata themselves.
            Type dataServiceType = this.dataServiceInstance.GetType();

            ServiceOperationProvider sop = new ServiceOperationProvider(dataServiceType, this.ResolveResourceType, this.ResolveResourceSet);

            foreach (ServiceOperation so in sop.ServiceOperations)
            {
                if (this.metadata.ServiceOperations.ContainsKey(so.Name))
                {
                    throw new InvalidOperationException(Strings.BaseServiceProvider_OverloadingNotSupported(dataServiceType, (MethodInfo)so.CustomState));
                }

                this.metadata.ServiceOperations.Add(so.Name, so);
            }
        }
        /// <summary>Adds service operations based on methods on the data service type.</summary>
        private void LoadServiceOperations()
        {
            // This method is only called for V1 providers, since in case of custom providers,
            // they are suppose to load the metadata themselves.
            Type dataServiceType = this.dataServiceInstance.GetType();

            ServiceOperationProvider sop = new ServiceOperationProvider(dataServiceType, this.ResolveResourceType, this.ResolveResourceSet);

            foreach (ServiceOperation so in sop.ServiceOperations)
            {
                if (this.metadata.ServiceOperations.ContainsKey(so.Name))
                {
                    throw new InvalidOperationException(Strings.BaseServiceProvider_OverloadingNotSupported(dataServiceType, (MethodInfo)so.CustomState));
                }

                this.metadata.ServiceOperations.Add(so.Name, so);
            }
        }