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)); }
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); }
protected AbstractQueryPartParserStrategy(ODataQueryPartType queryPartType) { QueryPartType = queryPartType; }