예제 #1
0
        public ODataQueryPart Parse(ODataQueryPartType type, string parameterValue)
        {
            if (type != QueryPartType)
            {
                throw new ArgumentException(String.Format("'{0}' cannot parse query parts of type '{1}'.", GetType(), type));
            }

            return(Parse(parameterValue));
        }
예제 #2
0
        public static string GetUrlParameterName(this ODataQueryPartType type)
        {
            string result;

            if (TypeToParameterNames.TryGetValue(type, out result) == false)
            {
                throw new ArgumentException(String.Format("ODataQueryPartType '{0}' does not have a url parameter associated with it.", type));
            }

            return(result);
        }
        public ODataQueryPart Parse(ODataQueryPartType type, string parameterValue)
        {
            IODataQueryPartParserStrategy strategy;
            if (_strategies.TryGetValue(type, out strategy) == false)
            {
                throw new ArgumentException(String.Format("There is no parsing strategy for ODataQueryPartType '{0}'.", type));
            }

            var result = strategy.Parse(type, parameterValue);

            return result;
        }
        public ODataQueryPart Parse(ODataQueryPartType type, string parameterValue)
        {
            IODataQueryPartParserStrategy strategy;

            if (_strategies.TryGetValue(type, out strategy) == false)
            {
                throw new ArgumentException(String.Format("There is no parsing strategy for ODataQueryPartType '{0}'.", type));
            }

            var result = strategy.Parse(type, parameterValue);

            return(result);
        }
예제 #5
0
 protected AbstractQueryPartParserStrategy(ODataQueryPartType queryPartType)
 {
     QueryPartType = queryPartType;
 }