コード例 #1
0
        /// <summary>
        /// Register a factory that creates functions links.
        /// </summary>
        public FunctionConfiguration HasFunctionLink(Func <ResourceContext, Uri> functionLinkFactory, bool followsConventions)
        {
            if (functionLinkFactory == null)
            {
                throw new ArgumentNullException("functionLinkFactory");
            }

            if (!IsBindable || BindingParameter.TypeConfiguration.Kind != EdmTypeKind.Entity)
            {
                throw Error.InvalidOperation("TODO: " /*SRResources.HasFunctionLinkRequiresBindToEntity, Name*/);
            }

            OperationLinkBuilder = new OperationLinkBuilder(functionLinkFactory, followsConventions);
            FollowsConventions   = followsConventions;
            return(this);
        }
コード例 #2
0
        /// <summary>
        /// Register a factory that creates feed actions links.
        /// </summary>
        public ActionConfiguration HasFeedActionLink(Func <ResourceSetContext, Uri> actionLinkFactory, bool followsConventions)
        {
            if (actionLinkFactory == null)
            {
                throw new ArgumentNullException("actionLinkFactory");
            }

            if (!IsBindable ||
                BindingParameter.TypeConfiguration.Kind != EdmTypeKind.Collection ||
                ((CollectionTypeConfiguration)BindingParameter.TypeConfiguration).ElementType.Kind != EdmTypeKind.Entity)
            {
                throw Error.InvalidOperation(/*SRResources.HasActionLinkRequiresBindToCollectionOfEntity, Name*/ "TODO: ");
            }

            OperationLinkBuilder = new OperationLinkBuilder(actionLinkFactory, followsConventions);
            FollowsConventions   = followsConventions;
            return(this);
        }