Net.Http.WebApi.OData.Query.OrderByQueryOption.OrderByQueryOption C# (CSharp) Method

OrderByQueryOption() public method

Initialises a new instance of the OrderByQueryOption class.
public OrderByQueryOption ( string rawValue ) : System
rawValue string The raw request value.
return System
        public OrderByQueryOption(string rawValue)
        {
            if (rawValue == null)
            {
                throw new ArgumentNullException(nameof(rawValue));
            }

            this.RawValue = rawValue;

            var equals = rawValue.IndexOf('=') + 1;
            var properties = rawValue.Substring(equals, rawValue.Length - equals);

            if (properties.Contains(','))
            {
                this.Properties = properties.Split(Comma)
                    .Select(raw => new OrderByProperty(raw))
                    .ToArray();
            }
            else
            {
                this.Properties = new[] { new OrderByProperty(properties) };
            }
        }
OrderByQueryOption