예제 #1
0
        /// <summary>
        /// Returns whether or not the uri refers to a WebInvoke service operation call
        /// </summary>
        /// <param name="uri">The uri to extend</param>
        /// <returns>whether or not the uri refers to a WebInvoke service operation call</returns>
        public static bool IsWebInvokeServiceOperation(this ODataUri uri)
        {
            if (uri.IsServiceOperation())
            {
                ODataUriSegment functionSegment = uri.Segments.First(s => s is FunctionSegment);
                return(functionSegment.CheckSegment <FunctionSegment>(f => f.Function.Annotations.OfType <LegacyServiceOperationAnnotation>().Single().Method == Http.HttpVerb.Post));
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Returns whether or not the uri refers to a service operation call
        /// </summary>
        /// <param name="uri">The uri to extend</param>
        /// <returns>whether or not the uri refers to a service operation call</returns>
        public static bool IsServiceOperation(this ODataUri uri)
        {
            ODataUriSegment functionSegment = uri.Segments.LastOrDefault(s => s is FunctionSegment);

            if (functionSegment != null)
            {
                return(functionSegment.CheckSegment <FunctionSegment>(f => f.Function.IsServiceOperation()));
            }

            return(false);
        }